boot, bootrc – connect to the root file server|
Boot is the first program run after a kernel has been loaded.
It mounts bootfs.paq, a compressed filesystem contained in root(3),
sets up the rc(1) environment and executes bootrc passing on its
arguments. Bootrc connects to the file server that will serve
the root, performs any authentication needed to connect to
that server, and executes the init(8) program. Both boot and bootrc
are started by the kernel, never run directly by the user. See
booting(8) for information about the process of loading the kernel
(and boot) into memory. |
Once loaded, the kernel initializes its data structures and devices. It sets the two environment variables /env/cputype and /env/terminal to describe the processor. It then binds a place–holder file server, root(3), onto / and crafts an initial process whose sole function is to exec(2) /boot/boot, a binary which is compiled into root(3).
The command line passed depends on the information passed from boot ROM to kernel. Machines that boot directly from ROM (that is, most machines other than PCs) pass the boot line given to the ROM directly to boot.
On the PC, each line in the file plan9.ini(8) of the form name=value is passed to the boot program as an environment variable with the same name and value.
After boot passed its execution to bootrc, it must determine the fileserver to use and a method with which to connect to it. Typically device will name a local disk partition or ethernet interface. The complete list of methods is given below.
Bootrc must also set a user name to be used as the owner of devices and all console processes and an encryption key to be used when challenged. Bootrc will prompt for these.
Method and device are prompted for first. The prompt lists all
valid methods, with the default in brackets, for example:
The other interactions depend on whether the system is a terminal
or a CPU server.
If the bootfs.paq has been built with the cache file system, cfs(4),
the local disk partition /dev/sdXX/cache (where XX is a unit specifier)
exists, and the root file system is from a remote server, then
bootrc will insert a user level cache process between the remote
server and the local namespace that caches all
remote accesses on the local partition.
Once connected, boot behaves as on the terminal except for exec(2)'ing
On PCs, the default arguments to boot are constructed using the
bootargs variable in plan9.ini(8). |
Start cwfs(4) in config mode:
root(3), dhcpd(8), init(8)|
The use of bootargs in general is odd.|
Boot first appeared in Plan 9 from Bell Labs. It was rewritten
in rc for 9front (April, 2011).|