Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

The Parts of the I/O Kit

Physically and electronically, the I/O Kit is composed of many parts: frameworks and libraries, development and testing tools, and informational resources such as example projects, documentation, and header files. This section catalogs these parts and indicates where they are installed and how they can be accessed.

In this section:

Frameworks and Libraries
Applications and Tools
Other I/O Kit Resources


Frameworks and Libraries

The I/O Kit is based on three C++ libraries. All of them are packaged in frameworks, but only IOKit.framework is a true framework. The Kernel framework exists primarily to expose kernel header files, including those of libkern and IOKit. The code of these “libraries” is actually built into the kernel; however, drivers (when loaded) do link against the kernel as if it were a library.

Table 1-1  Frameworks and libraries of the I/O Kit

Framework or library

Description and location

Kernel/IOKit

The library used for developing kernel-resident device drivers. Headers location: Kernel.framework/Headers/IOKit

Kernel/libkern

The library containing classes useful for all development of kernel software. Headers location: Kernel.framework/Headers/libkern

IOKit

The framework used for developing device interfaces. Location: IOKit.framework

Applications and Tools

You use a handful of development applications to build, manage, debug, examine, and package device drivers. Table 1-2 lists the applications used in driver development; these applications are installed in /Developer/Applications.

Table 1-2  Applications used in driver development

Application

Description

Xcode

The primary development application for Mac OS X. Xcode manages projects, provides a full-featured code editor, builds projects according to arbitrarily complex rules, provides a user interface for software configuration, and acts as a front end for debugging and documentation searches.

I/O Registry Explorer

Enables the graphical exploration of the contents and structure of the I/O Registry.

Package Maker

Creates an installation package for the Installer application; used for deployment of kernel extensions (including device drivers).

Table 1-3 describes the command-line tools used in developing device drivers with the I/O Kit; all tools are located in /usr/sbin/ or /sbin.

Note: You can view on-line documentation of these tools (called man pages in the UNIX world) by entering a command in the shell provided by the Terminal application. The command is man, and the main argument to the man command is the name of the tool for which you want to see documentation. For example, to see the man page for the kextload tool, enter the following line in Terminal:

man kextload

Table 1-3  Command-line tools used in driver development

Tool

Description and location

ioreg

Prints the contents of the I/O Registry (a command-line version of the I/O Registry Explorer application).

kextload

Loads a kernel extension (such as device driver) or generates a statically linked symbol file for remote debugging.

kextunload

Unloads a kernel extension (if possible).

kextstat

Prints statistics about currently loaded drivers and other kernel extensions.

iostat

Displays kernel I/O statistics on terminal, disk, and CPU operations.

ioclasscount

Displays instance count of a specified class.

ioalloccount

Displays some accounting of memory allocated by I/O Kit objects in the kernel.

kextcache

Compresses and archives kernel extensions (including drivers) so they can be automatically loaded into the kernel at boot time. See Loading Kernel Extensions at Boot Time.

gcc

Apple’s version of the GNU C++ compiler; Xcode automatically invokes it with the correct set of flags for I/O Kit projects.

gdb

Apple’s version of the GNU debugger; Xcode automatically invokes it with the correct set of flags for I/O Kit projects.

Other I/O Kit Resources

Several informational resources are included with the I/O Kit “product,” particularly documentation and header files. Some of these resources are described in the preceding chapter, “Introduction to I/O Kit Fundamentals”

The I/O Kit is part of the Darwin Open Source project. Apple maintains a website where you can find much information related to the I/O Kit and other Open Source projects managed by Apple. The following two locations are of particular interest:



< Previous PageNext Page > Hide TOC


Last updated: 2007-05-17




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice