View | Details | Raw Unified | Return to bug 212932
Collapse All | Expand All

(-)chapter.xml (-380 / +380 lines)
Lines 37-68 Link Here
37
37
38
    <itemizedlist>
38
    <itemizedlist>
39
      <listitem>
39
      <listitem>
40
	<para>The components of the &os; bootstrap system and how they
40
        <para>The components of the &os; bootstrap system and how they
41
	  interact.</para>
41
          interact.</para>
42
      </listitem>
42
      </listitem>
43
43
44
      <listitem>
44
      <listitem>
45
	<para>The options that can be passed to the components in the
45
        <para>The options that can be passed to the components in the
46
	  &os; bootstrap in order to control the boot process.</para>
46
          &os; bootstrap in order to control the boot process.</para>
47
      </listitem>
47
      </listitem>
48
48
49
      <listitem>
49
      <listitem>
50
	<para>How to configure a customized boot splash screen.</para>
50
        <para>How to configure a customized boot splash screen.</para>
51
      </listitem>
51
      </listitem>
52
52
53
      <listitem>
53
      <listitem>
54
	<para>The basics of setting device hints.</para>
54
        <para>The basics of setting device hints.</para>
55
      </listitem>
55
      </listitem>
56
56
57
      <listitem>
57
      <listitem>
58
	<para>How to boot into single- and multi-user mode and how to
58
        <para>How to boot into single- and multi-user mode and how to
59
	  properly shut down a &os; system.</para>
59
          properly shut down a &os; system.</para>
60
      </listitem>
60
      </listitem>
61
    </itemizedlist>
61
    </itemizedlist>
62
62
63
    <note>
63
    <note>
64
      <para>This chapter only describes the boot process for &os;
64
      <para>This chapter only describes the boot process for &os;
65
	running on x86 and amd64 systems.</para>
65
        running on x86 and amd64 systems.</para>
66
    </note>
66
    </note>
67
  </sect1>
67
  </sect1>
68
68
Lines 78-84 Link Here
78
      disk, how is the operating system started?</para>
78
      disk, how is the operating system started?</para>
79
79
80
    <para>This problem parallels one in the book <citetitle>The
80
    <para>This problem parallels one in the book <citetitle>The
81
	Adventures of Baron Munchausen</citetitle>.  A character had
81
        Adventures of Baron Munchausen</citetitle>.  A character had
82
      fallen part way down a manhole, and pulled himself out by
82
      fallen part way down a manhole, and pulled himself out by
83
      grabbing his bootstraps and lifting.  In the early days of
83
      grabbing his bootstraps and lifting.  In the early days of
84
      computing, the term <firstterm>bootstrap</firstterm> was applied
84
      computing, the term <firstterm>bootstrap</firstterm> was applied
Lines 88-94 Link Here
88
    <indexterm><primary><acronym>BIOS</acronym></primary></indexterm>
88
    <indexterm><primary><acronym>BIOS</acronym></primary></indexterm>
89
89
90
    <indexterm><primary>Basic Input/Output
90
    <indexterm><primary>Basic Input/Output
91
	System</primary><see><acronym>BIOS</acronym></see></indexterm>
91
        System</primary><see><acronym>BIOS</acronym></see></indexterm>
92
92
93
    <para>On x86 hardware, the Basic Input/Output System
93
    <para>On x86 hardware, the Basic Input/Output System
94
      (<acronym>BIOS</acronym>) is responsible for loading the
94
      (<acronym>BIOS</acronym>) is responsible for loading the
Lines 103-120 Link Here
103
103
104
    <note>
104
    <note>
105
      <para>&os; provides for booting from both the older
105
      <para>&os; provides for booting from both the older
106
	<acronym>MBR</acronym> standard, and the newer GUID Partition
106
        <acronym>MBR</acronym> standard, and the newer GUID Partition
107
	Table (<acronym>GPT</acronym>).  <acronym>GPT</acronym>
107
        Table (<acronym>GPT</acronym>).  <acronym>GPT</acronym>
108
	partitioning is often found on computers with the Unified
108
        partitioning is often found on computers with the Unified
109
	Extensible Firmware Interface (<acronym>UEFI</acronym>).
109
        Extensible Firmware Interface (<acronym>UEFI</acronym>).
110
	However, &os; can boot from <acronym>GPT</acronym> partitions
110
        However, &os; can boot from <acronym>GPT</acronym> partitions
111
	even on machines with only a legacy <acronym>BIOS</acronym>
111
        even on machines with only a legacy <acronym>BIOS</acronym>
112
	with &man.gptboot.8;.  Work is under way to provide direct
112
        with &man.gptboot.8;.  Work is under way to provide direct
113
	<acronym>UEFI</acronym> booting.</para>
113
        <acronym>UEFI</acronym> booting.</para>
114
    </note>
114
    </note>
115
115
116
    <indexterm><primary>Master Boot Record
116
    <indexterm><primary>Master Boot Record
117
	(<acronym>MBR</acronym>)</primary></indexterm>
117
        (<acronym>MBR</acronym>)</primary></indexterm>
118
118
119
    <indexterm><primary>Boot Manager</primary></indexterm>
119
    <indexterm><primary>Boot Manager</primary></indexterm>
120
120
Lines 170-195 Link Here
170
      <indexterm><primary>Boot Manager</primary></indexterm>
170
      <indexterm><primary>Boot Manager</primary></indexterm>
171
171
172
      <indexterm><primary>Master Boot Record
172
      <indexterm><primary>Master Boot Record
173
	(<acronym>MBR</acronym>)</primary></indexterm>
173
        (<acronym>MBR</acronym>)</primary></indexterm>
174
174
175
      <para>The boot manager code in the <acronym>MBR</acronym> is
175
      <para>The boot manager code in the <acronym>MBR</acronym> is
176
	sometimes referred to as <emphasis>stage zero</emphasis> of
176
        sometimes referred to as <emphasis>stage zero</emphasis> of
177
	the boot process.  By default, &os; uses the
177
        the boot process.  By default, &os; uses the
178
	<application>boot0</application> boot manager.</para>
178
        <application>boot0</application> boot manager.</para>
179
179
180
      <para>The <acronym>MBR</acronym> installed by the &os; installer
180
      <para>The <acronym>MBR</acronym> installed by the &os; installer
181
	is based on <filename>/boot/boot0</filename>.  The size and
181
        is based on <filename>/boot/boot0</filename>.  The size and
182
	capability of <application>boot0</application> is restricted
182
        capability of <application>boot0</application> is restricted
183
	to 446 bytes due to the slice table and
183
        to 446 bytes due to the slice table and
184
	<literal>0x55AA</literal> identifier at the end of the
184
        <literal>0x55AA</literal> identifier at the end of the
185
	<acronym>MBR</acronym>.  If <application>boot0</application>
185
        <acronym>MBR</acronym>.  If <application>boot0</application>
186
	and multiple operating systems are installed, a message
186
        and multiple operating systems are installed, a message
187
	similar to this example will be displayed at boot time:</para>
187
        similar to this example will be displayed at boot time:</para>
188
188
189
      <example xml:id="boot-boot0-example">
189
      <example xml:id="boot-boot0-example">
190
	<title><filename>boot0</filename> Screenshot</title>
190
        <title><filename>boot0</filename> Screenshot</title>
191
191
192
	<screen>F1 Win
192
        <screen>F1 Win
193
F2 FreeBSD
193
F2 FreeBSD
194
194
195
Default: F2</screen>
195
Default: F2</screen>
Lines 196-216 Link Here
196
      </example>
196
      </example>
197
197
198
      <para>Other operating systems will overwrite an existing
198
      <para>Other operating systems will overwrite an existing
199
	<acronym>MBR</acronym> if they are installed after &os;.  If
199
        <acronym>MBR</acronym> if they are installed after &os;.  If
200
	this happens, or to replace the existing
200
        this happens, or to replace the existing
201
	<acronym>MBR</acronym> with the &os; <acronym>MBR</acronym>,
201
        <acronym>MBR</acronym> with the &os; <acronym>MBR</acronym>,
202
	use the following command:</para>
202
        use the following command:</para>
203
203
204
      <screen>&prompt.root; <userinput>fdisk -B -b /boot/boot0 <replaceable>device</replaceable></userinput></screen>
204
      <screen>&prompt.root; <userinput>fdisk -B -b /boot/boot0 <replaceable>device</replaceable></userinput></screen>
205
205
206
      <para>where <replaceable>device</replaceable> is the boot disk,
206
      <para>where <replaceable>device</replaceable> is the boot disk,
207
	such as <filename>ad0</filename> for the first
207
        such as <filename>ad0</filename> for the first
208
	<acronym>IDE</acronym> disk, <filename>ad2</filename> for the
208
        <acronym>IDE</acronym> disk, <filename>ad2</filename> for the
209
	first <acronym>IDE</acronym> disk on a second
209
        first <acronym>IDE</acronym> disk on a second
210
	<acronym>IDE</acronym> controller, or <filename>da0</filename>
210
        <acronym>IDE</acronym> controller, or <filename>da0</filename>
211
	for the first <acronym>SCSI</acronym> disk.  To create a
211
        for the first <acronym>SCSI</acronym> disk.  To create a
212
	custom configuration of the <acronym>MBR</acronym>, refer to
212
        custom configuration of the <acronym>MBR</acronym>, refer to
213
	&man.boot0cfg.8;.</para>
213
        &man.boot0cfg.8;.</para>
214
    </sect2>
214
    </sect2>
215
215
216
    <sect2 xml:id="boot-boot1">
216
    <sect2 xml:id="boot-boot1">
Lines 217-273 Link Here
217
      <title>Stage One and Stage Two</title>
217
      <title>Stage One and Stage Two</title>
218
218
219
      <para>Conceptually, the first and second stages are part of the
219
      <para>Conceptually, the first and second stages are part of the
220
	same program on the same area of the disk.  Because of space
220
        same program on the same area of the disk.  Because of space
221
	constraints, they have been split into two, but are always
221
        constraints, they have been split into two, but are always
222
	installed together.  They are copied from the combined
222
        installed together.  They are copied from the combined
223
	<filename>/boot/boot</filename> by the &os; installer or
223
        <filename>/boot/boot</filename> by the &os; installer or
224
	<command>bsdlabel</command>.</para>
224
        <command>bsdlabel</command>.</para>
225
225
226
      <para>These two stages are located outside file systems, in the
226
      <para>These two stages are located outside file systems, in the
227
	first track of the boot slice, starting with the first sector.
227
        first track of the boot slice, starting with the first sector.
228
	This is where <application>boot0</application>, or any other
228
        This is where <application>boot0</application>, or any other
229
	boot manager, expects to find a program to run which will
229
        boot manager, expects to find a program to run which will
230
	continue the boot process.</para>
230
        continue the boot process.</para>
231
231
232
      <para>The first stage, <filename>boot1</filename>, is very
232
      <para>The first stage, <filename>boot1</filename>, is very
233
	simple, since it can only be 512 bytes in size.  It knows just
233
        simple, since it can only be 512 bytes in size.  It knows just
234
	enough about the &os; <firstterm>bsdlabel</firstterm>, which
234
        enough about the &os; <firstterm>bsdlabel</firstterm>, which
235
	stores information about the slice, to find and execute
235
        stores information about the slice, to find and execute
236
	<filename>boot2</filename>.</para>
236
        <filename>boot2</filename>.</para>
237
237
238
      <para>Stage two, <filename>boot2</filename>, is slightly more
238
      <para>Stage two, <filename>boot2</filename>, is slightly more
239
	sophisticated, and understands the &os; file system enough to
239
        sophisticated, and understands the &os; file system enough to
240
	find files.  It can provide a simple interface to choose the
240
        find files.  It can provide a simple interface to choose the
241
	kernel or loader to run.  It runs
241
        kernel or loader to run.  It runs
242
	<application>loader</application>, which is much more
242
        <application>loader</application>, which is much more
243
	sophisticated and provides a boot configuration file.  If the
243
        sophisticated and provides a boot configuration file.  If the
244
	boot process is interrupted at stage two, the following
244
        boot process is interrupted at stage two, the following
245
	interactive screen is displayed:</para>
245
        interactive screen is displayed:</para>
246
246
247
      <example xml:id="boot-boot2-example">
247
      <example xml:id="boot-boot2-example">
248
	<title><filename>boot2</filename> Screenshot</title>
248
        <title><filename>boot2</filename> Screenshot</title>
249
249
250
	<screen>&gt;&gt; FreeBSD/i386 BOOT
250
        <screen>&gt;&gt; FreeBSD/i386 BOOT
251
Default: 0:ad(0,a)/boot/loader
251
Default: 0:ad(0,a)/boot/loader
252
boot:</screen>
252
boot:</screen>
253
      </example>
253
      </example>
254
254
255
      <para>To replace the installed <filename>boot1</filename> and
255
      <para>To replace the installed <filename>boot1</filename> and
256
	<filename>boot2</filename>, use <command>bsdlabel</command>,
256
        <filename>boot2</filename>, use <command>bsdlabel</command>,
257
	where <replaceable>diskslice</replaceable> is the disk and
257
        where <replaceable>diskslice</replaceable> is the disk and
258
	slice to boot from, such as <filename>ad0s1</filename> for the
258
        slice to boot from, such as <filename>ad0s1</filename> for the
259
	first slice on the first <acronym>IDE</acronym> disk:</para>
259
        first slice on the first <acronym>IDE</acronym> disk:</para>
260
260
261
      <screen>&prompt.root; <userinput>bsdlabel -B <replaceable>diskslice</replaceable></userinput></screen>
261
      <screen>&prompt.root; <userinput>bsdlabel -B <replaceable>diskslice</replaceable></userinput></screen>
262
262
263
      <warning>
263
      <warning>
264
	<para>If just the disk name is used, such as
264
        <para>If just the disk name is used, such as
265
	  <filename>ad0</filename>, <command>bsdlabel</command> will
265
          <filename>ad0</filename>, <command>bsdlabel</command> will
266
	  create the disk in <quote>dangerously dedicated
266
          create the disk in <quote>dangerously dedicated
267
	    mode</quote>, without slices.  This is probably not the
267
            mode</quote>, without slices.  This is probably not the
268
	  desired action, so double check the
268
          desired action, so double check the
269
	  <replaceable>diskslice</replaceable> before pressing
269
          <replaceable>diskslice</replaceable> before pressing
270
	  <keycap>Return</keycap>.</para>
270
          <keycap>Return</keycap>.</para>
271
      </warning>
271
      </warning>
272
    </sect2>
272
    </sect2>
273
273
Lines 277-464 Link Here
277
      <indexterm><primary>boot-loader</primary></indexterm>
277
      <indexterm><primary>boot-loader</primary></indexterm>
278
278
279
      <para>The <application>loader</application> is the final stage
279
      <para>The <application>loader</application> is the final stage
280
	of the three-stage bootstrap process.  It is located on the
280
        of the three-stage bootstrap process.  It is located on the
281
	file system, usually as
281
        file system, usually as
282
	<filename>/boot/loader</filename>.</para>
282
        <filename>/boot/loader</filename>.</para>
283
283
284
      <para>The <application>loader</application> is intended as an
284
      <para>The <application>loader</application> is intended as an
285
	interactive method for configuration, using a built-in command
285
        interactive method for configuration, using a built-in command
286
	set, backed up by a more powerful interpreter which has a more
286
        set, backed up by a more powerful interpreter which has a more
287
	complex command set.</para>
287
        complex command set.</para>
288
288
289
      <para>During initialization, <application>loader</application>
289
      <para>During initialization, <application>loader</application>
290
	will probe for a console and for disks, and figure out which
290
        will probe for a console and for disks, and figure out which
291
	disk it is booting from.  It will set variables accordingly,
291
        disk it is booting from.  It will set variables accordingly,
292
	and an interpreter is started where user commands can be
292
        and an interpreter is started where user commands can be
293
	passed from a script or interactively.</para>
293
        passed from a script or interactively.</para>
294
294
295
      <indexterm><primary>loader</primary></indexterm>
295
      <indexterm><primary>loader</primary></indexterm>
296
      <indexterm><primary>loader configuration</primary></indexterm>
296
      <indexterm><primary>loader configuration</primary></indexterm>
297
297
298
      <para>The <application>loader</application> will then read
298
      <para>The <application>loader</application> will then read
299
	<filename>/boot/loader.rc</filename>, which by default reads
299
        <filename>/boot/loader.rc</filename>, which by default reads
300
	in <filename>/boot/defaults/loader.conf</filename> which sets
300
        in <filename>/boot/defaults/loader.conf</filename> which sets
301
	reasonable defaults for variables and reads
301
        reasonable defaults for variables and reads
302
	<filename>/boot/loader.conf</filename> for local changes to
302
        <filename>/boot/loader.conf</filename> for local changes to
303
	those variables.  <filename>loader.rc</filename> then acts on
303
        those variables.  <filename>loader.rc</filename> then acts on
304
	these variables, loading whichever modules and kernel are
304
        these variables, loading whichever modules and kernel are
305
	selected.</para>
305
        selected.</para>
306
306
307
      <para>Finally, by default, <application>loader</application>
307
      <para>Finally, by default, <application>loader</application>
308
	issues a 10 second wait for key presses, and boots the kernel
308
        issues a 10 second wait for key presses, and boots the kernel
309
	if it is not interrupted.  If interrupted, the user is
309
        if it is not interrupted.  If interrupted, the user is
310
	presented with a prompt which understands the command set,
310
        presented with a prompt which understands the command set,
311
	where the user may adjust variables, unload all modules, load
311
        where the user may adjust variables, unload all modules, load
312
	modules, and then finally boot or reboot.  <xref
312
        modules, and then finally boot or reboot.  <xref
313
	  linkend="boot-loader-commands"/> lists the most commonly
313
          linkend="boot-loader-commands"/> lists the most commonly
314
	used <application>loader</application> commands.  For a
314
        used <application>loader</application> commands.  For a
315
	complete discussion of all available commands, refer to
315
        complete discussion of all available commands, refer to
316
	&man.loader.8;.</para>
316
        &man.loader.8;.</para>
317
317
318
      <table xml:id="boot-loader-commands" frame="none" pgwide="1">
318
      <table xml:id="boot-loader-commands" frame="none" pgwide="1">
319
	<title>Loader Built-In Commands</title>
319
        <title>Loader Built-In Commands</title>
320
320
321
	<tgroup cols="2">
321
        <tgroup cols="2">
322
	  <thead>
322
          <thead>
323
	    <row>
323
            <row>
324
	      <entry>Variable</entry>
324
              <entry>Variable</entry>
325
	      <entry>Description</entry>
325
              <entry>Description</entry>
326
	    </row>
326
            </row>
327
	  </thead>
327
          </thead>
328
328
329
	  <tbody>
329
          <tbody>
330
	    <row>
330
            <row>
331
	      <entry>autoboot
331
              <entry>autoboot
332
		<replaceable>seconds</replaceable></entry>
332
                <replaceable>seconds</replaceable></entry>
333
	      <entry>Proceeds to boot the kernel if not interrupted
333
              <entry>Proceeds to boot the kernel if not interrupted
334
		within the time span given, in seconds.  It displays a
334
                within the time span given, in seconds.  It displays a
335
		countdown, and the default time span is 10
335
                countdown, and the default time span is 10
336
		seconds.</entry>
336
                seconds.</entry>
337
	    </row>
337
            </row>
338
338
339
	    <row>
339
            <row>
340
	      <entry>boot
340
              <entry>boot
341
		<optional><replaceable>-options</replaceable></optional>
341
                <optional><replaceable>-options</replaceable></optional>
342
		<optional><replaceable>kernelname</replaceable></optional></entry>
342
                <optional><replaceable>kernelname</replaceable></optional></entry>
343
	      <entry>Immediately proceeds to boot the kernel, with
343
              <entry>Immediately proceeds to boot the kernel, with
344
		any specified options or kernel name.  Providing a
344
                any specified options or kernel name.  Providing a
345
		kernel name on the command-line is only applicable
345
                kernel name on the command-line is only applicable
346
		after an <command>unload</command> has been issued.
346
                after an <command>unload</command> has been issued.
347
		Otherwise, the previously-loaded kernel will be
347
                Otherwise, the previously-loaded kernel will be
348
		used.  If <emphasis>kernelname</emphasis> is not
348
                used.  If <emphasis>kernelname</emphasis> is not
349
		qualified it will be searched under
349
                qualified, it will be searched under
350
		<emphasis>/boot/kernel</emphasis> and
350
                <emphasis>/boot/kernel</emphasis> and
351
		<emphasis>/boot/modules</emphasis>.</entry>
351
                <emphasis>/boot/modules</emphasis>.</entry>
352
	    </row>
352
            </row>
353
353
354
	    <row>
354
            <row>
355
	      <entry>boot-conf</entry>
355
              <entry>boot-conf</entry>
356
	      <entry>Goes through the same automatic configuration of
356
              <entry>Goes through the same automatic configuration of
357
		modules based on specified variables, most commonly
357
                modules based on specified variables, most commonly
358
		<envar>kernel</envar>.  This only makes sense if
358
                <envar>kernel</envar>.  This only makes sense if
359
		<command>unload</command> is used first, before
359
                <command>unload</command> is used first, before
360
		changing some variables.</entry>
360
                changing some variables.</entry>
361
	    </row>
361
            </row>
362
362
363
	    <row>
363
            <row>
364
	      <entry>help
364
              <entry>help
365
		<optional><replaceable>topic</replaceable></optional></entry>
365
                <optional><replaceable>topic</replaceable></optional></entry>
366
	      <entry>Shows help messages read from
366
              <entry>Shows help messages read from
367
		<filename>/boot/loader.help</filename>.  If the topic
367
                <filename>/boot/loader.help</filename>.  If the topic
368
		given is <literal>index</literal>, the list of
368
                given is <literal>index</literal>, the list of
369
		available topics is displayed.</entry>
369
                available topics is displayed.</entry>
370
	    </row>
370
            </row>
371
371
372
	    <row>
372
            <row>
373
	      <entry>include <replaceable>filename</replaceable>
373
              <entry>include <replaceable>filename</replaceable>
374
		&hellip;</entry>
374
                &hellip;</entry>
375
	      <entry>Reads the specified file and interprets it line
375
              <entry>Reads the specified file and interprets it line
376
		by line.  An error immediately stops the
376
                by line.  An error immediately stops the
377
		<command>include</command>.</entry>
377
                <command>include</command>.</entry>
378
	    </row>
378
            </row>
379
379
380
	    <row>
380
            <row>
381
	      <entry>load <optional>-t
381
              <entry>load <optional>-t
382
		  <replaceable>type</replaceable></optional>
382
                  <replaceable>type</replaceable></optional>
383
		<replaceable>filename</replaceable></entry>
383
                <replaceable>filename</replaceable></entry>
384
	      <entry>Loads the kernel, kernel module, or file of the
384
              <entry>Loads the kernel, kernel module, or file of the
385
		type given, with the specified filename.  Any
385
                type given, with the specified filename.  Any
386
		arguments after <replaceable>filename</replaceable>
386
                arguments after <replaceable>filename</replaceable>
387
		are passed to the file.  If
387
                are passed to the file.  If
388
		<emphasis>filename</emphasis> is not qualified it
388
                <emphasis>filename</emphasis> is not qualified, it
389
		will be searched under
389
                will be searched under
390
		<emphasis>/boot/kernel</emphasis>
390
                <emphasis>/boot/kernel</emphasis>
391
		and <emphasis>/boot/modules</emphasis>.</entry>
391
                and <emphasis>/boot/modules</emphasis>.</entry>
392
	    </row>
392
            </row>
393
393
394
	    <row>
394
            <row>
395
	      <entry>ls <optional>-l</optional>
395
              <entry>ls <optional>-l</optional>
396
		<optional><replaceable>path</replaceable></optional></entry>
396
                <optional><replaceable>path</replaceable></optional></entry>
397
	      <entry>Displays a listing of files in the given path, or
397
              <entry>Displays a listing of files in the given path, or
398
		the root directory, if the path is not specified.  If
398
                the root directory, if the path is not specified.  If
399
		<option>-l</option> is specified, file sizes will
399
                <option>-l</option> is specified, file sizes will
400
		also be shown.</entry>
400
                also be shown.</entry>
401
	    </row>
401
            </row>
402
402
403
	    <row>
403
            <row>
404
	      <entry>lsdev <optional>-v</optional></entry>
404
              <entry>lsdev <optional>-v</optional></entry>
405
	      <entry>Lists all of the devices from which it may be
405
              <entry>Lists all of the devices from which it may be
406
		possible to load modules.  If <option>-v</option> is
406
                possible to load modules.  If <option>-v</option> is
407
		specified, more details are printed.</entry>
407
                specified, more details are printed.</entry>
408
	    </row>
408
            </row>
409
409
410
	    <row>
410
            <row>
411
	      <entry>lsmod <optional>-v</optional></entry>
411
              <entry>lsmod <optional>-v</optional></entry>
412
	      <entry>Displays loaded modules.  If <option>-v</option>
412
              <entry>Displays loaded modules.  If <option>-v</option>
413
		is specified, more details are shown.</entry>
413
                is specified, more details are shown.</entry>
414
	    </row>
414
            </row>
415
415
416
	    <row>
416
            <row>
417
	      <entry>more <replaceable>filename</replaceable></entry>
417
              <entry>more <replaceable>filename</replaceable></entry>
418
	      <entry>Displays the files specified, with a pause at
418
              <entry>Displays the files specified, with a pause at
419
		each <varname>LINES</varname> displayed.</entry>
419
                each <varname>LINES</varname> displayed.</entry>
420
	    </row>
420
            </row>
421
421
422
	    <row>
422
            <row>
423
	      <entry>reboot</entry>
423
              <entry>reboot</entry>
424
	      <entry>Immediately reboots the system.</entry>
424
              <entry>Immediately reboots the system.</entry>
425
	    </row>
425
            </row>
426
426
427
	    <row>
427
            <row>
428
	      <entry>set <replaceable>variable</replaceable>, set
428
              <entry>set <replaceable>variable</replaceable>, set
429
		<replaceable>variable</replaceable>=<replaceable>value</replaceable></entry>
429
                <replaceable>variable</replaceable>=<replaceable>value</replaceable></entry>
430
	      <entry>Sets the specified environment variables.</entry>
430
              <entry>Sets the specified environment variables.</entry>
431
	    </row>
431
            </row>
432
432
433
	    <row>
433
            <row>
434
	      <entry>unload</entry>
434
              <entry>unload</entry>
435
	      <entry>Removes all loaded modules.</entry>
435
              <entry>Removes all loaded modules.</entry>
436
	    </row>
436
            </row>
437
	  </tbody>
437
          </tbody>
438
	</tgroup>
438
        </tgroup>
439
      </table>
439
      </table>
440
440
441
      <para>Here are some practical examples of loader usage.  To boot
441
      <para>Here are some practical examples of loader usage.  To boot
442
	the usual kernel in single-user mode
442
        the usual kernel in single-user mode
443
	<indexterm><primary>single-user
443
        <indexterm><primary>single-user
444
	  mode</primary></indexterm>:</para>
444
          mode</primary></indexterm>:</para>
445
445
446
      <screen><userinput>boot -s</userinput></screen>
446
      <screen><userinput>boot -s</userinput></screen>
447
447
448
      <para>To unload the usual kernel and modules and then load the
448
      <para>To unload the usual kernel and modules and then load the
449
	previous or another, specified kernel:</para>
449
        previous or another, specified kernel:</para>
450
450
451
      <screen><userinput>unload</userinput>
451
      <screen><userinput>unload</userinput>
452
<userinput>load <replaceable>kernel.old</replaceable></userinput></screen>
452
<userinput>load <replaceable>kernel.old</replaceable></userinput></screen>
453
453
454
      <para>Use <filename>kernel.GENERIC</filename> to refer to the
454
      <para>Use <filename>kernel.GENERIC</filename> to refer to the
455
	default kernel that comes with an installation, or
455
        default kernel that comes with an installation, or
456
	<filename>kernel.old</filename>, to refer to the previously
456
        <filename>kernel.old</filename>, to refer to the previously
457
	installed kernel before a system upgrade or before configuring
457
        installed kernel before a system upgrade or before configuring
458
	a custom kernel.</para>
458
        a custom kernel.</para>
459
459
460
      <para>Use the following to load the usual modules with another
460
      <para>Use the following to load the usual modules with another
461
	kernel:</para>
461
        kernel:</para>
462
462
463
      <screen><userinput>unload</userinput>
463
      <screen><userinput>unload</userinput>
464
<userinput>set kernel="<replaceable>kernel.old</replaceable>"</userinput>
464
<userinput>set kernel="<replaceable>kernel.old</replaceable>"</userinput>
Lines 469-476 Link Here
469
      <screen><userinput>load -t userconfig_script <replaceable>/boot/kernel.conf</replaceable></userinput></screen>
469
      <screen><userinput>load -t userconfig_script <replaceable>/boot/kernel.conf</replaceable></userinput></screen>
470
470
471
      <indexterm>
471
      <indexterm>
472
	<primary>kernel</primary>
472
        <primary>kernel</primary>
473
	<secondary>boot interaction</secondary>
473
        <secondary>boot interaction</secondary>
474
      </indexterm>
474
      </indexterm>
475
    </sect2>
475
    </sect2>
476
476
Lines 478-640 Link Here
478
      <title>Last Stage</title>
478
      <title>Last Stage</title>
479
479
480
      <indexterm>
480
      <indexterm>
481
	<primary>&man.init.8;</primary>
481
        <primary>&man.init.8;</primary>
482
      </indexterm>
482
      </indexterm>
483
483
484
      <para>Once the kernel is loaded by either
484
      <para>Once the kernel is loaded by either
485
	<application>loader</application> or by
485
        <application>loader</application> or by
486
	<application>boot2</application>, which bypasses
486
        <application>boot2</application>, which bypasses
487
	<application>loader</application>, it examines any boot flags
487
        <application>loader</application>, it examines any boot flags
488
	and adjusts its behavior as necessary.  <xref
488
        and adjusts its behavior as necessary.  <xref
489
	  linkend="boot-kernel"/> lists the commonly used boot flags.
489
          linkend="boot-kernel"/> lists the commonly used boot flags.
490
	Refer to &man.boot.8; for more information on the other boot
490
        Refer to &man.boot.8; for more information on the other boot
491
	flags.</para>
491
        flags.</para>
492
492
493
      <indexterm>
493
      <indexterm>
494
	<primary>kernel</primary>
494
        <primary>kernel</primary>
495
	<secondary>bootflags</secondary>
495
        <secondary>bootflags</secondary>
496
      </indexterm>
496
      </indexterm>
497
497
498
      <table xml:id="boot-kernel" frame="none" pgwide="1">
498
      <table xml:id="boot-kernel" frame="none" pgwide="1">
499
	<title>Kernel Interaction During Boot</title>
499
        <title>Kernel Interaction During Boot</title>
500
500
501
	<tgroup cols="2">
501
        <tgroup cols="2">
502
	  <thead>
502
          <thead>
503
	    <row>
503
            <row>
504
	      <entry>Option</entry>
504
              <entry>Option</entry>
505
	      <entry>Description</entry>
505
              <entry>Description</entry>
506
	    </row>
506
            </row>
507
	  </thead>
507
          </thead>
508
508
509
	  <tbody>
509
          <tbody>
510
	    <row>
510
            <row>
511
	      <entry><option>-a</option></entry>
511
              <entry><option>-a</option></entry>
512
	      <entry>During kernel initialization, ask for the device
512
              <entry>During kernel initialization, ask for the device
513
		to mount as the root file system.</entry>
513
                to mount as the root file system.</entry>
514
	    </row>
514
            </row>
515
515
516
	    <row>
516
            <row>
517
	      <entry><option>-C</option></entry>
517
              <entry><option>-C</option></entry>
518
	      <entry>Boot the root file system from a
518
              <entry>Boot the root file system from a
519
		<acronym>CDROM</acronym>.</entry>
519
                <acronym>CDROM</acronym>.</entry>
520
	    </row>
520
            </row>
521
521
522
	    <row>
522
            <row>
523
	      <entry><option>-s</option></entry>
523
              <entry><option>-s</option></entry>
524
	      <entry>Boot into single-user mode.</entry>
524
              <entry>Boot into single-user mode.</entry>
525
	    </row>
525
            </row>
526
526
527
	    <row>
527
            <row>
528
	      <entry><option>-v</option></entry>
528
              <entry><option>-v</option></entry>
529
	      <entry>Be more verbose during kernel startup.</entry>
529
              <entry>Be more verbose during kernel startup.</entry>
530
	    </row>
530
            </row>
531
	  </tbody>
531
          </tbody>
532
	</tgroup>
532
        </tgroup>
533
      </table>
533
      </table>
534
534
535
      <para>Once the kernel has finished booting, it passes control to
535
      <para>Once the kernel has finished booting, it passes control to
536
	the user process &man.init.8;, which is located at
536
        the user process &man.init.8;, which is located at
537
	<filename>/sbin/init</filename>, or the program path specified
537
        <filename>/sbin/init</filename>, or the program path specified
538
	in the <envar>init_path</envar> variable in
538
        in the <envar>init_path</envar> variable in
539
	<command>loader</command>.  This is the last stage of the boot
539
        <command>loader</command>.  This is the last stage of the boot
540
	process.</para>
540
        process.</para>
541
541
542
      <para>The boot sequence makes sure that the file systems
542
      <para>The boot sequence makes sure that the file systems
543
	available on the system are consistent.  If a
543
        available on the system are consistent.  If a
544
	<acronym>UFS</acronym> file system is not, and
544
        <acronym>UFS</acronym> file system is not, and
545
	<command>fsck</command> cannot fix the inconsistencies,
545
        <command>fsck</command> cannot fix the inconsistencies,
546
	<application>init</application> drops the system into
546
        <application>init</application> drops the system into
547
	single-user mode so that the system administrator can resolve
547
        single-user mode so that the system administrator can resolve
548
	the problem directly.  Otherwise, the system boots into
548
        the problem directly.  Otherwise, the system boots into
549
	multi-user mode.</para>
549
        multi-user mode.</para>
550
550
551
      <sect3 xml:id="boot-singleuser">
551
      <sect3 xml:id="boot-singleuser">
552
	<title>Single-User Mode</title>
552
        <title>Single-User Mode</title>
553
553
554
	<indexterm><primary>single-user mode</primary></indexterm>
554
        <indexterm><primary>single-user mode</primary></indexterm>
555
	<indexterm><primary>console</primary></indexterm>
555
        <indexterm><primary>console</primary></indexterm>
556
556
557
	<para>A user can specify this mode by booting with
557
        <para>A user can specify this mode by booting with
558
	  <option>-s</option> or by setting the
558
          <option>-s</option> or by setting the
559
	  <envar>boot_single</envar> variable in
559
          <envar>boot_single</envar> variable in
560
	  <application>loader</application>.  It can also be reached
560
          <application>loader</application>.  It can also be reached
561
	  by running <command>shutdown now</command> from multi-user
561
          by running <command>shutdown now</command> from multi-user
562
	  mode.  Single-user mode begins with this message:</para>
562
          mode.  Single-user mode begins with this message:</para>
563
563
564
	<programlisting>Enter full pathname of shell or RETURN for /bin/sh:</programlisting>
564
        <programlisting>Enter full pathname of shell or RETURN for /bin/sh:</programlisting>
565
565
566
	<para>If the user presses <keycap>Enter</keycap>, the system
566
        <para>If the user presses <keycap>Enter</keycap>, the system
567
	  will enter the default Bourne shell.  To specify a different
567
          will enter the default Bourne shell.  To specify a different
568
	  shell, input the full path to the shell.</para>
568
          shell, input the full path to the shell.</para>
569
569
570
	<para>Single-user mode is usually used to repair a system that
570
        <para>Single-user mode is usually used to repair a system that
571
	  will not boot due to an inconsistent file system or an error
571
          will not boot due to an inconsistent file system or an error
572
	  in a boot configuration file.  It can also be used to reset
572
          in a boot configuration file.  It can also be used to reset
573
	  the <systemitem class="username">root</systemitem> password
573
          the <systemitem class="username">root</systemitem> password
574
	  when it is unknown.  These actions are possible as the
574
          when it is unknown.  These actions are possible as the
575
	  single-user mode prompt gives full, local access to the
575
          single-user mode prompt gives full, local access to the
576
	  system and its configuration files.  There is no networking
576
          system and its configuration files.  There is no networking
577
	  in this mode.</para>
577
          in this mode.</para>
578
578
579
	<para>While single-user mode is useful for repairing a system,
579
        <para>While single-user mode is useful for repairing a system,
580
	  it poses a security risk unless the system is in a
580
          it poses a security risk unless the system is in a
581
	  physically secure location.  By default, any user who can
581
          physically secure location.  By default, any user who can
582
	  gain physical access to a system will have full control of
582
          gain physical access to a system will have full control of
583
	  that system after booting into single-user mode.</para>
583
          that system after booting into single-user mode.</para>
584
584
585
	<para>If the system <literal>console</literal> is changed to
585
        <para>If the system <literal>console</literal> is changed to
586
	  <literal>insecure</literal> in
586
          <literal>insecure</literal> in
587
	  <filename>/etc/ttys</filename>, the system will first prompt
587
          <filename>/etc/ttys</filename>, the system will first prompt
588
	  for the <systemitem class="username">root</systemitem>
588
          for the <systemitem class="username">root</systemitem>
589
	  password before initiating single-user mode.  This adds a
589
          password before initiating single-user mode.  This adds a
590
	  measure of security while removing the ability to reset the
590
          measure of security while removing the ability to reset the
591
	  <systemitem class="username">root</systemitem> password when
591
          <systemitem class="username">root</systemitem> password when
592
	  it is unknown.</para>
592
          it is unknown.</para>
593
593
594
	<example xml:id="boot-insecure-console">
594
        <example xml:id="boot-insecure-console">
595
	  <title>Configuring an Insecure Console in
595
          <title>Configuring an Insecure Console in
596
	    <filename>/etc/ttys</filename></title>
596
            <filename>/etc/ttys</filename></title>
597
597
598
	  <programlisting># name  getty                           type    status          comments
598
          <programlisting># name  getty                           type    status          comments
599
#
599
#
600
# If console is marked "insecure", then init will ask for the root password
600
# If console is marked "insecure", then init will ask for the root password
601
# when going to single-user mode.
601
# when going to single-user mode.
602
console none                            unknown off <replaceable>insecure</replaceable></programlisting>
602
console none                            unknown off <replaceable>insecure</replaceable></programlisting>
603
	</example>
603
        </example>
604
604
605
	<para>An <literal>insecure</literal> console means that
605
        <para>An <literal>insecure</literal> console means that
606
	  physical security to the console is considered to be
606
          physical security to the console is considered to be
607
	  insecure, so only someone who knows the <systemitem
607
          insecure, so only someone who knows the <systemitem
608
	    class="username">root</systemitem> password may use
608
            class="username">root</systemitem> password may use
609
	  single-user mode.</para>
609
          single-user mode.</para>
610
      </sect3>
610
      </sect3>
611
611
612
      <sect3 xml:id="boot-multiuser">
612
      <sect3 xml:id="boot-multiuser">
613
	<title>Multi-User Mode</title>
613
        <title>Multi-User Mode</title>
614
614
615
	<indexterm><primary>multi-user mode</primary></indexterm>
615
        <indexterm><primary>multi-user mode</primary></indexterm>
616
616
617
	<para>If <application>init</application> finds the file
617
        <para>If <application>init</application> finds the file
618
	  systems to be in order, or once the user has finished their
618
          systems to be in order, or once the user has finished their
619
	  commands in single-user mode and has typed
619
          commands in single-user mode and has typed
620
	  <command>exit</command> to leave single-user mode, the
620
          <command>exit</command> to leave single-user mode, the
621
	  system enters multi-user mode, in which it starts the
621
          system enters multi-user mode, in which it starts the
622
	  resource configuration of the system.</para>
622
          resource configuration of the system.</para>
623
623
624
	<indexterm><primary>rc files</primary></indexterm>
624
        <indexterm><primary>rc files</primary></indexterm>
625
625
626
	<para>The resource configuration system reads in configuration
626
        <para>The resource configuration system reads in configuration
627
	  defaults from <filename>/etc/defaults/rc.conf</filename> and
627
          defaults from <filename>/etc/defaults/rc.conf</filename> and
628
	  system-specific details from
628
          system-specific details from
629
	  <filename>/etc/rc.conf</filename>.  It then proceeds to
629
          <filename>/etc/rc.conf</filename>.  It then proceeds to
630
	  mount the system file systems listed in
630
          mount the system file systems listed in
631
	  <filename>/etc/fstab</filename>.  It starts up networking
631
          <filename>/etc/fstab</filename>.  It starts up networking
632
	  services, miscellaneous system daemons, then the startup
632
          services, miscellaneous system daemons, then the startup
633
	  scripts of locally installed packages.</para>
633
          scripts of locally installed packages.</para>
634
634
635
	<para>To learn more about the resource configuration system,
635
        <para>To learn more about the resource configuration system,
636
	  refer to &man.rc.8; and examine the scripts located in
636
          refer to &man.rc.8; and examine the scripts located in
637
	  <filename>/etc/rc.d</filename>.</para>
637
          <filename>/etc/rc.d</filename>.</para>
638
      </sect3>
638
      </sect3>
639
    </sect2>
639
    </sect2>
640
  </sect1>
640
  </sect1>
Lines 650-662 Link Here
650
      <title>Configuring Boot Time Splash Screens</title>
650
      <title>Configuring Boot Time Splash Screens</title>
651
651
652
      <authorgroup>
652
      <authorgroup>
653
	<author>
653
        <author>
654
	  <personname>
654
          <personname>
655
	    <firstname>Joseph J.</firstname>
655
            <firstname>Joseph J.</firstname>
656
	    <surname>Barbish</surname>
656
            <surname>Barbish</surname>
657
	  </personname>
657
          </personname>
658
	  <contrib>Contributed by </contrib>
658
          <contrib>Contributed by </contrib>
659
	</author>
659
        </author>
660
      </authorgroup>
660
      </authorgroup>
661
    </info>
661
    </info>
662
662
Lines 691-697 Link Here
691
691
692
    <para>Sample splash screen files can be downloaded from the
692
    <para>Sample splash screen files can be downloaded from the
693
      gallery at <link
693
      gallery at <link
694
	xlink:href="http://artwork.freebsdgr.org/node/3/">http://artwork.freebsdgr.org</link>.
694
        xlink:href="http://artwork.freebsdgr.org/node/3/">http://artwork.freebsdgr.org</link>.
695
      By installing the <package>sysutils/bsd-splash-changer</package>
695
      By installing the <package>sysutils/bsd-splash-changer</package>
696
      package or port, a random splash image from a collection will
696
      package or port, a random splash image from a collection will
697
      display at boot.</para>
697
      display at boot.</para>
Lines 723-729 Link Here
723
bitmap_name="/boot/<replaceable>splash.pcx</replaceable>"</programlisting>
723
bitmap_name="/boot/<replaceable>splash.pcx</replaceable>"</programlisting>
724
724
725
    <para>To instead use ASCII art in the <link
725
    <para>To instead use ASCII art in the <link
726
	xlink:href="https://en.wikipedia.org/wiki/TheDraw">https://en.wikipedia.org/wiki/TheDraw</link>
726
        xlink:href="https://en.wikipedia.org/wiki/TheDraw">https://en.wikipedia.org/wiki/TheDraw</link>
727
      format:</para>
727
      format:</para>
728
728
729
    <programlisting>splash_txt="YES"
729
    <programlisting>splash_txt="YES"
Lines 748-771 Link Here
748
    <variablelist>
748
    <variablelist>
749
      <varlistentry><term><literal>beastie_disable="YES"</literal></term>
749
      <varlistentry><term><literal>beastie_disable="YES"</literal></term>
750
750
751
	<listitem>
751
        <listitem>
752
	  <para>This will stop the boot options menu from being
752
          <para>This will stop the boot options menu from being
753
	    displayed, but the timed wait count down prompt will still
753
            displayed, but the timed wait count down prompt will still
754
	    be present.  Even with the display of the boot options
754
            be present.  Even with the display of the boot options
755
	    menu disabled, entering an option selection at the timed
755
            menu disabled, entering an option selection at the timed
756
	    wait count down prompt will enact the corresponding boot
756
            wait count down prompt will enact the corresponding boot
757
	    option.</para>
757
            option.</para>
758
	</listitem>
758
        </listitem>
759
      </varlistentry>
759
      </varlistentry>
760
760
761
      <varlistentry><term><literal>loader_logo="beastie"</literal></term>
761
      <varlistentry><term><literal>loader_logo="beastie"</literal></term>
762
762
763
	<listitem>
763
        <listitem>
764
	  <para>This will replace the default words
764
          <para>This will replace the default words
765
	    <quote>&os;</quote>, which are displayed to the right of
765
            <quote>&os;</quote>, which are displayed to the right of
766
	    the boot options menu, with the colored beastie
766
            the boot options menu, with the colored beastie
767
	    logo.</para>
767
            logo.</para>
768
	</listitem>
768
        </listitem>
769
      </varlistentry>
769
      </varlistentry>
770
    </variablelist>
770
    </variablelist>
771
771
Lines 778-790 Link Here
778
      <title>Device Hints</title>
778
      <title>Device Hints</title>
779
779
780
      <authorgroup>
780
      <authorgroup>
781
	<author>
781
        <author>
782
	  <personname>
782
          <personname>
783
	    <firstname>Tom</firstname>
783
            <firstname>Tom</firstname>
784
	    <surname>Rhodes</surname>
784
            <surname>Rhodes</surname>
785
	  </personname>
785
          </personname>
786
	  <contrib>Contributed by </contrib>
786
          <contrib>Contributed by </contrib>
787
	</author>
787
        </author>
788
      </authorgroup>
788
      </authorgroup>
789
    </info>
789
    </info>
790
790
Lines 828-865 Link Here
828
828
829
    <itemizedlist>
829
    <itemizedlist>
830
      <listitem>
830
      <listitem>
831
	<para><literal>at</literal>: specifies the bus which the
831
        <para><literal>at</literal>: specifies the bus which the
832
	  device is attached to.</para>
832
          device is attached to.</para>
833
      </listitem>
833
      </listitem>
834
834
835
      <listitem>
835
      <listitem>
836
	<para><literal>port</literal>: specifies the start address of
836
        <para><literal>port</literal>: specifies the start address of
837
	  the <acronym>I/O</acronym> to be used.</para>
837
          the <acronym>I/O</acronym> to be used.</para>
838
      </listitem>
838
      </listitem>
839
839
840
      <listitem>
840
      <listitem>
841
	<para><literal>irq</literal>: specifies the interrupt request
841
        <para><literal>irq</literal>: specifies the interrupt request
842
	  number to be used.</para>
842
          number to be used.</para>
843
      </listitem>
843
      </listitem>
844
844
845
      <listitem>
845
      <listitem>
846
	<para><literal>drq</literal>: specifies the DMA channel
846
        <para><literal>drq</literal>: specifies the DMA channel
847
	  number.</para>
847
          number.</para>
848
      </listitem>
848
      </listitem>
849
849
850
      <listitem>
850
      <listitem>
851
	<para><literal>maddr</literal>: specifies the physical memory
851
        <para><literal>maddr</literal>: specifies the physical memory
852
	  address occupied by the device.</para>
852
          address occupied by the device.</para>
853
      </listitem>
853
      </listitem>
854
854
855
      <listitem>
855
      <listitem>
856
	<para><literal>flags</literal>: sets various flag bits for the
856
        <para><literal>flags</literal>: sets various flag bits for the
857
	  device.</para>
857
          device.</para>
858
      </listitem>
858
      </listitem>
859
859
860
      <listitem>
860
      <listitem>
861
	<para><literal>disabled</literal>: if set to
861
        <para><literal>disabled</literal>: if set to
862
	  <literal>1</literal> the device is disabled.</para>
862
          <literal>1</literal> the device is disabled.</para>
863
      </listitem>
863
      </listitem>
864
    </itemizedlist>
864
    </itemizedlist>
865
865
Lines 900-906 Link Here
900
900
901
    <note>
901
    <note>
902
      <para>Power management requires &man.acpi.4; to be loaded as
902
      <para>Power management requires &man.acpi.4; to be loaded as
903
	a module or statically compiled into a custom kernel.</para>
903
        a module or statically compiled into a custom kernel.</para>
904
    </note>
904
    </note>
905
  </sect1>
905
  </sect1>
906
</chapter>
906
</chapter>

Return to bug 212932