C H A P T E R  4

The I/O Kit Framework

Device drivers for Mac OS X are written using a framework known as the I/O Kit. The I/O Kit consists of header files and libraries that provide the services required by drivers, as well as header files and libraries that are used by user space code to locate a kernel driver and interact with it. There are two main parts of the I/O Kit:

  • Kernel.framework
  • IOKit.framework

Although it is slightly counterintuitive, the I/O Kit framework is designed for user space applications and not for developing I/O Kit drivers in the kernel. Instead, the Kernel framework contains the header files used for kernel space driver development. If you examine the contents of the Kernel framework, you will see that it contains a directory named IOKit that consists of the header files used for kernel space driver development. Another important directory in the Kernel framework is named libkern, which contains the foundation classes and types on which the kernel I/O Kit framework is built.

The user space I/O Kit framework serves two purposes. It provides user applications with functions for determining the hardware devices present on the machine on which it is running, functions for locating the appropriate driver for a particular hardware device, and functions for sending control requests and request statuses from that driver. These topics are further discussed in Chapter 5. In addition, the user I/O Kit framework provides the user space application the ability to communicate with certain hardware devices directly, removing the need for a kernel driver. This is possible for a select range of devices, most notably USB and FireWire devices that do not need to be shared between multiple running applications. We discuss this aspect of the I/O Kit in Chapter 15.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.70.88