kernel - Change PROP_RWLOCK from spinlock to mtx
[dragonfly.git] / usr.sbin / boot0cfg / boot0cfg.8
1 .\" Copyright (c) 1999 Robert Nordier
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
17 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
18 .\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
19 .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/usr.sbin/boot0cfg/boot0cfg.8,v 1.5.2.6 2003/03/12 22:08:13 trhodes Exp $
26 .\" $DragonFly: src/usr.sbin/boot0cfg/boot0cfg.8,v 1.4 2008/03/24 23:04:19 swildner Exp $
27 .\"
28 .Dd June 20, 2009
29 .Dt BOOT0CFG 8
30 .Os
31 .Sh NAME
32 .Nm boot0cfg
33 .Nd boot manager installation/configuration utility
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl Bv
37 .Op Fl b Ar boot0
38 .Op Fl d Ar drive
39 .Op Fl f Ar file
40 .Op Fl m Ar mask
41 .Op Fl o Ar options
42 .Op Fl s Ar slice
43 .Op Fl t Ar ticks
44 .Ar disk
45 .Sh DESCRIPTION
46 The
47 .Dx
48 .Sq boot0
49 boot manager permits the operator to select from which disk and
50 slice an i386 machine (PC) is booted.
51 .Pp
52 Note that what are referred to here as
53 .Dq slices
54 are typically called
55 .Dq partitions
56 in
57 .No non- Ns Bx
58 documentation relating to the PC.
59 Typically, only non-removable disks are sliced.
60 .Pp
61 The
62 .Nm
63 utility optionally installs the
64 .Sq boot0
65 boot manager on the specified
66 .Ar disk ;
67 and allows various operational parameters to be configured.
68 .Pp
69 On PCs, a boot manager typically occupies sector 0 of a disk, which is
70 known as the Master Boot Record (MBR).
71 The MBR contains both code (to which control is passed by the PC BIOS)
72 and data (an embedded table of defined slices).
73 .Pp
74 The options are:
75 .Bl -tag -width indent
76 .It Fl B
77 Install the
78 .Sq boot0
79 boot manager.
80 This option causes MBR code to be replaced, without
81 affecting the embedded slice table.
82 .It Fl b Ar boot0
83 Specify which
84 .Sq boot0
85 image to use.
86 The default is
87 .Pa /boot/boot0
88 which will use the video card as output, alternatively
89 .Pa /boot/boot0sio
90 can be used for output to the COM1 port.
91 (Be aware that nothing will be output to the COM1 port unless the
92 modem signals DSR and CTS are active.)
93 .It Fl d Ar drive
94 Specify the drive number used by the PC BIOS in referencing the drive
95 which contains the specified
96 .Ar disk .
97 Typically this will be 0x80 for the first hard drive, 0x81 for the
98 second hard drive, and so on; however any integer between 0 and 0xff
99 is acceptable here.
100 .It Fl f Ar file
101 Specify that a backup copy of the preexisting MBR should be written to
102 .Ar file .
103 This file is created if it does not exist, and replaced if it does.
104 .It Fl m Ar mask
105 Specify slices to be enabled/disabled, where
106 .Ar mask
107 is an integer between 0 (no slices enabled) and 0xf (all four slices
108 enabled).
109 .It Fl o Ar options
110 A comma-separated string of any of the following options may be
111 specified (with
112 .Dq no
113 prepended as necessary):
114 .Bl -tag -width indent
115 .It packet
116 Try to use the disk packet (BIOS INT 0x13 extensions) interface,
117 as opposed to the legacy (CHS) interface, when doing disk I/O.
118 It might be necessary to avoid packet mode for very old systems,
119 which have broken packet mode support.
120 The default is
121 .Sq packet .
122 .It setdrv
123 Forces the drive containing the disk to be referenced using drive
124 number definable by means of the
125 .Fl d
126 option.
127 The default is
128 .Sq nosetdrv .
129 .It update
130 Allow the MBR to be updated by the boot manager.
131 (The MBR may be updated to flag slices as
132 .Sq active ,
133 and to save slice selection information.)
134 This is the default; a
135 .Sq noupdate
136 option causes the MBR to be treated as read-only.
137 .El
138 .It Fl s Ar slice
139 Set the default boot selection to
140 .Ar slice .
141 Values between 1 and 4 refer to slices; a value of 5 refers to the
142 option of booting from a second disk.
143 .It Fl t Ar ticks
144 Set the timeout value to
145 .Ar ticks .
146 (There are approximately 18.2 ticks per second.)
147 .It Fl v
148 Verbose: display information about the slices defined, etc.
149 .El
150 .Sh FILES
151 .Bl -tag -width ".Pa /boot/boot0sio" -compact
152 .It Pa /boot/boot0
153 The default
154 .Sq boot0
155 image
156 .It Pa /boot/boot0sio
157 Image for serial consoles (COM1,9600,8,N,1,MODEM)
158 .El
159 .Sh EXIT STATUS
160 .Ex -std
161 .Sh EXAMPLES
162 To boot slice 2 on the next boot:
163 .Pp
164 .Dl "boot0cfg -s 2 ad0"
165 .Pp
166 To enable just slices 1 and 2 in the menu:
167 .Pp
168 .Dl "boot0cfg -m 0x3 ad0"
169 .Pp
170 To go back to non-interactive booting, use
171 .Xr fdisk 8
172 to install the default MBR:
173 .Pp
174 .Dl "fdisk -B ad0"
175 .Sh SEE ALSO
176 .Xr boot 8 ,
177 .Xr fdisk 8
178 .Sh AUTHORS
179 .An Robert Nordier Aq rnordier@FreeBSD.org .
180 .Sh BUGS
181 Use of the
182 .Sq packet
183 option may cause
184 .Sq boot0
185 to fail, depending on the nature of BIOS support.
186 .Pp
187 Use of the
188 .Sq setdrv
189 option with an incorrect
190 .Fl d
191 operand may cause the MBR to be written to the wrong disk.
192 Be careful!