]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/reboot/boot_i386.8
Remove $FreeBSD$: two-line nroff pattern
[FreeBSD/FreeBSD.git] / sbin / reboot / boot_i386.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 .Dd July 11, 2020
38 .Dt BOOT 8 i386
39 .Os
40 .Sh NAME
41 .Nm boot
42 .Nd system bootstrapping procedures
43 .Sh DESCRIPTION
44 .Sy Power fail and crash recovery .
45 Normally, the system will reboot itself at power-up or after crashes.
46 An automatic consistency check of the file systems will be performed,
47 and unless this fails, the system will resume multi-user operations.
48 .Pp
49 .Sy Cold starts .
50 Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
51 known as drive A:) and, failing that, from hard disk drive 0 (sometimes
52 known as drive C:, or as drive 0x80 to the BIOS).
53 Some BIOSes allow
54 you to change this default sequence, and may also include a CD-ROM
55 drive as a boot device.
56 .Pp
57 Some newer PCs boot using UEFI firmware, not BIOS.
58 That process is described
59 in
60 .Xr uefi 8 .
61 .Pp
62 A three-stage bootstrap is employed.
63 Control is passed from the boot blocks (bootstrap stages one and two) to a
64 third-stage bootstrap program,
65 .Xr loader 8 .
66 This third stage provides more sophisticated control over the booting
67 process than it is possible to achieve in the boot blocks, which are
68 constrained by occupying limited fixed space on a given disk or slice.
69 .Pp
70 The remainder of this subsection deals only with the boot blocks.
71 The
72 .Xr loader 8
73 program is documented separately.
74 .Pp
75 After the boot blocks have been loaded,
76 you should see a prompt similar to the following:
77 .Bd -literal
78 >> FreeBSD/x86 BOOT
79 Default: 0:ad(0,a)/boot/loader
80 boot:
81 .Ed
82 .Pp
83 The automatic boot will attempt to load
84 .Pa /boot/loader
85 from partition
86 .Ql a
87 of either the floppy or the hard disk.
88 This boot may be aborted by typing any character on the keyboard
89 at the
90 .Ql boot\&:
91 prompt.
92 At this time, the following input will be accepted:
93 .Bl -tag -width indent
94 .It Ic \&?
95 Give a short listing of the files in the root directory of the default
96 boot device, as a hint about available boot files.
97 (A
98 .Ic ?\&
99 may also be specified as the last segment of a path, in which case
100 the listing will be of the relevant subdirectory.)
101 .It Xo
102 .Sm off
103 .Ar bios_drive : interface ( unit , Oo Ar slice , Oc Ar part )
104 .Ar filename
105 .Sm on
106 .Op Fl aCcDdghmnPprsv
107 .Op Fl S Ns Ar speed
108 .Xc
109 Specify boot file and flags.
110 .Bl -tag -width indent
111 .It Ar bios_drive
112 The drive number as recognized by the BIOS.
113 0 for the first drive, 1 for the second drive, etc.
114 .It Ar interface
115 The type of controller to boot from.
116 Note that the controller is required
117 to have BIOS support since the BIOS services are used to load the
118 boot file image.
119 .Pp
120 The supported interfaces are:
121 .Pp
122 .Bl -tag -width "adXX" -compact
123 .It ad
124 ST506, IDE, ESDI, RLL disks on a WD100[2367] or lookalike
125 controller
126 .It fd
127 5 1/4" or 3 1/2" High density floppies
128 .It da
129 SCSI disk on any supported SCSI controller
130 .\".It cd
131 .\"boot from CDROM
132 .El
133 .It Ar unit
134 The unit number of the drive on the interface being used.
135 0 for the first drive, 1 for the second drive, etc.
136 .It Oo Ar slice , Oc Ns Ar part
137 The partition letter inside the
138 .Bx
139 portion of the disk.
140 See
141 .Xr bsdlabel 8 .
142 By convention, only partition
143 .Ql a
144 contains a bootable image.
145 If sliced disks are used
146 .Pq Dq fdisk partitions ,
147 any
148 .Ar slice
149 (1 for the first slice, 2 for the second slice, etc.\&)
150 can be booted from, with the default (if not specified) being the active slice
151 or, otherwise, the first
152 .Fx
153 slice.
154 If
155 .Ar slice
156 is specified as 0, the first
157 .Fx
158 slice (also known as
159 .Dq compatibility
160 slice) is booted from.
161 .It Ar filename
162 The pathname of the file to boot (relative to the root directory
163 on the specified partition).
164 Defaults to
165 .Pa /boot/kernel/kernel .
166 Symbolic links are not supported (hard links are).
167 .It Xo Op Fl aCcDdghmnPpqrsv
168 .Op Fl S Ns Ar speed
169 .Xc
170 Boot flags:
171 .Pp
172 .Bl -tag -width "-CXX" -compact
173 .It Fl a
174 during kernel initialization,
175 ask for the device to mount as the root file system.
176 .It Fl C
177 try to mount root file system from a CD-ROM.
178 .It Fl c
179 this flag is currently a no-op.
180 .It Fl D
181 boot with the dual console configuration.
182 In the single
183 configuration, the console will be either the internal display
184 or the serial port, depending on the state of the
185 .Fl h
186 option below.
187 In the dual console configuration,
188 both the internal display and the serial port will become the console
189 at the same time, regardless of the state of the
190 .Fl h
191 option.
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 h
200 force the serial console.
201 For instance, if you boot from the internal console,
202 you can use the
203 .Fl h
204 option to force the kernel to use the serial port as its
205 console device.
206 .It Fl m
207 mute the console to suppress all kernel console input and output during the
208 boot.
209 .It Fl n
210 ignore key press to interrupt boot before
211 .Xr loader 8
212 is invoked.
213 .It Fl P
214 probe the keyboard.
215 If no keyboard is found, the
216 .Fl D
217 and
218 .Fl h
219 options are automatically set.
220 .It Fl p
221 pause after each attached device during the device probing phase.
222 .It Fl q
223 be quiet,
224 do not write anything to the console unless automatic boot fails or
225 is disabled.
226 This option only affects second-stage bootstrap,
227 to prevent next stages from writing to the console use in
228 combination with the
229 .Fl m
230 option.
231 .It Fl r
232 use the statically configured default for the device containing the
233 root file system
234 (see
235 .Xr config 8 ) .
236 Normally, the root file system is on the device
237 that the kernel was loaded from.
238 .It Fl s
239 boot into single-user mode; if the console is marked as
240 .Dq insecure
241 (see
242 .Xr ttys 5 ) ,
243 the root password must be entered.
244 .It Fl S Ns Ar speed
245 set the speed of the serial console to
246 .Ar speed .
247 The default is 9600 unless it has been overridden by setting
248 .Va BOOT_COMCONSOLE_SPEED
249 in
250 .Xr make.conf 5
251 and recompiling and reinstalling the boot blocks.
252 .It Fl v
253 be verbose during device probing (and later).
254 .El
255 .El
256 .El
257 .Pp
258 Use the
259 .Pa /boot.config
260 file to set the default configuration options for the boot block code.
261 See
262 .Xr boot.config 5
263 for more information about the
264 .Pa /boot.config
265 file.
266 .Sh FILES
267 .Bl -tag -width /boot/loader -compact
268 .It Pa /boot.config
269 parameters for the boot blocks (optional)
270 .It Pa /boot/boot1
271 first stage bootstrap file
272 .It Pa /boot/boot2
273 second stage bootstrap file
274 .It Pa /boot/loader
275 third stage bootstrap
276 .It Pa /boot/kernel/kernel
277 default kernel
278 .It Pa /boot/kernel.old/kernel
279 typical non-default kernel (optional)
280 .El
281 .Sh DIAGNOSTICS
282 When disk-related errors occur, these are reported by the second-stage
283 bootstrap using the same error codes returned by the BIOS, for example
284 .Dq Disk error 0x1 (lba=0x12345678) .
285 Here is a partial list of these error codes:
286 .Pp
287 .Bl -tag -width "0x80" -compact
288 .It 0x1
289 Invalid argument
290 .It 0x2
291 Address mark not found
292 .It 0x4
293 Sector not found
294 .It 0x8
295 DMA overrun
296 .It 0x9
297 DMA attempt across 64K boundary
298 .It 0xc
299 Invalid media
300 .It 0x10
301 Uncorrectable CRC/ECC error
302 .It 0x20
303 Controller failure
304 .It 0x40
305 Seek failed
306 .It 0x80
307 Timeout
308 .El
309 .Pp
310 .Sy "NOTE" :
311 On older machines, or otherwise where EDD support (disk packet
312 interface support) is not available, all boot-related files and
313 structures (including the kernel) that need to be accessed during the
314 boot phase must reside on the disk at or below cylinder 1023 (as the
315 BIOS understands the geometry).
316 When a
317 .Dq Disk error 0x1
318 is reported by the second-stage bootstrap, it generally means that this
319 requirement has not been adhered to.
320 .Sh SEE ALSO
321 .Xr ddb 4 ,
322 .Xr boot.config 5 ,
323 .Xr make.conf 5 ,
324 .Xr mount.conf 5 ,
325 .Xr ttys 5 ,
326 .Xr boot0cfg 8 ,
327 .Xr btxld 8 ,
328 .Xr config 8 ,
329 .Xr efibootmgr 8 ,
330 .Xr efivar 8 ,
331 .Xr gpart 8 ,
332 .Xr gptboot 8 ,
333 .Xr gptzfsboot 8 ,
334 .Xr halt 8 ,
335 .Xr loader 8 ,
336 .Xr nextboot 8 ,
337 .Xr reboot 8 ,
338 .Xr shutdown 8 ,
339 .Xr uefi 8 ,
340 .Xr zfsbootcfg 8
341 .Sh BUGS
342 The bsdlabel format used by this version of
343 .Bx
344 is quite
345 different from that of other architectures.
346 .Pp
347 Due to space constraints, the keyboard probe initiated by the
348 .Fl P
349 option is simply a test that the BIOS has detected an
350 .Dq extended
351 keyboard.
352 If an
353 .Dq XT/AT
354 keyboard (with no F11 and F12 keys, etc.) is attached, the probe will
355 fail.