9srv Manual Collection/plan9/9boot(8) | 9srv Manual Collection/plan9/9boot(8) |
---|
9bootpbs, 9load and 9loadusb are less-commonly-used variants that reside in a FAT file system under the name 9load and bootstrap Plan 9. 9bootpbs is like 9boot but it can be started by a partition boot sector (PBS), as can 9load and 9loadusb. It is intended to PXE boot older machines without working PXE ROMs. 9load and 9loadusb read FAT file systems. 9loadusb will use only the BIOS's device drivers, and thus can load from FAT file systems on USB devices. In contrast, 9load will not use BIOS device drivers and cannot read USB devices.
This profusion of loaders is unfortunate, but at least they are compiled from the same source. The division into separate programs is dictated by the need to fit within the first 640K of memory and the need to avoid intermixing BIOS and non-BIOS disk access.
These programs are run automatically by the boot procedures described below; they cannot be run directly by hand. There are two bootstrap sequences:
In summary, Plan 9 is usually booted on a PC by using a PXE-capable BIOS to boot 9boot directly over the ethernet. File servers that must be able to boot when other machines are down boot directly from a Plan 9 disk partition prepared using format to install the appropriate files and bootstrap sectors (see prep(8)).
Details follow.
Some options in plan9.ini are used by 9boot:
9load is a similar bootstrap program, loaded by the PC partition boot sector program (PBS), which usually resides in the first sector of the active disk partition. It is initially loaded at physical address 0x10000(64K); it begins execution at virtual address 0x80010000. In order to find configuration information, 9load searches all units on devices sd?[0-9]* (all sd devices), for a file called plan9.ini (see plan9.ini(8)) on a FAT partition named dos or 9fat. If one is found, searching stops and the file is read into memory at physical address 0x1200 where it can be found later by any loaded bootfile.
When the search for plan9.ini is done, 9load proceeds to determine which bootfile to load. If there was no bootfile option, 9load searches sd?[0-9]* FAT partitions for a kernel (any file named 9pc*, 9k8* or 9k10*) and if it finds exactly one kernel in a given FAT partition, chooses it. 9load then attempts to load the bootfile. unless the bootfile=manual option was given, in which case prompt mode is entered immediately. If the default device is fd, 9load will prompt the user for input before proceeding with the default bootfile load after 5 seconds; this prompt is omitted if a bootfile option was given.
9load
prints the list of available
devices
and
enters prompt mode on encountering any error
or if directed to do so by a
bootfile=manual
option.
In prompt mode, the user is required to type
a
bootfile
in response to the
Boot
from:
prompt.
The format of the bootfile name is device!file or device!partition!file. If !file is omitted, the default for the particular device is used. Supported devices are
When booting from disk,
the BIOS loads the
first sector of the medium at location
0x7C00.
In the case of a disk, it is the master boot record (MBR).
The MBR copies itself to address
0x600,
finds the active partition and loads its PBS at address
0x7C00.
A copy of the Plan 9 MBR is kept in
/386/mbr;
some commercial MBRs cannot read sectors
past 2GB.
The Plan 9 MBR can read sectors up to 8.5GB into
the disk, and further if the BIOS supports LBA.
The single file
/386/mbr
detects whether the BIOS supports LBA and
acts appropriately, defaulting to CHS mode
when LBA is not present.
The PBSs cannot do this due to code size limitations.
The Plan 9 MBR is suitable for booting non-Plan-9
operating systems,
and (modulo the large disk constraints just described)
non-Plan-9 MBRs are suitable for booting Plan 9.
A control-P character typed at any time on the console causes 9boot to perform a hardware reset (Ctrl-Alt-Del can also be used on a PC keyboard).
9load must be contiguously allocated on the disk. See dossrv(4) for information on ensuring this.
FAT-filesystem:\9load
FAT-filesystem:\plan9.ini
bios and sdB usually only work on the first LBA device in the BIOS's list of boot devices, if they work at all.
USB keyboards will only work with 9boot if the BIOS emulates a PS/2 keyboard (and that is enabled).
9srv Manual Collection/plan9/9boot(8) | Rev: Wed Sep 04 06:17:33 BST 2013 |