Table of Contents

Preface ix

Part 1 . Getting Around

1 . The Mac 0S X Command Line 3 Mac OS X Shells 3 The Terminal and Compared 3 Using the Terminal 4 The Services Menu 10 Using the tcsh Shell 11 Mac OS X's Unix Development Tools 22

2. Startup 32 Booting Mac OS X 32 Adding Startup Items 37 Scheduling Tasks 41

3. Directory Services 42 Understanding Directory Services 42 Programming with Directory Services 43 Configuring Directory Services 44 Netlnfo 47 Netlnfo Utilities 48 Netlnfo Command Reference 50 Managing Groups 55 Managing Users and Passwords 57 Managing Hostnames and IP Addresses 60

v

Exporting Directories with NFS 61 Flat Files and Their Netlnfo Counterparts 61 Restoring the Netlnfo Database 62

Part II. Building Applications

4. Compiling Source Code 67 Compiler Differences 69 Compiling Unix Source Code 70 Architectural Issues 76

5. Libraries, Headers, and Frameworks 78 Header Files 78 The System Library : libSystem 83 Shared Libraries Versus Loadable Modules 84 Library Versions 89 Creating and Linking Static Libraries 91 Prebinding 91 Interesting and Important Libraries 92

6. Creating and Installing Packages 96 Fink 96 Creating Fink Packages 101 GNU-Darwin 104 Packaging Tools 105

Part III. Beyond the User Space

7 . Building the Darwin Kernel 123 Darwin Development Tools 123 Getting the Source Code 125 Building and Installing the Kernel 127 Kernel Configuration 128

8. System Management Tools 130 Diagnostic Utilities 130 Kernel Utilities 136 System Configuration 140

vi 1 TabieofContents 9. The 146 Installing X11 146 Running XDarwin 147 Desktops and Window Managers 148 X11-based Applications and Libraries 149 Making X11 Applications More -like 151 AquaTerm 154 Connecting to Other X Window Systems 155 Virtual Network Computers 156 Conclusion 159

Part IV. Appendixes

A . The Mac 0S X Filesystem 163

B. Command-Line Tools: The Missing Manpages 174

Index 189

Table of Contents 1 vii