home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeMac OS X for Unix GeeksSearch this book

8.3. System Configuration

Although you can perform most system configuration through the System Preferences program, the defaults command lets you poke around under the hood. You can get even further under the hood with the nvram command (perhaps further than most people would need or want to get).

8.3.1. defaults

When you customize your Mac using the System Preferences, all of those changes and settings are stored in what's known as the defaults system. Everything that you've done to make your Mac your own is stored as XML data in the form of a property list (or plist). This property list is, in turn, stored in ~/Library/Preferences.

Every time you change one of those settings, that particular property list is updated. For the initiated, there are two other ways to alter the property lists. The first is by using the PropertyListEditor application (/Developer/Applications) and the other is by using the defaults command in the Terminal. Whether you use System Preferences, PropertyListEditor, or the defaults command, any changes you make affect the current user. Syntax

defaults [-currentHost | -host name] command Options

Performs operations on the local machine.

-host name
Performs operations on the specified host. Commands

Prints out all of your current settings.

read domain
Prints out your settings for the specified domain, such as com.apple.dock.

read domain key
Prints out the value of the specified key. For example, to see the current Dock orientation, use:

defaults read com.apple.dock orientation.
read-type domain key
Prints out the data type of the specified key. For example, defaults read-type com.apple.dock orientation tells you that the type of the orientation key is string.

write domain key value
Writes a value to the specified key.

rename domain old_key new_key
Renames the specified key.

delete domain
Deletes the specified domain. So, if you issued the command defaults delete com.apple.dock, the Dock would forget everything. The next time you log in, the Dock's settings are set to the system default.

delete domain key
Deletes the specified key. So, if you issued the command defaults delete com.apple.dock orientation, the Dock would forget its orientation. The next time you log in, the Dock's settings are set to the system default.

Lists all the domains in your defaults.

find string
Searches all defaults for the specified string.

Prints a list of options.

8.3.2. nvram

The nvram utility modifies Open Firmware variables, which control the boot-time behavior of your Macintosh. To list all Open Firmware variables, use nvram -p. The Apple Open Firmware page is http://bananajr6000.apple.com/.

To change a variable, you must run nvram as root or as the superuser. To set a variable, use variable=value. For example, to configure Mac OS X to boot verbosely, use nvram boot-args=-v. (Booting into Mac OS 9 or earlier will reset this.) Table 8-7 lists Open Firmware variables. Some variables use the Open Firmware Device Tree notation (see the technotes available at the Apple Open Firmware page).

WARNING: Be careful changing the nvram utility, since incorrect settings can turn a G4 iMac into a $2000 doorstop. If you render your computer unbootable, you can reset Open Firmware by zapping the PRAM. To zap the PRAM, hold down Option-Figure -P-R as you start the computer, and then release the keys when you hear a second startup chime. (If your two hands are busy holding down the other buttons and you have trouble reaching the power button, remember that you can press it with your nose.)

Table 8-7. nvram variables




The automatic boot settings. If true (the default), Open Firmware will automatically boot an operating system. If false, the process will stop at the Open Firmware prompt. Be careful using this with Old World (unsupported) machines and third-party graphics adapters, since the display and keyboard may not be initialized until the operating system starts (in which case, you will not have access to Open Firmware).


The arguments that are passed to the boot loader.


The command that starts the boot process. The default is mac-boot, an Open Firmware command that examines the boot-device for a Mac OS startup.


The device to boot from. The syntax is device:[partition],path:filename, and a common default is hd:,\\:tbxi. In the path, \\ is an abbreviation for /System/Library/CoreServices, and tbxi is the file type of the BootX boot loader. (Run /Developer/Tools/GetFileInfo on BootX to see its type.)


The name of the boot loader. (This is often blank, since boot-command and boot-device are usually all that are needed.)


The image to display on the boot screen.


A variable that can contain an Open Firmware boot script.


A variable that specifies the console output device, using an Open Firmware Device Tree name.


An IP address for diskless booting.


A gateway address for diskless booting.


Description not available at time of writing; see errata page at http://www.oreilly.com/catalog/mosxgeeks.


A router address for diskless booting.


An IP address for diskless booting.


A default subnet mask for diskless booting.


A private variable; not usable for security reasons.


A private variable; not usable for security reasons.


A private variable; not usable for security reasons.


A variable that determines whether the Open Firmware Forth interpreter will display extra debugging information.


The input device to use for the Open Firmware console.


A secondary input device (so you can have a screen and serial console at the same time). Use scca for the first serial port.


The CPU endian-ness. If true, initializes the PowerPC chip as little-endian. The default is false.


A private variable; not usable for security reasons.


The mouse device using an Open Firmware Device Tree name.


A sequence of commands to execute at boot time (if use-nvramc? is set to true).


A custom banner to display at boot time.


The oem banner settings. Set to true to enable the oem banner. The default is false.


A 64-by-64 bit array containing a custom black-and-white logo to display at boot time. This should be specified in hex.


The oem logo settings. Set to true to enable the oem logo. The default is false.


The device to use as the system console. The default is screen.


A secondary output device (so you can have everything go to both the screen and a serial console). Use scca for the first serial port.


A private variable; not usable for security reasons.


The amount of RAM currently installed. For example, 256 MB is shown as 0x10000000.


The starting physical address that is available to Open Firmware.


The address translation settings. If true, Open Firmware will use real-mode address translation. Otherwise, it uses virtual-mode address translation.


The size of the physical address space available to Open Firmware.


The number of columns for the system console.


The number of rows for the system console.


Set by page checking output words to prevent Open Firmware text from scrolling off the top of the screen.


The number of MB of RAM to test at boot time. The default is 0.


The device node naming settings. Specifies whether to use generic device node names such as 'screen', as opposed to Apple hardware code names.


The command settings. If this is true, Open Firmware uses the commands in nvramrc at boot time.


The starting virtual address that is available to Open Firmware.


The size of the virtual address space available to Open Firmware.

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.