1*3af2acdcSchristos.\" $NetBSD: installboot.8,v 1.14 2017/02/17 22:30:28 christos Exp $ 2e8fb96d0Sleo.\" 3e8b50101Spk.\" Copyright (c) 1996 The NetBSD Foundation, Inc. 4e8fb96d0Sleo.\" All rights reserved. 5e8fb96d0Sleo.\" 6e8b50101Spk.\" This code is derived from software contributed to The NetBSD Foundation 7e8b50101Spk.\" by Paul Kranenburg. 8e8b50101Spk.\" 9e8fb96d0Sleo.\" Redistribution and use in source and binary forms, with or without 10e8fb96d0Sleo.\" modification, are permitted provided that the following conditions 11e8fb96d0Sleo.\" are met: 12e8fb96d0Sleo.\" 1. Redistributions of source code must retain the above copyright 13e8fb96d0Sleo.\" notice, this list of conditions and the following disclaimer. 14e8fb96d0Sleo.\" 2. Redistributions in binary form must reproduce the above copyright 15e8fb96d0Sleo.\" notice, this list of conditions and the following disclaimer in the 16e8fb96d0Sleo.\" documentation and/or other materials provided with the distribution. 17e8fb96d0Sleo.\" 18e8b50101Spk.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19e8b50101Spk.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20e8b50101Spk.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21e8b50101Spk.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22e8b50101Spk.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23e8b50101Spk.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24e8b50101Spk.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25e8b50101Spk.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26e8b50101Spk.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27e8b50101Spk.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28e8b50101Spk.\" POSSIBILITY OF SUCH DAMAGE. 29e8fb96d0Sleo.\" 30*3af2acdcSchristos.Dd February 17, 2017 31ea043b4bSwiz.Dt INSTALLBOOT 8 atari 32e8fb96d0Sleo.Os 33e8fb96d0Sleo.Sh NAME 34e8fb96d0Sleo.Nm installboot 35e8fb96d0Sleo.Nd install a bootstrap on an FFS filesystem partition 36e8fb96d0Sleo.Sh SYNOPSIS 37675aa2fdSperry.Nm /usr/mdec/installboot 384f556b54Sjdc.Op Fl Nmtuv 39e8fb96d0Sleo.Ar device 40e8fb96d0Sleo.Sh DESCRIPTION 41ea043b4bSwiz.Nm 42e8fb96d0Sleoprepares the 43e8fb96d0Sleo.Pq physically 444f556b54Sjdcfirst partition on a device for boot-strapping from the TOS-ROM. 454f556b54SjdcThe bootstrap is written into the bootblock area on the partition, right 46e8fb96d0Sleoin front of the disk pack label, and hence limited in size to 474f556b54Sjdc.Dv LABELOFFSET 48d42596d1Swizbytes. 49d42596d1SwizA disk pack label should be created 50e8fb96d0Sleo.Po 51e8fb96d0Sleosee 52e8fb96d0Sleo.Xr disklabel 8 53e8fb96d0Sleo.Pc 54e8fb96d0Sleobefore installing the bootstrap. 55e8fb96d0Sleo.Pp 564f556b54SjdcThe bootstrap is split into three parts: a small first-stage program 57e8fb96d0Sleothat resides in the 58e8fb96d0Sleo.Pq physically 59e8fb96d0Sleofirst 512 bytes on the device 60e8fb96d0Sleo.Pq as specified by Atari Corp. , 614f556b54Sjdca second-stage program that immediately follows the first-stage 624f556b54Sjdcprogram, and a third-stage program that resides on the root filesystem. 634f556b54SjdcThe first-stage program is loaded into memory by the ROM. 64e8fb96d0SleoAfter receiving control, it loads the second-stage program and the 654f556b54Sjdcdisk label. 664f556b54SjdcThe second-stage boot program uses the stand-alone 67e8fb96d0Sleofilesystem code in 68e8fb96d0Sleo.Dq libsa.a 694f556b54Sjdcto load the third-stage boot program from the root-filesystem on the device. 704f556b54SjdcThe third-stage boot program then loads the kernel. 714f556b54SjdcThe prototype code for the first-stage boot program can be found in 724f556b54Sjdc.Pa /usr/mdec/std/fdboot 73e8fb96d0Sleo.Pq floppy disk code , 744f556b54Sjdc.Pa /usr/mdec/std/sdboot 75e8fb96d0Sleo.Pq SCSI disk code 76e8fb96d0Sleoand 774f556b54Sjdc.Pa /usr/mdec/std/wdboot 78e8fb96d0Sleo.Pq IDE disk code . 79e8fb96d0SleoThe second-stage boot program is stored in 804f556b54Sjdc.Pa /usr/mdec/std/bootxx . 814f556b54Sjdcand the third-stage boot program is stored in 824f556b54Sjdc.Pa /usr/mdec/std/boot.atari . 834f556b54SjdcThe boot code for Milan machines is different from the other machines and 844f556b54Sjdcthe files for the Milan can be found in the directory 854f556b54Sjdc.Pa /usr/mdec/milan . 864f556b54SjdcNote that the Milan uses the SCSI disk code for both SCSI and IDE disks. 87e8fb96d0Sleo.Pp 88e8fb96d0SleoFor backwards compatibility with the vendor specific AHDI disk 89e8fb96d0Sleolabel, a\ special first-stage boot program is provided in 904f556b54Sjdc.Pa /usr/mdec/std/xxboot.ahdi . 91e8fb96d0SleoTogether with the general second-stage boot program, it is installed 92e07a535fSleoin the AHDI partition where the 9334a98169Sperry.Nx 944f556b54Sjdcdisk label lives. 954f556b54SjdcFurthermore, 96e8fb96d0Sleothe AHDI specifications require an additional bootstrap, which is 97e8fb96d0Sleowritten into the AHDI root sector 98e8fb96d0Sleo.Pq disk block zero . 99e8fb96d0SleoThe prototype code for this AHDI compliant bootstrap can be found in 1004f556b54Sjdc.Pa /usr/mdec/std/sdb00t.ahdi 101e8fb96d0Sleoand 1024f556b54Sjdc.Pa /usr/mdec/std/wdb00t.ahdi , 1034f556b54Sjdcor the equivalents in 1044f556b54Sjdc.Pa /usr/mdec/milan . 1054f556b54Sjdc.Pp 1064f556b54SjdcPerform the following steps to make a file system bootable: 1074f556b54Sjdc.Bl -enum 1084f556b54Sjdc.It 1094f556b54SjdcCopy the secondary bootstrap (either 1104f556b54Sjdc.Pa /usr/mdec/std/boot.atari 1114f556b54Sjdcor 1124f556b54Sjdc.Pa /usr/mdec/milan/boot.atari ) 1134f556b54Sjdcto the root directory of the target file system. 1144f556b54Sjdc.It 1154f556b54SjdcUse 1164f556b54Sjdc.Nm 1174f556b54Sjdcto install the primary and secondary bootstrap programs 1184f556b54Sjdc(from 1194f556b54Sjdc.Pa /usr/mdec/std 1204f556b54Sjdcor 1214f556b54Sjdc.Pa /usr/mdec/milan ) 1224f556b54Sjdcinto the 1234f556b54Sjdc.Ar filesystem . 1244f556b54Sjdc.El 125e8fb96d0Sleo.Pp 126e8fb96d0SleoThe options are as follows: 127e8fb96d0Sleo.Bl -tag -width flag 128e8fb96d0Sleo.It Fl N 129e8fb96d0SleoDo not actually write anything on the disk. 1304f556b54Sjdc.It Fl m 1314f556b54SjdcUse Milan boot code. 132e8fb96d0Sleo.It Fl t 133e8fb96d0SleoNumber of tracks per cylinder (IDE disk). 134e8fb96d0Sleo.It Fl u 135e8fb96d0SleoNumber of sectors per track (IDE disk). 136e8fb96d0Sleo.It Fl v 137e8fb96d0SleoVerbose mode. 138e8fb96d0Sleo.El 139e8fb96d0Sleo.Pp 140e8fb96d0SleoThe arguments are: 141e8fb96d0Sleo.Bl -tag -width device 142e8fb96d0Sleo.It Ar device 143e8fb96d0SleoThe name of the device on which the bootstrap is to be installed. 144e8fb96d0Sleo.El 145e8fb96d0Sleo.Sh EXAMPLES 146e8fb96d0SleoThe following command will install the first-stage and second-stage 147e8fb96d0Sleoboot programs in the bootblock area on 148e8fb96d0Sleo.Dq sd0c : 149e8fb96d0Sleo.Bd -literal -offset indent 150e8fb96d0Sleoinstallboot sd0 151e8fb96d0Sleo.Ed 152e5275bd1Swiz.Sh SEE ALSO 153*3af2acdcSchristos.Xr atari/bootpref 8 , 154e5275bd1Swiz.Xr disklabel 8 155e5275bd1Swiz.Sh HISTORY 156e5275bd1SwizThe 157e5275bd1Swiz.Nm 158e5275bd1Swizcommand first appeared in 159e5275bd1Swiz.Nx 1.1 1601f8c01efSwiz.Sh BUGS 161e8fb96d0Sleo.Nm 162e8fb96d0Sleoknows too much about kernel internal details, forcing it to 163e8fb96d0Sleocheck the running kernel's release and revision. 164e8fb96d0Sleo.Pp 165e8fb96d0SleoBecause neither the floppy disk driver nor 166e8fb96d0Sleo.Xr disklabel 8 167e8fb96d0Sleoare capable of creating a disk pack label on a floppy disk, 168e8fb96d0Sleo.Nm 169e8fb96d0Sleohas to create a\ fictitious label, that is not used by the kernel. 170e07a535fSleo.Pp 171e07a535fSleoExcept for installation of the bootcode on floppy, 172e07a535fSleo.Nm 173e07a535fSleoautomatically sets the boot preference in NVRAM to 17434a98169Sperry.Nx . 175