1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software written and contributed 5.\" to Berkeley by William Jolitz. 6.\" 7.\" Almost completely rewritten for FreeBSD 2.1 by Joerg Wunsch. 8.\" 9.\" Substantially revised for FreeBSD 3.1 by Robert Nordier. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 3. All advertising materials mentioning features or use of this software 20.\" must display the following acknowledgement: 21.\" This product includes software developed by the University of 22.\" California, Berkeley and its contributors. 23.\" 4. Neither the name of the University nor the names of its contributors 24.\" may be used to endorse or promote products derived from this software 25.\" without specific prior written permission. 26.\" 27.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37.\" SUCH DAMAGE. 38.\" 39.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94 40.\" 41.\" $FreeBSD$ 42.\" 43.Dd April 19, 1994 44.Dt BOOT 8 i386 45.Os 46.Sh NAME 47.Nm boot 48.Nd 49system bootstrapping procedures 50.Sh DESCRIPTION 51.Sy Power fail and crash recovery. 52Normally, the system will reboot itself at power-up or after crashes. 53An automatic consistency check of the file systems will be performed, 54and unless this fails, the system will resume multi-user operations. 55.Pp 56.Sy Cold starts. 57Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes 58known as drive A:) and, failing that, from hard disk drive 0 (sometimes 59known as drive C:, or as drive 0x80 to the BIOS). Some BIOSes allow 60you to change this default sequence, and may also include a CD-ROM 61drive as a boot device. 62.Pp 63By default, a three-stage bootstrap is employed, and control is 64automatically passed from the boot blocks (bootstrap stages one and 65two) to a separate third-stage bootstrap program, 66.Pa loader . 67This third stage provides more sophisticated control over the booting 68process than it is possible to achieve in the boot blocks, which are 69constrained by occupying limited fixed space on a given disk or slice. 70.Pp 71However, it is possible to dispense with the third stage altogether, 72either by specifying a kernel name in the boot block parameter 73file, 74.Pa /boot.config , 75or by hitting a key during a brief pause (while one of the characters 76.Dv - , 77.Dv \e , 78.Dv \&| , 79or 80.Dv / 81is displayed) before 82.Pa loader 83is invoked. Booting will also be attempted at stage two, if the 84third stage cannot be loaded. 85.Pp 86The remainder of this subsection deals only with the boot blocks. The 87.Pa loader 88program is documented separately. 89.Pp 90After the boot blocks have been loaded, 91you should see a prompt similar to the following: 92.Bd -literal 93>> FreeBSD/i386 BOOT 94Default: 0:wd(0,a)/kernel 95boot: 96.Ed 97.Pp 98The automatic boot will attempt to load 99.Pa /kernel 100from partition 101.Ql a 102of either the floppy or the hard disk. 103This boot may be aborted by typing any character on the keyboard 104at the 105.Ql boot: 106prompt. At this time, the following input will be accepted: 107.Bl -tag -width 10x 108.It \&? 109Give a short listing of the files in the root directory of the default 110boot device, as a hint about available boot files. (A 111.Dv \&? 112may also be specified as the last segment of a path, in which case 113the listing will be of the relevant subdirectory.) 114.Pp 115.It bios_drive:interface(unit,part) filename Op Fl aCcDdghPrsv 116Specify boot file and flags. 117.Bl -tag -width 10x -compact 118.It bios_drive 119The drive number as recognized by the BIOS. 1200 for the first drive, 1 for the second drive, etc. 121.It interface 122The type of controller to boot from. Note that the controller is required 123to have BIOS support since the BIOS services are used to load the 124boot file image. 125.Pp 126The supported interfaces are: 127.Bl -tag -width "wdXX" -compact 128.It wd 129ST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike 130controller 131.It fd 1325 1/4" or 3 1/2" High density floppies 133.It da 134SCSI disk on any supported SCSI controller 135.\".It cd 136.\"boot from CDROM 137.El 138.It unit 139The unit number of the drive on the interface being used. 1400 for the first drive, 1 for the second drive, etc. 141.It part 142The partition letter inside the BSD portion of the disk. See 143.Xr disklabel 8 . 144By convention, only partition 145.Ql a 146contains a bootable image. If sliced disks are used 147.Pq Dq fdisk partitions , 148any slice can be booted from, with the default being the active slice 149or, otherwise, the first FreeBSD slice. 150.It filename 151The pathname of the file to boot (relative to the root directory 152on the specified partition). Defaults to 153.Pa /kernel . 154Symbolic links are not supported (hard links are). 155.It Fl acCdDghPrsv 156Boot flags: 157.Bl -tag -width "-CXX" -compact 158.It Fl a 159during kernel initialization, 160ask for the device to mount as as the root file system. 161.It Fl C 162boot from CDROM. 163.It Fl c 164run UserConfig to modify hardware parameters for the loaded 165kernel. If the kernel was built with the USERCONFIG_BOOT option, 166remain in UserConfig regardless of any 167.Ic quit 168commands present in the script. 169.It Fl D 170toggle single and dual console configurations. In the single 171configuration the console will be either the internal display 172or the serial port, depending on the state of the 173.Fl h 174option below. In the dual console configuration, 175both the internal display and the serial port will become the console 176at the same time, regardless of the state of the 177.Fl h 178option. However, the dual console configuration takes effect only during 179the boot prompt. Once the kernel is loaded, the console specified 180by the 181.Fl h 182option becomes the only console. 183.It Fl d 184enter the DDB kernel debugger 185.Pq see Xr ddb 4 186as early as possible in kernel initialization. 187.It Fl g 188use the GDB remote debugging protocol. 189.It Fl h 190toggle internal and serial consoles. You can use this to switch 191console devices. For instance, if you boot from the internal console, 192you can use the 193.Fl h 194option to force the kernel to use the serial port as its 195console device. Alternatively, if you boot from the serial port, 196you can use this option to force the kernel to use the internal display 197as the console instead. 198The serial port driver 199.Xr sio 4 200has a flag to override this option. 201If that flag is set, the serial port will always be used as the console, 202regardless of the 203.Fl h 204option described here. See the man page for 205.Xr sio 4 206for more details. 207.It Fl P 208probe the keyboard. If no keyboard is found, the 209.Fl D 210and 211.Fl h 212options are automatically set. 213.It Fl r 214use the statically configured default for the device containing the 215root file system 216.Pq see Xr config 8 . 217Normally, the root file system is on the device 218that the kernel was loaded from. 219.It Fl s 220boot into single-user mode; if the console is marked as 221.Dq insecure 222.Pq see Xr ttys 5 , 223the root password must be entered. 224.It Fl v 225be verbose during device probing (and later). 226.El 227.El 228.El 229.Pp 230You may put a BIOS drive number, a controller type, a unit number, 231a partition, a kernel file name, and any valid option in 232.Pa /boot.config 233to set defaults. Enter them in one line just as you type at the 234.Ql boot: 235prompt. 236.Sh FILES 237.Bl -tag -width /kernel.old.config -compact 238.It Pa /boot.config 239parameters for the boot blocks (optional) 240.It Pa /boot/boot1 241first stage bootstrap file 242.It Pa /boot/boot2 243second stage bootstrap file 244.It Pa /boot/loader 245third stage bootstrap 246.It Pa /kernel 247default kernel 248.It Pa /kernel.old 249typical non-default kernel (optional) 250.El 251.Sh SEE ALSO 252.Xr ddb 4 , 253.Xr ttys 5 , 254.Xr btxld 8 , 255.Xr config 8 , 256.Xr disklabel 8 , 257.Xr halt 8 , 258.Xr loader 8 , 259.Xr reboot 8 , 260.Xr shutdown 8 261.Sh DIAGNOSTICS 262When disk-related errors occur, these are reported by the second-stage 263bootstrap using the same error codes returned by the BIOS, for example 264``Disk error 0x1 (lba=0x12345678)''. Here is a partial list of these 265error codes: 266.Bl -tag -width "0x80" -compat 267.It 0x1 268Invalid argument 269.It 0x2 270Address mark not found 271.It 0x4 272Sector not found 273.It 0x8 274DMA overrun 275.It 0x9 276DMA attempt across 64K boundary 277.It 0xc 278Invalid media 279.It 0x10 280Uncorrectable CRC/ECC error 281.It 0x20 282Controller failure 283.It 0x40 284Seek failed 285.It 0x80 286Timeout 287.El 288.Pp 289IMPORTANT NOTE: Because of limitations imposed by the conventional 290disk interface provided by the BIOS, all boot-related files and 291structures (including the kernel) that need to be accessed during the 292boot phase must reside on the disk at or below cylinder 1023 (as the 293BIOS understands the geometry). When a 294.Dq Disk error 0x1 295is reported by the second-stage bootstrap, it generally means that this 296requirement has not been adhered to. 297.Sh BUGS 298The disklabel format used by this version of 299.Bx 300is quite 301different from that of other architectures. 302.Pp 303Due to space constraints, the keyboard probe initiated by the 304.Fl P 305option is simply a test that the BIOS has detected an 306.Dq extended 307keyboard. If an 308.Dq XT/AT 309keyboard (with no F11 and F12 keys, etc.) is attached, the probe will 310fail. 311.Pp 312Some features are not yet documented. 313