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 - https://developer.apple.com/documentation/driverkit/debugging_and_testing_system_extensions?changes=latest_minor.
Post
Replies
Boosts
Views
Activity
I couldn't even find the relevant header to include to get it. I had to declare it myself and include it in my sample code.
#define __Require(assertion, exceptionLabel) \
do \
{ \
if ( __builtin_expect(!(assertion), 0) ) \
{ \
goto exceptionLabel; \
} \
} while ( 0 )
#define __Require_Action(assertion, exceptionLabel, action) \
do \
{ \
if ( __builtin_expect(!(assertion), 0) ) \
{ \
{ \
action; \
} \
goto exceptionLabel; \
} \
} while ( 0 )
Have you tried this suggestion: https://developer.apple.com/forums/thread/131240?answerId=415255022#415255022
I can get around the build issue, but the driver can't be loaded. Still trying to figure it out. If you managed to solve your problem, would appreciate if you can share how you did it. (I don't have the driverkit.entitlement yet)
I think I have figured it out.
The reason the driver was not loading was because incorrect values in IOKitPersonalities. Without realizing this mistake, I was looking everywhere and inevitably looked at the System Information -> Software -> Extensions section from where I got the above error message.
That error message is still valid -- it means that the driver is not signed and therefore cannot be loaded by the default kernel which has the protections in place.
However, in a kernel with SIP disabled, and with systemextensionsctl developer on, the driver will be loaded by the kernel upon demand (But it'll still show the above message in System Information -> Software -> Extensions panel).
Managed to get the driver loaded and working. Problem was incorrect values in IOKitPersonalities.
If you have SIP disabled and systemextentionctl developer on, you can test drivers using the developer certificate. See here - https://developer.apple.com/forums/thread/131240?answerId=415255022#415255022 for instructions.
Figured out the problem.
It's quite silly actually. All DriverKit drivers have to call RegisterService() from Start(). This was not explicitly called out in HIDDriverKit docs. And I didn't go through the DriverKit docs thoroughly enough before starting off with the HIDDriverKit.
Oh well..