2 |
- |
1 |
This is a specialised pc kernel that acts as a bootstrap loader for
|
|
|
2 |
386 and amd64 kernels, and replaces the old 9pxeload, 9load and
|
|
|
3 |
9loadusb. It relies on the pc port (in /sys/src/9/pc) for most of its
|
|
|
4 |
non-portable source files, notably the disk and ethernet drivers, so
|
|
|
5 |
you'll want an up-to-date system (see replica/pull) if installing this
|
|
|
6 |
by hand. Support for user mode (such as system calls) is almost
|
|
|
7 |
entirely absent. There is some duplication of code with the pc
|
|
|
8 |
kernel, but we have tried to keep it to a minimum.
|
|
|
9 |
|
|
|
10 |
Caveats:
|
|
|
11 |
|
|
|
12 |
9boot doesn't scan disks for partition tables since it doesn't contain
|
|
|
13 |
the disk drivers, but `readparts=' in plan9.ini (see
|
|
|
14 |
/sys/src/9/boot/parts.c) will make the loaded kernel read them early
|
|
|
15 |
on. 9load does read partition tables.
|
|
|
16 |
|
|
|
17 |
9loadusb seems to hang for two minutes when attempting to read via the
|
|
|
18 |
bios on some bioses (e.g., vmware's), then reports a disk timeout on
|
|
|
19 |
the INT 13 extended read operation.
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
How these new bootstraps differ from the old 9load and 9pxeload.
|
|
|
23 |
|
|
|
24 |
The old 9load was a single process derived from (but separately
|
|
|
25 |
evolved from) an old PC kernel, so it needed modified device drivers
|
|
|
26 |
(primarily for ethernet and disk controllers), which was an ongoing
|
|
|
27 |
maintenance nuisance, and not all ethernet controllers had bootstrap
|
|
|
28 |
drivers. The new bootstraps are just specialised Plan 9 kernels that
|
|
|
29 |
are loaded into the first 640KB of RAM, so they use unmodified Plan 9
|
|
|
30 |
drivers. There isn't enough room below 512K to include useful support
|
|
|
31 |
for user mode and system calls, but the new bootstraps do implement
|
|
|
32 |
kernel processes. The 512K limit is imposed by PXE or PBS loading of
|
|
|
33 |
the new bootstraps into the first 512K or 640K.
|
|
|
34 |
|
|
|
35 |
The old 9load was capable of loading from disks, floppies, USB disks
|
|
|
36 |
or ethernet (via PXE). Again due to space limitations, we've had to
|
|
|
37 |
focus the new bootstraps more sharply. 9boot loads via PXE and
|
|
|
38 |
nothing else, which is our usual mode of operation. 9load loads from
|
|
|
39 |
non-USB disks (using BIOS INT 13 calls) but not floppies, which ought
|
|
|
40 |
to be obsolete by now. If you must boot from floppy and are doing so
|
|
|
41 |
now and your BIOS won't boot from USB, do this to arrange to boot from
|
|
|
42 |
USB disk instead:
|
|
|
43 |
|
|
|
44 |
a: && cp /386/9loadusb /n/a:/9load
|
|
|
45 |
|
|
|
46 |
9loadusb loads from USB disks only. BIOSes seem to be easily confused
|
|
|
47 |
by intermixing direct I/O and BIOS calls, thus we keep 9load and
|
|
|
48 |
9loadusb distinct.
|
|
|
49 |
|
|
|
50 |
The new bootstraps can load amd64 as well as 386 kernels, and generate
|
|
|
51 |
Gnu Multiboot tables for their benefit.
|
|
|
52 |
|
|
|
53 |
The new 9load will look on all available disks for FAT file systems.
|
|
|
54 |
If no bootfile is specified in a plan9.ini, it will examine each file
|
|
|
55 |
system to see if it contains a single Plan 9 kernel (9pc* or 9k8*),
|
|
|
56 |
and if so, will boot it.
|
|
|
57 |
|
|
|
58 |
The new 9boot contains no disk drivers, so it can't read partition
|
|
|
59 |
tables and populate #ec/sd??part for the kernel's benefit, so if you
|
|
|
60 |
need to access a disk partition early in the kernel's execution (e.g.,
|
|
|
61 |
you have an nvram partition), you'll want to add
|
|
|
62 |
|
|
|
63 |
readparts=
|
|
|
64 |
|
|
|
65 |
to the /cfg/pxe file for any such machines.
|
|
|
66 |
|
|
|
67 |
The new bootstraps should run on more machines than the old ones. We
|
|
|
68 |
discovered new ways to enable the A20 address line and try them all
|
|
|
69 |
until success. This may fix various odd memory corruption problems
|
|
|
70 |
seen in the past. We also discovered that BIOS calls may enable
|
|
|
71 |
interrupts, so we disable them again immediately upon return. This
|
|
|
72 |
may prevent mysterious resets seen with the old bootstraps.
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
CD booting changes
|
|
|
76 |
|
|
|
77 |
pbsraw can be up to 2k, so we can print and be nice, uses things
|
|
|
78 |
written up by mk9660. In any case, it reads a contiguous file and is
|
|
|
79 |
468 bytes long (we dropped the 9fat support here), so it could be used
|
|
|
80 |
to load from any raw partition supporting lba access.
|
|
|
81 |
|
|
|
82 |
There are corresponding changes to mk9660 to annotate the PBS. A new
|
|
|
83 |
parameter, -x loader, names a loader that has to be in the root
|
|
|
84 |
directory. In conjuction with -B, can be used to boot directly from
|
|
|
85 |
the CD.
|
|
|
86 |
|
|
|
87 |
9load was changed to deal with a 9fat image file in the root directory
|
|
|
88 |
of a CD image. It has to be called bootdisk.img and can be of any
|
|
|
89 |
size (as long as it is contiguous).
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
Memory Map
|
|
|
93 |
|
|
|
94 |
This is how the bootstraps use memory:
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
31K ---------------------
|
|
|
99 |
start of pxe decomp + compressed 9boot
|
|
|
100 |
64K ---------------------
|
|
|
101 |
start of pbs decomp + compressed 9boot
|
|
|
102 |
decompresses to 9MB
|
|
|
103 |
...
|
|
|
104 |
512K ---------------------
|
|
|
105 |
pxe loader from ROM
|
|
|
106 |
640K ---------------------
|
|
|
107 |
UMB
|
|
|
108 |
1MB ---------------------
|
|
|
109 |
kernel
|
|
|
110 |
9MB ---------------------
|
|
|
111 |
9boot after decomp.
|
|
|
112 |
decompresses kernel.gz
|
|
|
113 |
from 13MB to 1MB.
|
|
|
114 |
13MB ---------------------
|
|
|
115 |
(kernel.gz)
|
|
|
116 |
15MB ---------------------
|
|
|
117 |
no-man's land
|
|
|
118 |
16MB ---------------------
|
|
|
119 |
malloc arena for 9boot
|
|
|
120 |
...
|
|
|
121 |
|
|
|
122 |
chinese puzzle constraints:
|
|
|
123 |
BIOS calls only work from bottom 1MB (640K, really).
|
|
|
124 |
with paging on, we need to have created page tables for the memory we use.
|
|
|
125 |
a20 has to be enabled before we try to use memory above 1MB.
|