We have PCI storage device for which we use Kernel Driver.
In kernel driver development we use getDeviceMemoryWithIndex to get IODeviceMemory and then we map it using IODeviceMemory->map then we fetch virtual memory using IOMemoryMap->getVirtualAddress.
So my query is what's alternative for this in PCIDriverKit for developing DEXT.
I found _CopyDeviceMemoryWithIndex api which seems similar to getDeviceMemoryWithIndex.
But when I used this api then this is failing with error: 0xe00002cd (Device Not Open.)
I'm doubting this failure because of IOPCIDevice->Open failure for which I have already created another thread [https://developer.apple.com/forums/thread/661711] to discuss this issue.
There is no sample code available so I'm just following WWDC2020 presentation for Modernize PCI and SCSI drivers with DriverKit.
My driver is loading and unloading on device connect/disconnect and able to fetch VID and DEVID from PCI registers. I'm using IOPCIDevice as provider and IOPCIMatch for driver matching.
Any help or suggestion is really appreciated.
Thanks