xref: /freebsd/sbin/reboot/boot_i386.8 (revision c4d9468ea0e627c69802bd0689c93527dc2e2a85)
18fae3551SRodney W. Grimes.\" Copyright (c) 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" This code is derived from software written and contributed
58fae3551SRodney W. Grimes.\" to Berkeley by William Jolitz.
68fae3551SRodney W. Grimes.\"
7d16b647eSJoerg Wunsch.\" Almost completely rewritten for FreeBSD 2.1 by Joerg Wunsch.
8d16b647eSJoerg Wunsch.\"
9e5da9b6bSRobert Nordier.\" Substantially revised for FreeBSD 3.1 by Robert Nordier.
10e5da9b6bSRobert Nordier.\"
118fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
128fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
138fae3551SRodney W. Grimes.\" are met:
148fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
158fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
168fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
178fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
188fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
198fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
208fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
218fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
228fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
238fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
248fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
258fae3551SRodney W. Grimes.\"    without specific prior written permission.
268fae3551SRodney W. Grimes.\"
278fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
288fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
298fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
308fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
318fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
328fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
338fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
348fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
358fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
368fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
378fae3551SRodney W. Grimes.\" SUCH DAMAGE.
388fae3551SRodney W. Grimes.\"
398fae3551SRodney W. Grimes.\"     @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
408fae3551SRodney W. Grimes.\"
417f3dea24SPeter Wemm.\" $FreeBSD$
42d16b647eSJoerg Wunsch.\"
438fae3551SRodney W. Grimes.Dd April 19, 1994
448fae3551SRodney W. Grimes.Dt BOOT 8 i386
458fae3551SRodney W. Grimes.Os
468fae3551SRodney W. Grimes.Sh NAME
478fae3551SRodney W. Grimes.Nm boot
48eb083802SRuslan Ermilov.Nd system bootstrapping procedures
498fae3551SRodney W. Grimes.Sh DESCRIPTION
508fae3551SRodney W. Grimes.Sy Power fail and crash recovery .
518fae3551SRodney W. GrimesNormally, the system will reboot itself at power-up or after crashes.
528fae3551SRodney W. GrimesAn automatic consistency check of the file systems will be performed,
538fae3551SRodney W. Grimesand unless this fails, the system will resume multi-user operations.
548fae3551SRodney W. Grimes.Pp
558fae3551SRodney W. Grimes.Sy Cold starts .
568dfcea8cSRobert NordierMost i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
578dfcea8cSRobert Nordierknown as drive A:) and, failing that, from hard disk drive 0 (sometimes
588dfcea8cSRobert Nordierknown as drive C:, or as drive 0x80 to the BIOS).  Some BIOSes allow
598dfcea8cSRobert Nordieryou to change this default sequence, and may also include a CD-ROM
60c65c062fSBruce Evansdrive as a boot device.
6189aeb8ceSRobert Nordier.Pp
6289aeb8ceSRobert NordierBy default, a three-stage bootstrap is employed, and control is
6389aeb8ceSRobert Nordierautomatically passed from the boot blocks (bootstrap stages one and
6489aeb8ceSRobert Nordiertwo) to a separate third-stage bootstrap program,
65e57c888fSAlexey Zelkin.Xr loader 8 .
668dfcea8cSRobert NordierThis third stage provides more sophisticated control over the booting
678dfcea8cSRobert Nordierprocess than it is possible to achieve in the boot blocks, which are
688dfcea8cSRobert Nordierconstrained by occupying limited fixed space on a given disk or slice.
6989aeb8ceSRobert Nordier.Pp
7089aeb8ceSRobert NordierHowever, it is possible to dispense with the third stage altogether,
7189aeb8ceSRobert Nordiereither by specifying a kernel name in the boot block parameter
7289aeb8ceSRobert Nordierfile,
7389aeb8ceSRobert Nordier.Pa /boot.config ,
7489aeb8ceSRobert Nordieror by hitting a key during a brief pause (while one of the characters
75d0353b83SRuslan Ermilov.Sy - ,
76d0353b83SRuslan Ermilov.Sy \e ,
77d0353b83SRuslan Ermilov.Sy \&| ,
7889aeb8ceSRobert Nordieror
79d0353b83SRuslan Ermilov.Sy /
8089aeb8ceSRobert Nordieris displayed) before
81e57c888fSAlexey Zelkin.Xr loader 8
8289aeb8ceSRobert Nordieris invoked.  Booting will also be attempted at stage two, if the
8389aeb8ceSRobert Nordierthird stage cannot be loaded.
8489aeb8ceSRobert Nordier.Pp
859ef416cfSRobert NordierThe remainder of this subsection deals only with the boot blocks.  The
86d0353b83SRuslan Ermilov.Xr loader 8
879ef416cfSRobert Nordierprogram is documented separately.
8889aeb8ceSRobert Nordier.Pp
89c65c062fSBruce EvansAfter the boot blocks have been loaded,
90c65c062fSBruce Evansyou should see a prompt similar to the following:
91c65c062fSBruce Evans.Bd -literal
9289aeb8ceSRobert Nordier>> FreeBSD/i386 BOOT
93dba060d3SJoseph KoshyDefault: 0:ad(0,a)/kernel
94c65c062fSBruce Evansboot:
95c65c062fSBruce Evans.Ed
96c65c062fSBruce Evans.Pp
97c65c062fSBruce EvansThe automatic boot will attempt to load
98d16b647eSJoerg Wunsch.Pa /kernel
99d16b647eSJoerg Wunschfrom partition
100d16b647eSJoerg Wunsch.Ql a
101d16b647eSJoerg Wunschof either the floppy or the hard disk.
102d16b647eSJoerg WunschThis boot may be aborted by typing any character on the keyboard
103d16b647eSJoerg Wunschat the
104c65c062fSBruce Evans.Ql boot:
105d16b647eSJoerg Wunschprompt.  At this time, the following input will be accepted:
106d0353b83SRuslan Ermilov.Bl -tag -width indent
107d0353b83SRuslan Ermilov.It Ic \&?
108d16b647eSJoerg WunschGive a short listing of the files in the root directory of the default
10989aeb8ceSRobert Nordierboot device, as a hint about available boot files.  (A
110d0353b83SRuslan Ermilov.Ic ?\&
11189aeb8ceSRobert Nordiermay also be specified as the last segment of a path, in which case
11289aeb8ceSRobert Nordierthe listing will be of the relevant subdirectory.)
1138dfcea8cSRobert Nordier.Pp
114d0353b83SRuslan Ermilov.It Xo
115d0353b83SRuslan Ermilov.Ar bios_drive : Ns Ar interface Ns Po
116d0353b83SRuslan Ermilov.Ar unit , Ns Ar part Pc
117d0353b83SRuslan Ermilov.Ar filename
118d0353b83SRuslan Ermilov.Op Fl aCcDdghPrsv
119d0353b83SRuslan Ermilov.Xc
120d16b647eSJoerg WunschSpecify boot file and flags.
121d0353b83SRuslan Ermilov.Bl -tag -width indent
122d0353b83SRuslan Ermilov.It Ar bios_drive
123c65c062fSBruce EvansThe drive number as recognized by the BIOS.
124c65c062fSBruce Evans0 for the first drive, 1 for the second drive, etc.
125d0353b83SRuslan Ermilov.It Ar interface
126c65c062fSBruce EvansThe type of controller to boot from.  Note that the controller is required
127d16b647eSJoerg Wunschto have BIOS support since the BIOS services are used to load the
128d16b647eSJoerg Wunschboot file image.
1298fae3551SRodney W. Grimes.Pp
130c65c062fSBruce EvansThe supported interfaces are:
131d0353b83SRuslan Ermilov.Pp
132dba060d3SJoseph Koshy.Bl -tag -width "adXX" -compact
133dba060d3SJoseph Koshy.It ad
134d16b647eSJoerg WunschST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike
1358fae3551SRodney W. Grimescontroller
136d16b647eSJoerg Wunsch.It fd
137d16b647eSJoerg Wunsch5 1/4" or 3 1/2" High density floppies
1387af89e87SKazutaka YOKOTA.It da
139d16b647eSJoerg WunschSCSI disk on any supported SCSI controller
140c65c062fSBruce Evans.\".It cd
141c65c062fSBruce Evans.\"boot from CDROM
142d16b647eSJoerg Wunsch.El
143d0353b83SRuslan Ermilov.It Ar unit
144c65c062fSBruce EvansThe unit number of the drive on the interface being used.
145c65c062fSBruce Evans0 for the first drive, 1 for the second drive, etc.
146d0353b83SRuslan Ermilov.It Ar part
147d16b647eSJoerg WunschThe partition letter inside the BSD portion of the disk.  See
148d16b647eSJoerg Wunsch.Xr disklabel 8 .
149d16b647eSJoerg WunschBy convention, only partition
150d16b647eSJoerg Wunsch.Ql a
151d16b647eSJoerg Wunschcontains a bootable image.  If sliced disks are used
152d16b647eSJoerg Wunsch.Pq Dq fdisk partitions ,
15389aeb8ceSRobert Nordierany slice can be booted from, with the default being the active slice
154e57c888fSAlexey Zelkinor, otherwise, the first
155e57c888fSAlexey Zelkin.Fx
156e57c888fSAlexey Zelkinslice.
157d0353b83SRuslan Ermilov.It Ar filename
158c65c062fSBruce EvansThe pathname of the file to boot (relative to the root directory
159c65c062fSBruce Evanson the specified partition).  Defaults to
16089aeb8ceSRobert Nordier.Pa /kernel .
161d16b647eSJoerg WunschSymbolic links are not supported (hard links are).
1627af89e87SKazutaka YOKOTA.It Fl acCdDghPrsv
163d16b647eSJoerg WunschBoot flags:
164d0353b83SRuslan Ermilov.Pp
165c65c062fSBruce Evans.Bl -tag -width "-CXX" -compact
166d16b647eSJoerg Wunsch.It Fl a
167c65c062fSBruce Evansduring kernel initialization,
168a910f192SDima Dorfmanask for the device to mount as the root file system.
169c65c062fSBruce Evans.It Fl C
170c65c062fSBruce Evansboot from CDROM.
171d16b647eSJoerg Wunsch.It Fl c
172d16b647eSJoerg Wunschrun UserConfig to modify hardware parameters for the loaded
173d0353b83SRuslan Ermilovkernel.  If the kernel was built with one of
174d0353b83SRuslan Ermilov.Dv USERCONFIG , INTRO_USERCONFIG , VISUAL_USERCONFIG
175d0353b83SRuslan Ermilovoptions,
1760c473d52SMike Smithremain in UserConfig regardless of any
1770c473d52SMike Smith.Ic quit
1780c473d52SMike Smithcommands present in the script.
179c65c062fSBruce Evans.It Fl D
180c65c062fSBruce Evanstoggle single and dual console configurations.  In the single
181c65c062fSBruce Evansconfiguration the console will be either the internal display
182c65c062fSBruce Evansor the serial port, depending on the state of the
183c65c062fSBruce Evans.Fl h
184c65c062fSBruce Evansoption below.  In the dual console configuration,
185c65c062fSBruce Evansboth the internal display and the serial port will become the console
186c65c062fSBruce Evansat the same time, regardless of the state of the
187c65c062fSBruce Evans.Fl h
188c65c062fSBruce Evansoption.  However, the dual console configuration takes effect only during
189c65c062fSBruce Evansthe boot prompt.  Once the kernel is loaded, the console specified
190c65c062fSBruce Evansby the
191c65c062fSBruce Evans.Fl h
192c65c062fSBruce Evansoption becomes the only console.
193d16b647eSJoerg Wunsch.It Fl d
194d16b647eSJoerg Wunschenter the DDB kernel debugger
195c4d9468eSRuslan Ermilov(see
196c4d9468eSRuslan Ermilov.Xr ddb 4 )
197048362aaSDaniel O'Callaghanas early as possible in kernel initialization.
198c65c062fSBruce Evans.It Fl g
199c65c062fSBruce Evansuse the GDB remote debugging protocol.
200d16b647eSJoerg Wunsch.It Fl h
201c65c062fSBruce Evanstoggle internal and serial consoles.  You can use this to switch
202c65c062fSBruce Evansconsole devices.  For instance, if you boot from the internal console,
203c65c062fSBruce Evansyou can use the
204c65c062fSBruce Evans.Fl h
205c65c062fSBruce Evansoption to force the kernel to use the serial port as its
206c65c062fSBruce Evansconsole device.  Alternatively, if you boot from the serial port,
207c65c062fSBruce Evansyou can use this option to force the kernel to use the internal display
208688db407SKazutaka YOKOTAas the console instead.
209688db407SKazutaka YOKOTAThe serial port driver
210688db407SKazutaka YOKOTA.Xr sio 4
211688db407SKazutaka YOKOTAhas a flag to override this option.
212688db407SKazutaka YOKOTAIf that flag is set, the serial port will always be used as the console,
213688db407SKazutaka YOKOTAregardless of the
214688db407SKazutaka YOKOTA.Fl h
215688db407SKazutaka YOKOTAoption described here.  See the man page for
216688db407SKazutaka YOKOTA.Xr sio 4
217688db407SKazutaka YOKOTAfor more details.
218c65c062fSBruce Evans.It Fl P
219c65c062fSBruce Evansprobe the keyboard.  If no keyboard is found, the
220c65c062fSBruce Evans.Fl D
221c65c062fSBruce Evansand
222c65c062fSBruce Evans.Fl h
223c65c062fSBruce Evansoptions are automatically set.
224d16b647eSJoerg Wunsch.It Fl r
225c65c062fSBruce Evansuse the statically configured default for the device containing the
226c65c062fSBruce Evansroot file system
227c4d9468eSRuslan Ermilov(see
228c4d9468eSRuslan Ermilov.Xr config 8 ) .
229c65c062fSBruce EvansNormally, the root file system is on the device
230c65c062fSBruce Evansthat the kernel was loaded from.
231d16b647eSJoerg Wunsch.It Fl s
232d16b647eSJoerg Wunschboot into single-user mode; if the console is marked as
233d16b647eSJoerg Wunsch.Dq insecure
234c4d9468eSRuslan Ermilov(see
235c4d9468eSRuslan Ermilov.Xr ttys 5 ) ,
2369448def9SPhilippe Charnierthe root password must be entered.
237d16b647eSJoerg Wunsch.It Fl v
238c65c062fSBruce Evansbe verbose during device probing (and later).
239d16b647eSJoerg Wunsch.El
240d16b647eSJoerg Wunsch.El
241d16b647eSJoerg Wunsch.El
242c65c062fSBruce Evans.Pp
243c65c062fSBruce EvansYou may put a BIOS drive number, a controller type, a unit number,
2448dfcea8cSRobert Nordiera partition, a kernel file name, and any valid option in
245c65c062fSBruce Evans.Pa /boot.config
2468dfcea8cSRobert Nordierto set defaults.  Enter them in one line just as you type at the
247c65c062fSBruce Evans.Ql boot:
248c65c062fSBruce Evansprompt.
2498fae3551SRodney W. Grimes.Sh FILES
250d0353b83SRuslan Ermilov.Bl -tag -width /boot/loader -compact
251c65c062fSBruce Evans.It Pa /boot.config
25289aeb8ceSRobert Nordierparameters for the boot blocks (optional)
2539ef416cfSRobert Nordier.It Pa /boot/boot1
2549ef416cfSRobert Nordierfirst stage bootstrap file
2559ef416cfSRobert Nordier.It Pa /boot/boot2
2569ef416cfSRobert Nordiersecond stage bootstrap file
25789aeb8ceSRobert Nordier.It Pa /boot/loader
2589ef416cfSRobert Nordierthird stage bootstrap
259b3bfc719SDavid Greenman.It Pa /kernel
260c65c062fSBruce Evansdefault kernel
261c65c062fSBruce Evans.It Pa /kernel.old
262c65c062fSBruce Evanstypical non-default kernel (optional)
2638fae3551SRodney W. Grimes.El
2648fae3551SRodney W. Grimes.Sh SEE ALSO
265d16b647eSJoerg Wunsch.Xr ddb 4 ,
266d16b647eSJoerg Wunsch.Xr ttys 5 ,
267042f27bdSTim Vanderhoek.Xr boot0cfg 8 ,
2688dfcea8cSRobert Nordier.Xr btxld 8 ,
269c65c062fSBruce Evans.Xr config 8 ,
270af202156SWolfram Schneider.Xr disklabel 8 ,
2718fae3551SRodney W. Grimes.Xr halt 8 ,
2729ef416cfSRobert Nordier.Xr loader 8 ,
2738fae3551SRodney W. Grimes.Xr reboot 8 ,
274af202156SWolfram Schneider.Xr shutdown 8
275e5da9b6bSRobert Nordier.Sh DIAGNOSTICS
276e5da9b6bSRobert NordierWhen disk-related errors occur, these are reported by the second-stage
277e5da9b6bSRobert Nordierbootstrap using the same error codes returned by the BIOS, for example
278e57c888fSAlexey Zelkin.Dq Disk error 0x1 (lba=0x12345678) .
279e57c888fSAlexey ZelkinHere is a partial list of these error codes:
2801252c1bbSRuslan Ermilov.Pp
2811252c1bbSRuslan Ermilov.Bl -tag -width "0x80" -compact
282e5da9b6bSRobert Nordier.It 0x1
283e5da9b6bSRobert NordierInvalid argument
284e5da9b6bSRobert Nordier.It 0x2
285e5da9b6bSRobert NordierAddress mark not found
286e5da9b6bSRobert Nordier.It 0x4
287e5da9b6bSRobert NordierSector not found
288e5da9b6bSRobert Nordier.It 0x8
289e5da9b6bSRobert NordierDMA overrun
290e5da9b6bSRobert Nordier.It 0x9
291e5da9b6bSRobert NordierDMA attempt across 64K boundary
292e5da9b6bSRobert Nordier.It 0xc
293e5da9b6bSRobert NordierInvalid media
294e5da9b6bSRobert Nordier.It 0x10
295e5da9b6bSRobert NordierUncorrectable CRC/ECC error
296e5da9b6bSRobert Nordier.It 0x20
297e5da9b6bSRobert NordierController failure
298e5da9b6bSRobert Nordier.It 0x40
299e5da9b6bSRobert NordierSeek failed
300e5da9b6bSRobert Nordier.It 0x80
301e5da9b6bSRobert NordierTimeout
302e5da9b6bSRobert Nordier.El
303e5da9b6bSRobert Nordier.Pp
304d0353b83SRuslan Ermilov.Sy "IMPORTANT NOTE" :
305d0353b83SRuslan ErmilovBecause of limitations imposed by the conventional
306e5da9b6bSRobert Nordierdisk interface provided by the BIOS, all boot-related files and
307e5da9b6bSRobert Nordierstructures (including the kernel) that need to be accessed during the
308e5da9b6bSRobert Nordierboot phase must reside on the disk at or below cylinder 1023 (as the
309e5da9b6bSRobert NordierBIOS understands the geometry).  When a
310e5da9b6bSRobert Nordier.Dq Disk error 0x1
311e5da9b6bSRobert Nordieris reported by the second-stage bootstrap, it generally means that this
312e5da9b6bSRobert Nordierrequirement has not been adhered to.
3138fae3551SRodney W. Grimes.Sh BUGS
314d0353b83SRuslan ErmilovThe
315d0353b83SRuslan Ermilov.Xr disklabel 5
316d0353b83SRuslan Ermilovformat used by this version of
3178fae3551SRodney W. Grimes.Bx
3188fae3551SRodney W. Grimesis quite
3198fae3551SRodney W. Grimesdifferent from that of other architectures.
320d16b647eSJoerg Wunsch.Pp
321c64dca10SRobert NordierDue to space constraints, the keyboard probe initiated by the
322c64dca10SRobert Nordier.Fl P
323c64dca10SRobert Nordieroption is simply a test that the BIOS has detected an
324c64dca10SRobert Nordier.Dq extended
325c64dca10SRobert Nordierkeyboard.  If an
326c64dca10SRobert Nordier.Dq XT/AT
327c64dca10SRobert Nordierkeyboard (with no F11 and F12 keys, etc.) is attached, the probe will
328c64dca10SRobert Nordierfail.
329c64dca10SRobert Nordier.Pp
3308dfcea8cSRobert NordierSome features are not yet documented.
331