Correct BSD License clause numbering from 1-2-4 to 1-2-3.
[dragonfly.git] / sbin / reboot / boot_pc32.8
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. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     @(#)boot_i386.8 8.2 (Berkeley) 4/19/94
36 .\"
37 .\" $FreeBSD: src/sbin/reboot/boot_i386.8,v 1.23.2.11 2002/04/24 17:47:58 rnordier Exp $
38 .\" $DragonFly: src/sbin/reboot/boot_pc32.8,v 1.11 2008/09/15 20:28:56 thomas Exp $
39 .\"
40 .Dd September 2, 2008
41 .Dt BOOT 8 i386
42 .Os
43 .Sh NAME
44 .Nm boot
45 .Nd system bootstrapping procedures
46 .Sh DESCRIPTION
47 .Sy Power fail and crash recovery .
48 Normally, the system will reboot itself at power-up or after crashes.
49 An automatic consistency check of the file systems will be performed,
50 and unless this fails, the system will resume multi-user operations.
51 .Pp
52 .Sy Cold starts .
53 Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
54 known as drive A:) and, failing that, from hard disk drive 0 (sometimes
55 known as drive C:, or as drive 0x80 to the BIOS).  Some BIOSes allow
56 you to change this default sequence, and may also include a CD-ROM
57 drive as a boot device.
58 .Pp
59 By default, a three-stage bootstrap is employed, and control is
60 automatically passed from the boot blocks (bootstrap stages one and
61 two) to a separate third-stage bootstrap program,
62 .Xr loader 8 .
63 This third stage provides more sophisticated control over the booting
64 process than it is possible to achieve in the boot blocks, which are
65 constrained by occupying limited fixed space on a given disk or slice.
66 .Pp
67 However, it is possible to dispense with the third stage altogether,
68 either by specifying a kernel name in the boot block parameter
69 file,
70 .Pa /boot.config ,
71 or, unless option
72 .Fl n
73 is set, by hitting a key during a brief pause (while one of the characters
74 .Sy - ,
75 .Sy \e ,
76 .Sy \&| ,
77 or
78 .Sy /
79 is displayed) before
80 .Xr loader 8
81 is invoked.  Booting will also be attempted at stage two, if the
82 third stage cannot be loaded.
83 .Pp
84 The remainder of this subsection deals only with the boot blocks.  The
85 .Xr loader 8
86 program is documented separately.
87 .Pp
88 After the boot blocks have been loaded,
89 you should see a prompt similar to the following:
90 .Bd -literal
91 DragonFly boot
92 0:ad(0,a)/boot/loader:
93 .Ed
94 .Pp
95 The automatic boot will attempt to load
96 .Pa /boot/loader
97 and if that fails
98 .Pa /loader
99 from partition
100 .Ql a
101 of either the floppy or the hard disk.
102 This boot may be aborted by typing any character on the keyboard
103 at the
104 .Ql boot:
105 prompt.  At this time, the following input will be accepted:
106 .Bl -tag -width indent
107 .It Ic \&?
108 Give a short listing of the files in the root directory of the default
109 boot device, as a hint about available boot files.  (A
110 .Ic ?\&
111 may also be specified as the last segment of a path, in which case
112 the 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 aCcDdghmnPprsVv
119 .Xc
120 Specify boot file and flags.
121 .Bl -tag -width indent
122 .It Ar bios_drive
123 The drive number as recognized by the BIOS.
124 0 for the first drive, 1 for the second drive, etc.
125 .It Ar interface
126 The type of controller to boot from.  Note that the controller is required
127 to have BIOS support since the BIOS services are used to load the
128 boot file image.
129 .Pp
130 The supported interfaces are:
131 .Pp
132 .Bl -tag -width "adXX" -compact
133 .It ad
134 ST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike
135 controller
136 .It fd
137 5 \(14" or 3 \(12" High density floppies
138 .It da
139 SCSI disk on any supported SCSI controller
140 .\".It cd
141 .\"boot from CDROM
142 .El
143 .It Ar unit
144 The unit number of the drive on the interface being used.
145 0 for the first drive, 1 for the second drive, etc.
146 .It Ar part
147 The partition letter inside the
148 .Bx
149 portion of the disk.  See
150 .Xr disklabel 8 .
151 By convention, only partition
152 .Ql a
153 contains a bootable image.  If sliced disks are used
154 .Pq Dq fdisk partitions ,
155 any slice can be booted from, with the default being the active slice
156 or, otherwise, the first
157 .Dx
158 slice.
159 .It Ar filename
160 The pathname of the file to boot (relative to the root directory
161 on the specified partition).  Defaults to
162 .Pa /boot/kernel .
163 Symbolic links are not supported (hard links are).
164 .It Fl aCcDdghmnPprsVv
165 Boot flags:
166 .Pp
167 .Bl -tag -width "-CXX" -compact
168 .It Fl a
169 during kernel initialization,
170 ask for the device to mount as the root file system.
171 .It Fl C
172 boot from CDROM.
173 .It Fl c
174 run UserConfig to modify hardware parameters for the loaded
175 kernel.  If the kernel was built with one of
176 .Dv USERCONFIG , INTRO_USERCONFIG , VISUAL_USERCONFIG
177 options,
178 remain in UserConfig regardless of any
179 .Ic quit
180 commands present in the script.
181 .It Fl D
182 Use all available consoles as the system console.  Input will be accepted
183 on any console and output will be routed to all of them.  This is the
184 default.
185 .It Fl h
186 Use the serial console as the system console.
187 .It Fl V
188 Use the video console as the system console.
189 .It Fl m
190 Mute the system console.  None of the console devices will be used for the
191 system console.
192 .It Fl d
193 enter the DDB kernel debugger
194 (see
195 .Xr ddb 4 )
196 as early as possible in kernel initialization.
197 .It Fl g
198 use the GDB remote debugging protocol.
199 .It Fl n
200 ignore key press to interrupt boot before
201 .Xr loader 8
202 is invoked.
203 .It Fl P
204 probe the keyboard.  If no keyboard is found, the
205 .Fl D
206 and
207 .Fl h
208 options are automatically set.
209 .It Fl p
210 pause after each attached device during the device probing phase.
211 .It Fl r
212 use the statically configured default for the device containing the
213 root file system
214 (see
215 .Xr config 8 ) .
216 Normally, the root file system is on the device
217 that the kernel was loaded from.
218 .It Fl s
219 boot into single-user mode; if the console is marked as
220 .Dq insecure
221 (see
222 .Xr ttys 5 ) ,
223 the root password must be entered.
224 .It Fl v
225 be verbose during device probing (and later).
226 .El
227 .El
228 .El
229 .Pp
230 You may put a BIOS drive number, a controller type, a unit number,
231 a partition, a kernel file name, and any valid option in
232 .Pa /boot.config
233 to set defaults.  Enter them in one line just as you type at the
234 .Ql boot:
235 prompt.
236 .Sh FILES
237 .Bl -tag -width /boot/loader -compact
238 .It Pa /boot.config
239 parameters for the boot blocks (optional)
240 .It Pa /boot/boot1
241 first stage bootstrap file
242 .It Pa /boot/boot2
243 second stage bootstrap file
244 .It Pa /boot/loader
245 third stage bootstrap
246 .It Pa /boot/kernel
247 default kernel
248 .It Pa /boot/kernel.old
249 typical non-default kernel (optional)
250 .El
251 .Sh DIAGNOSTICS
252 When disk-related errors occur, these are reported by the second-stage
253 bootstrap using the same error codes returned by the BIOS, for example
254 .Dq Disk error 0x1 (lba=0x12345678) .
255 Here is a partial list of these error codes:
256 .Pp
257 .Bl -tag -width "0x80" -compact
258 .It 0x1
259 Invalid argument
260 .It 0x2
261 Address mark not found
262 .It 0x4
263 Sector not found
264 .It 0x8
265 DMA overrun
266 .It 0x9
267 DMA attempt across 64K boundary
268 .It 0xc
269 Invalid media
270 .It 0x10
271 Uncorrectable CRC/ECC error
272 .It 0x20
273 Controller failure
274 .It 0x40
275 Seek failed
276 .It 0x80
277 Timeout
278 .El
279 .Pp
280 .Sy "NOTE" :
281 On older machines, or otherwise where EDD support (disk packet
282 interface support) is not available, all boot-related files and
283 structures (including the kernel) that need to be accessed during the
284 boot phase must reside on the disk at or below cylinder 1023 (as the
285 BIOS understands the geometry).  When a
286 .Dq Disk error 0x1
287 is reported by the second-stage bootstrap, it generally means that this
288 requirement has not been adhered to.
289 .Sh SEE ALSO
290 .Xr ddb 4 ,
291 .Xr ttys 5 ,
292 .Xr boot0cfg 8 ,
293 .Xr btxld 8 ,
294 .Xr config 8 ,
295 .Xr disklabel 8 ,
296 .Xr halt 8 ,
297 .Xr loader 8 ,
298 .Xr reboot 8 ,
299 .Xr shutdown 8
300 .Sh BUGS
301 The
302 .Xr disklabel 5
303 format used by this version of
304 .Bx
305 is quite
306 different from that of other architectures.
307 .Pp
308 Due to space constraints, the keyboard probe initiated by the
309 .Fl P
310 option is simply a test that the BIOS has detected an
311 .Dq extended
312 keyboard.  If an
313 .Dq XT/AT
314 keyboard (with no F11 and F12 keys, etc.) is attached, the probe will
315 fail.
316 .Pp
317 Some features are not yet documented.