1994-05-26 06:35:07 +00:00
|
|
|
.\" Copyright (c) 1991, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software written and contributed
|
|
|
|
.\" to Berkeley by William Jolitz.
|
|
|
|
.\"
|
1995-10-07 12:05:00 +00:00
|
|
|
.\" Almost completely rewritten for FreeBSD 2.1 by Joerg Wunsch.
|
|
|
|
.\"
|
1999-05-22 12:55:16 +00:00
|
|
|
.\" Substantially revised for FreeBSD 3.1 by Robert Nordier.
|
|
|
|
.\"
|
1994-05-26 06:35:07 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1995-10-07 12:05:00 +00:00
|
|
|
.\"
|
1994-05-26 06:35:07 +00:00
|
|
|
.Dd April 19, 1994
|
|
|
|
.Dt BOOT 8 i386
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm boot
|
|
|
|
.Nd
|
|
|
|
system bootstrapping procedures
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Sy Power fail and crash recovery.
|
|
|
|
Normally, the system will reboot itself at power-up or after crashes.
|
|
|
|
An automatic consistency check of the file systems will be performed,
|
|
|
|
and unless this fails, the system will resume multi-user operations.
|
|
|
|
.Pp
|
|
|
|
.Sy Cold starts.
|
1999-01-19 09:04:18 +00:00
|
|
|
Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
|
|
|
|
known as drive A:) and, failing that, from hard disk drive 0 (sometimes
|
|
|
|
known as drive C:, or as drive 0x80 to the BIOS). Some BIOSes allow
|
|
|
|
you to change this default sequence, and may also include a CD-ROM
|
1997-07-05 02:02:02 +00:00
|
|
|
drive as a boot device.
|
1999-01-06 14:19:09 +00:00
|
|
|
.Pp
|
|
|
|
By default, a three-stage bootstrap is employed, and control is
|
|
|
|
automatically passed from the boot blocks (bootstrap stages one and
|
|
|
|
two) to a separate third-stage bootstrap program,
|
1999-10-15 12:50:18 +00:00
|
|
|
.Xr loader 8 .
|
1999-01-19 09:04:18 +00:00
|
|
|
This third stage provides more sophisticated control over the booting
|
|
|
|
process than it is possible to achieve in the boot blocks, which are
|
|
|
|
constrained by occupying limited fixed space on a given disk or slice.
|
1999-01-06 14:19:09 +00:00
|
|
|
.Pp
|
|
|
|
However, it is possible to dispense with the third stage altogether,
|
|
|
|
either by specifying a kernel name in the boot block parameter
|
|
|
|
file,
|
|
|
|
.Pa /boot.config ,
|
|
|
|
or by hitting a key during a brief pause (while one of the characters
|
|
|
|
.Dv - ,
|
|
|
|
.Dv \e ,
|
|
|
|
.Dv \&| ,
|
|
|
|
or
|
|
|
|
.Dv /
|
|
|
|
is displayed) before
|
1999-10-15 12:50:18 +00:00
|
|
|
.Xr loader 8
|
1999-01-06 14:19:09 +00:00
|
|
|
is invoked. Booting will also be attempted at stage two, if the
|
|
|
|
third stage cannot be loaded.
|
|
|
|
.Pp
|
1999-03-16 13:16:11 +00:00
|
|
|
The remainder of this subsection deals only with the boot blocks. The
|
|
|
|
.Pa loader
|
|
|
|
program is documented separately.
|
1999-01-06 14:19:09 +00:00
|
|
|
.Pp
|
1997-07-05 02:02:02 +00:00
|
|
|
After the boot blocks have been loaded,
|
|
|
|
you should see a prompt similar to the following:
|
|
|
|
.Bd -literal
|
1999-01-06 14:19:09 +00:00
|
|
|
>> FreeBSD/i386 BOOT
|
|
|
|
Default: 0:wd(0,a)/kernel
|
1997-07-05 02:02:02 +00:00
|
|
|
boot:
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The automatic boot will attempt to load
|
1995-10-07 12:05:00 +00:00
|
|
|
.Pa /kernel
|
|
|
|
from partition
|
|
|
|
.Ql a
|
|
|
|
of either the floppy or the hard disk.
|
|
|
|
This boot may be aborted by typing any character on the keyboard
|
|
|
|
at the
|
1997-07-05 02:02:02 +00:00
|
|
|
.Ql boot:
|
1995-10-07 12:05:00 +00:00
|
|
|
prompt. At this time, the following input will be accepted:
|
1997-07-05 02:02:02 +00:00
|
|
|
.Bl -tag -width 10x
|
1995-10-07 12:05:00 +00:00
|
|
|
.It \&?
|
|
|
|
Give a short listing of the files in the root directory of the default
|
1999-01-06 14:19:09 +00:00
|
|
|
boot device, as a hint about available boot files. (A
|
|
|
|
.Dv \&?
|
|
|
|
may also be specified as the last segment of a path, in which case
|
|
|
|
the listing will be of the relevant subdirectory.)
|
1999-01-19 09:04:18 +00:00
|
|
|
.Pp
|
|
|
|
.It bios_drive:interface(unit,part) filename Op Fl aCcDdghPrsv
|
1995-10-07 12:05:00 +00:00
|
|
|
Specify boot file and flags.
|
1997-07-05 02:02:02 +00:00
|
|
|
.Bl -tag -width 10x -compact
|
|
|
|
.It bios_drive
|
|
|
|
The drive number as recognized by the BIOS.
|
|
|
|
0 for the first drive, 1 for the second drive, etc.
|
|
|
|
.It interface
|
|
|
|
The type of controller to boot from. Note that the controller is required
|
1995-10-07 12:05:00 +00:00
|
|
|
to have BIOS support since the BIOS services are used to load the
|
|
|
|
boot file image.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
1997-07-05 02:02:02 +00:00
|
|
|
The supported interfaces are:
|
|
|
|
.Bl -tag -width "wdXX" -compact
|
1995-10-07 12:05:00 +00:00
|
|
|
.It wd
|
|
|
|
ST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike
|
|
|
|
controller
|
|
|
|
.It fd
|
|
|
|
5 1/4" or 3 1/2" High density floppies
|
1998-09-23 06:54:14 +00:00
|
|
|
.It da
|
1995-10-07 12:05:00 +00:00
|
|
|
SCSI disk on any supported SCSI controller
|
1997-07-05 02:02:02 +00:00
|
|
|
.\".It cd
|
|
|
|
.\"boot from CDROM
|
1995-10-07 12:05:00 +00:00
|
|
|
.El
|
|
|
|
.It unit
|
1997-07-05 02:02:02 +00:00
|
|
|
The unit number of the drive on the interface being used.
|
|
|
|
0 for the first drive, 1 for the second drive, etc.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It part
|
|
|
|
The partition letter inside the BSD portion of the disk. See
|
1998-07-15 06:51:38 +00:00
|
|
|
.Xr disklabel 8 .
|
1995-10-07 12:05:00 +00:00
|
|
|
By convention, only partition
|
|
|
|
.Ql a
|
|
|
|
contains a bootable image. If sliced disks are used
|
|
|
|
.Pq Dq fdisk partitions ,
|
1999-01-06 14:19:09 +00:00
|
|
|
any slice can be booted from, with the default being the active slice
|
1999-10-15 12:50:18 +00:00
|
|
|
or, otherwise, the first
|
|
|
|
.Fx
|
|
|
|
slice.
|
1997-07-05 02:02:02 +00:00
|
|
|
.It filename
|
|
|
|
The pathname of the file to boot (relative to the root directory
|
|
|
|
on the specified partition). Defaults to
|
1999-01-06 14:19:09 +00:00
|
|
|
.Pa /kernel .
|
1995-10-07 12:05:00 +00:00
|
|
|
Symbolic links are not supported (hard links are).
|
1998-09-23 06:54:14 +00:00
|
|
|
.It Fl acCdDghPrsv
|
1995-10-07 12:05:00 +00:00
|
|
|
Boot flags:
|
1997-07-05 02:02:02 +00:00
|
|
|
.Bl -tag -width "-CXX" -compact
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl a
|
1997-07-05 02:02:02 +00:00
|
|
|
during kernel initialization,
|
|
|
|
ask for the device to mount as as the root file system.
|
|
|
|
.It Fl C
|
|
|
|
boot from CDROM.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl c
|
|
|
|
run UserConfig to modify hardware parameters for the loaded
|
1999-10-15 12:50:18 +00:00
|
|
|
kernel. If the kernel was built with one of USERCONFIG,
|
|
|
|
INTRO_USERCONFIG, VISUAL_USERCONFIG options,
|
1998-02-10 00:17:44 +00:00
|
|
|
remain in UserConfig regardless of any
|
|
|
|
.Ic quit
|
|
|
|
commands present in the script.
|
1997-07-05 02:02:02 +00:00
|
|
|
.It Fl D
|
|
|
|
toggle single and dual console configurations. In the single
|
|
|
|
configuration the console will be either the internal display
|
|
|
|
or the serial port, depending on the state of the
|
|
|
|
.Fl h
|
|
|
|
option below. In the dual console configuration,
|
|
|
|
both the internal display and the serial port will become the console
|
|
|
|
at the same time, regardless of the state of the
|
|
|
|
.Fl h
|
|
|
|
option. However, the dual console configuration takes effect only during
|
|
|
|
the boot prompt. Once the kernel is loaded, the console specified
|
|
|
|
by the
|
|
|
|
.Fl h
|
|
|
|
option becomes the only console.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl d
|
|
|
|
enter the DDB kernel debugger
|
|
|
|
.Pq see Xr ddb 4
|
1998-03-23 06:36:57 +00:00
|
|
|
as early as possible in kernel initialization.
|
1997-07-05 02:02:02 +00:00
|
|
|
.It Fl g
|
|
|
|
use the GDB remote debugging protocol.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl h
|
1997-07-05 02:02:02 +00:00
|
|
|
toggle internal and serial consoles. You can use this to switch
|
|
|
|
console devices. For instance, if you boot from the internal console,
|
|
|
|
you can use the
|
|
|
|
.Fl h
|
|
|
|
option to force the kernel to use the serial port as its
|
|
|
|
console device. Alternatively, if you boot from the serial port,
|
|
|
|
you can use this option to force the kernel to use the internal display
|
1999-07-06 11:45:27 +00:00
|
|
|
as the console instead.
|
|
|
|
The serial port driver
|
|
|
|
.Xr sio 4
|
|
|
|
has a flag to override this option.
|
|
|
|
If that flag is set, the serial port will always be used as the console,
|
|
|
|
regardless of the
|
|
|
|
.Fl h
|
|
|
|
option described here. See the man page for
|
|
|
|
.Xr sio 4
|
|
|
|
for more details.
|
1997-07-05 02:02:02 +00:00
|
|
|
.It Fl P
|
|
|
|
probe the keyboard. If no keyboard is found, the
|
|
|
|
.Fl D
|
|
|
|
and
|
|
|
|
.Fl h
|
|
|
|
options are automatically set.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl r
|
1997-07-05 02:02:02 +00:00
|
|
|
use the statically configured default for the device containing the
|
|
|
|
root file system
|
|
|
|
.Pq see Xr config 8 .
|
|
|
|
Normally, the root file system is on the device
|
|
|
|
that the kernel was loaded from.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl s
|
|
|
|
boot into single-user mode; if the console is marked as
|
|
|
|
.Dq insecure
|
|
|
|
.Pq see Xr ttys 5 ,
|
1998-07-15 06:51:38 +00:00
|
|
|
the root password must be entered.
|
1995-10-07 12:05:00 +00:00
|
|
|
.It Fl v
|
1997-07-05 02:02:02 +00:00
|
|
|
be verbose during device probing (and later).
|
1995-10-07 12:05:00 +00:00
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.El
|
1997-07-05 02:02:02 +00:00
|
|
|
.Pp
|
|
|
|
You may put a BIOS drive number, a controller type, a unit number,
|
1999-01-19 09:04:18 +00:00
|
|
|
a partition, a kernel file name, and any valid option in
|
1997-07-05 02:02:02 +00:00
|
|
|
.Pa /boot.config
|
1999-01-19 09:04:18 +00:00
|
|
|
to set defaults. Enter them in one line just as you type at the
|
1997-07-05 02:02:02 +00:00
|
|
|
.Ql boot:
|
|
|
|
prompt.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sh FILES
|
1997-07-05 02:02:02 +00:00
|
|
|
.Bl -tag -width /kernel.old.config -compact
|
|
|
|
.It Pa /boot.config
|
1999-01-06 14:19:09 +00:00
|
|
|
parameters for the boot blocks (optional)
|
1999-03-16 13:16:11 +00:00
|
|
|
.It Pa /boot/boot1
|
|
|
|
first stage bootstrap file
|
|
|
|
.It Pa /boot/boot2
|
|
|
|
second stage bootstrap file
|
1999-01-06 14:19:09 +00:00
|
|
|
.It Pa /boot/loader
|
1999-03-16 13:16:11 +00:00
|
|
|
third stage bootstrap
|
1994-08-05 09:14:37 +00:00
|
|
|
.It Pa /kernel
|
1997-07-05 02:02:02 +00:00
|
|
|
default kernel
|
|
|
|
.It Pa /kernel.old
|
|
|
|
typical non-default kernel (optional)
|
1994-05-26 06:35:07 +00:00
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
1995-10-07 12:05:00 +00:00
|
|
|
.Xr ddb 4 ,
|
|
|
|
.Xr ttys 5 ,
|
1999-01-19 09:04:18 +00:00
|
|
|
.Xr btxld 8 ,
|
1997-07-05 02:02:02 +00:00
|
|
|
.Xr config 8 ,
|
1997-01-13 00:25:51 +00:00
|
|
|
.Xr disklabel 8 ,
|
1994-05-26 06:35:07 +00:00
|
|
|
.Xr halt 8 ,
|
1999-03-16 13:16:11 +00:00
|
|
|
.Xr loader 8 ,
|
1994-05-26 06:35:07 +00:00
|
|
|
.Xr reboot 8 ,
|
1997-01-13 00:25:51 +00:00
|
|
|
.Xr shutdown 8
|
1999-05-22 12:55:16 +00:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
When disk-related errors occur, these are reported by the second-stage
|
|
|
|
bootstrap using the same error codes returned by the BIOS, for example
|
1999-10-15 12:50:18 +00:00
|
|
|
.Dq Disk error 0x1 (lba=0x12345678) .
|
|
|
|
Here is a partial list of these error codes:
|
1999-05-22 12:55:16 +00:00
|
|
|
.Bl -tag -width "0x80" -compat
|
|
|
|
.It 0x1
|
|
|
|
Invalid argument
|
|
|
|
.It 0x2
|
|
|
|
Address mark not found
|
|
|
|
.It 0x4
|
|
|
|
Sector not found
|
|
|
|
.It 0x8
|
|
|
|
DMA overrun
|
|
|
|
.It 0x9
|
|
|
|
DMA attempt across 64K boundary
|
|
|
|
.It 0xc
|
|
|
|
Invalid media
|
|
|
|
.It 0x10
|
|
|
|
Uncorrectable CRC/ECC error
|
|
|
|
.It 0x20
|
|
|
|
Controller failure
|
|
|
|
.It 0x40
|
|
|
|
Seek failed
|
|
|
|
.It 0x80
|
|
|
|
Timeout
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
IMPORTANT NOTE: Because of limitations imposed by the conventional
|
|
|
|
disk interface provided by the BIOS, all boot-related files and
|
|
|
|
structures (including the kernel) that need to be accessed during the
|
|
|
|
boot phase must reside on the disk at or below cylinder 1023 (as the
|
|
|
|
BIOS understands the geometry). When a
|
|
|
|
.Dq Disk error 0x1
|
|
|
|
is reported by the second-stage bootstrap, it generally means that this
|
|
|
|
requirement has not been adhered to.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sh BUGS
|
|
|
|
The disklabel format used by this version of
|
|
|
|
.Bx
|
|
|
|
is quite
|
|
|
|
different from that of other architectures.
|
1995-10-07 12:05:00 +00:00
|
|
|
.Pp
|
1999-06-26 21:57:08 +00:00
|
|
|
Due to space constraints, the keyboard probe initiated by the
|
|
|
|
.Fl P
|
|
|
|
option is simply a test that the BIOS has detected an
|
|
|
|
.Dq extended
|
|
|
|
keyboard. If an
|
|
|
|
.Dq XT/AT
|
|
|
|
keyboard (with no F11 and F12 keys, etc.) is attached, the probe will
|
|
|
|
fail.
|
|
|
|
.Pp
|
1999-01-19 09:04:18 +00:00
|
|
|
Some features are not yet documented.
|