DriverKit

RSS for tag

Develop device drivers that run in user space using DriverKit.

DriverKit Documentation

Posts under DriverKit tag

62 Posts
Sort by:
Post not yet marked as solved
1 Replies
858 Views
External usb foot pedal driver should not generate mouse click NSEvents In Monterey external usb foot pedal driver unexpectedly also acts as a mouse device and generates NSLeftMouseDown/NSRightMouseDown events. If I click the middle button of external usb foot pedal and then NSRightMouseDown gets received then it has to be a system problem (or a driver problem) How to solve this issue?
Posted Last updated
.
Post marked as solved
1 Replies
310 Views
I have tried extending IOUserNetworkEthernet and calling RegisterEthernetInterface. This works perfectly for one ethernet interface, though the driver crashes when RegisterEthernetInterface is called a second time (doesn't return an error code). I have tried registering with separate queues. Another approach was extending IOUserClient instead, and calling IOService::Create to create child IOUserNetworkEthernet instances. Everything about this approach works (the children appear within ioreg). However, once I call RegisterEthernetInterface on just one of the children, macOS crashes. How would I go about creating a dext with multiple ethernet interfaces? Have I been approaching it the right way? Thanks, Jake
Posted
by jake3.
Last updated
.
Post not yet marked as solved
6 Replies
1.2k Views
Apple developer documentation - https://developer.apple.com/documentation/apple_silicon/implementing_drivers_system_extensions_and_kexts#3616855 says: If your hardware communicates entirely using standards-based protocols, you can ship a driver that matches your hardware to one of the built-in system drivers. Is this possible to do if macOS itself has the driver implemented as a DEXT? Particularly, I'm interested in providing support for an FTDI device with a custom product ID in my application. I've understood that macOS implements the FTDI driver as a DEXT (/System/Library/DriverExtensions/com.apple.DriverKit-AppleUSBFTDI.dext). In Catalina, it's possible to work around this problem by instructing the users to install FTDI's custom KEXT driver, but that doesn't work anymore in Big Sur because the KEXT is blocked there.
Posted
by spartan1.
Last updated
.
Post not yet marked as solved
0 Replies
273 Views
I want to update the HIDPointerAccelerationTable which is used inside IOHIDPointerScrollFilter. Using the following does not seem to work (I am guessing there is a whitelist of properties that are passed down the stack): hidutil property --matching '{"ProductID":0x47}' --set '{"HIDPointerAccelerationTable":0}' I verify that nothing happens by monitoring this log stream: sudo log stream --level trace --predicate 'subsystem == "com.apple.iohid"' I cannot see where this is instantiated in the open-source code, although I do know that it is a CFPlugin. Not being able to update this property means I would have to reimplement the IOHIDPointerScrollFilter as part of a DriverKit driver, but its looking like a big task because DriverKit doesn't suppose CF/stdlib stuff. Is there a way to update the HIDPointerAccelerationTable property in IOHIDPointerScrollFilter? Can I write my own HIDServiceFilter? How can I register it? Or is this just an internal thing.
Posted
by vjpr.
Last updated
.
Post marked as solved
2 Replies
658 Views
HI, I have a simple IOUserHIDEventDriver derived class for a regular mouse which *only* logs messages for the incoming HID reports. The driver successfully loads when the USB transmitter is plugged in and I can receive the HID reports. I can also see that dispatchRelativePointerEvent()(for testing I overrode this method) is being called in response to the HID reports. But the cursor refuses to move! It's as if the dispatch function fails to push the HID reports back into the subsystem for further processing. I do have SIP disabled (or else the driver won't be loaded). I tried running the app (which loads the driver) from /Applications, but that doesn't work either. My entitlements all look fine too. What could be going on? TIA
Posted
by harikvpy.
Last updated
.
Post not yet marked as solved
3 Replies
841 Views
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?
Posted
by Oskarde.
Last updated
.
Post marked as solved
2 Replies
453 Views
My .iig file looks like this, I need to use different class IOUserHIDEventService and IOUserClient. How to modify the class of .llg? Use two different class functions in public: DriverKit.iig #ifndef DriverKit_h #define DriverKit_h #include <Availability.h> #include <DriverKit/IOService.iig> #include <HIDDriverKit/IOUserHIDEventService.iig> class IOHIDElement; class IOHIDDigitizerCollection; class DriverKit: public IOUserHIDEventService { public:   virtual bool init() override;   virtual void free() override;   virtual kern_return_t Start(IOService * provider) override; .......   ....... #endif /* DriverKit_h */
Posted
by ETANDT.
Last updated
.
Post not yet marked as solved
1 Replies
322 Views
Hello, I recently decided to upgrade my 3D printers mother board to the SKR Mini E3 and wanted to connect it to my Ipad Air Gen 3. There is no known driver for this so I'm going to try and make one instead. I have the window driver on github, but I'm not how to get started on writing a driver for Ipad. Can anyone please give me assistance?
Posted
by MLHuott.
Last updated
.
Post not yet marked as solved
1 Replies
304 Views
Hi, I'm currently port old driver to DriverKit framework. This driver use the properties mechanism to change the state of the device from user space. I would like also use it, but I can not force the call to overridden SetProperties function on driver site. Is it possible that SetProperties will be called when client call IOConnectSetCFProperties on given service? or I have to use the ExternalMethod mechanism. Or I will be possible to pass some dictionary structure which will mimic the SetProperty Call. Thank you for your answer. Best Regards, Andrzej
Posted Last updated
.
Post not yet marked as solved
1 Replies
234 Views
I am working on SCSIControllerDriverKit IOUserSCSIParallelInterfaceController When the MacOS system restarts or shuts down, Why DriverKit SetPowerState is not called? But when the MacOS system sleeps and wakes up, SetPowerState is called. kern_return_t IMPL (MyUserSpaceDriver, SetPowerState) { ....... }
Posted Last updated
.
Post not yet marked as solved
3 Replies
534 Views
Hi, Example code of AudioDriverKit from WWDC2021 stopped to work correctly for me. It builds and loads but when I want to record sine wave immediately after startIO function stopIO is called. It happens on both MacBook Air and Mac mini with macOS 12.0.1. I discovered it because my audio driver also stopped to work correctly - exactly the same problem I described above. Earlier I was testing both example code and my audio driver on macOS 12 public beta and everything was ok. Below I paste logs from console when I start recording: default 12:54:19.161261+0100 kernel StartIO: Start IO: device 2 default 12:54:19.161274+0100 kernel StartIO: Start IO: device 2 default 12:54:19.161092+0100 coreaudiod HALS_IOEngine2::StartIO: starting IO on device SimpleAudioDevice-UID default 12:54:19.161279+0100 kernel StartIO: Start IO: device 2 default 12:54:19.161138+0100 coreaudiod HALS_IOEngine2::_StartIO(435) on Context 443 state: Prewarm: 0 Play: 0 State: Stopped default 12:54:19.161374+0100 CAReportingService CAReportingService.mm:157 service type 9 set for reporter 897648164879 default 12:54:19.161437+0100 coreaudiod HALS_IOEngine2::_StartIO(435) on Context 443 state: Prewarm: 0 Play: 1 State: Running default 12:54:19.161761+0100 coreaudiod HALS_Device::_GetCombinedVolumeScalar: client 246 (pid 517) is not present and has a combined volume scalar is 1.000000 default 12:54:19.161798+0100 coreaudiod HALS_Device::_GetCombinedVolumeScalar: client 246 (pid 517) is not present and has a combined volume scalar is 1.000000 default 12:54:19.161808+0100 coreaudiod HALS_IOUADevice::HandlePropertiesChanged: Object: 431: SimpleAudioDevice-UID default 12:54:19.162034+0100 coreaudiod 'goin', 'glob', 0 default 12:54:19.162580+0100 coreaudiod CAReportingClient.mm:508 message { "device_is_aggregate" = 0; "input_avail_phys_formats" = "{ [16/48000/1 lpcm], [16/44100/1 lpcm] }"; "input_avail_virt_formats" = "{ [32/48000/1 lpcm], [32/44100/1 lpcm] }"; "input_bits_per_channel" = 32; "input_bytes_per_frame" = 4; "input_bytes_per_packet" = 4; "input_channels_per_frame" = 1; "input_device_source_list" = Unknown; "input_device_transport_list" = BuiltIn; "input_device_uid_list" = "SimpleAudioDevice-UID"; "input_format_id" = lpcm; "input_frames_per_packet" = 1; "input_num_tap_streams" = 0; "input_scalar_volume" = "1.000000"; "io_buffer_size" = 15; message = StartHardware; "output_num_tap_streams" = 0; "output_scalar_volume" = "1.000000"; "sample_rate" = 48000; }: ( 897648164879 ) error 12:54:19.163011+0100 coreaudiod 206515 HALS_IOUAUCDriver.cpp:500 Throwing Exception: ret != kIOReturnSuccess Failed to register event link error 12:54:19.163100+0100 coreaudiod 206515 HALS_IOUAEngine.cpp:157 Failed to register io thread! default 12:54:19.163950+0100 kernel StopIO: Stop IO: device 2 default 12:54:19.163968+0100 kernel StopIO: Stop IO: device 2 default 12:54:19.163974+0100 kernel StopIO: Stop IO: device 2 default 12:54:19.163166+0100 coreaudiod HALS_IOContext_Legacy_Impl::IOWorkLoop: failed to register io thread error 12:54:19.163310+0100 coreaudiod 206515 HALS_IOUAEngine.cpp:180 Throwing Exception: error != 0 Failed to disassociate event link 22 error 12:54:19.163482+0100 coreaudiod 206515 HALS_IOUAEngine.cpp:187 Failed to unregister io thread! default 12:54:19.163613+0100 coreaudiod HALS_IOEngine2::StopIO: stopping IO on device SimpleAudioDevice-UID default 12:54:19.163744+0100 coreaudiod HALS_IOEngine2::_StopIO(435) on Context 443 state: Prewarm: 0 Play: 1 State: Running default 12:54:19.164082+0100 coreaudiod HALS_IOUADevice::HandlePropertiesChanged: Object: 431: SimpleAudioDevice-UID default 12:54:19.164134+0100 coreaudiod 'goin', 'glob', 0 default 12:54:19.164289+0100 coreaudiod CAReportingClient.mm:480 stopping ( 897648164879 ) default 12:54:19.164542+0100 coreaudiod CAReportingClient.mm:508 message { "session_duration" = "0.003519058227539062"; }: ( 897648164879 ) error 12:54:19.165611+0100 Audacity HALC_ProxyIOContext::IOWorkLoop: the server failed to start, Error: 0x77686174 default 12:54:19.165045+0100 coreaudiod IO Stopped Context 443 after 0 frames. default 12:54:19.165199+0100 coreaudiod HALS_IOContext_Legacy_Impl::IOThreadEntry: 443 SimpleAudioDevice-UID (SimpleAudioDevice-UID): stopping with error 2003329396 default 12:54:19.165220+0100 coreaudiod HALB_PowerAssertion::Release: releasing power assertion ID 34859 of type 'PreventUserIdleSystemSleep' with name: 'com.apple.audio.context443.preventuseridlesleep' on behalf of 517 error 12:54:19.165390+0100 coreaudiod HALS_IOContext_Legacy_Impl::StartIOThread: the IO thread failed to start, Error: 2003329396 (what) Any advice? Thank you and regards
Posted
by slawek17.
Last updated
.
Post not yet marked as solved
0 Replies
440 Views
I'm using USBDriverKit to write an audio driver for a High Speed USB device. In an attempt to understand the difference between DriverKit Extension and Kernel Extension latencies, I'm dispatching individual isochronous microframes that for this device each account for a duration 125µs, or 6 samples at 48kHz. I don't yet know what kind of latency I'm actually getting but I was surprised to see a high CPU usage of ~11% on a 512GB M1 mac mini running Big Sur 11.6. That's 8000 IsochIO() calls and 8000 completion callbacks per second. Instruments.app tells me that most of my time (60%) is being spent inside mach_msg, as part of a remote procedure call. Multiple questions occur to me: is this normal? should I expect lower CPU usage? isn't mach_msg blocking? shouldn't CPU usage be low? don't low latency audio folks avoid things like remote procedure calls? is seeking low latency throughput with USBDriverKit futile? does Monterey's AudioDriverKit enable lower latency, or is it a convenience API?
Posted Last updated
.
Post not yet marked as solved
2 Replies
373 Views
Hello, I rewriting a audio driver that was created in IOKit to a new one based on AudioDriverKit. I would like to block possibility to connect multiple devices to the computer so that driver support just one device. In IOKit it was done by overriding IOAudioEngine::getLocalUniqueID() method and I cannot find anything similar in AudioDriverKit (IOUserAudioDevice). Do you know how to do it? Best Regards
Posted
by slawek17.
Last updated
.
Post not yet marked as solved
2 Replies
498 Views
We are the developer team of Nanjing Qinheng Microelectronics Co., Ltd. Recently, we have carried out device driver development and system adaptation for a variety of USB-to-serial chips. At present, our project is stagnant in the release stage because the "Provisioning Profile" does not contain our vendor ID(0x1A86). The release process of this driver will affect millions of users worldwide. We hope that the "Provisioning Profile" can be completed more quickly. This is very important for our customer and the experience of Apple's Big Sur.
Posted Last updated
.
Post not yet marked as solved
0 Replies
479 Views
Apple presented how to Create audio drivers with DriverKit on the latest WWDC 2021. Video presentation: https://developer.apple.com/videos/play/wwdc2021/10190 Code sample: https://developer.apple.com/documentation/audiodriverkit/creating_an_audio_device_driver We need a similar approach for cameras. The audio driver mentioned above can be compiled using the new Xcode 13 beta. So this approach is in progress. We need to develop a custom driver for the camera. Is there a solution in DriverKit for cameras? Is it planned? Should we develop a driver from scratch using USBDriverKit? Any suggestions are appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
564 Views
Hi, I have requested USB Transport and UserClient Access successfully, but the applications containing the entitlemet don't work. driver.dext: User-mode usb driver Driver.app: Application to install the user-mode driver Error Termination Reason: Namespace CODESIGNING, Code 0x01 ・entitlement file of driver.dext <key>com.apple.developer.driverkit</key> <true/> <key>com.apple.developer.driverkit.transport.usb</key> <array> <dict> <key>idVendor</key> <integer>****</integer> </dict> </array> ・entitlement file of Driver.app <key>com.apple.developer.driverkit.userclient-access</key> <array> <string>****bundle id of driver.dext</string> </array> ・driver.dext provisioning profile CMS command <key>Entitlements</key> <dict> <key>com.apple.developer.driverkit.transport.usb</key> <array> </array> <key>com.apple.developer.driverkit</key> <true/> <key>com.apple.application-identifier</key> <string>bundle id</string> <key>keychain-access-groups</key> <array> <string>****</string> </array> <key>com.apple.developer.team-identifier</key> <string>****</string> </dict> ・Driver.app provisioning profile CMS command <key>Entitlements</key> <dict> <key>com.apple.developer.system-extension.install</key> <true/> <key>com.apple.application-identifier</key> <string>bundle ID</string> <key>keychain-access-groups</key> <array> <string>****.*</string> </array> <key>com.apple.developer.team-identifier</key> <string>****</string> </dict> Would you let me know the solutions if you have?
Posted
by ShoC.
Last updated
.
Post not yet marked as solved
5 Replies
1.2k Views
I'm working on custom solution that uses USB device/interface drivers. For correct setup I need ability to communicate between my own Services, declared in IOKit Personalities of my DEXT. At the moment I'm seeing the one way to do it via some shared state. But DriverKit by default launches each USB service in separate process when device is connected. Documentation says that there is "IOUserServerOneProcess" key could be declared in Info.plist. But seems it does not work: all my USB services run in different processes. Could anybody suggest a way how to interact between own DriverKit services or run them in context of the single process?
Posted
by erreewrwe.
Last updated
.
Post not yet marked as solved
0 Replies
452 Views
On the macOS 10.14 I created a project(installer) that will install a .KEXT(driver) which was signed by the provider’s company. My installer can install the KEXT to the correct location which is “Library/Extensions”. But it will not work, even after reboot. Then I tried to use the command below, but the OS couldn't find the driver. kextstat Here is component plist for pkg <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>BundleIsVersionChecked</key> <true/> <key>BundleOverwriteAction</key> <string>upgrade</string> <key>RootRelativeBundlePath</key> <string>ThirdPartyOfficial.kext</string> </dict> </array> </plist> Below is what I did. Step1 pkgbuild --identifier "com.xxxx" --root "SrcPath" --install-location "/Applications/XXXX.app" --component-plist "plistPath" "outputPath" Step2 productsign --sign "Developer ID Installer: XXXX" "PkgPath" "NewPkgPath" Step3 xcrun altool --notarize-app --primary-bundle-id "BundleName" --username "XXXXX" --password "XXXX" --file "FilePath" Both CodeSing and Notarize were successful. I don’t know why it will not work. As well as it doesn’t show the “Allow” button in the Settings/Security and Privacy. Does anyone know what I missed?
Posted Last updated
.
Post not yet marked as solved
6 Replies
954 Views
Hello, I have requested com.apple.developer.driverkit.transport.usb successfully, but it cannot be used according to the steps provided by Apple. The console has an error log:“Unsatisfied entitlements: com.apple.developer.driverkit.transport.usb”, has anyone encountered the same problem , If you have solved it, please tell me the solution. Thank you
Posted Last updated
.