gibsonpil / libpci-rs

A cross-platform PCI enumeration library for Rust.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Platform specific info [API basis] #15

Open shibedrill opened 6 months ago

shibedrill commented 6 months ago

To attain feature parity with the OG libpci, I think we should expose OS-specific information (such as kernel drivers, irqs, memory addresses, flags, etc) through an expansion of the API. The only thing I'm uncertain of: How much of this information is shared between OSs, and can be made common? How much is specific to a certain OS? How much of it is purely related to the computer the PCI device is installed in, and how much is intrinsic to the device itself? Once we know which information is shared across all operating systems, we can determine what changes we should make to the public API. After that it should be smooth sailing.

shibedrill commented 6 months ago

Image

Image

Initial support for the new APIs is almost done on my end. I need to figure out how to get some of this information, but memory regions are nearly fully implemented and the API is ready for people to write their own backends. The From trait for PciDeviceSoftware is the main mechanism here- later we can add a method to PciDeviceHardware that just returns PciDeviceSoftware::from(self).

shibedrill commented 6 months ago

Before I push any commits, I want to see for sure which items are available on all operating systems, and plan out a means by which to structure all of it. I'm unsure if we should keep this at priority 0 right now, since this is a new struct separate from the main device struct and adding this to the API should be non-breaking.