O'Reilly logo

Mac OS X for Unix Geeks by Brian Jepson, Ernest E. Rothman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Kernel Utilities

Mac OS X includes various utilities that interact with the kernel. With these utilities, you can debug a running kernel, load and unload kernel modules or extensions, or set kernel variables.

ddb

The ddb utility can debug a running kernel. It is not included with the current version of Mac OS X. If you want to use ddb, you can find its source code in the xnu (Darwin kernel) source code. For details on building the kernel or obtaining source code from CVS, see Chapter 7.

Kernel Module Utilities

The following list describes utilities for manipulating kernel modules. For more information, see the kernel extension tutorials available at http://www.opensource.apple.com/projects/documentation/howto. These utilities must be run by root or by someone with superuser privileges.

kextload

Loads an extension bundle.

kextunload

Unloads an extension bundle.

kextstat

Displays the status of currently loaded kernel extensions. Table 8-5 describes this utility’s output.

Table 8-5. Information displayed by kextstat

Item number

Column

Description

1

Index

Index number of the loaded extension. Extensions are loaded in sequence; gaps in this sequence signify extensions that have been unloaded.

2

Refs

Number of references to this extension from other extensions.

3

Address

Kernel space address of the extension.

4

Size

Amount of kernel memory (in bytes) used by the extension.

5

Wired

Amount of wired kernel memory (in bytes) used by the extension.

6

Name (Version) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required