Booting is the process of loading and executing a client program. The client program is normally an operating system or an operating system's loader program, but boot can also be used to load and execute other kinds of programs, such as diagnostics. (For more details about loading programs other than the operating system, see Chapter 5, Loading and Executing Programs").
Booting usually happens automatically based on the values contained in the configuration variables described above. However, the user can also initiate booting from the User Interface.
OpenBoot performs the following steps during the boot process:
The firmware may reset the machine if a client program has been executed since the last reset. (The execution of a reset is implementation dependent.)
A device is selected by parsing the boot command line to determine the boot device and the boot arguments to use. Depending on the form of the boot command, the boot device and/or argument values may be taken from configuration variables.
The bootpath and bootargs properties in the /chosen node of the device tree are set with the selected values.
The selected program is loaded into memory using a protocol that depends on the type of the selected device. For example, a disk boot might read a fixed number of blocks from the beginning of the disk, while a tape boot might read a particular tape file.
The loaded program is executed. The behavior of the program may be further controlled by the argument string (if any) that was either contained in the selected configuration variable or was passed to the boot command on the command line.
Often, the program loaded and executed by the boot process is a secondary boot program whose purpose is to load yet another program. This secondary boot program may use a protocol different from that used by OpenBoot to load the secondary boot program. For example, OpenBoot might use the Trivial File Transfer Protocol (TFTP) to load the secondary boot program while the secondary boot program might then use the Network File System (NFS) protocol to load the operating system.
Typical secondary boot programs accept arguments of the form:
where filename is the name of the file containing the operating system and where -flags is a list of options controlling the details of the start-up phase of either the secondary boot program, the operating system or both. Please note that, as shown in the boot command template immediately below, OpenBoot treats all such text as a single, opaque arguments string that has no special meaning to OpenBoot itself; the arguments string is passed unaltered to the specified program.
ok boot [device-specifier] [arguments]
The optional parameters for the boot command are described in Table 2-1.Table 2-1 Optional boot Command Parameters
The name (full path name or devalias) of the boot device. Typical values include:
cdrom (CD-ROM drive)
disk (hard disk)
floppy (3-1/2" diskette drive)
tape (SCSI tape)
If device-specifier is not specified and if diagnostic-mode? returns false, boot uses the device specified by the boot-device configuration variable.
If device-specifier is not specified and if diagnostic-mode? returns true, boot uses the device specified by the diag-device configuration variable.
The name of the program to be booted (e.g. stand/diag) and any program arguments.
If arguments is not specified and if diagnostic-mode? returns false, boot uses the file specified by the boot-file configuration variable.
If arguments is not specified and if diagnostic-mode? returns true, boot uses the file specified by the diag-file configuration variable.
Most commands (such as boot and test) that require a device name accept either a full device path name or a device alias. In this manual, the term device-specifier indicates that either an appropriate device path name or a device alias is acceptable for such commands.
Since a device alias cannot be syntactically distinguished from the arguments, OpenBoot resolves this ambiguity as follows:
If the space-delimited word following boot on the command line begins with /, the word is a device-path and, thus, a device-specifier. Any text to the right of this device-specifier is included in arguments.
Otherwise, if the space-delimited word matches an existing device alias, the word is a device-specifier. Any text to the right of this device-specifier is included in arguments.
Otherwise, the appropriate default boot device is used, and any text to the right of boot is included in arguments.
ok boot device-specifier
If boot has a single argument that either begins with the character / or is the name of a defined devalias, boot uses the argument as a device specifier. boot loads and executes the program specified by the default boot arguments from the specified device.
ok boot disk
ok boot net
ok boot arguments
ok boot device-specifier arguments
If there are at least two space-delimited arguments, and if the first such argument begins with the character / or if it is the name of a defined devalias, boot uses the first argument as a device specifier and uses all of the remaining text as its arguments. boot loads and executes the program specified by the arguments from the specified device.
For all of the above cases, boot records the device that it uses in the bootpath property of the /chosen node. boot also records the arguments that it uses in the bootargs property of the /chosen node.
Device alias definitions vary from system to system. Use the devalias command, described in Chapter 1, Overview", to obtain the definitions of your system's aliases.