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.Xr loader 8 . 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.Xr loader 8 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 150.Fx 151slice. 152.It filename 153The pathname of the file to boot (relative to the root directory 154on the specified partition). Defaults to 155.Pa /kernel . 156Symbolic links are not supported (hard links are). 157.It Fl acCdDghPrsv 158Boot flags: 159.Bl -tag -width "-CXX" -compact 160.It Fl a 161during kernel initialization, 162ask for the device to mount as as the root file system. 163.It Fl C 164boot from CDROM. 165.It Fl c 166run UserConfig to modify hardware parameters for the loaded 167kernel. If the kernel was built with one of USERCONFIG, 168INTRO_USERCONFIG, VISUAL_USERCONFIG options, 169remain in UserConfig regardless of any 170.Ic quit 171commands present in the script. 172.It Fl D 173toggle single and dual console configurations. In the single 174configuration the console will be either the internal display 175or the serial port, depending on the state of the 176.Fl h 177option below. In the dual console configuration, 178both the internal display and the serial port will become the console 179at the same time, regardless of the state of the 180.Fl h 181option. However, the dual console configuration takes effect only during 182the boot prompt. Once the kernel is loaded, the console specified 183by the 184.Fl h 185option becomes the only console. 186.It Fl d 187enter the DDB kernel debugger 188.Pq see Xr ddb 4 189as early as possible in kernel initialization. 190.It Fl g 191use the GDB remote debugging protocol. 192.It Fl h 193toggle internal and serial consoles. You can use this to switch 194console devices. For instance, if you boot from the internal console, 195you can use the 196.Fl h 197option to force the kernel to use the serial port as its 198console device. Alternatively, if you boot from the serial port, 199you can use this option to force the kernel to use the internal display 200as the console instead. 201The serial port driver 202.Xr sio 4 203has a flag to override this option. 204If that flag is set, the serial port will always be used as the console, 205regardless of the 206.Fl h 207option described here. See the man page for 208.Xr sio 4 209for more details. 210.It Fl P 211probe the keyboard. If no keyboard is found, the 212.Fl D 213and 214.Fl h 215options are automatically set. 216.It Fl r 217use the statically configured default for the device containing the 218root file system 219.Pq see Xr config 8 . 220Normally, the root file system is on the device 221that the kernel was loaded from. 222.It Fl s 223boot into single-user mode; if the console is marked as 224.Dq insecure 225.Pq see Xr ttys 5 , 226the root password must be entered. 227.It Fl v 228be verbose during device probing (and later). 229.El 230.El 231.El 232.Pp 233You may put a BIOS drive number, a controller type, a unit number, 234a partition, a kernel file name, and any valid option in 235.Pa /boot.config 236to set defaults. Enter them in one line just as you type at the 237.Ql boot: 238prompt. 239.Sh FILES 240.Bl -tag -width /kernel.old.config -compact 241.It Pa /boot.config 242parameters for the boot blocks (optional) 243.It Pa /boot/boot1 244first stage bootstrap file 245.It Pa /boot/boot2 246second stage bootstrap file 247.It Pa /boot/loader 248third stage bootstrap 249.It Pa /kernel 250default kernel 251.It Pa /kernel.old 252typical non-default kernel (optional) 253.El 254.Sh SEE ALSO 255.Xr ddb 4 , 256.Xr ttys 5 , 257.Xr btxld 8 , 258.Xr config 8 , 259.Xr disklabel 8 , 260.Xr halt 8 , 261.Xr loader 8 , 262.Xr reboot 8 , 263.Xr shutdown 8 264.Sh DIAGNOSTICS 265When disk-related errors occur, these are reported by the second-stage 266bootstrap using the same error codes returned by the BIOS, for example 267.Dq Disk error 0x1 (lba=0x12345678) . 268Here is a partial list of these error codes: 269.Bl -tag -width "0x80" -compat 270.It 0x1 271Invalid argument 272.It 0x2 273Address mark not found 274.It 0x4 275Sector not found 276.It 0x8 277DMA overrun 278.It 0x9 279DMA attempt across 64K boundary 280.It 0xc 281Invalid media 282.It 0x10 283Uncorrectable CRC/ECC error 284.It 0x20 285Controller failure 286.It 0x40 287Seek failed 288.It 0x80 289Timeout 290.El 291.Pp 292IMPORTANT NOTE: Because of limitations imposed by the conventional 293disk interface provided by the BIOS, all boot-related files and 294structures (including the kernel) that need to be accessed during the 295boot phase must reside on the disk at or below cylinder 1023 (as the 296BIOS understands the geometry). When a 297.Dq Disk error 0x1 298is reported by the second-stage bootstrap, it generally means that this 299requirement has not been adhered to. 300.Sh BUGS 301The disklabel format used by this version of 302.Bx 303is quite 304different from that of other architectures. 305.Pp 306Due to space constraints, the keyboard probe initiated by the 307.Fl P 308option is simply a test that the BIOS has detected an 309.Dq extended 310keyboard. If an 311.Dq XT/AT 312keyboard (with no F11 and F12 keys, etc.) is attached, the probe will 313fail. 314.Pp 315Some features are not yet documented. 316