Darwin Development Tools
Getting the Source Code
Building and Installing the Kernel
Kernel Configuration
The Darwin kernel, on which Mac OS X is based, is available in a publicly accessible CVS archive. This is not a watered-down version: you can rebuild a kernel that matches your current Mac OS X kernel in every respect. The only noticeable difference will be when you type uname -v:
Darwin Kernel Version 6.0: Sat Jul 27 13:18:52 PDT 2002; root:xnu/xnu-344.obj~1/RELEASE_PPC
Just because you can build your kernel, does that mean you should? For most users, the answer is no, for the following reasons:
For many users, configuring a Unix kernel involves little more than choosing and configuring device drivers. On Darwin, most devices are not in the kernel; they have their own top-level directory in the CVS archive. So, you do not need to configure Darwin to set up additional hardware support.
Apple hardware is predictable. Most of you will be building Darwin for a G3 or G4 machine, and the range of possible chipsets is limited.
However, if you want to try installing an unofficial kernel patch, or if you want to try your hand at optimizing the kernel, then this chapter's for you.
The Darwin kernel requires a collection of development tools that are not part of the Mac OS X Developer Tools package. To get these tools, visit the Darwin project at http://developer.apple.com/darwin/ and follow the links for the Darwin Development Environment for Mac OS X. Those links lead to a package called darwintools.pkg, which you should install. This package installs a number of header files, libraries, and tools into /usr/local. The tools are described in Table 7-1. The source code for these utilities and libraries can be found in the cctools, mkisofs, Libstreams, and bootstrap_cmds CVS modules. If you are working with an interim or seed release of Darwin or Mac OS X that is out of sync with the current Darwin Development Environment, you may need to check these utilities out and install them yourself.
Tool |
Description |
CVS module |
---|---|---|
check_dylib |
Checks the integrity of a dynamic library. |
cctools |
checksyms |
Checks a binary to ensure that it adheres to Mac OS X conventions. |
cctools |
cmpshlib |
Compares two versions of a shared library for compatibility. |
cctools |
decomment |
Strips C and C++ comments from an input file. |
bootstrap_cmds |
devdump |
Interactively reads the contents of a device or filesystem image. |
mkisofs (as dump.c) |
hack_libgcc |
Hacks a framework to export backward-compatible symbols. |
cctools |
indr |
Prepends an underscore to selected symbol names in an object file. |
cctools |
isodump |
Interactively reads the contents of an ISO 9660 image. |
mkisofs |
isoinfo |
Reads information from an ISO 9660 image. Use isoinfo -h for a usage summary. |
mkisofs |
isovfy |
Verifies an ISO image. |
mkisofs |
kern_tool |
Supports cross-compilation of the kernel; a hacked version of the nm utility. |
cctools |
mkhybrid |
Creates a hybrid ISO 9660/Joliet/HFS filesystem. |
mkisofs |
mkisofs |
Creates a hard link to mkhybrid. |
mkisofs |
mkshlib |
Creates a host and target shared library. The host shared library looks like a static library to the linker, but at runtime, the target shared library is loaded. |
cctools |
relpath |
Finds and prints a relative pathname, given a starting directory and an ending directory. |
bootstrap_cmds |
seg_addr_table |
Works with segment address tables. |
cctools |
seg_hack |
Changes segment names. |
cctools |
setdbg |
Operates as an interactive kernel debugger. |
Copyright © 2003 O'Reilly & Associates. All rights reserved.