NetBSD/share/man/man8/man8.i386/boot.8

319 lines
7.9 KiB
Groff

.\" $NetBSD: boot.8,v 1.35 2003/10/17 22:05:27 wiz Exp $
.\"
.\" 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.
.\"
.\" 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. 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
.\"
.Dd October 8, 2003
.Dt BOOT 8 i386
.Os
.Sh NAME
.Nm boot
.Nd
system bootstrapping procedures
.Sh DESCRIPTION
.Tn IA-32
computers
.Po
the
.Tn IBM PC
and its clones
.Pc
that can run
.Nx Ns /i386
can use any of the following boot procedures, depending on what the hardware and
.Tn BIOS
support:
.Pp
.Bl -tag -width "pxeboot(8)"
.It boot
bootstrap
.Nx
from the system
.Tn BIOS
.It Xr dosboot 8
bootstrap
.Nx
from
.Tn MS-DOS
.It Xr w95boot 8
bootstrap
.Nx
from
.Tn Windows 95
.It Xr pxeboot 8
network bootstrap
.Nx
from a
.Tn TCP/IP
.Tn LAN
with
.Tn DHCP ,
.Tn TFTP ,
and
.Tn NFS .
.El
.Ss 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.
.Ss Cold starts
The 386
.Tn "PC AT"
clones attempt to boot the floppy disk drive A (otherwise known as drive
0) first, and failing that, attempt to boot the hard disk C (otherwise
known as hard disk controller 1, drive 0).
The
.Nx
bootblocks are loaded and started either by the
.Tn BIOS ,
or by a boot selector program (such as OS-BS, BOOTEASY, the OS/2 Boot Menu or
.Nx Ns 's
.No boot-selecting
master boot record - see
.Xr mbr 8 ) .
.Ss Normal Operation
Once running, a banner similar to the following will appear:
.Bd -unfilled -offset indent
\*[Gt]\*[Gt] NetBSD BIOS Boot, revision 3.0
\*[Gt]\*[Gt] (user@buildhost, builddate)
\*[Gt]\*[Gt] Memory: 637/15360 k
Press return to boot now, any other key for boot menu
booting hd0a:netbsd - starting in 5
.Ed
.Pp
After a countdown, the system image listed will be loaded.
In the example above, it will be
.Dq Li hd0a:netbsd
which is the file
.Nm netbsd
on partition
.Dq a
of the
.Nx
.Tn MBR
partition of the first hard disk known to the
.Tn BIOS
.Po
which is an
.Tn IDE
or similar device - see the
.Sx BUGS
section
.Pc .
Pressing a key within the time limit will enter interactive mode.
.Ss Interactive mode
In interactive mode, the boot loader will present a prompt, allowing
input of these commands:
.\" NOTE: much of this text is duplicated in dosboot.8; please try to
.\" keep both files synchronized.
.Bl -tag -width 04n -offset 04n
.It Xo Ic boot
.Op Va device : Ns
.Op Va filename
.Op Fl acdqsv
.Xc
The default
.Va device
will be set to the disk that the boot loader was
loaded from.
To boot from an alternate disk, the full name of the device should
be given at the prompt.
.Va device
is of the form
.Xo Va xd
.Op Va N Ns Op Va x
.Xc
where
.Va xd
is the device from which to boot,
.Va N
is the unit number, and
.Va x
is the partition letter.
.Pp
The following list of supported devices may vary from installation to
installation:
.Pp
.Bl -hang -compact
.It hd
Hard disks as numbered by the BIOS. This includes
ST506, IDE, ESDI, RLL disks on a WD100[2367] or
lookalike controller(s), and SCSI disks
on SCSI controllers recognized by the BIOS.
.It fd
Floppy drives as numbered by the BIOS.
.El
.Pp
The default
.Va filename
is
.Pa netbsd ;
if the boot loader fails to successfully
open that image, it then tries
.Pa netbsd.gz
(expected to be a kernel image compressed by gzip), followed by
.Pa netbsd.old ,
.Pa netbsd.old.gz ,
.Pa onetbsd ,
and finally
.Pa onetbsd.gz .
Alternate system images can be loaded by just specifying the name of the image.
.Pp
Options are:
.Bl -tag -width xxx
.It Fl a
Prompt for the root file system device, the system crash dump
device, and the path to
.Xr init 8 .
.It Fl c
Bring the system up into the device configuration manager. From here
the device locators can be tuned to the hardware; see
.Xr userconf 4 .
.It Fl d
Bring the system up in debug mode. Here it waits for a kernel
debugger connect; see
.Xr ddb 4 .
.It Fl q
Boot the system in quiet mode.
.It Fl s
Bring the system up in single-user mode.
.It Fl v
Boot the system in verbose mode.
.El
.It Ic consdev Va dev
Immediately switch the console to the specified device
.Va dev
and reprint the banner.
.Va dev
must be one of
.\" .Bl -item -width com[0123]kbd -offset indent -compact
.Ar pc , com0 , com1 , com2 ,
.Ar com3 , com0kbd , com1kbd , com2kbd ,
.Ar com3kbd ,
or
.Ar auto .
See
.Sx Console Selection Policy
in
.Xr boot_console 8 .
.It Ic dev Op Va device
Set the default drive and partition for subsequent filesystem
operations. Without an argument, print the current setting.
.Va device
is of the form specified in
.Cm boot .
.It Ic help
Print an overview about commands and arguments.
.It Ic ls Op Pa path
Print a directory listing of
.Pa path ,
containing inode number, filename and file type.
.Pa path
can contain a device specification.
.It Ic quit
Reboot the system.
.El
.Pp
In an emergency, the bootstrap methods described in the
.Nx
installation notes for the i386 architecture
can be used to boot from floppy.
.Sh FILES
.Bl -tag -width /usr/mdec/bootxx_fstype -compact
.It Pa /boot
boot program code loaded by the primary bootstrap
.It Pa /netbsd
system code
.It Pa /netbsd.gz
gzip-compressed system code
.It Pa /usr/mdec/boot
master copy of the boot program (copy to /boot)
.It Pa /usr/mdec/bootxx_fstype
primary bootstrap for filesystem type fstype, copied to the start of
the netbsd partition by
.Xr installboot 8 .
.El
.Sh SEE ALSO
.Xr ddb 4 ,
.Xr userconf 4 ,
.Xr boot_console 8 ,
.Xr dosboot 8 ,
.Xr halt 8 ,
.Xr installboot 8 ,
.Xr mbr 8 ,
.Xr pxeboot 8 ,
.Xr reboot 8 ,
.Xr shutdown 8 ,
.Xr w95boot 8
.Sh BUGS
This manual page documents the
.Pa boot
interface, which is used by ports other than
.Nx Ns /i386 .
.Pp
Any
.Ar filename
specified after the boot options, e.g.:
.Pp
.Bd -unfilled -offset indent -compact
.Cm boot -d netbsd.test
.Ed
.Pp
is ignored, and the default kernel is booted.
.Pp
Hard disks are always accessed by
.Tn BIOS
functions.
Unit numbers are
.Tn BIOS
device numbers which might differ from numbering in the
.Nx
kernel or physical parameters
.Po
e.g.,
.Tn SCSI
slave numbers
.Pc .
There isn't any distinction between
.Dq sd
and
.Dq wd
devices at the bootloader level.
This is less a bug of the bootloader code than
a shortcoming of the PC architecture.
The default disk device's name printed in the starting message
is derived from the
.Dq type
field of the
.Nx
disklabel (if it is a hard disk).