9bootpbs , 9load and 9loadusb are less-commonly-used variants that reside in a FAT file system under the name .L 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:
BIOS, floppy PBS,
.IR 9load ,
kernel
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
or boot floppy
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 : .TF bootfile=manual
console
baud Specifies the console device and baud rate if not a display.
ether n Ethernet interfaces. These can be used to load the bootfile over a network.
bootfile= bootfile Specifies the bootfile .
bootfile=auto Default.
bootfile=local Like auto , but do not attempt to load over the network. ..
bootfile=manual After determining which devices are available for loading from, enter prompt mode.
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
.BR fd
and
sd?[0-9]* (all
sd devices),
for a file called
.B plan9\eplan9.ini
or
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 device s 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 .L Boot .L from: prompt.
The format of the bootfile name is device ! file or device ! partition ! file\f1. If ! file is omitted, the default for the particular device is used. Supported devices are .TF \fLethern
ether n Ethernet, 9boot only. N specifies the Ethernet device number. If a partition is specified, it is taken to be the name of a host machine from which to load the kernel.
sd Cn Normal disk,
9load only.
The device name format is described in
sd (3). A
partition must be given and must normally
name a partition containing a FAT file system.
The name
.B dos
refers to the first DOS partition on a given device.
It is common for Plan 9 partitions to contain a small
FAT file system for configuration.
By convention, this partition is called
9fat . There is no default partition,
but if
file is omitted,
9load will load a kernel directly from the named partition
without any interpretation of a file system.
.
fd n An MS-DOS floppy disk, 9load only. N specifies the floppy drive, either 0 or 1. The bootfile is the contents of the MS-DOS file . There is no default file. For compatibility with normal disks, a partition may be given, but only dos is recognized: fd0!dos! file\f1. .. .
bios n USB or other BIOS device, 9loadusb only. 9load loads from a FAT file system on the first LBA device in the BIOS's list of devices to try to boot from, using the BIOS INT 13 calls also used by pbslba . It does not understand any form of partition table; see the EXAMPLES in prep (8) for how to format such a device.
sdB n USB or other BIOS device's partition, 9loadusb only. A special case of sd Cn that uses bios n to read from a FAT file system.
When booting from disk,
or floppy,
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).
In the case of a floppy, this is the PBS.
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.
/386 these programs reside here
/cfg/pxe directory of configuration ( plan9.ini ) files on your TFTP server
"FAT-filesystem" :\e9load
"FAT-filesystem" :\eplan9.ini .br
.IB "FAT-filesystem" :\eplan9\eplan9.ini
0
/sys/src/boot/pc first-stage disk boot sectors (MBR, PBS)
/sys/src/9/pcboot PC-bootstrap-specific source
/sys/src/9/^(pc port ip) common kernel source
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).