Home > Articles > Home & Office Computing > Mac OS X

  • Print
  • + Share This
From the author of Drivers


The majority of code in most modern kernels is found in device drivers. In OS X, somewhat unusually, these are written in a dialect of C++, embedded C++, which omits many of the features of C++ that cause runtime overhead. Interestingly, the older DriverKit framework from OPENSTEP used Objective-C, a dynamic language with (generally speaking) more overhead than C++ for drivers, but on computers an order of magnitude faster Apple chose to go with a dialect of C++. It's unclear why they made this change; possibly they found that most drivers didn't use the features of Objective-C, or possibly they just wanted to move the Objective-C runtime out of the kernel.

IOKit, the framework used for writing device drivers, provides a hierarchy of C++ classes for various different generic devices and allows drivers to be written by subclassing them.

  • + Share This
  • 🔖 Save To Your Account