1.\" $NetBSD: boot.8,v 1.9 2008/10/30 09:49:23 apb Exp $ 2.\" 3.\" Copyright (c) 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" This code is derived from software written and contributed 7.\" to Berkeley by William Jolitz. 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. Neither the name of the University nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94 34.\" 35.Dd October 30, 2008 36.Os 37.Dt BOOT 8 38.Sh NAME 39.Nm boot 40.Nd 41system bootstrapping procedures 42.Sh DESCRIPTION 43This document provides information on using common features in the 44.Nx 45boot loader. 46Additional information may be found in 47architecture-specific 48.Xr boot 8 49manual pages. 50.Pp 51In the native 52.Nx 53boot protocol, options are passed from the boot loader 54to the kernel via flag bits in the 55.Va boothowto 56variable, which is interpreted by the kernel in much the same way 57as the 58.Va howto 59argument passed to the 60.Xr reboot 2 61system call. 62.Ss Interactive mode 63In interactive mode, the boot loader will present a prompt, allowing 64input of these commands: 65.\" NOTE: much of this text is duplicated in architecture-specific 66.\" man pages (man8/man8.*/*boot*.8); 67.\" please try to keep all relevant files synchronized. 68.Bl -tag -width 04n -offset 04n 69.It Xo Ic boot 70.Op Va device : Ns 71.Op Va filename 72.Op Fl 1234abcdmqsvxz 73.Xc 74The default 75.Va device 76will be set to the disk that the boot loader was 77loaded from. 78To boot from an alternate disk, the full name of the device should 79be given at the prompt. 80.Va device 81is of the form 82.Xo Va xd 83.Op Va N Ns Op Va x 84.Xc 85where 86.Va xd 87is the device from which to boot, 88.Va N 89is the unit number, and 90.Va x 91is the partition letter. 92.Pp 93The following list of supported devices may vary from installation to 94installation: 95.Pp 96.Bl -hang -compact 97.It hd 98Hard disks. 99.It fd 100Floppy drives. 101.El 102.Pp 103The default 104.Va filename 105is 106.Pa netbsd ; 107if the boot loader fails to successfully 108open that image, it then tries 109.Pa netbsd.gz 110(expected to be a kernel image compressed by gzip), followed by 111.Pa netbsd.old , 112.Pa netbsd.old.gz , 113.Pa onetbsd , 114and finally 115.Pa onetbsd.gz . 116Alternate system images can be loaded by just specifying the name of the image. 117.Pp 118Options are: 119.Bl -tag -width xxx 120.It Fl 1 121Sets the machine-dependent flag 122.Sy RB_MD1 123in 124.Va boothowto . 125.It Fl 2 126Sets the machine-dependent flag 127.Sy RB_MD2 128in 129.Va boothowto . 130.It Fl 3 131Sets the machine-dependent flag 132.Sy RB_MD3 133in 134.Va boothowto . 135.It Fl 4 136Sets the machine-dependent flag 137.Sy RB_MD4 138in 139.Va boothowto . 140.It Fl a 141Sets the 142.Sy RB_ASKNAME 143flag in 144.Va boothowto . 145This causes the kernel to prompt for the root file system device, 146the system crash dump device, and the path to 147.Xr init 8 . 148.It Fl b 149Sets the 150.Sy RB_HALT 151flag in 152.Va boothowto . 153This causes subsequent reboot attempts to halt instead of rebooting. 154.It Fl c 155Sets the 156.Sy RB_USERCONF 157flag in 158.Va boothowto . 159This causes the kernel to enter the 160.Xr userconf 4 161device configuration manager as soon as possible during the boot. 162.Xr userconf 4 163allows devices to be enabled or disabled, and allows device locators 164(such as hardware addresses or bus numbers) 165to be modified before the kernel attempts to attach the devices. 166.It Fl d 167Sets the 168.Sy RB_KDB 169flag in 170.Va boothowto . 171Requests the kernel to enter debug mode, in which it 172waits for a connection from a kernel debugger; see 173.Xr ddb 4 . 174.It Fl m 175Sets the 176.Sy RB_MINIROOT 177flag in 178.Va boothowto . 179Informs the kernel that a mini-root file system is present in memory. 180.It Fl q 181Sets the 182.Sy AB_QUIET 183flag in 184.Va boothowto . 185Boot the system in quiet mode. 186.It Fl s 187Sets the 188.Sy RB_SINGLE 189flag in 190.Va boothowto . 191Boot the system in single-user mode. 192.It Fl v 193Sets the 194.Sy AB_VERBOSE 195flag in 196.Va boothowto . 197Boot the system in verbose mode. 198.It Fl x 199Sets the 200.Sy AB_DEBUG 201flag in 202.Va boothowto . 203Boot the system with debug messages enabled. 204.It Fl z 205Sets the 206.Sy AB_SILENT 207flag in 208.Va boothowto . 209Boot the system in silent mode. 210.El 211.It Ic consdev Va dev 212Immediately switch the console to the specified device 213.Va dev 214and reprint the banner. 215.Va dev 216must be one of 217.\" .Bl -item -width com[0123]kbd -offset indent -compact 218.Ar pc , com0 , com1 , com2 , 219.Ar com3 , com0kbd , com1kbd , com2kbd , 220.Ar com3kbd , 221or 222.Ar auto . 223See 224.Sx Console Selection Policy 225in 226.Xr boot_console 8 . 227.It Ic dev Op Va device 228Set the default drive and partition for subsequent filesystem 229operations. 230Without an argument, print the current setting. 231.Va device 232is of the form specified in 233.Cm boot . 234.It Ic help 235Print an overview about commands and arguments. 236.\" .It Ic load Va module Op Va arguments 237.\" [i386 only] 238.It Ic ls Op Pa path 239Print a directory listing of 240.Pa path , 241containing inode number, filename, and file type. 242.Pa path 243can contain a device specification. 244.\" .It Ic multiboot Va kernel Op Va arguments 245.\" [i386 only] 246.It Ic quit 247Reboot the system. 248.El 249.Pp 250In an emergency, the bootstrap methods described in the 251.Nx 252installation notes for the specific architecture 253can be used. 254.Sh FILES 255.Bl -tag -width /usr/mdec/bootxx_fstype -compact 256.It Pa /boot 257boot program code loaded by the primary bootstrap 258.\" .It Pa /boot.cfg 259.\" optional configuration file 260.\" (used only on i386 and amd64 architectures) 261.It Pa /netbsd 262system code 263.It Pa /netbsd.gz 264gzip-compressed system code 265.It Pa /usr/mdec/boot 266master copy of the boot program (copy to /boot) 267.It Pa /usr/mdec/bootxx_fstype 268primary bootstrap for filesystem type fstype, copied to the start of 269the 270.Nx 271partition by 272.Xr installboot 8 . 273.El 274.Sh SEE ALSO 275Architecture-specific 276.Xr boot 8 277manual pages, 278.Xr ddb 4 , 279.Xr userconf 4 , 280.\" .Xr boot.cfg 5 , 281.Xr halt 8 , 282.Xr installboot 8 , 283.Xr reboot 8 , 284.Xr rescue 8 , 285.Xr shutdown 8 286.Sh BUGS 287The kernel file name must be specified before, not after, the boot options. 288Any 289.Ar filename 290specified after the boot options, e.g.: 291.Pp 292.Bd -unfilled -offset indent -compact 293.Cm boot -d netbsd.test 294.Ed 295.Pp 296is ignored, and the default kernel is booted. 297