Still exploring PCIDriverKit for getting this solution.
Now after watching Modernize PCI and SCSI drivers with DriverKit I got points on how to proceed.
As per the presentation, device memory mapping is done by PCIDriverKit so Memory Space and Configuration Space should be accessible.
There is no issue with Configuration Read/Write and MemoryReadxx is also working fine for reading offsets in a specific memory index (say BAR0).
But MemoryWriteXX APIs are causing DEXT crash.
In kernel driver development we use getDeviceMemoryWithIndex to get Device Memory (BAR0 -> Controller Register) and then we map it using IODeviceMemory->map then we fetch virtual memory using IOMemoryMap->getVirtualAddress.
So again my question is how can I achieve functionality similar to KEXT in DEXT??
Post
Replies
Boosts
Views
Activity
@Drewbadour
Thanks for your reply..
Actually I want to use one of the provider device object to call api to read/write configuration register.
I want to iterate through all provider device object to match a specific provider then use this object for the same, the same way I used in my KEXT using IoService-getProvider.
Seems there is alternative, use BOT protocol using USBDriverKit. Get the Interface, setup pipes and use IOUSBHostPipe-IO call to communicate with device.
Hi akstp31,
As you have mentioned you have IOServiceOpen and IOConnectCallMethod works fine for you??
For me also it's working fine but data received in DEXT is not same as passed by application.
Are you getting data used in *inputStruct parameter in DriverExtension??
Also are you getting value passed as *outputStruct in Driver Extension.
As discussed in below thread, value of *outputStruct in DEXT received in my code is 0.
https://developer.apple.com/forums/thread/657515
Hi JSambrook,
How is your user space driver for PCIe device going on??
Hi,
I'm also facing same issue. For me also structureOutput value as 0 receiving in UserClient.
One more issue I'm facing is that even structure Input data is not matching what sent by application.
Hi,
I'm also observing this issue. For me also IOPCIDevice->Open is failing but ConfugurationReadXX/ConfigurationWriteXX is not throwing any error and I can access PCI register to fetch
Vendor ID: kIOPCIConfigurationOffsetVendorID and
Device ID: kIOPCIConfigurationOffsetDeviceID
So I can confirm that My DEXT is matching with my PCI device.
In WWDC2020 presentation: https://developer.apple.com/videos/play/wwdc2020/10210/ just IOPCIDevice->Open is required to communicate with device but this itself is failing.
I'm stuck here..
Any help would be appreciated..
Thanks
I'm also looking for reply on this thread from apple engineers.