4. Solaris (Intel Platform Edition) BootstrapsThe previous chapters have provided an overview of Open Firmware, the Solaris booting architecture, and the x86 BIOS, booting, and configuration architectures. With this background, it is now possible to discuss the Solaris (Intel Platform Edition) realmode environment. The first and most basic component of the Solaris (Intel Platform Edition) realmode environment is the bootstrap, a sequence of programs that, starting from the BIOS handoff, causes the loading of a specified operating system. 4.1 Design GoalsThe Solaris (Intel Platform Edition) bootstraps should be able to boot an operating system from any disk, CD, or network adapter, and be able to do so independently of whether or not the BIOS supports booting or even reading from those devices. The Solaris (Intel Platform Edition) bootstraps should be able to automatically boot a designated operating system from a default device, or to permit a user to manually intervene and request the booting of an arbitrary file from an arbitrary device. They should also support the ability to maintain multiple operating systems on a machine (for example, Windows, NT, or Linux) and to boot any of them. The Solaris (Intel Platform Edition) booting mechanisms should be compatible with and exploit all available BIOS mechanisms. The Solaris (Intel Platform Edition) booting mechanisms should provide Open Firmware-like services to the client operating system, and all information that the OS needs to use the machine. 4.2 First-Stage BootstrapThe bootstrap process is somewhat arbitrarily divided into two phases: the first stage and the second stage. The second-stage bootstrap is a large, general, and complex program that is capable of loading a kernel from a wide range of devices. The first-stage bootstrap is a sequence of simpler programs to get the second-stage bootstrap loaded into memory. It is also worth distinguishing the initial boot device (from which the first-stage bootstrap will be loaded, and which must be supported by BIOS) from the eventual boot device (which need not be supported by BIOS, and from which the operating system will be loaded). As described in the previous chapter, the BIOS will load 512 bytes from the beginning of some boot device into memory and transfer control to it. This initiates the first-stage bootstrap process. The code in that 512 bytes locates and reads a slightly larger program. This program, in turn, locates and reads in the second-stage bootstrap. At present, the only supported initial boot devices are hard disks and diskettes. The first-stage bootstrap process works differently for each of these devices (as it likely will for future initial boot devices like CDs and network interfaces). The primary differences between first-stage booting from a disk and a diskette are:
In Solaris the structure of the FDISK table is defined by the include file /usr/include/sys/dktp/fdisk.h, and the structure of the VTOC is defined by the include file /usr/include/sys/vtoc.h (you can view these files now by entering the following "file" links in your browser's location field: file:/usr/include/sys/dktp/fdisk.h or file:/usr/include/sys/vtoc.h). 4.2.1 First-Stage Booting From a DiskThe BIOS reads a standard master boot record (MBR), which in turn reads the first sector (partition boot record (PBR)) from the active boot partition. The PBR on a Solaris partition contains a 512-byte program called pboot. This program consults the FDISK table to find out where the Solaris partition starts, seeks to the third sector in the first cylinder (immediately past the Solaris VTOC), and reads in a large program installed there, called "bootblock." All of the required disk I/O is performed by using BIOS INT13 block I/O reads.
Figure 4-1 Physical Bootstrap Layout on Disk The bootblock program is large enough to talk to the user and interpret file systems. The bootblock program does the following:
The PBR program (pboot) and the large, first-stage bootstrap (bootblk) can be found in the directory /usr/lib/fs/ufs, and are installed onto a newly formatted disk by the script /usr/sbin/installboot. 4.2.2 First-Stage Booting From a DisketteThe process for booting from a diskette differs from the process for booting from a hard disk because bootable diskettes are written in DOS (FAT12) format rather than as Solaris file systems. They are not divided into logical subdisks by either FDISK tables or Solaris VTOC. The BIOS reads 512 bytes from the first sector on the diskette. In Solaris, these first 512 bytes come from a program called mdboot. The first 512 bytes of this program load in the second 512 bytes (which are always found in cluster 2/sector 32), and then locate the larger program strap.com (which is always a contiguous file beginning in cluster 3), load it into memory, and transfer control to it. The strap.com program knows how to interpret a FAT12 file system and looks for a configuration file on the diskette (strap.rc). This file contains instructions on what load module should be loaded, and where in memory. The default solarisstrap.rc instructs strap.com to load the program solarisboot.bin from the diskette. This is the same second-stage bootstrap program that the bootblock program loads from a hard disk.
Figure 4-2 Physical Diskette Bootstrap Layout The mdboot and strap.com programs and the program that installs them onto a bootable diskette (a special PCFS newfs command) are not distributed with the Solaris environment but only exist as internal build tools. In essence, however, the process:
4.3 Second-Stage BootstrapThe whole purpose of the various first-stage bootstrap processes is to get the second-stage bootstrap loaded into memory. The second-stage bootstrap is a large and versatile program that is capable of loading and executing files stored on a wide range of different devices and file system types. Its primary purpose is to load a selected kernel from a selected root device. On x86 based systems, the second-stage bootstrap serves another very important purpose: it provides (for the kernel and other clients) the services that are performed by Open Firmware on SPARC based systems. It is worthwhile to distinguish the boot device from the root device. The boot device is the device from which the second-stage bootstrap, Configuration Assistant, and realmode device drivers are loaded. The root device is the device from which the desired operating system is loaded. There are many situations where these are not the same device, so it is important to be mindful of the difference. The configuration analysis and device methods are provided by other components of the Solaris (Intel Platform Edition) realmode environment (the Configuration Assistant and the realmode drivers), but the second-stage bootstrap loads and provides services for those programs. The second-stage bootstrap depends only on the hardware BIOS, and on extensions to that BIOS that are provided by the realmode drivers. There are several features of the second-stage bootstrap that warrant description:
Figure 4-3 Second-Stage Bootstrap Components and Interfaces 4.3.1 Boot ShellBecause of the wide diversity and rapid evolution of x86 platforms, the startup procedures in the second-stage bootstrap are not hard-coded to allow easier maintenance and updating. Instead, a simple (shell-like) scripting language is used, and the system startup process is implemented by scripts written in that language. These scripts are easy to understand and update. The scripting language is documented in boot(1M), but a summary of its features is presented here. The language includes general programming and scripting features, augmented by a set of extensions for traversing and manipulating a device information tree. The general programming features include several commands and constructs from the Bourne shell:
There are some additional functions for traversing and building a device information tree:
4.3.2 Boot Control ScriptsAlmost every aspect of the booting process is controlled by a series of scripts. The primary boot control script is expected to be on the boot device (the device from which the second-stage bootstrap was loaded) in a file named boot.rc. All subsequent processing is controlled by this script. In practice the primary boot control script does not change much, and its primary job is to run other scripts. It:
Figure 4-4 Files in Second-Stage Booting In principle the /etc/bootrc script is specific to the system being loaded. In most cases, however, this script:
4.3.3 File System InterpretationThe scripts to be executed and files to be loaded can be found on diskettes (in DOS FAT12 format), on hard disks (with FDISK partitions, Solaris VTOC, and UFS file systems), or on CDs (in High Sierra/RockRidge format). If the system is being booted over a network, the control scripts and programs to be loaded will be accessed via the NFS protocol. The file system implementations are used by the:
The second-stage bootstrap understands all necessary file system formats and protocols, and it is able to access files in any combination of these file systems. To do this it must be able to read from the disk (or communicate over the network). All disk access is performed with BIOS INT13 disk I/O functions (perhaps augmented by realmode device drivers). All network I/O is performed with BIOS INTFB packet transport functions (entirely provided by realmode device drivers). 4.3.4 Program LoaderThe second-stage bootstrap understands two load module formats: EXE and ELF. The .exe support is used primarily to load the Configuration Assistant and realmode device drivers from the boot device. It can also be used to load arbitrary realmode programs (or any DOS program that works under the emulation). The ELF support is not as general. While the kernel and its runtime loader are ELF load modules, and the second-stage bootstrap is capable of loading and transferring control to them, the environment in which they are loaded may not be one in which an arbitrary ELF (even for a standalone program) could run. 4.3.5 Composite File SystemThe "composite file system" provides several valuable features that can be used in combination with any of the other standard file systems. These features, which are all implemented in the second-stage bootstrap, have no analog on Open Firmware machines, but were necessitated by two problems with the x86 architecture:
Most of the features of the composite file system are designed to make it easy to augment the standard release CD with additional files distributed on one or more diskettes. These features include: Path Mapping One problem with storing updated Solaris files on a DOS diskette is the fact that DOS file systems are limited to 8.3 naming (an eight-character name and a three-character suffix, limited to uppercase letters). You cannot, for example, create a file named "name_to_major."File Overlaying To support the delivery of new device drivers on one or more diskettes and to make it appear that they are actually on the CD, the composite file system also has the ability to overlay files from one file system on top of another file system. This is controlled by the same solaris.map mechanism that is used for path mapping.Compressed Files Another problem with diskettes is that they are small. By compressing files, it is possible to deliver many more drivers on a small number of diskettes. Rather than requiring the programs that open and read files to support compression, the composite file system provides a transparent detection and decompression facility, one that can be used on any device or file system.Symbolic Links DOS file systems do not support links (either hard or symbolic). If the same data is needed in multiple places, replicating that data consumes valuable space on the diskette and complicates software maintenance.PCFS Volume/Drive Specifications Dealing with multiple diskettes is required because:A RAM-based Pseudo File System The composite file system also includes a RAM-based pseudo file system, where files can be created, and subsequently opened and read back. There are a few situations where a RAMFS comes in handy:
In using these features, it is important to remember that they are all
implemented in the second-stage bootstrap and are only available to programs
that use the second-stage bootstrap for file access. The Configuration
Assistant uses the second-stage bootstrap (through DOS emulation) to access
files. The newly booted kernel uses the second-stage bootstrap (through
the boot operations) to access files, but only until it quiesces the bootstrap
and takes over the machine. Once this happens, the composite file system
features are no longer in effect.
4.3.6 Boot OperationsAs described in Chapter 2, Open Firmware provides a variety of services for the loaded client software. A basic Solaris kernel uses these services to read configuration files and to load additional drivers and services, until it is complete enough to assume control of the machine. Virtually none of these services are provided by standard PC BIOS. The second-stage bootstrap bridges the gap by providing the loaded kernel with call vectors to access Open Firmware-style services. For more information on Open Firmware, see the Open Firmware home page. To summarize here, the services include:
These entry points are defined (for Solaris) by the include file /usr/include/sys/bootconf.h (to view this file, type file:/usr/include/sys/bootconf.h in your browser's location field). There are a few other PROM diagnostic services that are supposed to continue to be available even after the bootstrap has been quiesced. These entry points are defined (for Solaris) by the include file /usr/include/sys/promif.h (to view this file, type file:/usr/include/sys/promif.h in your browser's location field). In addition to these standard services, there are also a set of specialized x86 services to permit kernel initialization code to directly make BIOS calls (for example, to access EISA configuration data or Power Management services). 4.3.7 DOS EmulationThe Device Configuration Assistant (discussed in the next chapter) needs a variety of services in order to read its configuration files and load realmode drivers. While these services could have been obtained from the boot operations vector (described in the previous section), it was better to write the Configuration Assistant to standard DOS interfaces. The second-stage bootstrap provides an emulation of a large number of INT21 DOS services for loaded EXEs. While this is not intended as a general purpose DOS emulator, it is adequate to run a fair number of interesting programs and debuggers. The supported functions include:
4.4 Standard Booting Scenarios4.4.1 Booting From an Installed DiskIn a normal Solaris bootstrap from an installed disk:
4.4.2 Booting From an Installation CDBecause booting directly from a CD isn't yet available (see Section 4.5.2), a diskette is used to boot from a Solaris installation CD.
4.4.3 Booting Over the NetworkBecause booting directly from a network adapter isn't yet available (see Section 4.5.1), a diskette is used to boot Solaris from a network server.
4.5 Future Booting ScenariosThe mechanisms and scenarios discussed above are all in everyday use for normal Solaris systems. There has also been considerable thought given to how other booting scenarios could be supported:
This section lays out the thinking that has gone into these scenarios, the issues that have been recognized, and how we believe these features will be implemented. 4.5.1 Direct Booting From a Network AdapterMany network adapters are available with RPL, BOOTP, or DHCP boot ROMs. All of these protocols are capable of fetching and loading large programs, making it possible for the ROM to directly load boot.bin (with no first-stage bootstrap required beyond the ROM). This has been implemented (and worked on Solaris 2.1 for x86). The problem is that the second-stage bootstrap needs to have BIOS (or emulated BIOS) support for the root device so that it can load additional components over NFS. Unfortunately, very few network adapter ROMs provide interfaces for packet services. They are capable of loading boot.bin, but without a properly configured driver for the active network adapter, the loaded second-stage bootstrap will be unable to do any further network I/O. Initially we tried binding network adapter drivers into the downloaded second-stage bootstrap. This required the boot servers to know what types of network adapters were on each host and how they were configured, and to assemble an appropriate bootstrap/driver pair on demand. This approach proved complex to develop, administer, and support, and it was ultimately abandoned in favor of the boot diskette-based model described in the previous section. It appears that the emergence of Network Computers, and NetPCs, is producing a new generation of network adapter ROMs that will provide packet services, via a standard BIOS interface, for the loaded client software. Once these are available, it should be relatively straightforward to implement direct network booting without the need for a boot diskette. 4.5.2 Direct Booting From a CDHistorically the boot ROMs on SCSI host bus adapters have refused to attempt to boot from CD-ROM drives. Now most motherboard disk controllers are capable of supporting CD-ROM drives, and all new machines have CD-ROM drives, and most major software is distributed on CDs. BIOS developers have recognized the need to be able to boot directly from a CD, a new standard (El Torito) has been proposed for bootable CDs, and the BIOS on newer disk controllers now recognizes and is willing to boot from one of these devices. We have built El Torito format Solaris CDs, and run through the entire first- and second-stage bootstrap processes. The only problem with booting from an El Torito format CD is that we still need a realmode driver for the associated disk controller (see Chapter 6). The BIOS provides all of the INT13 block I/O services that we need, but it hides the type of the disk controller to which the CD-ROM drive is attached. If we don't know what disk controller the CD-ROM drive is connected to, we cannot put the physical path to that device in the boot-path property, and the Solaris kernel will not be able to directly open that device for its own use. A realmode driver is needed to generate the required physical path. 4.5.3 Fast Booting From a Non-Bootable DeviceEarly in the chapter, we made a distinction between the device from which the first- and second-stage bootstraps were loaded and the device from which the client operating system would be loaded. This section describes how a diskette can be used as the initial boot device, and then how Solaris can be loaded from a non-bootable CD or network interface. Booting through a diskette may be acceptable when a system is to be installed, but it is a very slow and cumbersome process if the system is to be regularly booted from a non-bootable device. The files that are placed on a diskette can (with minimal changes) also be placed on a hard disk partition. The second-stage bootstrap on that partition can be configured (through the bootenv.rc file) to automatically load a specified file from a specified device. The sequence of operations in this case is a combination of the hard disk and diskette booting sequences:
From this point the booting process continues exactly as it does from a diskette, but the boot control files and programs are all read from the boot partition on the hard disk.
| ||||||||||||||||||||||||||||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||