C H A P T E R 2 |
Booting and Testing Your System |
This chapter describes the most common tasks that you perform using OpenBoot. These tasks enable you to:
The most important function of OpenBoot firmware is to boot the system. Booting is the process of loading and executing a stand-alone program such as an operating system. Booting can either be initiated automatically or by typing a command at the User Interface.
The boot process is controlled by a number of configuration variables . (Configuration variables are discussed in detail in Chapter 3 ) The configuration variables that affect the boot process are:
This variable controls whether or not the system automatically boots after a system reset or when the power is turned on. This variable is typically true .
This variable specifies the command to be executed when auto-boot? is true . The default value of boot-command is boot with no command line arguments.
If the value is true , run in the Diagnostic mode. This variable is false by default.
This variable contains the name of the default boot device that is used when OpenBoot is not in diagnostic mode.
This variable contains the default boot arguments that are used when OpenBoot is not in diagnostic mode.
This variable contains the name of the default diagnostic mode boot device.
This variable contains the default diagnostic mode boot arguments.
Based on the values of the above configuration variables, the boot process can proceed in a number of different ways. For instance:
If auto-boot? is true , the machine will boot from either the default boot device or from the diagnostic boot device depending on whether OpenBoot is in diagnostic mode.
If auto-boot? is false , the machine will stop at the OpenBoot User Interface without booting the system. To boot the system, you can do one of the following:
Type the boot command without any arguments. The machine will boot from the default boot device using the default boot arguments.
Type the boot command with an explicit boot device. The machine will boot from the specified boot device using the default boot arguments.
Typically, auto-boot? will be true , boot-command will be boot , and OpenBoot will not be in diagnostic mode. Consequently, the system will automatically load and execute the program and arguments described by boot-file from the device described by boot-device when the system is first turned on or following a system reset.
If you want to boot the default program when auto-boot? is false , simply type boot at the ok prompt.
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 ").
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.
The boot command has the following format:
The optional parameters for the boot command are described in .
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 .
Consequently, boot command lines have the following possible forms.
With this form, boot loads and executes the program specified by the default boot arguments from the default boot device.
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.
For example, to explicitly boot from the primary disk, type:
To explicitly boot from the primary network device, type:
If boot has a single argument that neither begins with the character / nor is the name of a defined devalias , boot uses all of the remaining text as its arguments.
boot loads and executes the program specified by the arguments from the default boot device.
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 ", to obtain the definitions of your system's aliases.
Several diagnostic routines are available from the User Interface. These on-board tests let you check devices such as the network controller, the floppy disk system, memory, installed SBus cards and SCSI devices, and the system clock.
The value returned by diagnostic-mode? controls:
The selection of the device and file that are used by the boot and load commands (if the device and file are not explicitly specified as arguments to those commands).
The extent of the diagnostics performed during power-on self-test, and the (implementation dependent) number of diagnostic messages produced.
OpenBoot will be in diagnostic mode and the diagnostic-mode? command will return true if at least one of the following conditions is met:
When OpenBoot is in the Diagnostic mode , the value of diag-device is used as the default boot device and the value of diag-file is used as the default boot arguments for the boot command.
When OpenBoot is not in the Diagnostic mode , the value of boot-device is used as the default boot device and the value of boot-file is used as the default boot arguments for the boot command.
lists diagnostic test commands. Not all of these tests are available in all OpenBoot implementations.
Execute the specified device's selftest method. For example: |
|
To check a SCSI bus for connected devices, type:
The actual response depends on the devices on the SCSI bus.
To test a single installed device, type:
In general, if no message is displayed, the test succeeded.
Note - Many devices require the system's diag-switch? parameter to be true in order to run this test. |
The diskette drive test determines whether or not the diskette drive is functioning properly. For some implementations, a formatted, high-density (HD) disk must be in the diskette drive for this test to succeed.
To test the diskette drive, type:
Note - Not all OpenBoot systems include this test word. |
To eject the diskette from the diskette drive of a system capable of software-controlled ejection, type:
Note - Not all OpenBoot systems include this test word. |
In the preceding example, the first number (4000000) is the base address of the testing, and the following number (11) is the number of megabytes to go.
To test the clock function, type:
The system responds by incrementing a number once a second. Press any key to stop the test.
Note - Not all OpenBoot systems include this test word. |
To test the primary network controller, type:
The system responds with a message indicating the result of the test.
To monitor a network connection, type:
The system monitors network traffic, displaying " . " each time it receives an error-free packet and "X " each time it receives a packet with an error that can be detected by the network hardware interface.
Note - Not all OpenBoot systems include this test word. |
The User Interface provides one or more commands to display system information. banner is provided by all OpenBoot implementations; the remaining commands represent extensions provided by some implementations. These commands, listed in , let you display the system banner, the Ethernet address for the Ethernet controller, the contents of the ID PROM, and the version number of OpenBoot. (The ID PROM contains information specific to each individual machine, including the serial number, date of manufacture, and Ethernet address assigned to the machine.)
Also see the device tree browsing commands in .
Occasionally, you may need to reset your system. The reset-all command resets the entire system and is similar to performing a power cycle.
If your system is set up to run the power-on self-test (POST) and initialization procedures on reset, these procedures begin executing once you initiate this command. (On some systems, POST is only executed after power-on.) Once POST completes, the system either boots automatically or enters the User Interface, just as it would have done after a power cycle.