Understand the role of drivers in bridging the gap between software and hardware, ensuring smooth hardware functionality.

Drivers Documentation

Post

Replies

Boosts

Views

Activity

USBDriverKit driver not showing up in settings on iPadOS 18
In iPadOS 17.7 my driver shows up in settings just fine. After recompiling with Xcode 16 and installing my app (containing my driver) on iPadOS 18, the app shows up in settings but the driver-enable button is missing from Settings. When I plug-in my custom USB device, the app cannot detect it and I am left with no way to manually enable the driver, as I did in the previous version of iPadOS.
1
0
282
Sep ’24
How to enable PCIDriverKit Bus Leader? (and Memory Space enable?)
I am porting a working kernel extension IOKit driver to a DriverKit system extension. Our device is a PCI device accessed through Thunderbolt. The change from IOPCIFamily to PCIDriverKit has some differences in approach, though. Namely, in IOKit / IOPCIFamily, this was the correct way to become Bus Leader: mPCIDevice->setBusLeadEnable(true); // setBusMasterEnable(..) deprecated in OS 12.4 but now, PCIDriverKit's IOPCIDevice does not have that function. Instead I am doing the following: // Set Bus Leader and Memory Space enable uint16_t commandRegister = 0; ivars->mPCIDevice->ConfigurationRead16(kIOPCIConfigurationOffsetCommand, &commandRegister); commandRegister |= (kIOPCICommandBusLead | kIOPCICommandMemorySpace); ivars->mPCIDevice->ConfigurationWrite16(kIOPCIConfigurationOffsetCommand, commandRegister); But I am not convinced this is working (I am still experiencing unexpected errors when attempting to DMA from our device, using the same steps that work for the kernel extension). The only hint I can find in the online documentation is here, which reads: Note The endpoint driver is responsible for enabling the Memory Space Enable and Bus Master Enable settings each time it configures the PCI device. When a crash occurs, or when the system unloads your driver, the system disables these features. ...but that does not state directly how to enable bus leader status. What is the "PCIDriverKit approved" way to become bus leader? Is there a way to verify/confirm that a device is bus leader? (This would be helpful to prove that bus leadership is not the issue for DMA errors, as well as to confirm that bus leadership was granted). Thanks in advance!
1
0
265
Sep ’24
Unable to Print or Scan to/from HP Pagewide Pro 477dw MFP
Upgraded my 2 machines to Sequoia 15 and consequently I am unable to print or scan with both machines. A 3rd machine which is not upgraded as yet is unaffected. AirPrint from iPhones is not affected. The printing process executes without error. The printer receives the job but does not actually execute the print. The machine behaves like the job in the queue is completed normally. No error message. Just no physical printout. Happens with all applications. When Scanning - fails to connect to device to enable scanning. error message after some time is attached
0
0
232
Sep ’24
Drivers are not visible in iOS 18 Public beta
Hello team, I am using USBDriverKit and Driverkit framework in my application for communication of USB device. After updating my iPad OS to 18 public beta, I am unable to get option to enable drivers in my setting page of my application. However, I am able to see that options in developer beta version of iPad OS 18. Can anyone guide me, how should I proceed further as I am unable to use my USB devices.
8
1
553
Sep ’24
NEFilterManager.Grade.firewall is not working with SimpleFirewall sample app
I explored Apple's Filtering Network Traffic sample. I noticed for me, FilterDataProvider's startFilter method is called only when I make filterManager.grade = .inspector before calling filterManager.saveToPreferences. Could someone help why the startFilter is not called when I leave the filterManager's grade property with it's default value. i.e NEFilterManagerGradeFirewall? https://developer.apple.com/documentation/networkextension/filtering_network_traffic
1
0
311
Aug ’24
IOServiceNameMatching can't find dext service
I'm using the following code to find the dext service. The driver is enabled in iOS settings prior to launching the app. io_service_t mService = IO_OBJECT_NULL; kern_return_t ret = kIOReturnSuccess; io_iterator_t iterator = IO_OBJECT_NULL; if (__builtin_available(iOS 15.0, *)) { ret = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceNameMatching("MyDriver"), &iterator); } else { // Fallback on earlier versions } if (ret != kIOReturnSuccess) { printf("Unable to find service"); } while ((mService = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { //Only able to find service if launching the app first and then connecting the device .......... } I noticed the call IOServiceNameMatching doesn't return the same result for the following workflows: Launch the app first and then connect the device, IOServiceGetMatchingServices can find the service. Connect the device to USB-C port first, then launch the app, the same call can't find a matching service (iterator is null). I would need to disconnect and reconnect the device while the app is running in order to find the matching dext. Any suggestion on how to find the matching dext service for workflow #2? Thanks
6
0
485
Aug ’24
How to Symbolicate an Apple Silicon Panic?
Investigating a kernel panic, I discovered that Apple Silicon Panic traces are not working with how I know to symbolicate the panic information. I have not found proper documentation that corrects this situation. Attached file is an indentity-removed panic, received from causing an intentional panic (dereferencing nullptr), so that I know what functions to expect in the call stack. This is cut-and-pasted from the "Report To Apple" dialog that appears after the reboot: panic_1_4_21_b.txt To start, I download and install the matching KDK (in this case KDK_14.6.1_23G93.kdk), identified from this line: OS version: 23G93 Kernel version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122 Then start lldb from Terminal, using this command: bash_prompt % lldb -arch arm64e /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122 Next I load the remaining scripts per the instructions from lldb: (lldb) settings set target.load-script-from-symbol-file true I need to know what address to load my kext symbols to, which I read from this line of the panic log, after the @ symbol: com.company.product(1.4.21d119)[92BABD94-80A4-3F6D-857A-3240E4DA8009]@0xfffffe001203bfd0->0xfffffe00120533ab I am using a debug build of my kext, so the DWARF symbols are part of the binary. I use this line to load the symbols into the lldb session: (lldb) addkext -F /Library/Extensions/KextName.kext/Contents/MacOS/KextName 0xfffffe001203bfd0 And now I should be able to use lldb image lookup to identify pointers on the stack that land within my kext. For example, the current PC at the moment of the crash lands within the kext (expected, because it was intentional): (lldb) image lookup -a 0xfffffe001203fe10 Which gives the following incorrect result: Address: KextName[0x0000000000003e40] (KextName.__TEXT.__cstring + 14456) Summary: "ffer has %d retains\n" That's not even a program instruction - that's within a cstring. No, that cstring isn't involved in anything pertaining to the intentional panic I am expecting to see. Can someone please explain what I'm doing wrong and provide instructions that will give symbol information from a panic trace on an Apple Silicon Mac? Disclaimers: Yes I know IOPCIFamily is deprecated, I am in process of transitioning to DriverKit Dext from IOKit kext. Until then I must maintain the kext. Terminal command "atos" provides similar incorrect results, and seems to not work with debug-built-binaries (only dSYM files) Yes this is an intentional panic so that I can verify the symbolicate process before I move on to investigating an unexpected panic I have set nvram boot-args to include keepsyms=1 I have tried (lldb) command script import lldb.macosx but get a result of error: no images in crash log (after the nvram settings)
4
0
707
Aug ’24
CMIO Custom Properties Don't Work With NSSNumber under macOS 12.x (but do under macOS 14.x)
I created a camera extension project that required interaction via custom properties. I originally coded it on macOS 14.x. In the camera extension code, receiving and returning NSNumber values as shown in the code at the bottom. The app was working perfectly until I went to test on mac 12.7.6. Under that version of macOS, the custom properties weren't working at all. I also saw lines in the logs like this: CMIO_DAL_CMIOExtension_Stream.mm:1165:GetPropertyData 50 wrong 4cc format for key 4cc_back_glob_0000 which was totally perplexiing, because it was clear that the 4cc codes were fine under 13.x, especially given that the documentation for CMIOExtensionPropertyState clearly says that NSNumbers should be OK. On a hunch, I changed the code to use NSString instead of NSNumber, and it started working again under 12.7.6. So, my experience is that macOS 12.x doesn't allow you to use NSNumbers, but it happy with NSStrings. Hope that saves someone else some time. And here is is the code that worked on 14.x, but not on 12.x. // 4cc constant const CMIOExtensionProperty CMIOExtensionPropertyCustomPropertyData_BackgroundOption = @"4cc_back_glob_0000"; - (nullable CMIOExtensionDeviceProperties *)devicePropertiesForProperties:(NSSet<CMIOExtensionProperty> *)properties error:(NSError * _Nullable *)outError { // doesn't work on macOS 12.x, works on 14.x CMIOExtensionDeviceProperties *deviceProperties = [CMIOExtensionDeviceProperties devicePropertiesWithDictionary:@{}]; if ([properties containsObject:CMIOExtensionPropertyCustomPropertyData_BackgroundOption]) { NSNumber* nsBackgroundOption = [NSNumber numberWithUnsignedInt:(unsigned int)_backgroundOption]; CMIOExtensionPropertyState* state = [CMIOExtensionPropertyState propertyStateWithValue:nsBackgroundOption]; [deviceProperties setPropertyState:state forProperty:CMIOExtensionPropertyCustomPropertyData_BackgroundOption]; } return deviceProperties; } - (BOOL)setDeviceProperties:(CMIOExtensionDeviceProperties *)deviceProperties error:(NSError * _Nullable *)outError { // doesn't work on macOS 12.x, works on 14.x NSDictionary* devicePropertiesDict = [deviceProperties propertiesDictionary]; CMIOExtensionPropertyState* propState = nil; propState = [devicePropertiesDict objectForKey:CMIOExtensionPropertyCustomPropertyData_BackgroundOption]; if (propState != NULL) { NSNumber* nsBackgroundOption = [propState value]; if (nsBackgroundOption != NULL) { uint32_t newBackgroundOption = [nsBackgroundOption unsignedIntValue]; if (newBackgroundOption != _backgroundOption) { log_info(@"##### Set Background Option to %d", (int) newBackgroundOption); } _backgroundOption = newBackgroundOption; } } return YES; }
1
0
395
Aug ’24
Universal Audio Apollo Twin X and iMac upgrades
I am on a 2021 24" M-1 iMac running Sonoma 14.5. I've recently acquired Universal Audio's Apollo Twin X DAW. I'm recording with Logic Pro X software. I've already gone through the Mac security instructions to get the Apollo Twin X installed, but I am getting little onscreen warnings from Apple saying that my set up may not be compatible with upcoming iOS updates. UA is pointing the finger at Apple. So, what gives? Will Apple updates welcoming Universal Audio Apollo Twin X into its world seamlessly? I am avoiding updating my iOS because of this issue.
0
0
249
Aug ’24
matching dictionary to find particular IOUSBInterface
Hello, I am trying to get value of InterfaceClass for particular USB Device. I modified matching dictionary and added the property locationID property. CFMutableDictionaryRef matchingDictionary = IOServiceMatching(kIOUSBInterfaceClassName); if (!matchingDictionary) { return -1; } int32_t locationID = 0xffff; CFNumberRef cfLocationID = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &locationID); CFDictionaryAddValue(matchingDictionary, CFSTR(kUSBHostPropertyLocationID), cfLocationID); CFRelease(cfLocationID); io_service_t ioService = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDictionary); if (!ioService) { return -1; } CFNumberRef cfInterfaceClass = (CFNumberRef)IORegistryEntrySearchCFProperty(ioService, kIOServicePlane, CFSTR(kUSBHostMatchingPropertyInterfaceClass), kCFAllocatorDefault, kNilOptions); ... Unfortunately nothing is found and ioService is NULL. What can be wrong here? Thank you in advance!
2
0
428
Aug ’24
Xerox scanning issue
I have a xerox workcentre 2025 cannot scan I always get the below message what can I do Translated Report (Full Report Below) Process: Scanner [1323] Path: /Applications/Scanner.app/Contents/MacOS/Scanner Identifier: COM.GILBERT.PhysicalScanner Version: 1.6 (1.6) App Item ID: 1521553621 App External ID: 837739896 Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2024-08-13 18:39:31.5587 +0300 OS Version: macOS 14.6.1 (23G93) Report Version: 12 Anonymous UUID: 7C7DF391-F1F6-6185-10D7-1063C7D7596A Sleep/Wake UUID: B47B7F17-5F97-438D-9DC4-DB3CE78959E5 Time Awake Since Boot: 820 seconds Time Since Wake: 295 seconds System Integrity Protection: enabled Notes: PC register does not match crashing frame (0x0 vs 0x104A8E142) Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 4 Illegal instruction: 4 Terminating Process: exc handler [1323] Error Formulating Crash Report: PC register does not match crashing frame (0x0 vs 0x104A8E142) Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Scanner 0x104a8e142 0x104a89000 + 20802 1 Scanner 0x104a9021b 0x104a89000 + 29211 2 Scanner 0x104a8dabc 0x104a89000 + 19132 3 AppKit 0x7ff819e427ed -[NSApplication(NSResponder) sendAction:to:from:] + 337 4 AppKit 0x7ff819e42663 -[NSControl sendAction:to:] + 86 5 AppKit 0x7ff819e42595 __26-[NSCell _sendActionFrom:]_block_invoke + 131 6 AppKit 0x7ff819e4249e -[NSCell _sendActionFrom:] + 171 7 AppKit 0x7ff819e423e6 -[NSButtonCell _sendActionFrom:] + 96 8 AppKit 0x7ff819e3f2d2 NSControlTrackMouse + 1823 9 AppKit 0x7ff819e3eb8f -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 125 10 AppKit 0x7ff819e3ea56 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 666 11 AppKit 0x7ff819e3de4b -[NSControl mouseDown:] + 666 12 AppKit 0x7ff819e3c7f3 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4582 13 AppKit 0x7ff819db5857 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 313 14 AppKit 0x7ff819db5503 -[NSWindow(NSEventRouting) sendEvent:] + 345 15 AppKit 0x7ff81a5681a0 -[NSApplication(NSEventRouting) sendEvent:] + 1456 16 AppKit 0x7ff81a122d2e -[NSApplication _handleEvent:] + 65 17 AppKit 0x7ff819c465aa -[NSApplication run] + 640 18 AppKit 0x7ff819c1a4f3 NSApplicationMain + 816 19 Scanner 0x104a8b0d9 0x104a89000 + 8409 20 dyld 0x204d8b345 start + 1909 Thread 1:: com.apple.rosetta.exceptionserver 0 runtime 0x7ff7ffd4c414 0x7ff7ffd48000 + 17428 Thread 2:: com.apple.NSEventThread 0 ??? 0x7ff8a6856a78 ??? 1 libsystem_kernel.dylib 0x7ff81656808e mach_msg2_trap + 10 2 libsystem_kernel.dylib 0x7ff816576878 mach_msg2_internal + 84 3 libsystem_kernel.dylib 0x7ff81656f178 mach_msg_overwrite + 653 4 libsystem_kernel.dylib 0x7ff81656837d mach_msg + 19 5 CoreFoundation 0x7ff816685909 __CFRunLoopServiceMachPort + 143 6 CoreFoundation 0x7ff81668437c __CFRunLoopRun + 1371 7 CoreFoundation 0x7ff816683859 CFRunLoopRunSpecific + 557 8 AppKit 0x7ff819db329c _NSEventThread + 122 9 libsystem_pthread.dylib 0x7ff8165a818b _pthread_start + 99 10 libsystem_pthread.dylib 0x7ff8165a3ae3 thread_start + 15 Thread 3: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 4: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 5: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 6: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 7: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 8: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 9: 0 runtime 0x7ff7ffd6a94c 0x7ff7ffd48000 + 141644 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x00007f90ecfa0db0 rbx: 0x00007f90ecfa0db0 rcx: 0x00007f90ed0099f8 rdx: 0x00007ff85642ec60 rdi: 0x00007f90ed009000 rsi: 0x00007f90ecfa0d00 rbp: 0x000000030d8f4d50 rsp: 0x000000030d8f4c80 r8: 0x00007f90ed009038 r9: 0x000000000fff0b1a r10: 0x0000600000025920 r11: 0x00007ff91ddde92e r12: 0x0000000000000001 r13: 0x0000600001307020 r14: 0x0000000000000000 r15: 0x00006000013070a8 rip: rfl: 0x0000000000000246 tmp0: 0x0000000104a8e142 tmp1: 0x0000000000000216 tmp2: 0x0000000104ab6d80
0
0
268
Aug ’24
xcode 15.3 multiple commands preventing build - in ARCHIVE version only
The following exceptions occur when I try to archive a version of this app. It runs fine in DEBUG - ive bashed my head through all github forums and stack overflow posts trying all fixes: deleting the duplicate pods in xcode - cause a hermes error which then fails ALL builds the following all show the same symptoms (same error ONLY in an archive build) adjusting pod file to eliminate duplicates inserting a script in build phases have checked info.plist, project.pbxproj and other key files HELP... i need to get this published 4 weeks ago Prepare build error: Multiple commands produce '/Users/Library/Developer/Xcode/DerivedData/WildtrackProReact-ccekvzdhkorxtrauputwcraqedhf/Build/Intermediates.noindex/ArchiveIntermediates/WildtrackProReact/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RCTI18nStrings.bundle' note: Target 'React-Core-c704a495-RCTI18nStrings' (project 'Pods') has create directory command with output '/Users/Library/Developer/Xcode/DerivedData/WildtrackProReact-ccekvzdhkorxtrauputwcraqedhf/Build/Intermediates.noindex/ArchiveIntermediates/WildtrackProReact/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RCTI18nStrings.bundle' note: Target 'React-Core.common-RCTI18nStrings' (project 'Pods') has create directory command with output '/Users/Library/Developer/Xcode/DerivedData/WildtrackProReact-ccekvzdhkorxtrauputwcraqedhf/Build/Intermediates.noindex/ArchiveIntermediates/WildtrackProReact/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RCTI18nStrings.bundle' Multiple commands produce '/Users/Library/Developer/Xcode/DerivedData/WildtrackProReact-ccekvzdhkorxtrauputwcraqedhf/Build/Intermediates.noindex/ArchiveIntermediates/WildtrackProReact/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RCTI18nStrings.bundle'
4
0
746
Aug ’24