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
0 Replies
99 Views
All dequed packets from sumbmission queues are enqued properly to completion queue after posting to stack. But After running heavy traffic (running iperf -b 1000m) for few times, dequeue fails and always return 0. When I check error code with dequeuePacket API it gets error 2e7. (which is underrun error) Why dequeue fails?
Posted
by
Post marked as solved
3 Replies
276 Views
I am working on a DriverKit project and the new class OSMappedFile sounds like something I am looking for, at least from what I understood from the description in the header file. https://developer.apple.com/documentation/driverkit/osmappedfile I've tried different combinations, however the method OSMappedFile::createFromPath always returns an error 0xe00002bc (general error), which is not helpful at all. Could you please provide more details about the class and how to use it? Is it possible to open an arbitrary file in an arbitrary location? Does the owner of the file matter? Does the entitlements have to be modified somehow? Thanks for reply I am testing it on Monterey 12.3.1, my driver is linking DriverKit 21.0, no provisioning profile, SIP is off.
Posted
by
Post not yet marked as solved
0 Replies
134 Views
Hi, With BigSur 11.6.5, the logs in the driver extension is not coming in console. It works fine in Monterey and previous versions of BigSur. Is there any known issue related to kernel logs in BigSur 11.6.5?
Posted
by
Post not yet marked as solved
0 Replies
151 Views
As the entitlement still not approved by Apple, I'm now testing the example "DriverkitUserClientSample" locally. I have disabled SIP , activate "systemextensionsctl developer on" , and also sign to run locally in build Settings. The thing is that i can build the project , but i still can see these log messages on my console. "amfid ::Basic requirement validation failed, error: (null)", "amfid:: driver signature not valid: -67050" Is that means i still cant test example without the entitlements ? or anything i can do to go on ?
Posted
by
Post not yet marked as solved
1 Replies
248 Views
Hi, I need to develop a cross-plateform driver extension (similar to a Windows Audio Processing Object (APO)) for an Audio Device and I'm struggling with associating the driver to a USB Audio Device. I'm using the SimpleAudioDriver example and override the device_uid with the Product ID and the manufacturer_uid with the Vendor ID. As I understand it with this documentation : https://developer.apple.com/news/?id=zk5xdwbn it should associate my driver with the device but it creates a new device. If you have any hints, please get back to me. Thanks.
Posted
by
Post not yet marked as solved
1 Replies
183 Views
I manage a system that automatically generates system extensions, and in order to ensure that every release's dext can be activated over top of any other release, I have it increment the dext's CFBundleVersion so that every release has a unique version number. However I just hit an error where, once CFBundleVersion reached 10000, dext activation would fail with this error: Property "CFBundleVersion" must be a valid kext version Apparently the maximum value any one of the three digits can be for CFBundleVersion is 9999, at least for a dext. So if CFBundleVersion only uses one number as opposed to three, it can't go higher than 9999. Note that I found this out from experimentation. No where in Apple's documentation have I found any mention of this restriction, including, most distressingly, in the docs for CFBundleVersion. Since I'm programmatically assigning this value, now I need to know: Are there any other requirements or restrictions for CFBundleVersion? I'm curious if there are any in the context of an app (be it on macOS, iOS, tvOS, and so on) or other types of extensions, as well as with a DriverKit extension.
Posted
by
Post marked as solved
1 Replies
252 Views
How do we compile a driverkit as library. Does this need any special entitlements?
Posted
by
Post not yet marked as solved
2 Replies
289 Views
Dear all I develop a driver for Mac OS . I have request the entitlement a long time( half year). but I can't get any message . I want to know. how to get a pic driver of entitlement. thanks !
Posted
by
Post not yet marked as solved
1 Replies
355 Views
I read the doc of installing system extensions https://developer.apple.com/documentation/systemextensions/installing_system_extensions_and_drivers?language=objc , but actually our product is a framework and installed by .pkg. I/O Kit kext is installed by script in .pkg. So I meet a problem :how to install DriverKit dext by script?
Posted
by
Post marked as solved
3 Replies
439 Views
Hi, I am trying to run an example driver project from https://developer.apple.com/documentation/driverkit/communicating_between_a_driverkit_extension_and_a_client_app?language=objc The project compiles fine, the driver extension is successfully installed and running, however when the client application tries to communicate with the driver (calls IOConnectCallScalarMethod CppUserClient/main.cpp, line 236), the driver crashes, even though there are no modifications of the example code. Does anybody know how to fix it? The project doesn't use any provisioning profile, all three targets are signed to run locally as described in the link. My system: MacOS 11.5.2 BigSur Apple M1 chip XCode 13.2.1 System Integrity Protection status: disabled. systemextensionsctl developer: Developer mode is on also ran command "sudo nvram boot-args=-arm64e_preview_abi" crash report program CppUserClient output
Posted
by
Post not yet marked as solved
1 Replies
471 Views
Hi, I'm looking for a developer to update a currently Intel-only legacy kext into a system extension so it works on M1 / ARM / Apple Silicon. Here's the problem: I'm a heavy user of a legacy software named ControllerMate. Unfortunately, it has been abandoned by the developer and he didn't make it open-source. The latest update was in late 2018 and the developer has stopped responding entirely and can not be reached, even to previous beta-testers. Confirmed by several power users who tried over the years. The app basically allows creation of macros and cascades and is extremely powerful. It's used by many people in the video post production and music production space in their professional workflows, and people built individual workflows around this over the years to work faster and more efficiently. Since it hasn't been updated, people are somewhat stuck and can't upgrade without breaking their workflows. Especially now with the new and powerful M1s, this becomes much more urgent and relevant again. The kext might have to be reverse engineered or hacked - I know, not something people in an Apple developer forum wanna hear, but we're desperate to find somebody for this and keep this going. I truly appreciate any input, insights and leads! Thank you!
Posted
by
Post marked as solved
1 Replies
280 Views
I've been creating a virtual ethernet interface. I've opened asynchronous communication with a controlling application and every time there are new packets, the controlling app is notified and then asks for the packet data. The packet data is stored in a simple struct, with uint8_t[1600] for the bytes, and uint32_t for the length. The dext is able to populate this struct with dummy data every time a packet is available, with the dummy data visible on the controlling application. However, I'm struggling to fill it with the real packet data. The IOUserNetworkPacket provides metadata about a packet. It contains a packets timestamp, size, etc, but it doesn't seem to contain the packet's data. There are the GetDataOffset() and GetMemorySegmentOffset() methods which seem to return byte offsets for where the packet data is located in their memory buffer. My instinct tells me to add this offset to the pointer of wherever the packet data is stored. The problem is I have no idea where the packets are actually stored. I know they are managed by the IOUserNetworkPacketBufferPool, but I don't think that's where their memory is. There is the CopyMemoryDescriptor() method which gives an IOMemoryDescriptor of its contents. I tried using the descriptor to create an IOMemoryMap, using it to call GetAddress(). The pointers to all the mentioned objects lead to junk data. I must be approaching this entirely wrong. If anyone knows how to access the packet data, or has any ideas, I would appreciate any help. Thanks.
Posted
by
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
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
Post not yet marked as solved
1 Replies
318 Views
I am porting some code with heavy use of stdlib and CF. Linking against CF produces the error: CoreFoundation is not available when building for DriverKit. I get errors like error: no member named 'clock_t' in the global namespace. What is the correct approach here? Could I statically link stdlib? Should I move my processing code to a separate process? Related: https://stackoverflow.com/questions/61797150/can-i-use-stl-in-a-driverkit-driver/61820426#61820426
Posted
by
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
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
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
by
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
by
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