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
0 answers

how to implement TxDataAvailable. how to know the size of buffer to be sent to USB layer

I want to develop a serial driver using a driver kit framework.I am trying to override IOUserserial class methods.But i don't know how to get the size of buffer to be sent to USB layer using TXDataAvailable() and RXDataAvailable() functions? Any…
bindu
  • 39
  • 1
1
vote
3 answers

Should macOS driverkit system extensions be arm64 or arm64e for Apple Silicon / M1?

I compile a macOS driverkit system extension as a Universal library so that it contains both x86_64 and arm64. One Apple Silicon computer A the driver starts when I attach the USB device. On Apple Silicon computer B I can see kernel:…
tuple_cat
  • 1,165
  • 2
  • 7
  • 22
1
vote
1 answer

Is it possible to create child IOUSBHostDevice with DriverKit?

With KEXT it was possible to allocate needed class (i.e. IOUSBHostDevice) do init(), attach(), set needed properties and call registerService() of this object. With DEXT we have got IOService::Create() method only which accepts property key name…
Alex
  • 11
  • 2
1
vote
1 answer

Should IOBufferMemoryDescriptor be released of free'd?

I am looking at the documentation of IOBufferMemoryDescriptor. It says "... Except where noted, you are also responsible for releasing buffers that you allocate.". IOBufferMemoryDescriptor::free also exists. My questions is: should I use free or…
tuple_cat
  • 1,165
  • 2
  • 7
  • 22
1
vote
0 answers

DriverKit - Access to hub for SuspendDevice() equivalent

I have written a DriverKit for a USB device and it seems to work well. It is a port from an existing KExt. In the KExt I could call SuspendDevice(true) on IOUsbDevice and it would tell the hub to suspend the port to which the device is attached. I…
ScottBraun
  • 61
  • 6
1
vote
1 answer

How to call a function from one Dext to another Dext?

i am trying to write a code to call a function from one dext to another dext. i have gone through the below link, it has information about sext to dext communication. How should "NewUserClient" be implemented may i know any function(or class) for…
seeni
  • 11
  • 1
1
vote
0 answers

How to get invoked handleInterruptPacket override method in case of ACM DEXT(IOUserUSBSerial)?

In ACM Dext handleInterruptPacket override method is not getting invoked by the system. Kindly let me know anything missing. iig file: class UserUsbACMControl: public IOUserUSBSerial { virtual void handleInterruptPacket(const uint8_t…
david
  • 413
  • 5
  • 20
1
vote
1 answer

How to develop driver to read disk by System Extension and DriverKit for macOS10.15+

I had developed a kernel extension(kext) by IOKit, but it will be deprecated in the future. So I want develope another driver use dext to replace kext using the DriverKit. But I don't find the executable solutions, like that I cannot find the some…
Dirk
  • 21
  • 1
1
vote
1 answer

Porting KEXT to DEXT unable to create ACM Serial TTY Entry

Currently we are porting kernel usb serial drivers to user serial drivers(Dext) as per apple WWDC19 announcement, dext ported and able to load when target device connected to MAC OS running catalina (15.4), but dext driver unable to create /dev/tty…
david
  • 413
  • 5
  • 20
1
vote
1 answer

idVendor for apple.developer.driverkit.transport.usb

I was reading this informative post How to set `com.apple.developer.driverkit.transport.usb` entitlement? I wanted to ask, where do I get this idVendor from? What should be its value ?
Baab
  • 179
  • 6
1
vote
1 answer

How to overwrite portions of a DriverKit OSData internal buffer?

The documentation of OSData says that "...You can add bytes to them and overwrite portions of the byte array.". I can see a method to append bytes, but I don't understand how I am able to overwrite a portion of the buffer. Another option would be to…
tuple_cat
  • 1,165
  • 2
  • 7
  • 22
1
vote
0 answers

Building Xcode project without a provisioning profile

I'm sorry if it's already answered here but I wasn't able to find it. I want to play a bit with DriverKit and SEXTs but I'm not in the Apple Developer Program. Is there a way to build a project using DriverKit in Xcode without using a provisioning…
1
vote
0 answers

How do i implement IOHIDEventDriver use SystemExtension

I have a old project, use the kext and…
Y.F
  • 11
  • 1
0
votes
1 answer

IOBufferMemoryDescriptor::Create returns kIOReturnNotReady

I'm writing a user-space application in MacOS to work with DMA, in a similar fashion to Linux's dmabuf. I created the memory descriptor with IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut,(int)pow(10,5),0,&command->buffer). However, the…
DrownedSuccess
  • 123
  • 1
  • 8
0
votes
0 answers

How to use MacOS Driverkit to generate a blocking with timeout mechanism ?

Background The function I want to achieve is that after calling a pcie hardware dma, it needs to be blocked until the hardware generates a pcie interrupt before it can run normally. If no interrupt is generated, just wait to timeout and…
xmx
  • 51
  • 3