Copyright (c) 1996 The NetBSD Foundation, Inc.
All rights reserved.
This code is derived from software contributed to The NetBSD Foundation
by Paul Kranenburg.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
.Dd February 17, 2017 .Dt INSTALLBOOT 8 atari .Os .Sh NAME .Nm installboot .Nd install a bootstrap on an FFS filesystem partition .Sh SYNOPSIS .Nm /usr/mdec/installboot .Op Fl Nmtuv .Ar device .Sh DESCRIPTION .Nm prepares the
q 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 .Dv LABELOFFSET bytes. A disk pack label should be created
o see .Xr disklabel 8
c before installing the bootstrap.
p The bootstrap is split into three parts: a small first-stage program that resides in the
q physically first 512 bytes on the device
q 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 .Dq 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
q floppy disk code ,
q SCSI disk code and
q IDE disk code . The second-stage boot program is stored in
a /usr/mdec/std/bootxx . and the third-stage boot program is stored in
a /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
a /usr/mdec/milan . Note that the Milan uses the SCSI disk code for both SCSI and IDE disks.
p For backwards compatibility with the vendor specific AHDI disk label, a special first-stage boot program is provided in
a /usr/mdec/std/xxboot.ahdi . Together with the general second-stage boot program, it is installed in the AHDI partition where the .Nx disk label lives. Furthermore, the AHDI specifications require an additional bootstrap, which is written into the AHDI root sector
q disk block zero . The prototype code for this AHDI compliant bootstrap can be found in
a /usr/mdec/std/sdb00t.ahdi and
a /usr/mdec/std/wdb00t.ahdi , or the equivalents in
p Perform the following steps to make a file system bootable: l -enum t Copy the secondary bootstrap (either
a /usr/mdec/std/boot.atari or
a /usr/mdec/milan/boot.atari ) to the root directory of the target file system. t Use .Nm to install the primary and secondary bootstrap programs (from
a /usr/mdec/milan ) into the .Ar filesystem . .El
p The options are as follows: l -tag -width flag t Fl N Do not actually write anything on the disk. t Fl m Use Milan boot code. t Fl t Number of tracks per cylinder (IDE disk). t Fl u Number of sectors per track (IDE disk). t Fl v Verbose mode. .El
p The arguments are: l -tag -width device t Ar device The name of the device on which the bootstrap is to be installed. .El .Sh EXAMPLES The following command will install the first-stage and second-stage boot programs in the bootblock area on .Dq sd0c : d -literal -offset indent installboot sd0 .Ed .Sh SEE ALSO .Xr atari/bootpref 8 , .Xr disklabel 8 .Sh HISTORY The .Nm command first appeared in .Nx 1.1 .Sh BUGS .Nm knows too much about kernel internal details, forcing it to check the running kernel's release and revision.
p Because neither the floppy disk driver nor .Xr disklabel 8 are capable of creating a disk pack label on a floppy disk, .Nm has to create a fictitious label, that is not used by the kernel.
p Except for installation of the bootcode on floppy, .Nm automatically sets the boot preference in NVRAM to .Nx .