SCSIControllerDriverKit

RSS for tag

Develop drivers for SCSI protocol-based devices.

Posts under SCSIControllerDriverKit tag

38 Posts

Post

Replies

Boosts

Views

Activity

How to setup DriverKit Timer Event with OSAction Callback Binding
Hello Everyone, I'm encountering an issue while setting up a timer event in DriverKit and would appreciate any guidance. Here's my current implementation: void DRV_MAIN_CLASS_NAME::SetupEventTimer() { // 1. Create dispatch queue kern_return_t ret = IODispatchQueue::Create("TimerQueue", 0, 0, &ivars->dispatchQueue); if (ret != kIOReturnSuccess) { LogErr("Failed to create dispatch queue: 0x%x", ret); return; } // 2. Create timer source ret = IOTimerDispatchSource::Create(ivars->dispatchQueue, &ivars->dispatchSource); if (ret != kIOReturnSuccess) { LogErr("Failed to create timer: 0x%x", ret); OSSafeReleaseNULL(ivars->dispatchQueue); return; } /*! * @brief Create an instance of OSAction. * @discussion Methods to allocate an OSAction instance are generated for each method defined in a class with * a TYPE attribute, so there should not be any need to directly call OSAction::Create(). * @param target OSObject to receive the callback. This object will be retained until the OSAction is * canceled or freed. * @param targetmsgid Generated message ID for the target method. * @param msgid Generated message ID for the method invoked by the receiver of the OSAction * to generate the callback. * @param referenceSize Size of additional state structure available to the creator of the OSAction * with GetReference. * @param action Created OSAction with +1 retain count to be released by the caller. * @return kIOReturnSuccess on success. See IOReturn.h for error codes. */ // 3: Create an OSAction for the TimerOccurred method // THIS IS WHERE I NEED HELP OSAction* timerAction = nullptr; ret = OSAction::Create(this, 0, 0, 0, &timerAction); if (ret != kIOReturnSuccess) { LogErr("Failed to create OSAction: 0x%x", ret); goto cleanup; } // 4. Set handler ret = ivars->dispatchSource->SetHandler(timerAction); if (ret != kIOReturnSuccess) { LogErr("Failed to set handler: 0x%x", ret); goto cleanup; } // 5. Schedule timer (1 second) uint64_t deadline = mach_absolute_time() + NSEC_PER_SEC; ivars->dispatchSource->WakeAtTime(0, deadline, 0); cleanup: if (ret != kIOReturnSuccess) { OSSafeReleaseNULL(timerAction); OSSafeReleaseNULL(ivars->dispatchSource); OSSafeReleaseNULL(ivars->dispatchQueue); } } Problem: The code runs but the OSAction callback binding seems incorrect (Step 3). According to the OSAction documentation, I need to use the TYPE macro to properly bind the callback method. But I try to use TYPE(DRV_MAIN_CLASS_NAME::TimerOccurred) kern_return_t TimerOccurred() LOCALONLY; TYPE(TimerOccurred) kern_return_t TimerOccurred() LOCALONLY; kern_return_t TimerOccurred() TYPE(DRV_MAIN_CLASS_NAME::TimerOccurred) LOCALONLY; All results in Out-of-line definition of 'TimerOccurred' does not match any declaration in 'DRV_MAIN_CLASS_NAME' Questions: What is the correct way to declare a timer callback method using TYPE? How to get the values targetmsgid & msgid generated by Xcode? Any help would be greatly appreciated! Best Regards, Charles
6
0
460
Apr ’25
Why UserInitializeTargetForID() not be invoked after UserCreateTargetForID() successfully?
Hello Everyone, I am trying to create a Fake SCSI target based on SCSIControllerDriverKit.framework and inherent from IOUserSCSIParallelInterfaceController, here is the code kern_return_t IMPL(DRV_MAIN_CLASS_NAME, Start) { ... // Programmatically create a null SCSI Target SCSIDeviceIdentifier nullTargetID = 0; // Example target ID, adjust as needed ret = UserCreateTargetForID(nullTargetID, nullptr); if (ret != kIOReturnSuccess) { Log("Failed to create Null SCSI Target for ID %llu", nullTargetID); return ret; } ... } According the document UserCreateTargetForID, after creating a TargetID successfully, the framework will call the UserInitializeTargetForID() The document said: As part of the UserCreateTargetForID call, the kernel calls several APIs like UserInitializeTargetForID which run on the default dispatch queue of the dext. But after UserCreateTargetForID created, why the UserInitializeTargetForID() not be invoked automatically? Here is the part of log show init() - Start init() - End Start() - Start Start() - try 1 times UserCreateTargetForID() - Start Allocating resources for Target ID 0 UserCreateTargetForID() - End Start() - Finished. UserInitializeController() - Start - PCI vendorID: 0x14d6, deviceID: 0x626f. - BAR0: 0x1, BAR1: 0x200004. - GetBARInfo() - BAR1 - MemoryIndex: 0, Size: 262144, Type: 0. UserInitializeController() - End UserStartController() - Start - msiInterruptIndex : 0x00000000 - interruptType info is 0x00010000 - PCI Dext interrupt final value, return status info is 0x00000000 UserStartController() - End Any assistance would be greatly appreciated! Thank you in advance for your support. Best regards, Charles
1
0
497
Mar ’25
The Map() of IOBufferMemoryDescriptor failure and cause the DriverKit Start() repeat
Hello Everyone, I am trying to develop a DriverKit for RAID system, using PCIDriverKit & SCSIControllerDriverKit framework. The driver can detect the Vendor ID and Device ID. But before communicating to the RAID system, I would like to simulate a virtual Volume using a memory block to talk with macOS. In the UserInitializeController(), I allocated a 512K memory for a IOBufferMemoryDescriptor* volumeBuffer, but fail to use Map() to map memory for volumeBuffer. result = ivars->volumeBuffer->Map( 0, // Options: Use default 0, // Offset: Start of the buffer ivars->volumeSize, // Length: Must not exceed buffer size 0, // Flags: Use default nullptr, // Address space: Default address space &mappedAddress // Output parameter ); Log("Memory mapped completed at address: 0x%llx", mappedAddress); // this line never run The Log for Map completed never run, just restart to run the Start() and makes this Driver re-run again and again, in the end, the driver eat out macOS's memory and system halt. Are the parameters for Map() error? or I should not put this code in UserInitializeController()? Any help is appreciated! Thanks in advance. Charles
0
0
430
Mar ’25
DriverKit CppUserClient Searching for dext service but Failed opening service with error: 0xe00002c7
Hi Everybody, Follow Communicating between a DriverKit extension and a client app to migrate our kext to dext. The dext might have been loaded successfully by using the command systemextensionsctl list, the dext is loaded and enabled. % sectl list 1 extension(s) --- com.apple.system_extension.driver_extension enabled active teamID bundleID (version) name [state] * * K3TDMD9Y6B com.accusys.scsidriver (1.0/1) com.accusys.scsidriver [activated enabled] We try to use the CppUserClient.cpp to communicate with the dext, but can not get the dext service. The debug message as below: Failed opening service with error: 0xe00002c7. Here is the part of CppUserClient.cpp static const char* dextIdentifier = "com.accusys.scsidriver"; kern_return_t ret = kIOReturnSuccess; io_iterator_t iterator = IO_OBJECT_NULL; io_service_t service = IO_OBJECT_NULL; ret = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOUserServer"), &iterator); printf("dextIdentifier = %s\n", dextIdentifier); printf("IOServiceNameMatching return = %d\n", ret); if (ret != kIOReturnSuccess) { printf("Unable to find service for identifier with error: 0x%08x.\n", ret); PrintErrorDetails(ret); } printf("Searching for dext service...\n"); while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { // Open a connection to this user client as a server to that client, and store the instance in "service" ret = IOServiceOpen(service, mach_task_self_, kIOHIDServerConnectType, &connection); if (ret == kIOReturnSuccess) { printf("\tOpened service.\n"); break; } else { printf("\tFailed opening service with error: 0x%08x.\n", ret); } IOObjectRelease(service); } IOObjectRelease(iterator); if (service == IO_OBJECT_NULL) { printf("Failed to match to device.\n"); return EXIT_FAILURE; } The console output message is dextIdentifier = com.accusys.scsidriver IOServiceNameMatching return = 0 Searching for dext service... Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed to match to device. Here is the log show message fredapp start UserInitializeController pcitest: fredapp pci vendorID: 14d6 deviceID: 626f fredapp nnnnnew configuaration read32 0x10 info: 1 fredapp nnnnnew configuaration read32 0x14 info: 80100004 fredapp new 128 before enable busmaster ReqMSGport_info 0x00000040 : fffff pcitest: fredapp 131 pci ConfigurationRead16 busmaster value 0 pcitest: fredapp 134 Enable BusMaster and IO space done...... locate 139 fredapp MemoryWrite32 function done...... fredapp new 143 after enable busmaster ReqMSGport_info 0x00000040 : 0 fredapp newwww before GetBARInfo memoryIndex1 info is: 5 fredapp GetBARInfo 1 kernel return status is: 0 fredapp GetBARInfo memoryIndex1 info is: 0 fredapp GetBARInfo barSize1 info is: 262144 fredapp GetBARInfo barType1 info is: 0 fredapp GetBARInfo result0 info is: 3758097136 fredapp GetBARInfo memoryIndex0 info is: 0 fredapp GetBARInfo barSize0 info is: 0 fredapp GetBARInfo barType0 info is: 0 pcitest: newwww fredapp againnnn test ReqMSGport info: 8 fredapp Start MPIO_Init_Prepare fredapp end MPIO_Init_Prepare. fredapp call 741 Total_memory_size: 1bb900 fredapp Start MemoryAllocationForAME_Module. fredapp IOBufferMemoryDescriptor create return status info is kIOReturnSuc fredapp IOBufferMemoryDescriptor virtualAddressSegment address info: 0x1 fredapp virtualAddressSegment length info: 0x00080000 fredapp end IOBufferMemoryDescriptor Create. fredapp dmaSpecification maxAddressBits: 0x00000000 fredapp dmaSpecification maxAddressBits: 0x00000027 fredapp IODMACommand create return status info is kIOReturnSuccess fredapp end IODMACommand Create. fredapp PrepareForDMA return status info is kIOReturnSuccess fredapp PrepareForDMA return status info is 0x00000000 fredapp Allocate memory PrepareforDMA return flags info: 0x00000003 fredapp Allocate memory PrepareforDMA return segmentsCount info: 0x00000 fredapp Allocate memory PrepareforDMA return physicalAddressSegment info: fredapp IOBufferMemoryDescriptor virtualAddressSegment address info-2: 0 fredapp verify data success init() - Finished. fredapp start UserGetDMASpecification fredapp end UserGetDMASpecification fredapp start UserMapHBAData fredapp end UserMapHBAData fredapp start UserStartController fredapp interruptType info is 0x00010000 fredapp PCI Dext interrupt final value return status info is 0x00000000 Any suggestions? Best Regards, Charles
6
0
887
Jan ’25
SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 Error:kIOReturnUnsupported (0xe00002c7)
I am using SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 to develop a Dext driver, which has only two classes: MyUserSCSIPeripheralDeviceType00 and MyUserClient, MyUserClient is responsible for receiving APP commands and passing them to MyUserSCSIPeripheralDeviceType00->UserSendCDB(), After the device is connected to the computer, the driver can match the device and start, calling MyUserSCSIPeripheralDeviceType00-->init(), MyUserSCSIPeripheralDeviceType00-->Start(), Any command sent by the APP to MyUserSCSIPeripheralDeviceType00 will return a failure: kIOReturnUnsupported (0xe00002c7), including UserSendCDB(), UserReportMediumBlockSize(), <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IOKitPersonalities</key> <dict> <key>MySCSIDriver</key> <dict> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleIdentifierKernel</key> <string>com.apple.kpi.iokit</string> <key>IOClass</key> <string>IOUserService</string> <key>IOMatchCategory</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>IOProviderClass</key> <string>IOSCSIPeripheralDeviceNub</string> <key>IOResourceMatch</key> <string>IOKit</string> <key>IOUserClass</key> <string>MyUserSCSIPeripheralDeviceType00</string> <key>IOUserServerName</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>UserClientProperties</key> <dict> <key>IOClass</key> <string>IOUserUserClient</string> <key>IOUserClass</key> <string>MyUserClient</string> </dict> <key>bConfigurationValue</key> <integer>1</integer> <key>bInterfaceNumber</key> <integer>0</integer> <key>bcdDevice</key> <integer>1</integer> <key>idProduct</key> <string>*</string> <key>idVendor</key> <integer>12345</integer> <key>Peripheral Device Type</key> <integer>0</integer> <key>IOKitDebug</key> <integer>65535</integer> </dict> </dict> </dict> </plist> This is the method that receives client calls kern_return_t MyUserSCSIPeripheralDeviceType00::HandleExternalStruct(IOUserClientMethodArguments* arguments) { kern_return_t ret = kIOReturnSuccess; SCSIType00OutParameters command; SCSIType00InParameters response; SCSI_Sense_Data sense; UInt64 fSenseAddr = (intptr_t)&sense; bzero((void *)&command, sizeof(SCSIType00OutParameters)); bzero((void *)&response, sizeof(SCSIType00InParameters)); bool test = TEST_UNIT_READY(&command, &response, fSenseAddr); // test is true ret = this->UserSendCDB(command, &response); // ret is kIOReturnUnsupported (0xe00002c7) UInt64 blockSize; kern_return_t sizeRet = this->UserReportMediumBlockSize(&blockSize); // sizeRet is kIOReturnUnsupported (0xe00002c7) }; // Not called. As per the documentation, this should be called during enumeration. kern_return_t IMPL(I4UserSCSIPeripheralDeviceType00, UserDetermineDeviceCharacteristics) { // *result = true; return kIOReturnSuccess; }
0
0
845
Apr ’24
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.
3
0
1.4k
Feb ’24
Is SCSIPeripheralsDriverKit on board?
I've try to develop a dext to send SCSI commands to some storage products, but when I try to implements SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 interface, I... just don't know how to do it, I tried to convert kext way to Driverkit way, but I always block by error warnings. After I google a lots of solutions, I was wondering is this feature working? or Is there any samples or guideline?
0
0
669
Jun ’23
How to access dmaaddress (Physical Address) in DriverKit?
I am trying to use IOUserBlockStorageDevice in DriverKit to simulate a fake device (Implementing a Ram Disk). Currently I'm confused on how to use the dmaaddress in the following interface virtual kern_return_t DoAsyncReadWrite (bool isRead, uint32_t requestID, uint64_t dmaAddr, uint64_t size, uint64_t lba, uint64_t numOfBlocks, IOUserStorageOptions options) = 0; According to https://github.com/briancabbott/macOS-system-projects/blob/19310aa5c7b7507408261a22a2e8f46f9d478a88/Resources/Code/apple-oss-distributions/IOStorageFamily/IOUserBlockStorageDevice_kext.cpp Before calling "DoAsyncReadWrite", kernel allocate a segment of physical memory by using "IODMAcommand::genIOVMSegments". This segment's physical address is pass to DoAsyncReadWrite as parameter "dmaAddr". To implement a correct ram disk, we need to "transform" this physical address to virtual so that we can "Read" or "Write" on this physical address. I tried to use "IOMemoryDescriptor" to access this dmaAddr. In IOKit, I belive I can use interface such as "withPhysicalAddress" to access the memory. However, such interface is not exist while using driverkit, all interface that I can use in DriverKit IOMemoryDescriptor is : -kern_return_t GetLength(uint64_t * returnLength) LOCALONLY; // apparently not this one -virtual kern_return_t CreateMapping( uint64_t options, uint64_t address, uint64_t offset, uint64_t length, uint64_t alignment, IOMemoryMap ** map); // Maybe this one with kIOMemoryFixedAddress option? // But I get Segment Fault while calling this with CreateMapping( kIOMemoryFixedAddress , dmaaddr, 0, size, 0, &map); // Or getting error return while calling CreateMapping with same paramters after IOBufferMemoryDescriptor::Create // Also, output iomemorymap is not used here, which is quiet strange. static kern_return_t CreateSubMemoryDescriptor(uint64_t memoryDescriptorCreateOptions, uint64_t offset, uint64_t length, IOMemoryDescriptor * ofDescriptor, IOMemoryDescriptor ** memory) attribute((availability(driverkit,introduced=20.0))); // Seems not this, it create “sub“ memory descriptor static kern_return_t CreateWithMemoryDescriptors(uint64_t memoryDescriptorCreateOptions, uint32_t withDescriptorsCount, IOMemoryDescriptor * const withDescriptors[32], IOMemoryDescriptor ** memory) attribute((availability(driverkit,introduced=20.0))); // Seems not this, it don’t take any dmaaddr as parameter. and a private function kern_return_t Map( uint64_t options, uint64_t address, uint64_t length, uint64_t alignment, uint64_t * returnAddress, uint64_t * returnLength) LOCALONLY; // Maybe this one? But the header file don’t show any description on this function and we are not sure what parameters should we pass. // Currently I've test Map( kIOMemoryFixedAddress , dmaaddr, size, 0, &returnAddress, &returnLength) but get error return. It seems that I've made some mistake on using IOMemoryDescriptor? How to correct access a dmaaddress? I've also tried class "IODMACommand", but also get unexpected behavior. Another question is how to read / write buffer after I create correct mapping. While implementing kext, IOMemoryDescriptor can use "readBytes" or "writeBytes" to read or write memory that IOMemoryDescriptor maps to. However, DriverKit don’t have interface of "readBytes" or "writeBytes". Maybe I can directly access buffer by casting the IOMemoryDescriptor::Map "returnAddress" to void? (I haven't tried it yet cause "Map" always failed now QQ) Thanks for everyone's help.
2
1
2.4k
Feb ’23
Sending SCSI commands to USB mass storage device
Our device is USB Mass stroage device. We want to send a specific SCSI command to a USB drive in Mac OS X. Have any demo app that uses IOUserSCSIPeripheralDeviceType00 in SCSIPeripheralsDriverKit? We want to use below SCSI command, but have no demo program. https://developer.apple.com/documentation/scsiperipheralsdriverkit/3946437-inquiry https://developer.apple.com/documentation/scsiperipheralsdriverkit/iouserscsiperipheraldevicetype00/3946461-usersendcdb
0
2
896
Nov ’22
SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
Context: We are working on migration of the driver, which is currently represented as a kernel extension, to the DriverKit framework. The driver works with Thunderbolt RAID storage devices. When connected through the Thunderbolt interface to the host, the device itself presents in the OS as a PCI device. The main function of our driver (.kext) is to create a "virtual" SCSI device in the OS for each virtual RAID array. So that the OS can work with these SCSI drives as usual disk storage.  We use https://developer.apple.com/documentation/scsicontrollerdriverkit to migrate this functionality in the dext version of the driver. Current issue: When a device is connected - the dext driver cannot create a SCSI drive in the OS. Technically our dext tries to create a SCSI drive using the UserCreateTargetForID method. On this step the OS sends the first SCSI command “Test Unit Ready ''to the device to check if it is a SCSI device. We process this command in an additional thread  separated from the main process of the dext (as it is recommended in the DriverKit documentation). We can see in the logs that the device receives this command and responses but when our dext sends this response to the OS the process is stuck in the waiting mode. How can we understand why it happens and fix it? More details: We are migrating functionality of an already existing “.kext” driver. We checked logs of the kext driver of this step: 15:06:17.902539+0700 Target device try to create for idx:0 15:06:17.902704+0700 Send command 0 for target 0 len 0 15:06:18.161777+0700 Complete command: 0 for target: 0 Len: 0 status: 0 flags: 0 15:06:18.161884+0700 Send command 18 for target 0 len 6 15:06:18.161956+0700 Complete command: 18 for target: 0 Len: 6 status: 0 flags: 0 15:06:18.162010+0700 Send command 18 for target 0 len 44 15:06:18.172972+0700 Complete command: 18 for target: 0 Len: 44 status: 0 flags: 0 15:06:18.275501+0700 Send command 18 for target 0 len 36 15:06:18.275584+0700 Complete command: 18 for target: 0 Len: 36 status: 0 flags: 0 15:06:18.276257+0700 Target device created for idx:0 We can see a successful message “Target device created for idx:0” In the the dext logs of the same step: We do not see the “Send command 18 for target 0 len 6” as we have in the kext logs  no log of the successful result “Target device created for idx:0” 15:54:10.903466+0700 Try to create target for 0 UUID 432421434863538456 15:54:10.903633+0700 UserDoesHBAPerformAutoSense 15:54:10.903763+0700 UserInitializeTargetForID 15:54:10.903876+0700 UserDoesHBASupportMultiPathing 15:54:10.904200+0700 UserProcessParallelTask start. 15:54:10.904298+0700 Sent command : 0 len 0 for target 0 15:54:11.163003+0700 Disable interrupts. 15:54:11.163077+0700 Complete cmd : 0 for target: 0 len: 0  status: 0 flags: 0 15:54:11.163085+0700 Enable interrupts. Will appreciate any help
3
1
1.4k
Nov ’22
Where is SCSIControllerDriverKit now?
Hi there! There was a presentation of the SCSI support in DriverKit on 2020 WWDC: https://developer.apple.com/videos/play/wwdc2020/10210/ Currently, the Xcode 12.4 (latest) has nothing regarding SCSI in DriverKit folders. Documentation says it is still in beta: https://developer.apple.com/documentation/scsicontrollerdriverkit So I've downloaded xcode 12.5 beta, where the driverkit 20.4 beta resides (according to https://developer.apple.com/support/xcode/) And what we have there? Just Kernel.framework/Versions/A/Headers/DriverKit/IOReturn.h 65:#define sub_iokit_scsi err_sub(16) And nothing more! So, the question is: do we have any way to use SCSI devices now on BigSur? Could I develop something for it with DriverKit, or should I use kext-approach for now, and wait for SCSI DriverKit support to be released indeed?
4
0
2.4k
Oct ’22
Does PCIDriverKit support PCI Device PNP?
I am woriking on SCSIControllerDriverKit IOUserSCSIParallelInterfaceController When I hot-plug my PCIe SCSI controller, the controller works normally, but when I hot remove the PCIe SCSI controller, the driverkit crashes. Thread 3 Crashed:: Dispatch queue: MyUserSpaceDriver-Default UserSpaceDriver-PCIe-hotremove.rtf.txt UserSpaceDriver-PCIe-hotremove.ips.txt
2
0
1.1k
Jan ’22
Does UserCreateTargetForID work for IOUserSCSIParallelInterfaceController?
I am working on SCSIControllerDriverKit UserSpaceDriver-UserCreateTargetForID.ips.txt I UserSpaceDriver-UserCreateTargetForID.rtf.txt OUserSCSIParallelInterfaceController My dext had follow this site description: https://developer.apple.com/documentation/scsicontrollerdriverkit/iouserscsiparallelinterfacecontroller/3567474-usercreatetargetforid But when the program calls: UserCreateTargetForID(scsi_target,targetOSDictionary) got panic.
0
0
1.2k
Dec ’21
IOSCIS DriverKit
Any advice how to migrate an app using kext to using IO from the app level. We have a USB device, which uses proprietary protocol to communicate. It looks like I can't ship .app with kext bundled in, so I have started looking into migrating our current driver to use user space APIs. Any pointers on how to handle migration from kext using IOSCSIProtocolInterface to user space IOUSBInterfaceInterface
3
0
2k
Jul ’21
How to setup DriverKit Timer Event with OSAction Callback Binding
Hello Everyone, I'm encountering an issue while setting up a timer event in DriverKit and would appreciate any guidance. Here's my current implementation: void DRV_MAIN_CLASS_NAME::SetupEventTimer() { // 1. Create dispatch queue kern_return_t ret = IODispatchQueue::Create("TimerQueue", 0, 0, &ivars->dispatchQueue); if (ret != kIOReturnSuccess) { LogErr("Failed to create dispatch queue: 0x%x", ret); return; } // 2. Create timer source ret = IOTimerDispatchSource::Create(ivars->dispatchQueue, &ivars->dispatchSource); if (ret != kIOReturnSuccess) { LogErr("Failed to create timer: 0x%x", ret); OSSafeReleaseNULL(ivars->dispatchQueue); return; } /*! * @brief Create an instance of OSAction. * @discussion Methods to allocate an OSAction instance are generated for each method defined in a class with * a TYPE attribute, so there should not be any need to directly call OSAction::Create(). * @param target OSObject to receive the callback. This object will be retained until the OSAction is * canceled or freed. * @param targetmsgid Generated message ID for the target method. * @param msgid Generated message ID for the method invoked by the receiver of the OSAction * to generate the callback. * @param referenceSize Size of additional state structure available to the creator of the OSAction * with GetReference. * @param action Created OSAction with +1 retain count to be released by the caller. * @return kIOReturnSuccess on success. See IOReturn.h for error codes. */ // 3: Create an OSAction for the TimerOccurred method // THIS IS WHERE I NEED HELP OSAction* timerAction = nullptr; ret = OSAction::Create(this, 0, 0, 0, &timerAction); if (ret != kIOReturnSuccess) { LogErr("Failed to create OSAction: 0x%x", ret); goto cleanup; } // 4. Set handler ret = ivars->dispatchSource->SetHandler(timerAction); if (ret != kIOReturnSuccess) { LogErr("Failed to set handler: 0x%x", ret); goto cleanup; } // 5. Schedule timer (1 second) uint64_t deadline = mach_absolute_time() + NSEC_PER_SEC; ivars->dispatchSource->WakeAtTime(0, deadline, 0); cleanup: if (ret != kIOReturnSuccess) { OSSafeReleaseNULL(timerAction); OSSafeReleaseNULL(ivars->dispatchSource); OSSafeReleaseNULL(ivars->dispatchQueue); } } Problem: The code runs but the OSAction callback binding seems incorrect (Step 3). According to the OSAction documentation, I need to use the TYPE macro to properly bind the callback method. But I try to use TYPE(DRV_MAIN_CLASS_NAME::TimerOccurred) kern_return_t TimerOccurred() LOCALONLY; TYPE(TimerOccurred) kern_return_t TimerOccurred() LOCALONLY; kern_return_t TimerOccurred() TYPE(DRV_MAIN_CLASS_NAME::TimerOccurred) LOCALONLY; All results in Out-of-line definition of 'TimerOccurred' does not match any declaration in 'DRV_MAIN_CLASS_NAME' Questions: What is the correct way to declare a timer callback method using TYPE? How to get the values targetmsgid & msgid generated by Xcode? Any help would be greatly appreciated! Best Regards, Charles
Replies
6
Boosts
0
Views
460
Activity
Apr ’25
Why UserInitializeTargetForID() not be invoked after UserCreateTargetForID() successfully?
Hello Everyone, I am trying to create a Fake SCSI target based on SCSIControllerDriverKit.framework and inherent from IOUserSCSIParallelInterfaceController, here is the code kern_return_t IMPL(DRV_MAIN_CLASS_NAME, Start) { ... // Programmatically create a null SCSI Target SCSIDeviceIdentifier nullTargetID = 0; // Example target ID, adjust as needed ret = UserCreateTargetForID(nullTargetID, nullptr); if (ret != kIOReturnSuccess) { Log("Failed to create Null SCSI Target for ID %llu", nullTargetID); return ret; } ... } According the document UserCreateTargetForID, after creating a TargetID successfully, the framework will call the UserInitializeTargetForID() The document said: As part of the UserCreateTargetForID call, the kernel calls several APIs like UserInitializeTargetForID which run on the default dispatch queue of the dext. But after UserCreateTargetForID created, why the UserInitializeTargetForID() not be invoked automatically? Here is the part of log show init() - Start init() - End Start() - Start Start() - try 1 times UserCreateTargetForID() - Start Allocating resources for Target ID 0 UserCreateTargetForID() - End Start() - Finished. UserInitializeController() - Start - PCI vendorID: 0x14d6, deviceID: 0x626f. - BAR0: 0x1, BAR1: 0x200004. - GetBARInfo() - BAR1 - MemoryIndex: 0, Size: 262144, Type: 0. UserInitializeController() - End UserStartController() - Start - msiInterruptIndex : 0x00000000 - interruptType info is 0x00010000 - PCI Dext interrupt final value, return status info is 0x00000000 UserStartController() - End Any assistance would be greatly appreciated! Thank you in advance for your support. Best regards, Charles
Replies
1
Boosts
0
Views
497
Activity
Mar ’25
The Map() of IOBufferMemoryDescriptor failure and cause the DriverKit Start() repeat
Hello Everyone, I am trying to develop a DriverKit for RAID system, using PCIDriverKit & SCSIControllerDriverKit framework. The driver can detect the Vendor ID and Device ID. But before communicating to the RAID system, I would like to simulate a virtual Volume using a memory block to talk with macOS. In the UserInitializeController(), I allocated a 512K memory for a IOBufferMemoryDescriptor* volumeBuffer, but fail to use Map() to map memory for volumeBuffer. result = ivars->volumeBuffer->Map( 0, // Options: Use default 0, // Offset: Start of the buffer ivars->volumeSize, // Length: Must not exceed buffer size 0, // Flags: Use default nullptr, // Address space: Default address space &mappedAddress // Output parameter ); Log("Memory mapped completed at address: 0x%llx", mappedAddress); // this line never run The Log for Map completed never run, just restart to run the Start() and makes this Driver re-run again and again, in the end, the driver eat out macOS's memory and system halt. Are the parameters for Map() error? or I should not put this code in UserInitializeController()? Any help is appreciated! Thanks in advance. Charles
Replies
0
Boosts
0
Views
430
Activity
Mar ’25
DriverKit CppUserClient Searching for dext service but Failed opening service with error: 0xe00002c7
Hi Everybody, Follow Communicating between a DriverKit extension and a client app to migrate our kext to dext. The dext might have been loaded successfully by using the command systemextensionsctl list, the dext is loaded and enabled. % sectl list 1 extension(s) --- com.apple.system_extension.driver_extension enabled active teamID bundleID (version) name [state] * * K3TDMD9Y6B com.accusys.scsidriver (1.0/1) com.accusys.scsidriver [activated enabled] We try to use the CppUserClient.cpp to communicate with the dext, but can not get the dext service. The debug message as below: Failed opening service with error: 0xe00002c7. Here is the part of CppUserClient.cpp static const char* dextIdentifier = "com.accusys.scsidriver"; kern_return_t ret = kIOReturnSuccess; io_iterator_t iterator = IO_OBJECT_NULL; io_service_t service = IO_OBJECT_NULL; ret = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOUserServer"), &iterator); printf("dextIdentifier = %s\n", dextIdentifier); printf("IOServiceNameMatching return = %d\n", ret); if (ret != kIOReturnSuccess) { printf("Unable to find service for identifier with error: 0x%08x.\n", ret); PrintErrorDetails(ret); } printf("Searching for dext service...\n"); while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { // Open a connection to this user client as a server to that client, and store the instance in "service" ret = IOServiceOpen(service, mach_task_self_, kIOHIDServerConnectType, &connection); if (ret == kIOReturnSuccess) { printf("\tOpened service.\n"); break; } else { printf("\tFailed opening service with error: 0x%08x.\n", ret); } IOObjectRelease(service); } IOObjectRelease(iterator); if (service == IO_OBJECT_NULL) { printf("Failed to match to device.\n"); return EXIT_FAILURE; } The console output message is dextIdentifier = com.accusys.scsidriver IOServiceNameMatching return = 0 Searching for dext service... Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed opening service with error: 0xe00002c7. Failed to match to device. Here is the log show message fredapp start UserInitializeController pcitest: fredapp pci vendorID: 14d6 deviceID: 626f fredapp nnnnnew configuaration read32 0x10 info: 1 fredapp nnnnnew configuaration read32 0x14 info: 80100004 fredapp new 128 before enable busmaster ReqMSGport_info 0x00000040 : fffff pcitest: fredapp 131 pci ConfigurationRead16 busmaster value 0 pcitest: fredapp 134 Enable BusMaster and IO space done...... locate 139 fredapp MemoryWrite32 function done...... fredapp new 143 after enable busmaster ReqMSGport_info 0x00000040 : 0 fredapp newwww before GetBARInfo memoryIndex1 info is: 5 fredapp GetBARInfo 1 kernel return status is: 0 fredapp GetBARInfo memoryIndex1 info is: 0 fredapp GetBARInfo barSize1 info is: 262144 fredapp GetBARInfo barType1 info is: 0 fredapp GetBARInfo result0 info is: 3758097136 fredapp GetBARInfo memoryIndex0 info is: 0 fredapp GetBARInfo barSize0 info is: 0 fredapp GetBARInfo barType0 info is: 0 pcitest: newwww fredapp againnnn test ReqMSGport info: 8 fredapp Start MPIO_Init_Prepare fredapp end MPIO_Init_Prepare. fredapp call 741 Total_memory_size: 1bb900 fredapp Start MemoryAllocationForAME_Module. fredapp IOBufferMemoryDescriptor create return status info is kIOReturnSuc fredapp IOBufferMemoryDescriptor virtualAddressSegment address info: 0x1 fredapp virtualAddressSegment length info: 0x00080000 fredapp end IOBufferMemoryDescriptor Create. fredapp dmaSpecification maxAddressBits: 0x00000000 fredapp dmaSpecification maxAddressBits: 0x00000027 fredapp IODMACommand create return status info is kIOReturnSuccess fredapp end IODMACommand Create. fredapp PrepareForDMA return status info is kIOReturnSuccess fredapp PrepareForDMA return status info is 0x00000000 fredapp Allocate memory PrepareforDMA return flags info: 0x00000003 fredapp Allocate memory PrepareforDMA return segmentsCount info: 0x00000 fredapp Allocate memory PrepareforDMA return physicalAddressSegment info: fredapp IOBufferMemoryDescriptor virtualAddressSegment address info-2: 0 fredapp verify data success init() - Finished. fredapp start UserGetDMASpecification fredapp end UserGetDMASpecification fredapp start UserMapHBAData fredapp end UserMapHBAData fredapp start UserStartController fredapp interruptType info is 0x00010000 fredapp PCI Dext interrupt final value return status info is 0x00000000 Any suggestions? Best Regards, Charles
Replies
6
Boosts
0
Views
887
Activity
Jan ’25
SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 Error:kIOReturnUnsupported (0xe00002c7)
I am using SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 to develop a Dext driver, which has only two classes: MyUserSCSIPeripheralDeviceType00 and MyUserClient, MyUserClient is responsible for receiving APP commands and passing them to MyUserSCSIPeripheralDeviceType00->UserSendCDB(), After the device is connected to the computer, the driver can match the device and start, calling MyUserSCSIPeripheralDeviceType00-->init(), MyUserSCSIPeripheralDeviceType00-->Start(), Any command sent by the APP to MyUserSCSIPeripheralDeviceType00 will return a failure: kIOReturnUnsupported (0xe00002c7), including UserSendCDB(), UserReportMediumBlockSize(), <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IOKitPersonalities</key> <dict> <key>MySCSIDriver</key> <dict> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleIdentifierKernel</key> <string>com.apple.kpi.iokit</string> <key>IOClass</key> <string>IOUserService</string> <key>IOMatchCategory</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>IOProviderClass</key> <string>IOSCSIPeripheralDeviceNub</string> <key>IOResourceMatch</key> <string>IOKit</string> <key>IOUserClass</key> <string>MyUserSCSIPeripheralDeviceType00</string> <key>IOUserServerName</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>UserClientProperties</key> <dict> <key>IOClass</key> <string>IOUserUserClient</string> <key>IOUserClass</key> <string>MyUserClient</string> </dict> <key>bConfigurationValue</key> <integer>1</integer> <key>bInterfaceNumber</key> <integer>0</integer> <key>bcdDevice</key> <integer>1</integer> <key>idProduct</key> <string>*</string> <key>idVendor</key> <integer>12345</integer> <key>Peripheral Device Type</key> <integer>0</integer> <key>IOKitDebug</key> <integer>65535</integer> </dict> </dict> </dict> </plist> This is the method that receives client calls kern_return_t MyUserSCSIPeripheralDeviceType00::HandleExternalStruct(IOUserClientMethodArguments* arguments) { kern_return_t ret = kIOReturnSuccess; SCSIType00OutParameters command; SCSIType00InParameters response; SCSI_Sense_Data sense; UInt64 fSenseAddr = (intptr_t)&sense; bzero((void *)&command, sizeof(SCSIType00OutParameters)); bzero((void *)&response, sizeof(SCSIType00InParameters)); bool test = TEST_UNIT_READY(&command, &response, fSenseAddr); // test is true ret = this->UserSendCDB(command, &response); // ret is kIOReturnUnsupported (0xe00002c7) UInt64 blockSize; kern_return_t sizeRet = this->UserReportMediumBlockSize(&blockSize); // sizeRet is kIOReturnUnsupported (0xe00002c7) }; // Not called. As per the documentation, this should be called during enumeration. kern_return_t IMPL(I4UserSCSIPeripheralDeviceType00, UserDetermineDeviceCharacteristics) { // *result = true; return kIOReturnSuccess; }
Replies
0
Boosts
0
Views
845
Activity
Apr ’24
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
3
Boosts
0
Views
1.4k
Activity
Feb ’24
Need a assistance in getting USB information using DriverKit Extension
I want to get the information of USB like, USB name, size, VID, PID, etc using DriverKit Extension but I'm facing difficulty finding such references or Sample code for the same. Please help me with the Sample code to get USB info with the help of Dext. Thanks
Replies
4
Boosts
0
Views
1.1k
Activity
Dec ’23
Is SCSIPeripheralsDriverKit on board?
I've try to develop a dext to send SCSI commands to some storage products, but when I try to implements SCSIPeripheralsDriverKit/IOUserSCSIPeripheralDeviceType00 interface, I... just don't know how to do it, I tried to convert kext way to Driverkit way, but I always block by error warnings. After I google a lots of solutions, I was wondering is this feature working? or Is there any samples or guideline?
Replies
0
Boosts
0
Views
669
Activity
Jun ’23
How to access dmaaddress (Physical Address) in DriverKit?
I am trying to use IOUserBlockStorageDevice in DriverKit to simulate a fake device (Implementing a Ram Disk). Currently I'm confused on how to use the dmaaddress in the following interface virtual kern_return_t DoAsyncReadWrite (bool isRead, uint32_t requestID, uint64_t dmaAddr, uint64_t size, uint64_t lba, uint64_t numOfBlocks, IOUserStorageOptions options) = 0; According to https://github.com/briancabbott/macOS-system-projects/blob/19310aa5c7b7507408261a22a2e8f46f9d478a88/Resources/Code/apple-oss-distributions/IOStorageFamily/IOUserBlockStorageDevice_kext.cpp Before calling "DoAsyncReadWrite", kernel allocate a segment of physical memory by using "IODMAcommand::genIOVMSegments". This segment's physical address is pass to DoAsyncReadWrite as parameter "dmaAddr". To implement a correct ram disk, we need to "transform" this physical address to virtual so that we can "Read" or "Write" on this physical address. I tried to use "IOMemoryDescriptor" to access this dmaAddr. In IOKit, I belive I can use interface such as "withPhysicalAddress" to access the memory. However, such interface is not exist while using driverkit, all interface that I can use in DriverKit IOMemoryDescriptor is : -kern_return_t GetLength(uint64_t * returnLength) LOCALONLY; // apparently not this one -virtual kern_return_t CreateMapping( uint64_t options, uint64_t address, uint64_t offset, uint64_t length, uint64_t alignment, IOMemoryMap ** map); // Maybe this one with kIOMemoryFixedAddress option? // But I get Segment Fault while calling this with CreateMapping( kIOMemoryFixedAddress , dmaaddr, 0, size, 0, &map); // Or getting error return while calling CreateMapping with same paramters after IOBufferMemoryDescriptor::Create // Also, output iomemorymap is not used here, which is quiet strange. static kern_return_t CreateSubMemoryDescriptor(uint64_t memoryDescriptorCreateOptions, uint64_t offset, uint64_t length, IOMemoryDescriptor * ofDescriptor, IOMemoryDescriptor ** memory) attribute((availability(driverkit,introduced=20.0))); // Seems not this, it create “sub“ memory descriptor static kern_return_t CreateWithMemoryDescriptors(uint64_t memoryDescriptorCreateOptions, uint32_t withDescriptorsCount, IOMemoryDescriptor * const withDescriptors[32], IOMemoryDescriptor ** memory) attribute((availability(driverkit,introduced=20.0))); // Seems not this, it don’t take any dmaaddr as parameter. and a private function kern_return_t Map( uint64_t options, uint64_t address, uint64_t length, uint64_t alignment, uint64_t * returnAddress, uint64_t * returnLength) LOCALONLY; // Maybe this one? But the header file don’t show any description on this function and we are not sure what parameters should we pass. // Currently I've test Map( kIOMemoryFixedAddress , dmaaddr, size, 0, &returnAddress, &returnLength) but get error return. It seems that I've made some mistake on using IOMemoryDescriptor? How to correct access a dmaaddress? I've also tried class "IODMACommand", but also get unexpected behavior. Another question is how to read / write buffer after I create correct mapping. While implementing kext, IOMemoryDescriptor can use "readBytes" or "writeBytes" to read or write memory that IOMemoryDescriptor maps to. However, DriverKit don’t have interface of "readBytes" or "writeBytes". Maybe I can directly access buffer by casting the IOMemoryDescriptor::Map "returnAddress" to void? (I haven't tried it yet cause "Map" always failed now QQ) Thanks for everyone's help.
Replies
2
Boosts
1
Views
2.4k
Activity
Feb ’23
Can Xcode DriverKit library include kern/clock.h?
My user space driver need to call a function: clock_get_calendar_microtime(&currentTime_sec,&currentTime_usec); I hope Xcode DriverKit library can include "kern/clock.h"
Replies
1
Boosts
0
Views
1.7k
Activity
Dec ’22
Sending SCSI commands to USB mass storage device
Our device is USB Mass stroage device. We want to send a specific SCSI command to a USB drive in Mac OS X. Have any demo app that uses IOUserSCSIPeripheralDeviceType00 in SCSIPeripheralsDriverKit? We want to use below SCSI command, but have no demo program. https://developer.apple.com/documentation/scsiperipheralsdriverkit/3946437-inquiry https://developer.apple.com/documentation/scsiperipheralsdriverkit/iouserscsiperipheraldevicetype00/3946461-usersendcdb
Replies
0
Boosts
2
Views
896
Activity
Nov ’22
SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
Context: We are working on migration of the driver, which is currently represented as a kernel extension, to the DriverKit framework. The driver works with Thunderbolt RAID storage devices. When connected through the Thunderbolt interface to the host, the device itself presents in the OS as a PCI device. The main function of our driver (.kext) is to create a "virtual" SCSI device in the OS for each virtual RAID array. So that the OS can work with these SCSI drives as usual disk storage.  We use https://developer.apple.com/documentation/scsicontrollerdriverkit to migrate this functionality in the dext version of the driver. Current issue: When a device is connected - the dext driver cannot create a SCSI drive in the OS. Technically our dext tries to create a SCSI drive using the UserCreateTargetForID method. On this step the OS sends the first SCSI command “Test Unit Ready ''to the device to check if it is a SCSI device. We process this command in an additional thread  separated from the main process of the dext (as it is recommended in the DriverKit documentation). We can see in the logs that the device receives this command and responses but when our dext sends this response to the OS the process is stuck in the waiting mode. How can we understand why it happens and fix it? More details: We are migrating functionality of an already existing “.kext” driver. We checked logs of the kext driver of this step: 15:06:17.902539+0700 Target device try to create for idx:0 15:06:17.902704+0700 Send command 0 for target 0 len 0 15:06:18.161777+0700 Complete command: 0 for target: 0 Len: 0 status: 0 flags: 0 15:06:18.161884+0700 Send command 18 for target 0 len 6 15:06:18.161956+0700 Complete command: 18 for target: 0 Len: 6 status: 0 flags: 0 15:06:18.162010+0700 Send command 18 for target 0 len 44 15:06:18.172972+0700 Complete command: 18 for target: 0 Len: 44 status: 0 flags: 0 15:06:18.275501+0700 Send command 18 for target 0 len 36 15:06:18.275584+0700 Complete command: 18 for target: 0 Len: 36 status: 0 flags: 0 15:06:18.276257+0700 Target device created for idx:0 We can see a successful message “Target device created for idx:0” In the the dext logs of the same step: We do not see the “Send command 18 for target 0 len 6” as we have in the kext logs  no log of the successful result “Target device created for idx:0” 15:54:10.903466+0700 Try to create target for 0 UUID 432421434863538456 15:54:10.903633+0700 UserDoesHBAPerformAutoSense 15:54:10.903763+0700 UserInitializeTargetForID 15:54:10.903876+0700 UserDoesHBASupportMultiPathing 15:54:10.904200+0700 UserProcessParallelTask start. 15:54:10.904298+0700 Sent command : 0 len 0 for target 0 15:54:11.163003+0700 Disable interrupts. 15:54:11.163077+0700 Complete cmd : 0 for target: 0 len: 0  status: 0 flags: 0 15:54:11.163085+0700 Enable interrupts. Will appreciate any help
Replies
3
Boosts
1
Views
1.4k
Activity
Nov ’22
Where is SCSIControllerDriverKit now?
Hi there! There was a presentation of the SCSI support in DriverKit on 2020 WWDC: https://developer.apple.com/videos/play/wwdc2020/10210/ Currently, the Xcode 12.4 (latest) has nothing regarding SCSI in DriverKit folders. Documentation says it is still in beta: https://developer.apple.com/documentation/scsicontrollerdriverkit So I've downloaded xcode 12.5 beta, where the driverkit 20.4 beta resides (according to https://developer.apple.com/support/xcode/) And what we have there? Just Kernel.framework/Versions/A/Headers/DriverKit/IOReturn.h 65:#define sub_iokit_scsi err_sub(16) And nothing more! So, the question is: do we have any way to use SCSI devices now on BigSur? Could I develop something for it with DriverKit, or should I use kext-approach for now, and wait for SCSI DriverKit support to be released indeed?
Replies
4
Boosts
0
Views
2.4k
Activity
Oct ’22
How to get LUN id of SCSI connected devices
Hi all I needed some help in getting the LUN id of all devices connected to the system especially for SCSI devices. I'm not able to find any such system command or a SCSI command. Thanks in advance.
Replies
2
Boosts
0
Views
1.1k
Activity
Sep ’22
MAP Protocol Connection
I would like to know whether MFI authentication is required to connect to Apple MAP protocol. Thank you very much!
Replies
0
Boosts
0
Views
572
Activity
Feb ’22
Does PCIDriverKit support PCI Device PNP?
I am woriking on SCSIControllerDriverKit IOUserSCSIParallelInterfaceController When I hot-plug my PCIe SCSI controller, the controller works normally, but when I hot remove the PCIe SCSI controller, the driverkit crashes. Thread 3 Crashed:: Dispatch queue: MyUserSpaceDriver-Default UserSpaceDriver-PCIe-hotremove.rtf.txt UserSpaceDriver-PCIe-hotremove.ips.txt
Replies
2
Boosts
0
Views
1.1k
Activity
Jan ’22
Does UserCreateTargetForID work for IOUserSCSIParallelInterfaceController?
I am working on SCSIControllerDriverKit UserSpaceDriver-UserCreateTargetForID.ips.txt I UserSpaceDriver-UserCreateTargetForID.rtf.txt OUserSCSIParallelInterfaceController My dext had follow this site description: https://developer.apple.com/documentation/scsicontrollerdriverkit/iouserscsiparallelinterfacecontroller/3567474-usercreatetargetforid But when the program calls: UserCreateTargetForID(scsi_target,targetOSDictionary) got panic.
Replies
0
Boosts
0
Views
1.2k
Activity
Dec ’21
IOSCIS DriverKit
Any advice how to migrate an app using kext to using IO from the app level. We have a USB device, which uses proprietary protocol to communicate. It looks like I can't ship .app with kext bundled in, so I have started looking into migrating our current driver to use user space APIs. Any pointers on how to handle migration from kext using IOSCSIProtocolInterface to user space IOUSBInterfaceInterface
Replies
3
Boosts
0
Views
2k
Activity
Jul ’21