NAME
|
9load, 9pxeload, ld – PC bootstrap program |
SYNOPSIS
|
(Under MS–DOS) [drive:][path]ld [ 9load ] |
DESCRIPTION
|
9load and ld are programs that reside in a FAT file system and
bootstrap Plan 9. 9load loads the kernel, but it cannot be run
from DOS; use ld to bootstrap (by starting 9load) if DOS is running.
9load is run automatically by the boot procedures described below;
it cannot be run directly by hand. 9pxeload is a version of
9load that can be booted using the PXE download found in some
ethernet card BIOSes. There are three bootstrap sequences: – BIOS, MBR, disk partition PBS, 9load, kernel – BIOS, floppy PBS, 9load, kernel – BIOS, MBR, DOS, ld, 9load, kernel. Details follow. 9load is a bootstrap program that loads and starts a program, typically the kernel, on a PC. It is run by the PC partition boot sector program (PBS), which usually resides in the first sector of the active partition. A copy of the Plan 9 PBS is kept in /386/pbs, but due to the ``cylinder–head–sector'' (CHS) addressing mode of old BIOSes, it can only operate up to 8.5GB into the disk. Plan 9 partitions further into the disk can only be booted using /386/pbslba, and then only if the machine's BIOS supports linear block addressing (LBA) mode for disk transfers. When booting from floppy or hard disk, the BIOS loads the first sector of the medium at location 0x7C00. In the case of a floppy, this is the PBS. In the case of a hard 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 considerations. 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. Thus the default sequence is: BIOS, MBR, PBS, 9load, kernel. Because it contains many device drivers for different disks and networks, 9load is larger than 64K and cannot be run as a DOS ``.com'' executable. A stripped–down version that knows about disks but not networks, called ld (really ld.com), fits in 64K and can be used under DOS to load and start a program (default 9load) from the FAT16 partition. Its command line argument is of the same format as the bootfile specifiers described below. This profusion of loaders is unfortunate, but at least ld and 9load are compiled from the same source. 9load begins execution at virtual address 0x80010000 (64K) and loads the bootfile at the entry address specified by the header, usually virtual 0xF0100020. After loading, control is passed to the entry location.
In summary, Plan 9 can be booted on a PC three different ways:
either by booting MS–DOS and using ld to start 9load in the appropriate
directory, by booting directly from a Plan 9 boot floppy or disk
partition prepared using format to install the appropriate files
and bootstrap sectors (see prep(8)), or by using a PXE
capable BIOS to boot 9pxeload directly over the ethernet. Bootfile
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
Kernel loading 9pxeload differs slightly in operation from 9load. It is initially loaded by the PXE BIOS at physical address 0x7C00. Only devices which can be automatically configured, e.g. most PCI ethernet adapters, will be recognised. If the file /cfg/pxe/XXXXXXXXXXXX can be located via a DHCP server, where XXXXXXXXXXXX is the MAC address of a recognised ethernet adapter, the contents are obtained and used as a plan9.ini.
Next, in order to find configuration information, 9load searches
all units on devices fd and sdCn, in that order, for a file called
plan9\plan9.ini or plan9.ini (see plan9.ini(8)) on a 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. Some options
in plan9.ini are used by 9load:
When the search for plan9.ini is done, 9load proceeds to determine
which bootfile to load. If there was no bootfile option, 9load
chooses a default from the following prioritized device list:
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. Other facilities and caveats A control–P character typed at any time on the console causes 9load to perform a hardware reset (Ctrl–Alt–Del can also be used on a PC keyboard).
When loaded from a PBS (rather than from ld.com), 9load must be
contiguously allocated on the disk. See dossrv(4) for information
on ensuring this. |
FILES
|
[drive:][path]9load [drive:][path]ld FAT–filesystem:\plan9\plan9.ini FAT–filesystem:\plan9.ini |
SOURCE
|
/sys/src/boot/pc |
SEE ALSO
|
plan9.ini(8), prep(8) |
BUGS
|
Much of the work done by 9load is duplicated by the loaded kernel.
If ld detects an installed MS–DOS Extended Memory Manager, it attempts to de–install it, but the technique used may not always work. It is safer not to install the Extended Memory Manager before running ld.
The way 9pxeload obtains the information normally found in a disc
plan9.ini file, and thereby the kernel to load and boot, is not
ideal and may change in the future. |