gibsonpil / libpci-rs

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

Illumos/Solaris support. #10

Open gibsonpil opened 8 months ago

gibsonpil commented 8 months ago

Illumos (a fork of Solaris 10 taken from when Oracle moved to a closed source model) is a tier 2 Rust target, so supporting it seems like it may be a logical decision.

shibedrill commented 8 months ago

Image

Looks like the devices in IllumOS (OpenIndiana) are stored in a directory similar to Linux. Implementing support might be trivial.

https://illumos.org/man/8/cfgadm_pci

gibsonpil commented 8 months ago

Image

Looks like the devices in IllumOS (OpenIndiana) are stored in a directory similar to Linux. Implementing support might be trivial.

https://illumos.org/man/8/cfgadm_pci

Thanks!

It looks like CFGADM has to make some calls in order to extract information from those files. I don't know where or not it will be as simple to parse as Linux's procfs (most of the BSDs also have devices stored in a directory format but you still have to use ioctl() to actually read them), but regardless those entires will likely come into play when we ultimately get the information we need out of IllumOS.

I found an included CLI tool within IllumOS that does a lot of what we need to do to add support for it, it also seems to make use of /devices/ coupled with a bunch of calls, some of them, similarly to the BSDs, being ioctl() calls. We can probably work out the remaining info we need to implement IllumOS support by skimming this file. https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/pcitool/pcitool.c

shibedrill commented 8 months ago

Image The CXX crate is causing a build failure on IllumOS OpenIndiana. Not entirely sure how to go about resolving this.

gibsonpil commented 8 months ago

Looks to me like you need to install a C/C++ compiler. I think GCC and clang are both functional, I'd go for clang though.