Question

I am trying to create a kext to be run on OS X 10.9. Currently, when I create the new project (in Xcode, I am given a c template with some methods I can override (cckext_start() and cckext_stop()). This is all fine and well but I would prefer to create my extension using c++.

Is this:

  1. Possible?
  2. Bad practice?

If so, how can I do it?

Was it helpful?

Solution

Yes, it is possible. As a matter of fact, the kernel API, or KPI, is mostly written in C++. The Kernel Extension Programming Guide and I/O Kit Fundamentals should get you started.

OTHER TIPS

OSX is designed for Kext's to be developed with C++, making it easy and quick to inherit from base classes for your own use, such as IOService, IOAudioDevice, IOBlockStorageDevice etc.

If you're new to kext programming, I highly recommend investing in the book OS X and iOS Kernel Programming, as the majority of it is dedicated to driver and Kext development, with good example code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top