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
1
vote
1 answer

Start returns 0xE00002C7 if my driver inherits IOUserUSBSerial

I am developing a DriverKit driver for single port USB-serial adapter. I have a simple driver code as following. class MyDriver: public IOUserUSBSerial { public: virtual bool init() override; virtual kern_return_t Start(IOService *provider)…
Jason
  • 33
  • 3
1
vote
1 answer

MacOS custom Audio Driver doesn't process our hardware audio stream

We are developing a custom audio driver for a USB microphone in order to do simple processing (EQs) on the input audio stream (comparable to an APO for Windows). Our code is based on the SimpleAudioDriver example from Apple and we finally managed to…
kinaar
  • 51
  • 4
1
vote
1 answer

How to fill up an IOBufferMemoryDescriptor with data

I'm using DriverKit in my iPadOS. I'm trying to create a IOBufferMemoryDescriptor and add the data I've got in an OSData object. I'm creating the IOBufferMemoryDescriptor with: ret = ivars->interface->CreateIOBuffer(kIOMemoryDirectionOut, …
xarly
  • 2,054
  • 4
  • 24
  • 40
1
vote
1 answer

How can I use USBmakebmRequestType with DriverKit

I'm building a driver in C++ for my iPad using DriverKit. I'm trying to make a request to a control endpoint, so I'm trying to use IOUSBHostInterface::DeviceRequest(). For the first parameter, bmRequestType, the documentation…
xarly
  • 2,054
  • 4
  • 24
  • 40
1
vote
1 answer

The DriverKit problems to develop multiple serial USB device

I am developing a DriverKit driver for a USB device which has multiple serial UARTs connected. Each UART will represent a cu.USBX port on Mac. My driver inherits IOUSBHostDevice class and it matches device ID well. Now, I am going to crate a new…
Jason
  • 33
  • 3
1
vote
4 answers

SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID

Context: We are working on migration of the driver, which is currently represented as a kernel extension, to the DriverKit framework. The driver works with Thunderbolt RAID storage devices. When connected through the Thunderbolt interface to the…
Alex
  • 29
  • 3
1
vote
1 answer

How to pass user setting to Driver Extension (MacOS)?

I am writing a driverkit extension whose goal is to block some categories of USB devices, such as flash drives. The driver should block (match to) any device of the relevant device classes, except those, which are whitelisted (based on their vendor…
TomasKenny
  • 43
  • 3
1
vote
0 answers

MacOS Configure the FrameBuffer as a UserClient

I am looking to update an existing kext which simple opens the IOFrameBuffer and modifies the configuration via a call to setAttributeForConnection(). I believe that a kext is no longer needed as I can connect to the Frame Buffer service as a user…
mark
  • 7,381
  • 5
  • 36
  • 61
1
vote
0 answers

Problem about setting IOTTYBaseName in USBSerialDriverKit

I want know how to set IOTTYBaseName in USBSerialDriverKit.I try to use SetProperties method inherit from IOService like following code, but the methodreturn -301 error code. super::CopyProperties(&pDict); bResult =…
曾勝億
  • 11
  • 1
1
vote
1 answer

IOPCIDevice invalidated when calling from a different user process

I'm working with Apple's DriverKitUserClientSample code as a basis, but I'm trying to use the PCIDriverKit. In my MyClass::Start method I successfully get the IOPCIDevice from the provider, and call Open() and GetBusDeviceFunction() on it, getting…
jreing
  • 281
  • 1
  • 11
1
vote
0 answers

USB Driver App Not start: Termination Reason: Namespace CODESIGNING, Code 0x1

I'm developing the following files. driver.dext: User-mode USB driver Driver.app: Application to install the user-mode USB driver I created new App IDs and provisioning profiles for the executable files. And I added the keys and values of the…
1
vote
1 answer

IOLock crashes mac OS when locking from IOUserService

We're using a data structure that requires locking and want to access it from an IOUserClient thread that runs when probing for a PCI device using PCIDriverKit. Is using IOLock not allowed in this kind of thread? When trying to use IOLock from an…
jreing
  • 281
  • 1
  • 11
1
vote
1 answer

How to access physical address from a DriverKit driver?

Now I am trying to write an IOUserSCSIParallelInterfaceController driver which uses neither DMA nor PCI and emulates a SCSI target. I realized that fBufferIOVMAddr (…
yuuzi41
  • 11
  • 2
1
vote
1 answer

Can a DriverKit System Extension match a hot pluggable device at boot time?

I have a DriverKit extension that can match a usb audio device just fine, but if I leave the device plugged in during a reboot, the AppleUSBAudio kernel extension matches it instead. Unplugging and replugging load my dext instead. Is this to be…
Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
1
vote
1 answer

OSDynamicCast not compiling in basic driver kit example

I've got a very simple driver kit driver. It's almost boiler plate. I'm getting a build failure when trying to use OSDynamicCast, as per the below kern_return_t IMPL(MyHIDDriver, NewUserClient) { IOService* client; auto ret =…
Chris
  • 7,996
  • 11
  • 66
  • 98