xref: /freebsd/sbin/reboot/boot_i386.8 (revision 6990ffd8a95caaba6858ad44ff1b3157d1efba8f)
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 system bootstrapping procedures
49.Sh DESCRIPTION
50.Sy Power fail and crash recovery .
51Normally, the system will reboot itself at power-up or after crashes.
52An automatic consistency check of the file systems will be performed,
53and unless this fails, the system will resume multi-user operations.
54.Pp
55.Sy Cold starts .
56Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
57known as drive A:) and, failing that, from hard disk drive 0 (sometimes
58known as drive C:, or as drive 0x80 to the BIOS).  Some BIOSes allow
59you to change this default sequence, and may also include a CD-ROM
60drive as a boot device.
61.Pp
62By default, a three-stage bootstrap is employed, and control is
63automatically passed from the boot blocks (bootstrap stages one and
64two) to a separate third-stage bootstrap program,
65.Xr loader 8 .
66This third stage provides more sophisticated control over the booting
67process than it is possible to achieve in the boot blocks, which are
68constrained by occupying limited fixed space on a given disk or slice.
69.Pp
70However, it is possible to dispense with the third stage altogether,
71either by specifying a kernel name in the boot block parameter
72file,
73.Pa /boot.config ,
74or by hitting a key during a brief pause (while one of the characters
75.Sy - ,
76.Sy \e ,
77.Sy \&| ,
78or
79.Sy /
80is displayed) before
81.Xr loader 8
82is invoked.  Booting will also be attempted at stage two, if the
83third stage cannot be loaded.
84.Pp
85The remainder of this subsection deals only with the boot blocks.  The
86.Xr loader 8
87program is documented separately.
88.Pp
89After the boot blocks have been loaded,
90you should see a prompt similar to the following:
91.Bd -literal
92>> FreeBSD/i386 BOOT
93Default: 0:ad(0,a)/kernel
94boot:
95.Ed
96.Pp
97The automatic boot will attempt to load
98.Pa /kernel
99from partition
100.Ql a
101of either the floppy or the hard disk.
102This boot may be aborted by typing any character on the keyboard
103at the
104.Ql boot:
105prompt.  At this time, the following input will be accepted:
106.Bl -tag -width indent
107.It Ic \&?
108Give a short listing of the files in the root directory of the default
109boot device, as a hint about available boot files.  (A
110.Ic ?\&
111may also be specified as the last segment of a path, in which case
112the listing will be of the relevant subdirectory.)
113.Pp
114.It Xo
115.Ar bios_drive : Ns Ar interface Ns Po
116.Ar unit , Ns Ar part Pc
117.Ar filename
118.Op Fl aCcDdghPrsv
119.Xc
120Specify boot file and flags.
121.Bl -tag -width indent
122.It Ar bios_drive
123The drive number as recognized by the BIOS.
1240 for the first drive, 1 for the second drive, etc.
125.It Ar interface
126The type of controller to boot from.  Note that the controller is required
127to have BIOS support since the BIOS services are used to load the
128boot file image.
129.Pp
130The supported interfaces are:
131.Pp
132.Bl -tag -width "adXX" -compact
133.It ad
134ST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike
135controller
136.It fd
1375 1/4" or 3 1/2" High density floppies
138.It da
139SCSI disk on any supported SCSI controller
140.\".It cd
141.\"boot from CDROM
142.El
143.It Ar unit
144The unit number of the drive on the interface being used.
1450 for the first drive, 1 for the second drive, etc.
146.It Ar part
147The partition letter inside the
148.Bx
149portion of the disk.  See
150.Xr disklabel 8 .
151By convention, only partition
152.Ql a
153contains a bootable image.  If sliced disks are used
154.Pq Dq fdisk partitions ,
155any slice can be booted from, with the default being the active slice
156or, otherwise, the first
157.Fx
158slice.
159.It Ar filename
160The pathname of the file to boot (relative to the root directory
161on the specified partition).  Defaults to
162.Pa /kernel .
163Symbolic links are not supported (hard links are).
164.It Fl acCdDghPrsv
165Boot flags:
166.Pp
167.Bl -tag -width "-CXX" -compact
168.It Fl a
169during kernel initialization,
170ask for the device to mount as the root file system.
171.It Fl C
172boot from CDROM.
173.It Fl c
174run UserConfig to modify hardware parameters for the loaded
175kernel.  If the kernel was built with one of
176.Dv USERCONFIG , INTRO_USERCONFIG , VISUAL_USERCONFIG
177options,
178remain in UserConfig regardless of any
179.Ic quit
180commands present in the script.
181.It Fl D
182toggle single and dual console configurations.  In the single
183configuration the console will be either the internal display
184or the serial port, depending on the state of the
185.Fl h
186option below.  In the dual console configuration,
187both the internal display and the serial port will become the console
188at the same time, regardless of the state of the
189.Fl h
190option.  However, the dual console configuration takes effect only during
191the boot prompt.  Once the kernel is loaded, the console specified
192by the
193.Fl h
194option becomes the only console.
195.It Fl d
196enter the DDB kernel debugger
197(see
198.Xr ddb 4 )
199as early as possible in kernel initialization.
200.It Fl g
201use the GDB remote debugging protocol.
202.It Fl h
203toggle internal and serial consoles.  You can use this to switch
204console devices.  For instance, if you boot from the internal console,
205you can use the
206.Fl h
207option to force the kernel to use the serial port as its
208console device.  Alternatively, if you boot from the serial port,
209you can use this option to force the kernel to use the internal display
210as the console instead.
211The serial port driver
212.Xr sio 4
213has a flag to override this option.
214If that flag is set, the serial port will always be used as the console,
215regardless of the
216.Fl h
217option described here.  See the man page for
218.Xr sio 4
219for more details.
220.It Fl P
221probe the keyboard.  If no keyboard is found, the
222.Fl D
223and
224.Fl h
225options are automatically set.
226.It Fl r
227use the statically configured default for the device containing the
228root file system
229(see
230.Xr config 8 ) .
231Normally, the root file system is on the device
232that the kernel was loaded from.
233.It Fl s
234boot into single-user mode; if the console is marked as
235.Dq insecure
236(see
237.Xr ttys 5 ) ,
238the root password must be entered.
239.It Fl v
240be verbose during device probing (and later).
241.El
242.El
243.El
244.Pp
245You may put a BIOS drive number, a controller type, a unit number,
246a partition, a kernel file name, and any valid option in
247.Pa /boot.config
248to set defaults.  Enter them in one line just as you type at the
249.Ql boot:
250prompt.
251.Sh FILES
252.Bl -tag -width /boot/loader -compact
253.It Pa /boot.config
254parameters for the boot blocks (optional)
255.It Pa /boot/boot1
256first stage bootstrap file
257.It Pa /boot/boot2
258second stage bootstrap file
259.It Pa /boot/loader
260third stage bootstrap
261.It Pa /kernel
262default kernel
263.It Pa /kernel.old
264typical non-default kernel (optional)
265.El
266.Sh SEE ALSO
267.Xr ddb 4 ,
268.Xr ttys 5 ,
269.Xr boot0cfg 8 ,
270.Xr btxld 8 ,
271.Xr config 8 ,
272.Xr disklabel 8 ,
273.Xr halt 8 ,
274.Xr loader 8 ,
275.Xr reboot 8 ,
276.Xr shutdown 8
277.Sh DIAGNOSTICS
278When disk-related errors occur, these are reported by the second-stage
279bootstrap using the same error codes returned by the BIOS, for example
280.Dq Disk error 0x1 (lba=0x12345678) .
281Here is a partial list of these error codes:
282.Pp
283.Bl -tag -width "0x80" -compact
284.It 0x1
285Invalid argument
286.It 0x2
287Address mark not found
288.It 0x4
289Sector not found
290.It 0x8
291DMA overrun
292.It 0x9
293DMA attempt across 64K boundary
294.It 0xc
295Invalid media
296.It 0x10
297Uncorrectable CRC/ECC error
298.It 0x20
299Controller failure
300.It 0x40
301Seek failed
302.It 0x80
303Timeout
304.El
305.Pp
306.Sy "IMPORTANT NOTE" :
307Because of limitations imposed by the conventional
308disk interface provided by the BIOS, all boot-related files and
309structures (including the kernel) that need to be accessed during the
310boot phase must reside on the disk at or below cylinder 1023 (as the
311BIOS understands the geometry).  When a
312.Dq Disk error 0x1
313is reported by the second-stage bootstrap, it generally means that this
314requirement has not been adhered to.
315.Sh BUGS
316The
317.Xr disklabel 5
318format used by this version of
319.Bx
320is quite
321different from that of other architectures.
322.Pp
323Due to space constraints, the keyboard probe initiated by the
324.Fl P
325option is simply a test that the BIOS has detected an
326.Dq extended
327keyboard.  If an
328.Dq XT/AT
329keyboard (with no F11 and F12 keys, etc.) is attached, the probe will
330fail.
331.Pp
332Some features are not yet documented.
333