DriverKit, USBDriverKit and SystemExtensions

I've watched the video of WWDC 2019 session 702, System Extensions and DriverKit, and I'm still a little puzzled.


For instance, what's the point of USBDriverKit, that is, why would I use it in preference to the already extant user-mode USB APIs? The demo shows an extension that does nothing - it logs to the debugger, but it doesn't provide any services to multiple clients in the system. In a KEXT, those services are provided by publishing them in the IORegistry; they provide well-known interfaces in the kernel to which a well-known user client can connect. If my extension ships in my own app, and provides services only to that app, I may as well implement the extension's functions directly in my app.

How does my app (or more importantly, a third-party app) communicate with my dext? That wasn't covered in session 702. Neither was the case of replacing or augmenting an existing system driver, for example filtering the data passing through a USB mass storage driver, based on sideband data which the standard system driver cannot convey. For a kext, I would simply call IORegisterService and the rest of the stack would be build on top of my driver.

Is the sample code for the demo of session 702 available? Any other sample code for DriverKit?

I agree that there are many open question and a shortage of information and examples. And USBSerialDriverKit has disappeared without further information (in beta 3 or 4).


To the best of my understanding, the new drivers / system extensions are shipped and installed with an application but they are active even when the application is not running and remain on the system until the application is removed. So the drivers are available to other applications and they are probably registered globally as well. That's a clear advantage over user-mode USB interface.

There are several DriverKit resources available in addition to https://developer.apple.com/documentation/driverkit?language=objc

Matching Behaviors & DriverKit
Code signing & DriverKit

Based on your question this is the sample thats most likely going to address it Other Samples
DriverKit, USBDriverKit and SystemExtensions
 
 
Q