Hello everyone.
I have been developing PCIe device driver through Thunderbolt.
However, it was confirmed that up to three devices connected to the daisy chain worked normally,
but the fourth device failed to operate the _CopyDeviceMemoryWithIndex() function for connection with the BAR0 App and did not work properly.
The standard specification of Thunderbolt 3/4 is said to be supported by daisy chain connection up to 6-device,
but in reality, it is only 3 units,
so I ask the forum for technical confirmation.
Of course total 4 device by 2-port x 2-device daisy chain connecting has working well.
The PCI entry in System information indicates that all devices have normal load of the PCIe device driver.
Thank you.
Drivers
RSS for tagUnderstand the role of drivers in bridging the gap between software and hardware, ensuring smooth hardware functionality.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Since updating to iOS18.4.1, I can no longer remove Waze from operating in Carplay. It was working perfectly prior to this update where I could view the Waze map on my iPhone 12 Pro, rather than the Carplay map. I prefer to use my iPhone map rather than the Carplay map. Now as soon as I open Waze, despite my having customized and removing it from the Carplay list, while the icon is removed, it continues to open in Carplay! Help! I cannot use Waze using the Carplay maps! Anyone have a solution?
Topic:
App & System Services
SubTopic:
Drivers
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)
Hi Everyone!
I want to block the USB wired mouse from accessing my machine. Which framework is used to implement ?
PS: I have already tried DriverKit Framework but it requires Apple's paid developer account. What will be alternative ?
Hello,
I recently created an app with the Calldirectory Extension. It worked all good as long as I was on my development iphone. I tried to install the app on my privat iphone (same phone/same os version), but then I faced an issue. I couldn't enable the Calldirectory Extension with an error
(Error Enabling Extension
Failed to request data for APPNAME. You may try enabling the extension again, and if the problem persists, conatact the application developer.)
I'm working on a DriverKit driver. I have it running on macOS, including a very simple client app written in SwiftUI. Everything is working fine there. I've added iPadOS as a destination for the app as demonstrated in the WWDC video on DriverKit for iPadOS. The app builds and runs on my iPad, as expected (after a little work to conditionalize out my use of SystemExtensions.framework for installation on macOS). However, after installing and running the app on an iPad, the driver does not show up in Settings->General, nor in the app-specific settings pane triggered by the inclusion of a settings bundle in the app.
I've confirmed that the dext is indeed being included in the app bundle when built for iPadOS (in MyApp.app/SystemExtensions/com.me.MyApp.MyDriver.dext). I also can see in the build log that there's a validation step for the dext, and that seems to be succeeding.
I don't know why the app isn't being discovered -- or in any case surfaced to the user -- when the app is installed on the iPad. Has anyone faced this problem and solved it? Are there ways to troubleshoot installation/discovery of an embedded DriverKit extensions on iOS? Unlike on macOS, I don't really see any relevant console messages.
Hi Apple support,
We requested the 4 HID-related Entitlements back in December 2024.
Similarly to another post here in the forums that was completely ignored, our request has NOT been processed for months.
Mailing the support staff results in boilerplate email responses with no content, calling them results in a chat with very nice people who are unable to help since they can't seem to reach the entitlement team directly. Having to wait for MONTHS when dealing with one of the biggest and supposedly best companies in the world is beyond disappointing.
Can anyone help? Is there anyone else that has had this same issue and that has found a work-around? I can share all necessary details.
Thanks, Matteo
I have a custom USB Audio Class 2 (UAC2) compatible device. When I connect this custom device to a MacBook with a configuration of up to 10 channels (16-bit), everything seems to work fine.
However, when I increase the channel count to 12, the MacBook does not recognize the 12 channels. It only shows the channel count as 0.
TN2274 is the only source where I found some information about Apple's Audio Class Drivers, but it doesn't mention any limitations regarding channel counts.
Could you let me know the current limitations of the Audio Class Drivers on the latest macOS versions? What configuration should I use to get 12 channels working?
P.S. I also found that a 12-channel, 8-bit configuration is detected by the MacBook, bit I want it to work with 16bits.
For more detail please check FB17098863
When I develop the system extension tool, I need to subscribe to the remote thread creation event. When the remote thread injection is triggered, I want to get the id, module name and starting function name of the remote thread. How can I get this information from es_event_remote_thread_create_t? If I can't get this information from es_event_remote_thread_create_t, is there any other way to get it?
Topic:
App & System Services
SubTopic:
Drivers
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
I’m experiencing a persistent issue with the new USB-C lossless audio feature on AirPods Max (firmware 7E101). I’m using original Apple USB-C to USB-C cable and have tested this setup across multiple Apple devices, including:
• iPhone (running iOS 18.5 beta)
• iPad Pro with USB-C
• MacBook Pro (15.5 Beta)
❗️Problem:
Despite Apple’s announcement that AirPods Max now support wired lossless audio over USB-C, I’m unable to get any audio output via USB-C on any device.
• On iPhone: I disabled Bluetooth, connected via USB-C — no sound.
• On MacBook: The device is shown as “AirPods Max USB Audio” in System Information > USB, but it does not appear in Sound settings or Audio MIDI Setup as an available output.
• On iPad Pro: Same behavior — no audio output.
Other details:
• I performed a factory reset of the headphones, but the LED flashes red instead of the expected amber → white sequence.
(Apple’s documentation does not mention red flash behavior during reset — might indicate an error state.)
• The issue is not isolated to the iOS 18.5 beta — since the same behavior occurs on macOS and iPadOS.
What works:
• Bluetooth audio still works fine.
• The cable and USB-C ports function with other audio devices.
⸻
Summary:
It looks like:
• USB audio is being detected on a hardware level (at least on Mac),
• but software support for output (especially on macOS/iPadOS) is either not implemented, disabled, or bugged — possibly connected to iOS 18.5 beta or broader OS-level limitations.
Topic:
App & System Services
SubTopic:
Drivers
Hi,
trying to upgrade from macOS Sequoia 15.3.2 to 15.4 gives this error. Now I can not boot from internal drive of M1 Air 2020, because it restores 15.4, that does not boot. I can only boot from external USB SSD that has macOS 15.3.2. How I can install back 15.3.2 or alternatively newer macOS to internal drive? I only have one Mac, this M1 Air 2020. I have AppleAppleCare+ to 9/18/25.
Remaining of error is attached here:
Can't ignore lock validation @t8020dart.c:535
panic(cpu 2 caller 0x0): t8020dart 0xfffffdf053908000 (dart-dispext0): Can't ignore lock validation @t8020dart.c:535
Debugger message: panic
Memory ID: 0x6
OS release type: Not set yet
OS version: Not set yet
Kernel version: Darwin Kernel Version 24.4.0: Wed Mar 19 21:12:54 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T8103
Fileset Kernelcache UUID: 2BBA525B95E0E6B962ECC44FC093AB57
Kernel UUID: 4E6CBD31-CD1E-3939-8A63-211A206AFA66
Boot session UUID: 3A34167D-2534-402F-9679-2CAD45F67CDA
iBoot version: iBoot-11881.101.1
iBoot Stage 2 version: iBoot-11881.101.1
secure boot?: YES
Hello Everyone,
I encountered an issue with PCI memory access in DriverKit. In my case, BAR0 is not available, but BAR1 is ready for use. Here’s the log output:
!!! ERROR : Failed to get BAR0 info (error: 0xe00002f0). !!!
BAR1 - MemoryIndex: 0x00000000, Size: 0x00040000, Type: 0
Issue Description
When I initially wrote to BAR0 using memoryIndex = 0, it worked successfully:
AME_Address_Write_32(pAMEData, pAMEData->memoryIndex, AME_HOST_INT_MASK_REGISTER, 0x0F);
However, I mistakenly forgot to update memoryIndex to 1 for BAR1. Surprisingly, the write operation still succeeded.
When I fixed memoryIndex = 1 for BAR1, the write operation no longer had any effect. There was no error, but the expected behavior did not occur.
Relevant API (From IOPCIDevice.iig)
/*!
/*!
* @brief Writes a 32-bit value to the PCI device's aperture at a given memory index.
* @discussion This method writes a 32-bit register on the device and returns its value.
* @param memoryIndex An index into the array of ranges assigned to the device.
* @param offset An offset into the device's memory specified by the index.
* @param data A 32-bit value to be written in host byte order.
*/
void
MemoryWrite32(uint8_t memoryIndex,
uint64_t offset,
uint32_t data) LOCALONLY;
Log Output:
Writes to BAR0 (memoryIndex = 0)
AME_Address_Write_32() called
memoryIndex: 0, offset: 0x34, data: 0xf
Wrote data 0xF to offset 52
AME_Address_Write_32() called
memoryIndex: 0, offset: 0xa0, data: 0x1
Wrote data 0x1 to offset 160
AME_Address_Write_32() called
memoryIndex: 0, offset: 0x20, data: 0xffffffff
Wrote data 0xFFFFFFFF to offset 32
Writes to BAR1 (memoryIndex = 1) – No Response
AME_Address_Write_32() called
memoryIndex: 1, offset: 0x34, data: 0xf
No confirmation log, no visible effect.
Questions
What should memoryIndex be set to for BAR1?
The log shows "BAR1 - MemoryIndex: 0x00000000", but should I be using 1 instead?
How can I verify if a write operation to BAR1 is successful?
Is there a way to check if the memory region is actually writable?
Should I use MemoryRead32() to confirm the written value?
Any guidance would be greatly appreciated!
Best Regards,
Charles
We have a macOS application which interacts with our USB and PCI devices to perform SCSI and NVME commands on them.
We use IOUSBHost, IOUSBLib and IOKitLib for USB interface and have created a custom driver to interact with PCI devices.
Is there a way we can implement a similar functionality for iOS as well if we connect the cards and readers using OTG?
When plugging in my matched USB device I see the logs below. It seems the kernelmanagerd process is sandboxed and can't write out the reason my Dext failed to load. Is there somewhere else I can look for this info?
default 11:03:22.175152-0700 kernelmanagerd Received kext load notification: me.keithg.MyUserUSBInterfaceDriver
default 11:03:22.177637-0700 kernel 1 duplicate report for Sandbox: icdd(2124) allow file-read-data /Library/Image Capture/Devices
error 11:03:22.177681-0700 kernel Sandbox: kernelmanagerd(545) deny(1) file-write-create /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.apple.kernelmanagerd/TemporaryItems
com.apple.libcoreservices error 11:03:22.177711-0700 kernelmanagerd mkdir: path=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.apple.kernelmanagerd/TemporaryItems/ mode= -rwx------: [1: Operation not permitted]
error 11:03:22.179361-0700 kernel Sandbox: kernelmanagerd(545) deny(1) file-write-create /private/var/db/loadedkextmt.plist.sb-5a00fc77-LNttZF
com.apple.libcoreservices error 11:03:22.177755-0700 kernelmanagerd _dirhelper_relative_internal: error for path <private>: [1: Operation not permitted]
com.apple.accessories default 11:03:22.177674-0700 WindowServer Sending analytics event... (eventName: com.apple.ioport.transport.USB.published)
error 11:03:22.179913-0700 kernelmanagerd Failed to write extension load report plist.
I read that iPadOS supports driverkit, and, presumably, the same serial FTDI UARTs as macOS.
Has this been migrated to USB-C iPhones on iOS 18?
After some searching, the developer doc is not clear, and web responses are contradictory.
We are currently using it for a wired sensor option of our BlueTooth HR sensor. When it is used in wired config, the radios are turned off. This is important to some of our customers. Since Lightning MFI sensors are being discontinued with Apple killing Lightning, we would love to have an alternative for iOS.
-- Harald
I'm trying to iterate through a USB device but the iterator is always empty or contains only the matched interface:
Single interface in Iterator
This happens when my driver matches against the interface. Because I need to use 2 interfaces (control and cdc), I try to open the IOUSBHostDevice (copied from the interface) and iterate through the rest, but I only get the interface my dext matched with.
Empty Iterator
I decided to match against USB communication devices, thinking things would be different. However, this time the interface iterator is completely empty (provider is IOUSBHostDevice).
Here's a snippet of my code before iterating with IOUSBHostDevice->CopyInterface():
// teardown the configured interfaces.
result = device->SetConfiguration(ivars->Config, true);
__Require_noErr_Action(result, _failure_Out,
ELOG("IOUSBHostDevice::SetConfiguration failed 0x%x", result));
// open usb device
result = device->Open(this, 0, 0);
__Require_noErr_Action(result, _failure_Out,
ELOG("Failed to open IOUSBHostDevice"));
// Get interface iterator
result = device->CreateInterfaceIterator(&iterRef);
__Require_noErr_Action(result, _failure_Out,
ELOG("IOUSBHostDevice::CreateInterfaceIterator failed failed: 0x%x", result));
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
Hello Everyone,
I am working on migrating a KEXT to DriverKit but am struggling to resolve a specific issue. The code in question is simple, but I haven't been able to find a solution.
void AME_IO_milliseconds_Delay(AME_U32 Delay)
{
Log("AME_IO_milliseconds_Delay()");
IOSleep(Delay);
return;
}
//delay for a number of microseconds
void AME_IO_microseconds_Delay(AME_U32 Delay)
{
Log("AME_IO_microseconds_Delay()");
IODelay(Delay);
return;
}
I've sought help from Copilot and ChatGPT, but their suggestions haven't worked. Any guidance on how to implement this functionality in DriverKit would be greatly appreciated.
Thank you for your time and assistance.
Best regards, Charles
I'm working on a project to allow HID input from macOS to a connected iOS device. Are we prohibited from matching to a connected iPhone with DriverKit? I see the attribute kCDCDoNotMatchThisDevice for my iPhone is YES when looking at the IO registry and my dext does not initialize