Questions tagged [driverkit]

DriverKit is a device driver development framework for Apple's macOS and iPadOS operating systems, introduced with macOS 10.15 "Catalina" and later added to iPadOS in version 16.

General information

DriverKit is a device driver development framework for Apple's macOS operating system, introduced with macOS 10.15 "Catalina." It was later also added to iPadOS in version 16.

The DriverKit SDK is contained in Apple's Xcode IDE distribution (from version 11 onwards), and is used to build so-called "driver extensions" or "dext" which run in special privileged user space processes. These extensions are installed by apps using the system extensions mechanism.

The DriverKit SDK interfaces with the wider IOKit infrastructure, both in kernel and general user space.

Features

As of macOS 10.15, the following types of driver can be implemented using DriverKit:

As of macOS 10.15.4, the following types of driver can additionally be implemented:

macOS 11.3 added support for:

macOS 12 added APIs for:

iPadOS 16 supports:

  • USBDriverKit
  • PCIDriverKit (Thunderbolt)
  • AudioDriverKit

Relevant question topics

  • Questions about which driver technology is the correct one to for implementing a driver for a particular device. In addition to DriverKit, drivers on macOS may also be implemented using a kext (kernel extension) or as a regular user space process, depending on the underlying device technology (USB, PCI, Firewire, etc.), the type of device (storage, network, audio, display, etc.), and the macOS version(s) targeted.
  • Questions related to the process of building, code signing, and packaging dexts. There is some overlap with macos-system-extension tag, using both can be appropriate when talking about the installation/activation process and APIs.
  • Code-level questions for implementing DriverKit based drivers. Co-tag with hid, usb, pci, etc. as appropriate when discussing specific types of device.
  • Questions about interaction of DriverKit drivers with the rest of the system, be it kexts or user space (app) clients. This will typically overlap with the iokit tag.
102 questions
2
votes
0 answers

Unable to Establish Connection to DriverKit System Extension from App

I am currently developing a macOS application that involves communication with a System Extension (DEXT) created using DriverKit. Despite the extension appearing to be correctly installed and activated, I'm encountering an issue establishing…
Henhen1227
  • 392
  • 1
  • 3
  • 12
2
votes
0 answers

DriverKit driver doesn't appear in Settings when installed with iPad app

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…
Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97
2
votes
1 answer

DriverKit USB driver (dext) process doesn't terminate after device is unplugged

I'm working on a USB driver using DriverKit for macOS (later iPadOS as well). The driver matches, loads, and is able to communicate with my device. However, I've noticed that when I unplug the device, the driver process is still running (as seen in…
Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97
2
votes
1 answer

Synchronization primitives in DriverKit

In a DriverKit extension, I would like to block a call from a user client until a specific hardware interrupt fires. Since there are no semaphores available (Does the DriverKit SDK support semaphores?), I've reached for a very basic spinlock using…
2
votes
2 answers

How to send data as input with IOConnectCallStructMethod

I'm trying to use IOConnectCallStructMethod so send data in the input field to talk to my driver in DriverKit (iPadOS) In this particular method I send an input and I expect getting an output. But ignore the output for now. In my case…
xarly
  • 2,054
  • 4
  • 24
  • 40
2
votes
1 answer

IOUserClientMethodArguments completion value is always NULL

I'm trying to use IOConnectCallAsyncStructMethod in order set a callback between a client and a driver in DriverKit for iPadOS. This is how I call IOConnectCallAsyncStructMethod ret = IOConnectCallAsyncStructMethod(connection,…
xarly
  • 2,054
  • 4
  • 24
  • 40
2
votes
1 answer

Is it possible to render video from HDMI on iPadOS?

It's very general question. I just want to understand if it's technically possible and why? Also to get some idea of what's the good starting point to investigate this topic. So question is: Is it technically possible Connect another device with…
NikR
  • 628
  • 4
  • 14
2
votes
2 answers

How to communicate between USBDriverKit driver and Client app?

We are experimenting with DriverKit on macOS while DriverKit is still in beta on iPadOS. We want to build a Driver for iPad that will allow to communicate our iPad App with USB device. What we did: Configured and implemented a driver that uses…
Myurik
  • 53
  • 2
2
votes
1 answer

How to match my dext with an USB device in DriverKit?

I am writing a driverkit extension whose goal is to block USB devices, such as flash drives. As a starting point, I chose example project at…
TomasKenny
  • 43
  • 3
2
votes
1 answer

NetworkingDriverKit - How can I access packet data?

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…
Jake Stewart
  • 63
  • 1
  • 5
2
votes
1 answer

How to use `IOConnectCallAsyncScalarMethod` with a GCD dispatch queue

I am working on some code that uses IOConnectCallAsyncScalarMethod() to get callbacks from a DriverKit extension. The setup is quite heavy, involving spawning a thread, manually creating a CFMachPortRef, adding its CFRunLoopSourceRef to a CFRunLoop…
2
votes
1 answer

Would DriverKit work for custom USB device to control mic volume (no stream)?

I would like to ask for guidance on how to ideally communicate with a custom USB HID device on MacOS. Use case Modify a microphone volume via an external USB HID device. Question Can I use DriverKit (HIDDriverKit) for that or I need to use IOKit? I…
Tom Kupka
  • 39
  • 4
2
votes
1 answer

CopyPipe of DriverKit IOUSBHostInterface fails with kIOReturnError (0xe00002bc)

For my own edification, I'm trying to read some audio data from a USB audio interface using a DriverKit System Extension. My IOProviderClass is IOUSBHostInterface. I can successfully Open() the interface, but CopyPipe() returns kIOReturnError…
Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
2
votes
2 answers

Can I open a DriverKit user client with a daemon?

I'm building a virtual HID device in Driver Kit. I was wanting to communicate with the virtual device driver from a daemon, as the daemon is necessary for generating the HID events that would be sent from the driver. I'm matching on my driver…
Chris
  • 7,996
  • 11
  • 66
  • 98
2
votes
1 answer

What options can be passed to IOService::Terminate in DriverKit

virtual kern_return_t IOService::Terminate(uint64_t options) says you can pass a parameter with options. I wonder what the different options are? The documentation does not say anything.
tuple_cat
  • 1,165
  • 2
  • 7
  • 22