installboot prepares the (physically) first partition on a device for boot-strapping from the TOS-ROM. The bootstrap is written into the bootblock area on the partition, right in front of the disk pack label, and hence limited in size to
LABELOFFSET bytes. A disk pack label should be created (see
disklabel(8)) before installing the bootstrap.
The bootstrap is split into three parts: a small first-stage program that resides in the (physically) first 512 bytes on the device (as specified by Atari Corp.), a second-stage program that immediately follows the first-stage program, and a third-stage program that resides on the root filesystem. The first-stage program is loaded into memory by the ROM. After receiving control, it loads the second-stage program and the disk label. The second-stage boot program uses the stand-alone filesystem code in “libsa.a” to load the third-stage boot program from the root-filesystem on the device. The third-stage boot program then loads the kernel. The prototype code for the first-stage boot program can be found in
/usr/mdec/std/fdboot (floppy disk code),
/usr/mdec/std/sdboot (SCSI disk code) and
/usr/mdec/std/wdboot (IDE disk code). The second-stage boot program is stored in
/usr/mdec/std/bootxx. and the third-stage boot program is stored in
/usr/mdec/std/boot.atari. The boot code for Milan machines is different from the other machines and the files for the Milan can be found in the directory
/usr/mdec/milan. Note that the Milan uses the SCSI disk code for both SCSI and IDE disks.
For backwards compatibility with the vendor specific AHDI disk label, a special first-stage boot program is provided in
/usr/mdec/std/xxboot.ahdi. Together with the general second-stage boot program, it is installed in the AHDI partition where the
NetBSD disk label lives. Furthermore, the AHDI specifications require an additional bootstrap, which is written into the AHDI root sector (disk block zero). The prototype code for this AHDI compliant bootstrap can be found in
/usr/mdec/std/sdb00t.ahdi and
/usr/mdec/std/wdb00t.ahdi, or the equivalents in
/usr/mdec/milan.
Perform the following steps to make a file system bootable:
1.
Copy the secondary bootstrap (either /usr/mdec/std/boot.atari or /usr/mdec/milan/boot.atari) to the root directory of the target file system.
2.
Use installboot to install the primary and secondary bootstrap programs (from /usr/mdec/std or /usr/mdec/milan) into the filesystem.
The options are as follows:
-N
Do not actually write anything on the disk.
-t
Number of tracks per cylinder (IDE disk).
-u
Number of sectors per track (IDE disk).
The arguments are:
device
The name of the device on which the bootstrap is to be installed.