1.\" $NetBSD: installboot.8,v 1.12 2004/03/09 20:29:05 wiz Exp $ 2.\" 3.\" Copyright (c) 1996 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Paul Kranenburg. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. All advertising materials mentioning features or use of this software 18.\" must display the following acknowledgement: 19.\" This product includes software developed by the NetBSD 20.\" Foundation, Inc. and its contributors. 21.\" 4. Neither the name of The NetBSD Foundation nor the names of its 22.\" contributors may be used to endorse or promote products derived 23.\" from this software without specific prior written permission. 24.\" 25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35.\" POSSIBILITY OF SUCH DAMAGE. 36.\" 37.Dd March 9, 2004 38.Dt INSTALLBOOT 8 atari 39.Os 40.Sh NAME 41.Nm installboot 42.Nd install a bootstrap on an FFS filesystem partition 43.Sh SYNOPSIS 44.Nm /usr/mdec/installboot 45.Op Fl Nmtuv 46.Ar device 47.Sh DESCRIPTION 48.Nm 49prepares the 50.Pq physically 51first partition on a device for boot-strapping from the TOS-ROM. 52The bootstrap is written into the bootblock area on the partition, right 53in front of the disk pack label, and hence limited in size to 54.Dv LABELOFFSET 55bytes. 56A disk pack label should be created 57.Po 58see 59.Xr disklabel 8 60.Pc 61before installing the bootstrap. 62.Pp 63The bootstrap is split into three parts: a small first-stage program 64that resides in the 65.Pq physically 66first 512 bytes on the device 67.Pq as specified by Atari Corp. , 68a second-stage program that immediately follows the first-stage 69program, and a third-stage program that resides on the root filesystem. 70The first-stage program is loaded into memory by the ROM. 71After receiving control, it loads the second-stage program and the 72disk label. 73The second-stage boot program uses the stand-alone 74filesystem code in 75.Dq libsa.a 76to load the third-stage boot program from the root-filesystem on the device. 77The third-stage boot program then loads the kernel. 78The prototype code for the first-stage boot program can be found in 79.Pa /usr/mdec/std/fdboot 80.Pq floppy disk code , 81.Pa /usr/mdec/std/sdboot 82.Pq SCSI disk code 83and 84.Pa /usr/mdec/std/wdboot 85.Pq IDE disk code . 86The second-stage boot program is stored in 87.Pa /usr/mdec/std/bootxx . 88and the third-stage boot program is stored in 89.Pa /usr/mdec/std/boot.atari . 90The boot code for Milan machines is different from the other machines and 91the files for the Milan can be found in the directory 92.Pa /usr/mdec/milan . 93Note that the Milan uses the SCSI disk code for both SCSI and IDE disks. 94.Pp 95For backwards compatibility with the vendor specific AHDI disk 96label, a\ special first-stage boot program is provided in 97.Pa /usr/mdec/std/xxboot.ahdi . 98Together with the general second-stage boot program, it is installed 99in the AHDI partition where the 100.Nx 101disk label lives. 102Furthermore, 103the AHDI specifications require an additional bootstrap, which is 104written into the AHDI root sector 105.Pq disk block zero . 106The prototype code for this AHDI compliant bootstrap can be found in 107.Pa /usr/mdec/std/sdb00t.ahdi 108and 109.Pa /usr/mdec/std/wdb00t.ahdi , 110or the equivalents in 111.Pa /usr/mdec/milan . 112.Pp 113Perform the following steps to make a file system bootable: 114.Bl -enum 115.It 116Copy the secondary bootstrap (either 117.Pa /usr/mdec/std/boot.atari 118or 119.Pa /usr/mdec/milan/boot.atari ) 120to the root directory of the target file system. 121.It 122Use 123.Nm 124to install the primary and secondary bootstrap programs 125(from 126.Pa /usr/mdec/std 127or 128.Pa /usr/mdec/milan ) 129into the 130.Ar filesystem . 131.El 132.Pp 133The options are as follows: 134.Bl -tag -width flag 135.It Fl N 136Do not actually write anything on the disk. 137.It Fl m 138Use Milan boot code. 139.It Fl t 140Number of tracks per cylinder (IDE disk). 141.It Fl u 142Number of sectors per track (IDE disk). 143.It Fl v 144Verbose mode. 145.El 146.Pp 147The arguments are: 148.Bl -tag -width device 149.It Ar device 150The name of the device on which the bootstrap is to be installed. 151.El 152.Sh EXAMPLES 153The following command will install the first-stage and second-stage 154boot programs in the bootblock area on 155.Dq sd0c : 156.Bd -literal -offset indent 157installboot sd0 158.Ed 159.Sh SEE ALSO 160.Xr bootpref 8 , 161.Xr disklabel 8 162.Sh HISTORY 163The 164.Nm 165command first appeared in 166.Nx 1.1 167.Sh BUGS 168.Nm 169knows too much about kernel internal details, forcing it to 170check the running kernel's release and revision. 171.Pp 172Because neither the floppy disk driver nor 173.Xr disklabel 8 174are capable of creating a disk pack label on a floppy disk, 175.Nm 176has to create a\ fictitious label, that is not used by the kernel. 177.Pp 178Except for installation of the bootcode on floppy, 179.Nm 180automatically sets the boot preference in NVRAM to 181.Nx . 182