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.\" $Id: boot_i386.8,v 1.17 1999/03/16 13:16:11 rnordier Exp $ 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. This option has no effect if the kernel was 198compiled with 199.Em options COMCONSOLE . 200.It Fl P 201probe the keyboard. If no keyboard is found, the 202.Fl D 203and 204.Fl h 205options are automatically set. 206.It Fl r 207use the statically configured default for the device containing the 208root file system 209.Pq see Xr config 8 . 210Normally, the root file system is on the device 211that the kernel was loaded from. 212.It Fl s 213boot into single-user mode; if the console is marked as 214.Dq insecure 215.Pq see Xr ttys 5 , 216the root password must be entered. 217.It Fl v 218be verbose during device probing (and later). 219.El 220.El 221.El 222.Pp 223You may put a BIOS drive number, a controller type, a unit number, 224a partition, a kernel file name, and any valid option in 225.Pa /boot.config 226to set defaults. Enter them in one line just as you type at the 227.Ql boot: 228prompt. 229.Sh FILES 230.Bl -tag -width /kernel.old.config -compact 231.It Pa /boot.config 232parameters for the boot blocks (optional) 233.It Pa /boot/boot1 234first stage bootstrap file 235.It Pa /boot/boot2 236second stage bootstrap file 237.It Pa /boot/loader 238third stage bootstrap 239.It Pa /kernel 240default kernel 241.It Pa /kernel.old 242typical non-default kernel (optional) 243.El 244.Sh SEE ALSO 245.Xr ddb 4 , 246.Xr ttys 5 , 247.Xr btxld 8 , 248.Xr config 8 , 249.Xr disklabel 8 , 250.Xr halt 8 , 251.Xr loader 8 , 252.Xr reboot 8 , 253.Xr shutdown 8 254.Sh DIAGNOSTICS 255When disk-related errors occur, these are reported by the second-stage 256bootstrap using the same error codes returned by the BIOS, for example 257``Disk error 0x1 (lba=0x12345678)''. Here is a partial list of these 258error codes: 259.Bl -tag -width "0x80" -compat 260.It 0x1 261Invalid argument 262.It 0x2 263Address mark not found 264.It 0x4 265Sector not found 266.It 0x8 267DMA overrun 268.It 0x9 269DMA attempt across 64K boundary 270.It 0xc 271Invalid media 272.It 0x10 273Uncorrectable CRC/ECC error 274.It 0x20 275Controller failure 276.It 0x40 277Seek failed 278.It 0x80 279Timeout 280.El 281.Pp 282IMPORTANT NOTE: Because of limitations imposed by the conventional 283disk interface provided by the BIOS, all boot-related files and 284structures (including the kernel) that need to be accessed during the 285boot phase must reside on the disk at or below cylinder 1023 (as the 286BIOS understands the geometry). When a 287.Dq Disk error 0x1 288is reported by the second-stage bootstrap, it generally means that this 289requirement has not been adhered to. 290.Sh BUGS 291The disklabel format used by this version of 292.Bx 293is quite 294different from that of other architectures. 295.Pp 296Some features are not yet documented. 297