Need an assistance to fetch the PCI devices information using PCIDrivers

I'm currently working on developing a PCI driver using PCIDriverKit, but I'm encountering challenges, particularly with the driver's extension. I need some insights on the APIs and methods to follow the best practices in generating PCI drivers for retrieving PCI devices information and running NVMe commands on the devices.

Replies

Hi, I do actually have a work-in-progress NVMe driver for xNVMe based on Driverkit.

At the moment, it's only doing one command at a time (queue depth = 1), and blocks until the command returns. It's plenty fast for prototyping, but not for any high performance work. I hope to make it async and much, much faster in the future, but this is at least a proof-of-concept.

I'm now in the process of releasing the code as the first beta.

What is your use-case? Maybe you can come to the xNVMe Discord server and we can discuss what you are looking for?

We have a mass storage device which is communicating with the MacOS. We are using libusb-1.0.23, IOKit and IOUSBHost to send the commands and It works fine for USB3.0 but it hangs and/or crashes when we try to connect using USB4.0. NVMeSMARTLibExternal.h is a header file we are using from IOKit library to get SMART data from USB4.0. Do you have any pointers which might help us investigate the issue further ? Have you run into such a scenario before. We are fine sending only 1 command at time for now. Addressing multiple command issue is not a priority for me yet.

Also, I'm not able to fin d a Discord server you mentioned. Can you please share a link or help with the correct name of a server?

  • Sorry, I didn't see your reply earlier.

    I had the same issues as you, and concluded that you need a custom driver, as the Apple NVMe driver does not provide raw access to the NVMe device.

    My code is still in the internal process of being open-sourced. But once it's cleared, it'll be released on the xNVMe repo: https://github.com/OpenMPDK/xNVMe

    Link to the Discord server is at the bottom of the GitHub page: https://discord.gg/XCbBX9DmKf

Add a Comment

Hi @baekalfen, The information you provided was really helpful. Thanks for the same!

We have built the latest version of xNVME cli from the sources " https://xnvme.io/" and we are trying to use it on MacOS Sonoma with a Prograde Device CFExpress connected via a Thunderbolt/USB4.0 interface. Mac OS is able to access this device, by reading and writing data to it. Also diskutil is able to read it. But when we use the xnvme cli, we are not able to list the devices available. PFA, attachments includes some screenshots for the same.

We are trying to understand why this may be the case, since OS is able to access it. Let us know if we can coordinate offline.

  • Try with 'sudo': 'sudo xnvme enum' or 'sudo xnvme list'.

    But the proper PCI support has not been released yet. The current support will only be through the block-layer device and the built-in NVMe driver.

Add a Comment