When is DriverKit going to actually be useable?

The example code from the last WWDC doesn't compile in the latest xcode, and the scaffold provided when creating a 'DriverKit Driver' in xcode is broken as well.


xcode provides:


#include "MyDriver.h"


kern_return_t

IMPL(MyDriver, Start)

{

kern_return_t ret;

ret = Start(provider, SUPERDISPATCH);

os_log(OS_LOG_DEFAULT, "Hello World");

return ret;

}


The include needs to be changed from '.h' to '.iig', but then the IMPL() macro generates an unknown type 'MyDriver_Start_Args' and 'provider' is an undeclared identifier.


I haven't found any way to even get this to compile in xcode 11.3.1


Without any working examples or proper documentation I hope kexts aren't getting phased out too soon.


Anyone else have any luck with this?

Post not yet marked as solved Up vote post of biggles Down vote post of biggles
2.7k views

Replies

Hi,


I'm also trying to build one sample example but getting same error as yours.


One example is available.

There are so may errors/issues still there in below example.

https://github.com/knightsc/USBApp


1. Class declared in .iig is not refered by .cpp file. (I declared this class in cpp only then I got errors in SDK's header files. unknown types and Semantic issues.)

2. IMPL is giving error.

3. TYPE is not creating Message ID constant for custom


If anyone compiled above example successfully then kindly let me know your XCode Version alongwith SDK version.


Thanks in Advance.

Hi

you need to get the driver kit & system-extension entitlement from apple. after that only that sample will compile.

else if u want to compile that code then u need to define your own header file with all the releavaent macros.

you can refer the driverkit framework files .

Hi,

Thank you for replying. Just for clarafication want to ask below details..


I found Entitlment related information as below:


Link: https://developer.apple.com/system-extensions/

Request an Entitlement

----------------------------------

If you plan to deploy drivers built with DriverKit, allow other developers to use your system extensions, or use the EndpointSecurity API, you’ll need to request an entitlement from Apple.

While your request is in review, you can test system extensions on your Mac by temporarily turning off System Integrity Protection.


So as per my understanding, Entitlment is not required for compiling and testing. Just disable your MAC integrity and deploy it for testing.

Nowhere it's mentioned that you need Entitlement for compiling


and correct me if I'm wrong.. just adding entitlment will not add Macros in project and resolve errors.


If you have successfully build the Git sample then please let me know.

Thanks.

Apple has no where mentioned that DriverKit and System Extension Entitlement is required for testing system extension.

We can still test System Extension by turning off System Integrity Protection.

Also don't forget to $ systemextensionsctl developer on to allow system extensions to be launched from the accompanying app during development cycle.

By default system extensions will only be loaded if the apps are launched from /Applications folder. The above command disables this check.

See here.
Hi,
I can't add

Code Block language
com.apple.developer.driverkit.userclient-access


into my provision profile. Is this entitlement need to request?
Thanks.


com.apple.developer.driverkit.userclient-access

You need to request this entitlement, currently via the "Request an Entitlement" page https://developer.apple.com/contact/request/system-extension/ . Make sure you include an array of bundle IDs for the clients that will need to communicate with your dext, as documented here https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_driverkit_userclient-access


In a very long time I haven't seen Apple release something so powerful and completely unusable because of a lack of any kind of supporting material. It would be nice to have one reference project for USBDriverKit, etc.