Reputation: 1529
I have followed the tutorial at
https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptKEXT/kext_tutorial.html#//apple_ref/doc/uid/20002365-BABJHCJA
to create a kernel extension (kext).
Basically the relevant code is this
kern_return_t MyKext_start (kmod_info_t * ki, void * d)
{
printf("MyKext has started.\n");
return KERN_SUCCESS;
}
I have succesfully loaded the kext (as shown by kextstat):
$ kextstat | grep MyKext
153 0 0xffffff7f846fc000 0x2000 0x2000 com.example.MyKext (1) 97D9903E-3CB5-3D3C-A7B0-4EF5AF8CB575 <4>
How can I view the printf
output? Should it not be visible when loading the kext?
Using Xcode 8.2.1 on macOS 10.12.3.
Upvotes: 1
Views: 2839
Reputation: 23428
The output will be in the system log, prefixed with "kernel: " (Console.app, or syslog
on the command line.)
Upvotes: 1