- Introduction
- Booting a System
- The OpenBoot Environment
- The OpenBoot Architecture
- The OpenBoot Interface
- Getting Help in OpenBoot
- PROM Device Tree (Full Device Pathnames)
- OpenBoot NVRAM
- OpenBoot Security
- OpenBoot Diagnostics
- OpenBoot PROM Versions
- Booting a System
- The Kernel
- System Run States
- System Shutdown
- Chapter Summary
- Apply Your Knowledge
Booting a System
Boot the system; access detailed information.
Explain how to perform a system boot.
Up to this point, this chapter describes the OpenBoot diagnostic utilities, variables, and parameters. At the OpenBoot PROM, the operating system is not yet running. In fact, the OpenBoot PROM will work fine if the operating system is not even loaded. The primary function of the OpenBoot firmware is to start up the system. Starting up is the process of loading and executing a standalone program (for example, the operating system or the diagnostic monitor). In this discussion, the standalone program that is being started is the two-part operating system kernel. After the kernel is loaded, the kernel starts the Unix system, mounts the necessary file systems, and runs /sbin/init to bring the system to the initdefault state that is specified in /etc/inittab. This process is described in the "System Run States" section, later in this chapter.
NOTE
Flash PROM If you choose to run the 32-bit Solaris operating environment on any Sun or UltraSPARC system, the Flash PROM update is not needed.
Starting up can be initiated either automatically or with a command entered at the user interface. On most SPARC-based systems, the bootstrap process consists of the following basic phases:
The system hardware is powered on.
The system firmware (the PROM) executes a POST. (The form and scope of POSTs depend on the version of the firmware in the system.)
After the tests have been completed successfully, the firmware attempts to autoboot if the appropriate OpenBoot configuration variable (auto-boot?) has been set.
The OpenBoot startup process is shown here:
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 270MHz), No Keyboard OpenBoot 3.15, 128 MB memory installed, Serial #10642306. Ethernet address 8:0:20:a2:63:82, Host ID: 80a26382. Rebooting with command: boot Boot device: disk:a File and args: SunOS Release 5.9 Version Beta_Refresh 64-bit Copyright 1983-2000 Sun Microsystems, Inc. All rights reserved. configuring IPv4 interfaces: hme0. configuring IPv6 interfaces: hme0. Hostname: ultra5 The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t0d0s5: is clean. /dev/rdsk/c0t0d0s7: is clean. /dev/rdsk/c0t0d0s6: is clean. Starting IPv6 neighbor discovery.Setting default IPv6 interface for multicast: add net ff00::/8: gateway fe80::a0 0:20ff:fea2:6382 starting rpc services: rpcbind done. Setting default IPv4 interface for multicast: add net 224.0/4: \ gateway Ultra5 syslog service starting. Print services started. volume management starting. Mar 23 13:19:33 unknown snmpdx: The system is ready. Ultra5 console login:
The startup process is controlled by a number of configuration variables, as described in Table 3.19.
Table 3.19 - Boot Configuration Variables
Variable |
Description |
auto-boot? |
Controls whether the system automatically starts up after a system reset or when the power is turned on. The default for this variable is true. When the system is powered on, the system automatically starts up to the default run level. |
boot-command |
Specifies the command to be executed when auto-boot? is true. The default value of boot-command is boot, with no command-line arguments. |
diag-switch? |
Causes the system to run in diagnostic mode if the value is true. This variable is false by default. |
boot-device |
Contains the name of the default startup device used when OpenBoot is not in diagnostic mode. |
boot-file |
Contains the default startup arguments used when OpenBoot is not in diagnostic mode. The default is no arguments. (See Table 3.20 for details on when this variable is used.) |
diag-device |
Contains the name of the default diagnostic mode startup device. The default is net. (See Table 3.20 for details on when this variable is used.) |
diag-file |
Contains the default diagnostic mode startup arguments. The default is no arguments. (See Table 3.20 for details on when this variable is used.) |
Typically, auto-boot? is set to true, boot-command is set to boot, and OpenBoot is not in diagnostic mode. Consequently, the system automatically loads and executes 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.
The boot Command
The boot command has the following syntax:
boot <OBP-name> <filename> <options> <flags>
All arguments and options are optional.
The boot command and its options are described in Table 3.20.
Table 3.20 - boot Command Arguments and Options
Argument |
Description |
<OBP-name> |
Specifies the OpenBoot PROM designations. For example, on desktop SPARC-based systems, the designation /sbus/esp@0,800000/sd@3,0:a indicates a SCSI disk (sd) at target 3, lun0 on the SCSI bus, with the esp host adapter plugged in to slot 0. OBP-name can be a device alias such as disk0 (for a floppy 3.5-inch disk drive), net (for Ethernet), or tape (for a SCSI tape). If the OBP name is not specified and diagnostic-mode? returns true, boot uses the device specified by the diag-device configuration variable. |
<filename> |
The name of the standalone program to be started up (for example, kernel/unix). The default is to start up /platform/platform-name/kernel/unix from the root partition. If specified, filename is relative to the root of the selected device and partition. If it is not specified, the boot program uses the value of the boot-file or diag-file based on the diag-switch? parameter. |
flags |
The boot program passes all startup flags to filename. The startup flags are not interpreted by boot. (See the section "The Kernel," later in this chapter, for information on the options that are available with the default standalone program, kernel/unix.) |
The following options control the behavior of the boot command:
Option |
Description |
-a | The startup program interprets this flag to mean "Ask me," so it prompts for the name of the standalone program to load. |
-f | When starting an Autoclient system, this option forces the boot program to bypass the client's local cache and read all files over the network from the client's file server. This option is ignored for all non-Autoclient systems. The -f option is then passed to the standalone program. |
-r | Triggers device reconfiguration during startup. |
-s | Boots into a single-user state. |
-v | Boots in verbose mode. When this option is set, all system messages are displayed. |
A noninteractive boot (boot) automatically boots the system by using default values for the boot path. You can initiate a noninteractive boot by typing the following command from the OpenBoot prompt:
ok boot
The system boots without requiring more interaction.
An interactive boot (boot -a) stops and asks for input during the boot process. The system provides a dialog box in which it displays the default boot values and gives you the option of changing them. You might want to boot interactively to make a temporary change to the system file or kernel. Booting interactively enables you to test your changes and recover easily if you have problems. To do this, follow the process in Step by Step 3.1.
Step by Step 3.1: The Interactive Boot Process
At the ok prompt, type boot -a and press Enter. The boot program prompts you interactively.
Press Enter to use the default kernel (/kernel/unix) as prompted, or type the name of the kernel to use for booting and then press Enter.
Press Enter to use the default modules directory path as prompted, or type the path for the modules directory and then press Enter.
Press Enter to use the default /etc/system file as prompted, or type the name of the system file and then press Enter.
Press Enter to use the default root file system type as prompted (that is, ufs for local disk booting or nfs for diskless clients).
Press Enter to use the default physical name of the root device as prompted or type the device name.
TIP
The Interactive Boot Process For the exam, you should make sure you understand what each step of an interactive boot process is asking for. For example, you should know the name of the default kernel, know what the default modules are and where they are located, understand what the /etc/system file is used for, and what is meant by the default root file system. Each of these are described in the section "The Kernel," later in this chapter.
The following output shows an example of an interactive boot session:
ok ok boot -a Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a File and args: -a Enter filename [kernel/sparcv9/unix]: Enter default directory for modules [/platform/SUNW,Ultra-5_10/kernel /platform/sun4u/kernel /kernel /usr/kernel]: Name of system file [etc/system]: SunOS Release 5.9 Version Generic_112233-02 64-bit Copyright 1983-2002 Sun Microsystems, Inc. All rights reserved. root filesystem type [ufs]: Enter physical name of root device [/pci@1f,0/pci@1,1/ide@3/disk@0,0:a]: configuring IPv4 interfaces: hme0. configuring IPv6 interfaces: hme0. Hostname: ultra5 The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t0d0s5: is clean. /dev/rdsk/c0t0d0s7: is clean. /dev/rdsk/c0t0d0s6: is clean. Starting IPv6 neighbor discovery. Setting default IPv6 interface for multicast: add net ff00::/8: \ gateway ultra5 Starting rpc services: rpcbind done. Setting default IPv4 interface for multicast: add net 224.0/4: Print services started. volume management starting. Mar 13 09:21:48 The system is ready. ultra5 console login:
NOTE
A Missing /etc/system File If the /etc/system file is missing at bootup, you see this message:
Warning cannot open system file!
The system still boots, however, using all "default" kernel parameters. Because by default the lines in the /etc/system file are all commented by the asterisk (*) character, /etc/system is actually an "empty" file. The kernel doesn't use anything from this file until you edit this file and enter an uncommented line. You can specify /dev/null (an empty file) for the system filename, and the system still boots. In fact, if the /etc/system file gets corrupted and the system won't boot from the /etc/system file, you can specify a file named /dev/null to get the system to boot.
To view more detailed information during the boot process, you use the -v option:
ok boot v
The system responds with this:
ok boot -v Resetting ... Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 270MHz), No Keyboard OpenBoot 3.15, 128 MB memory installed, Serial #10642306. Ethernet address 8:0:20:a2:63:82, Host ID: 80a26382. Initializing Memory Rebooting with command: boot -v Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a File and args: -v SunOS Release 5.9 Version Generic_112233-02 64-bit Copyright 1983-2002 Sun Microsystems, Inc. All rights reserved. Ethernet address = 8:0:20:a2:63:82 mem = 131072K (0x8000000) avail mem = 122306560 root nexus = Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 270MHz) pcipsy0 at root: UPA 0x1f 0x0 pcipsy0 is /pci@1f,0 PCI-device: pci@1,1, simba0 simba0 is /pci@1f,0/pci@1,1 PCI-device: pci@1, simba1 simba1 is /pci@1f,0/pci@1 PCI-device: ide@3, uata0 uata0 is /pci@1f,0/pci@1,1/ide@3 dad0 at pci1095,6460 target 0 lun 0 dad0 is /pci@1f,0/pci@1,1/ide@3/dad@0,0 <ST34321A cyl 8892 alt 2 hd 15 sec 63> root on /pci@1f,0/pci@1,1/ide@3/disk@0,0:a fstype ufs PCI-device: ebus@1, ebus0 power0 at ebus0: offset 14,724000 power0 is /pci@1f,0/pci@1,1/ebus@1/power@14,724000 su0 at ebus0: offset 14,3083f8 su0 is /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8 su1 at ebus0: offset 14,3062f8 su1 is /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8 se0 at ebus0: offset 14,400000 se0 is /pci@1f,0/pci@1,1/ebus@1/se@14,400000 cpu0: SUNW,UltraSPARC-IIi (upaid 0 impl 0x12 ver 0x13 clock 270 MHz) configuring IPv4 interfaces:SUNW,hme0 : PCI IO 2.0 (Rev Id = c1) Found PCI-device: network@1,1, hme0 hme0 is /pci@1f,0/pci@1,1/network@1,1 hme0. configuring IPv6 interfaces: hme0. Hostname: ultra5 dump on /dev/dsk/c0t0d0s1 size 420 MB SUNW,hme0 : Internal Transceiver Selected. SUNW,hme0 : Auto-Negotiated 100 Mbps Half-Duplex Link Up The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t0d0s5: is clean. /dev/rdsk/c0t0d0s7: is clean. /dev/rdsk/c0t0d0s6: is clean. Starting IPv6 neighbor discovery. Setting default IPv6 interface for multicast: add net ff00::/8:\ gateway ultra5 starting rpc services: rpcbind done. Setting default IPv4 interface for multicast: add net 224.0/4: syslog service starting. Print services started. Mar 13 11:04:03 unknown pseudo: pseudo-device: tod0 Mar 13 11:04:03 unknown genunix: tod0 is /pseudo/tod@0 Mar 13 11:04:03 unknown pseudo: pseudo-device: pm0 Mar 13 11:04:03 unknown genunix: pm0 is /pseudo/pm@0 Mar 13 11:04:04 unknown simba: PCI-device: SUNW,m64B@2, m640 Mar 13 11:04:04 unknown genunix: m640 is /pci@1f,0/pci@1,1/SUNW,m64B@2 Mar 13 11:04:04 unknown m64: m64#0: 1152x900, 4M mappable, rev 4750.7c volume management starting. Mar 13 11:04:06 unknown pseudo: pseudo-device: vol0 Mar 13 11:04:06 unknown genunix: vol0 is /pseudo/vol@0 Mar 13 11:04:07 unknown scsi: sd0 at uata0: target 2 lun 0 Mar 13 11:04:07 unknown genunix: sd0 is /pci@1f,0/pci@1,1/ide@3/sd@2,0 Mar 13 11:04:09 unknown ebus: fd0 at ebus0: offset 14,3023f0 Mar 13 11:04:09 unknown genunix: fd0 is /pci@1f,0/pci@1,1/ebus@1/ fdthree@14,\ 3023f0 Mar 13 11:04:15 unknown snmpdx: The system is ready. ultra5 console login:
If you are not at the system console to watch the boot information, you can use the Unix dmesg command to redisplay information that was displayed during the boot process, or you can view the information in the /var/adm/messages file. The dmesg command displays the contents of a fixed-size buffer. Therefore, if the system has been up for a long time, the initial boot messages may have been overwritten with other kernel log entries.
To view messages displayed during the boot process, you can use one of the following methods:
At a Unix prompt, type /usr/sbin/dmesg and press Enter.
At a Unix prompt, type more /var/adm/messages and press Enter.
When you specify an explicit device alias, such as disk3, with the boot command, the machine starts up from the specified startup device, using no startup arguments. Here's an example:
boot disk3
In this case, the system boots from the disk drive defined by the device alias named disk3. It then loads kernel/unix as the default standalone startup program.
Various options affect the behavior of the boot command. You use the following syntax to specify any of the options listed in Table 3.20 with the boot command: :
boot [options]
When you specify options with the boot command, the machine starts up from the default startup device. Here's an example:
boot a
NOTE
Viewing dmesg Output Several pages of information are displayed when you use this method, so I recommend that you pipe the dmesg command to more, as shown here: /usr/sbin/dmesg|more.
The a option instructs the boot command to ask for the name of the standalone program to load. If you specify kernel/unix, which is the default, you are prompted to enter the directory that contains the kernel modules. (See the section "The Kernel," later in this chapter, for details on kernel modules.)
You can mix options and arguments with the boot command by using the following syntax:
boot <OBP-name> <options>
When you specify the boot command with an explicit startup device and option, the machine starts up from the specified device using the specified option. Here's an example:
boot disk3 a
This gives the same prompts as the previous example, except that you are specifying the boot device and not using the default boot device. The system starts up the bootblock from the disk drive defined by the device alias named disk3.
During the startup process, OpenBoot performs the following tasks:
The firmware resets the machine if a client program has been executed since the last reset. 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 programs. For example, if you have just issued the testnet command, when you next type boot, the system resets before starting up.
The boot program is loaded into memory, using a protocol that depends on the type of selected device. You can start up from disk, tape, floppy, or the network. A disk startup might read a fixed number of blocks from the beginning of the disk, whereas a tape startup might read a particular tape file.
The loaded boot program is executed. The behavior of the boot program can be controlled by the argument string, if one is passed to the boot command on the command line.
The program that is loaded and executed by the startup process is a secondary boot program, the purpose of which is to load the standalone program. The second-level program is either ufsboot, when you're starting up from a disk, or inetboot, when you're starting up from the network.
If you're starting up from disk, the bootstrap process consists of two conceptually distinct phases: primary startup and secondary startup. The PROM assumes that the program for the primary startup (bootblk) is in the primary bootblock, which resides in sectors 1 through 15 of the startup device. The bootblock is created by using the installboot command. The software installation process typically installs the bootblock for you, so you don't need to issue this command unless you're recovering a corrupted bootblock.
To install a bootblock on disk c0t3d0s0, for example, you type the following:
installboot /usr/platform/'uname -i'/lib/fs/ufs/bootblk \ /dev/rdsk/c0t3d0s0
You can never see the bootblock. It resides in a protected area of the disk that cannot be viewed. The program in the bootblock area loads the secondary startup program, ufsboot.
When you're executing the boot command, if you specify a filename, that filename is the name of the standalone startup program to be loaded. If the pathname is relative (that is, it does not begin with a slash), ufsboot looks for the program in a platform-dependent search path. In other words, the relative path to the standalone program is prefixed with /platform/<platform-name>, where <platform-name> is specific to your hardware.
On the other hand, if the path to the filename is absolute, boot uses the specified path. The startup program then loads the standalone program and transfers control to it.
The following example shows how to specify the standalone startup program from the OpenBoot ok prompt:
ok boot disk5 kernel/unix s
In this example, the PROM looks for the primary boot program (bootblk) on disk5 (/pci@1f,0/pci@1,1/ide@3/disk@5,0). The primary startup program then loads ufsboot. ufsboot loads the standalone startup program named /platform/SUNW,Ultra-5_10/kernel/ unix, using the -s flag. Typical secondary startup programs, such as kernel/unix, accept arguments of the form <filename> -<flags>, where filename is the path to the standalone program and -<flags> is a list of options to be passed to the standalone program. The example starts up the operating system kernel, which is described in the next section. The -s flag instructs the kernel to start up in single-user mode.
NOTE
Determining Your System's Platform Name You can use the uname -i command to determine your system's platform name. For example, on a Sun Ultra 5, the path is /platform/SUNW,Ultra-5_10. You use the command uname -m to find the hardware classname of a system; for an Ultra 5, the hardware classname is sun4u.