xref: /netbsd-src/share/man/man8/man8.x86/boot.8 (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1.\"	$NetBSD: boot.8,v 1.26 2021/06/22 03:39:21 gutteridge Exp $
2.\"
3.\" Copyright (c) 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software written and contributed
7.\" to Berkeley by William Jolitz.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"     @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
34.\"
35.Dd July 15, 2020
36.Dt BOOT 8 x86
37.Os
38.Sh NAME
39.Nm boot
40.Nd
41system bootstrapping procedures
42.Sh DESCRIPTION
43Intel Architecture, 32-bit (IA-32) computers (the
44.Tn IBM PC
45and its clones)
46that can run
47.Nx Ns /i386
48or
49.Nx Ns /amd64
50can use any of the following boot procedures, depending on what the hardware and
51.Tn BIOS
52support:
53.Bl -tag -width "x86/pxeboot(8)"
54.It boot
55bootstrap
56.Nx
57from the system
58.Tn BIOS
59.It efiboot
60bootstrap
61.Nx
62from the system
63.Tn UEFI
64.It Xr x86/dosboot 8
65bootstrap
66.Nx
67from
68.Tn MS-DOS
69.It Xr x86/pxeboot 8
70network bootstrap
71.Nx
72from a
73.Tn TCP/IP
74.Tn LAN
75with
76.Tn DHCP ,
77.Tn TFTP ,
78and
79.Tn NFS .
80.El
81.Ss Power fail and crash recovery
82Normally, the system will reboot itself at power-up or after crashes.
83An automatic consistency check of the file systems will be performed,
84and unless this fails, the system will resume multi-user operations.
85.Ss Cold starts
86The 386
87.Tn "PC AT"
88clones attempt to boot the floppy disk drive A (otherwise known as drive
890) first, and failing that, attempt to boot the hard disk C (otherwise
90known as hard disk controller 1, drive 0).
91The
92.Nx
93bootblocks are loaded and started either by the
94.Tn BIOS ,
95or by a boot selector program (such as OS-BS, BOOTEASY, the OS/2 Boot Menu or
96.Nx Ns 's
97.No boot-selecting
98master boot record - see
99.Xr x86/mbr 8 ) .
100.Ss Normal Operation
101Once running, a banner similar to the following will appear:
102.Bd -literal -offset indent
103>> NetBSD BIOS Boot, revision 3.0
104>> (user@buildhost, builddate)
105>> Memory: 637/15360 k
106Press return to boot now, any other key for boot menu
107booting hd0a:netbsd - starting in 5
108.Ed
109.Pp
110After a countdown, the system image listed will be loaded.
111In the example above, it will be
112.Dq Li hd0a:netbsd
113which is the file
114.Pa /netbsd
115on partition
116.Dq Li a
117of the
118.Nx
119.Tn MBR
120partition of the first hard disk known to the
121.Tn BIOS
122.Po
123which is an
124.Tn IDE
125or similar device \(em see the
126.Sx BUGS
127section
128.Pc .
129.Pp
130Pressing a key within the time limit, or before the boot program starts, will
131enter interactive mode.
132When using a short or 0 timeout, it is often useful to interrupt the boot
133by holding down a shift key, as some BIOSes and BIOS extensions will drain the
134keystroke buffer at various points during POST.
135.Pp
136If present, the file
137.Pa /boot.cfg
138will be used to configure the behaviour of the boot loader including
139setting the timeout, choosing a console device, altering the banner
140text and displaying a menu allowing boot commands to be easily chosen.
141See
142.Xr boot.cfg 5 .
143.Ss Boot Protocol
144The
145.Nx Ns /x86
146boot loader can boot a kernel using either the native
147.Nx
148boot protocol, or the
149.Dq multiboot
150protocol (which is compatible with some other operating systems).
151In the native
152.Nx
153boot protocol, options are passed from the boot loader
154to the kernel via flag bits in the
155.Va boothowto
156variable (see
157.Xr boothowto 9 ) .
158In the multiboot protocol, options are passed from the boot loader
159to the kernel as strings.
160.Ss Diagnostic Output
161If the first stage boot fails to load the boot, it will print a terse
162message indicating the reason for the failure.
163The possible error messages and their cause are listed in
164.Xr x86/mbr 8 .
165.Pp
166If the first stage boot succeeds, the banner will be shown and the
167error messages should be self-explanatory.
168.Ss Interactive mode
169In interactive mode, the boot loader will present a prompt, allowing
170input of these commands:
171.\" NOTE: much of this text is duplicated in the MI boot.8.
172.\" Some of it is
173.\" also duplicated in the x86-specific x86/dosboot.8 and x86/pxeboot.8;
174.\" please try to keep all relevant files synchronized.
175.Bl -tag -width 04n -offset 04n
176.It Ic boot Oo Ar device Ns Ic \&: Oc Ns Oo Ar filename Oc Oo Fl 1234abcdmqsvxz Oc
177The default
178.Ar device
179will be set to the disk from which the boot loader was loaded.
180The partition is set to the first match in this list:
181.Bl -enum
182.It
183The first
184.Xr gpt 8
185partition with the
186.Va bootme
187attribute set.
188.It
189The partition from which the boot loader was loaded from, if that
190can be detected.
191.It
192The first partition with a file system that could be bootable.
193.It
194The first partition.
195.El
196.Pp
197To boot from an alternate disk, the full name of the device should
198be given at the prompt.
199.Ar device
200is of the form
201.Li NAME= Ns Ar partition_label
202when booting from a
203.Xr gpt 8
204partitioned disk.
205Otherwise, the syntax is
206.Xo Ar xd\^ Ns
207.Op Ar N\^ Ns Op Ar x
208.Xc
209where
210.Ar xd
211is the device from which to boot,
212.Ar N
213is the unit number, and
214.Ar x
215is the partition letter.
216.Pp
217In the latter case, the following list of supported devices may
218vary from installation to installation:
219.Bl -hang
220.It hd
221Hard disks as numbered by the BIOS.
222This includes ST506, IDE, ESDI, RLL disks on a WD100[2367] or
223lookalike controller(s), and SCSI disks
224on SCSI controllers recognized by the BIOS.
225.It fd
226Floppy drives as numbered by the BIOS.
227.It cd
228CD-ROM drives as numbered by the BIOS.
229.It raid
230RAIDframe configured from hard disks recognized by the BIOS.
231Only RAID level 1 sets are supported by bootstrap code.
232If the RAID is partitioned, the first partition is used, or the
233first
234.Xr gpt 8
235partition that has the
236.Va bootme
237attribute set.
238Inner RAIDframe partitions can also be given to the
239.Ic dev
240command using he
241.Li NAME= Ns Ar partition_label
242syntax.
243.El
244.Pp
245The default
246.Va filename
247is
248.Pa netbsd ;
249if the boot loader fails to successfully
250open that image, it then tries
251.Pa netbsd.gz
252(expected to be a kernel image compressed by gzip), followed by
253.Pa onetbsd ,
254.Pa onetbsd.gz ,
255.Pa netbsd.old ,
256and finally
257.Pa netbsd.old.gz .
258Alternate system images can be loaded by just specifying the name of the image.
259.Pp
260Options are:
261.Bl -tag -width xxx
262.It Fl 1
263Sets the machine-dependent flag
264.Dv RB_MD1
265in
266.Va boothowto .
267In
268.Nx Ns /x86 ,
269this disables multiprocessor boot;
270the kernel will boot in uniprocessor mode.
271.It Fl 2
272Sets the machine-dependent flag
273.Dv RB_MD2
274in
275.Va boothowto .
276In
277.Nx Ns /x86 ,
278this disables ACPI.
279.It Fl 3
280Sets the machine-dependent flag
281.Dv RB_MD3
282in
283.Va boothowto .
284In
285.Nx Ns /amd64 ,
286this disables SVS.
287.It Fl 4
288Sets the machine-dependent flag
289.Dv RB_MD4
290in
291.Va boothowto .
292In
293.Nx Ns /x86 ,
294this has no effect.
295.It Fl a
296Sets the
297.Dv RB_ASKNAME
298flag in
299.Va boothowto .
300This causes the kernel to prompt for the root file system device,
301the system crash dump device, and the path to
302.Xr init 8 .
303.It Fl b
304Sets the
305.Dv RB_HALT
306flag in
307.Va boothowto .
308This causes subsequent reboot attempts to halt instead of rebooting.
309.It Fl c
310Sets the
311.Dv RB_USERCONF
312flag in
313.Va boothowto .
314This causes the kernel to enter the
315.Xr userconf 4
316device configuration manager as soon as possible during the boot.
317.Xr userconf 4
318allows devices to be enabled or disabled, and allows device locators
319(such as hardware addresses or bus numbers)
320to be modified before the kernel attempts to attach the devices.
321.It Fl d
322Sets the
323.Dv RB_KDB
324flag in
325.Va boothowto .
326Requests the kernel to enter debug mode, in which it
327waits for a connection from a kernel debugger; see
328.Xr ddb 4 .
329.It Fl m
330Sets the
331.Dv RB_MINIROOT
332flag in
333.Va boothowto .
334Informs the kernel that a mini-root file system is present in memory.
335.It Fl q
336Sets the
337.Dv AB_QUIET
338flag in
339.Va boothowto .
340Boot the system in quiet mode.
341.It Fl s
342Sets the
343.Dv RB_SINGLE
344flag in
345.Va boothowto .
346Boot the system in single-user mode.
347.It Fl v
348Sets the
349.Dv AB_VERBOSE
350flag in
351.Va boothowto .
352Boot the system in verbose mode.
353.It Fl x
354Sets the
355.Dv AB_DEBUG
356flag in
357.Va boothowto .
358Boot the system with debug messages enabled.
359.It Fl z
360Sets the
361.Dv AB_SILENT
362flag in
363.Va boothowto .
364Boot the system in silent mode.
365.El
366.It Ic consdev Ar dev\| Ns Oo Ns Ic \&, Ns Ar speed Oc
367Immediately switch the console to the specified device
368.Ar dev
369and reprint the banner.
370.Ar dev
371must be one of
372.\" .Bl -item -width com[0123]kbd -offset indent -compact
373.Li pc , com0 , com1 , com2 ,
374.Li com3 , com0kbd , com1kbd , com2kbd ,
375.Li com3kbd ,
376or
377.Li auto .
378See
379.Sx Console Selection Policy
380in
381.Xr x86/boot_console 8 .
382.Pp
383A
384.Ar speed
385for the serial port is optional and defaults to 9600.
386If a value of zero is specified, then the current baud rate (set by the
387BIOS) will be used.
388Setting the
389.Ar speed
390with the
391.Li pc
392device is not possible.
393.It Ic dev Op Ar device
394Set the default drive and partition for subsequent file system
395operations.
396Without an argument, print the current setting.
397.Ar device
398is of the form specified in
399.Ic boot .
400.It Ic fs Ar file
401Load a file system image from the specified
402.Ar file ,
403and request the kernel to use it as the root file system.
404The
405.Xr makefs 8
406utility may be used to create suitable file system images.
407.It Ic help
408Print an overview about commands and arguments.
409.It Ic load Ar module Op Ar arguments
410Load the specified kernel
411.Ar module ,
412and pass it the specified
413.Ar arguments .
414If the module name is not an absolute path,
415.Bd -ragged -offset indent -compact
416.Pa /stand/ Ns Xo Ns
417.Aq Ar arch Ns
418.Pa / Ns
419.Aq Ar osversion Ns
420.Pa /modules/ Ns
421.Aq Ar module Ns
422.Pa / Ns
423.Aq Ar module Ns
424.Pa .kmod
425.Xc
426.Ed
427is used.
428Possible uses of the
429.Ic load
430command include loading a memory disk image before booting a kernel,
431or loading a
432.Tn Xen
433DOM0 kernel before booting the
434.Tn Xen
435hypervisor.
436See
437.Xr boot.cfg 5
438for examples.
439.Pp
440In addition to the
441.Cm boot
442options specified above, the
443.Tn Xen
444DOM0 kernel accepts
445.Po Ar arguments
446being separated with spaces
447.Pc :
448.Bl -tag -width xxx
449.It Ic bootdev Ns = Ns Ar dev Po or Ic root Ns = Ns Ar dev Pc
450Override the default boot device.
451.Ar dev
452is of the form
453.Li NAME= Ns Ar partition_label
454for
455.Xr gpt 8
456partitioned disks.
457It can also be a unit name
458.Pq Ql wd0 ,
459or an interface name
460.Po Ql bge0 ,
461.Ql wm0 ,
462\&...
463.Pc
464for cases where the root file system has to be loaded
465from network (see the
466.Sx BUGS
467section in
468.Xr x86/pxeboot 8 ) .
469.It Ic console Ns = Ns Ar dev
470Console used by DOM0 kernel during boot.
471.Ar dev
472accepts the same values as the ones given for the
473.Cm consdev
474command.
475See
476.Sx Console Selection Policy
477in
478.Xr x86/boot_console 8 .
479.It Xo Ic ip Ns Li \&= Ns
480.Ar my_ip Ns Li \&: Ns Ar serv_ip Ns Li \&: Ns Ar gw_ip Ns Li \&: Ns
481.Ar mask Ns Li \&: Ns Ar host Ns Li \&: Ns Ar iface
482.Xc
483Specify various parameters for a network boot (IPs are in
484dot notation),
485each one separated by a colon:
486.Bl -tag -width xxxxxxx
487.It Ar my_ip
488address of the host
489.It Ar serv_ip
490address of the NFS server
491.It Ar gw_ip
492address of the gateway
493.It Ar mask
494network mask
495.It Ar host
496address of the host
497.It Ar iface
498interface
499.Po e.g., Dq Li xennet0
500or
501.Dq Li eth0
502.Pc
503.El
504.It Ic nfsroot Ns = Ns Ar address Ns Li \&: Ns Ar rootpath
505Boot the system with root on NFS.
506.Ar address
507is the address of the NFS server, and
508.Ar rootpath
509is the remote mount point for the root file system.
510.It Ic pciback.hide Ns = Ns Ar pcidevs
511Pass a list of PCI IDs for use with the PCI backend driver,
512.Xr pciback 4 .
513.Ar pcidevs
514is formed of multiple IDs (in
515.Ar bus Ns Li \&: Ns Ar device Ns Li \&. Ns Ar function
516notation),
517each ID being surrounded with brackets.
518PCI domain IDs are currently ignored.
519See
520.Xr pciback 4 .
521.El
522.It Ic ls Op Ar path
523Print a directory listing of
524.Ar path ,
525containing inode number, filename, and file type.
526.Ar path
527can contain a device specification.
528.It Ic menu
529Display the boot menu and initiate a countdown,
530similarly to what would have happened if interactive mode
531had not been entered.
532.It Ic modules Bro Li \^on \
533           No \(or Li off \
534           No \(or Li enabled \
535           No \(or Li disabled\^ \
536           Brc
537The values
538.Ql enabled ,
539.Ql on
540will enable module loading for
541.Ic boot
542and
543.Ic multiboot ,
544whereas
545.Ql disabled ,
546.Ql off
547will turn off the feature.
548.It Ic multiboot Ar kernel Op Ar arguments
549Boot the specified
550.Ar kernel ,
551using the
552.Dq multiboot
553protocol instead of the native
554.Nx
555boot protocol.
556The
557.Ar kernel
558is specified in the same way as with the
559.Ic boot
560command.
561.Pp
562The multiboot protocol may be used in the following cases:
563.Bl -tag -width indent
564.It Nx Ns / Ns  Xen No kernels
565The
566.Tn Xen
567DOM0 kernel must be loaded as a module using the
568.Ic load
569command, and the
570.Tn Xen
571hypervisor must be booted using the
572.Ic multiboot
573command.
574Options for the DOM0 kernel (such as
575.Dq -s
576for single user mode) must be passed as options to the
577.Ic load
578command.
579Options for the hypervisor (such as
580.Dq Li dom0_mem=256M
581to reserve
582.Pf 256 Tn MB
583of memory for DOM0)
584must be passed as options to the
585.Ic multiboot
586command.
587See
588.Xr boot.cfg 5
589for examples on how to boot
590.Nx Ns / Ns  Xen.
591.It Nx No multiboot kernels
592A
593.Nx
594kernel that was built with
595.Cd options MULTIBOOT
596(see
597.Xr x86/multiboot 8 )
598may be booted with either the
599.Ic boot
600or
601.Ic multiboot
602command, passing the same
603.Ar arguments
604in either case.
605.It Non- Ns Nx No kernels
606A kernel for a
607.No non- Ns Nx
608operating system that expects to be booted using the
609multiboot protocol (such as by the GNU
610.Dq GRUB
611boot loader)
612may be booted using the
613.Ic multiboot
614command.
615See the foreign operating system's documentation for the available
616.Ar arguments .
617.El
618.It Ic quit
619Reboot the system.
620.It Ic root Ar spec
621Pass an explicit root specification to the kernel.
622See BTINFO_ROOTDEVICE for details.
623.It Ic rndseed Ar file
624Load the specified
625.Ar file
626and request the kernel to use it as a seed for the
627.Xr rnd 4
628random number generator.
629The
630.Ar file
631should be in the private format used by
632.Xr rndctl 8 ,
633and should have been saved by
634.Ql "rndctl -S"
635shortly before the previous shutdown.
636See the
637.Va random_seed
638and
639.Va random_file
640variables in
641.Xr rc.conf 5 ,
642and the
643.Pa /etc/rc.d/random_seed
644script, for a way to manage the seed file.
645Using the same seed file on more then one host,
646or for more than one boot on the same host,
647will reduce the quality of random numbers
648and may impact system security.
649.It Ic userconf Ar command
650Pass command
651.Ar command
652to
653.Xr userconf 4
654at boot time.
655These commands are processed before the interactive
656.Xr userconf 4
657shell is executed, if requested.
658.It Ic splash Ar file
659Load a graphical image from the specified
660.Ar file
661and request the kernel to use it as a splash screen.
662The
663.Ar file
664should contain an image in one of these formats:
665JPEG (baseline only, not progressive),
666PNG (8-bit only),
667TGA,
668BMP (non-1bpp, non-RLE),
669GIF,
670PSD (composited view only),
671or
672PIC.
673.It Ic vesa Bro Ar \^modenum \
674        No \(or Li on \
675        No \(or Li off \
676        No \(or Li enabled \
677        No \(or Li disabled \
678        No \(or Li list Brc
679Initialise the video card to the specified resolution and bit depth.
680The
681.Ar modenum
682should be in the form of
683.Ql 0x100 ,
684.Ql 800x600 ,
685.Ql 800x600x32 .
686The values
687.Ql enabled ,
688.Ql on
689put the display into the default mode, and
690.Ql disabled ,
691.Ql off
692returns the display into standard vga mode.
693The value
694.Ql list
695lists all supported modes.
696.El
697.Pp
698In an emergency, the bootstrap methods described in the
699.Nx
700installation notes for the x86 architectures
701can be used to boot from floppy or other media,
702or over the network.
703.Ss Locating the root file system
704The kernel uses information from the bootloader to locate the
705file system to mount as root.
706There are three methods:
707.Bl -tag -width 04n -offset 04n
708.\" XXX: what this .Va is supposed to mean?
709.It Dv BTINFO_ROOTDEVICE Va from
710.Xr boot.cfg 5
711or multiboot.
712The bootloader passes the root device name as driver, unit, and
713partition (like
714.Ql sd0a Ns ).
715This will be automatically substituted by a
716.Xr dk 4
717wedge if one is discovered.
718.Pp
719If the bootloader passes a wedge name as
720.Dq Li wedge:
721or
722.Dq Li NAME=
723followed by the name.
724The kernel will search for a
725.Xr dk 4
726device with that name.
727.It Dv BTINFO_BOOTWEDGE Va determined by bootblock
728The bootloader passes start offset and length of a hard disk partition
729and a offset, size and hash of a
730.Dq boot area .
731Then kernel searches
732all disks and wedges for a block sequence at that offset with a
733matching hash.
734If one is found, the kernel will look for a wedge
735on that device at the same offset.
736.Pp
737An additional partition number is provided if the bootloader also
738passed a
739.Dv BTINFO_BOOTDISK
740record.
741This (or partition
742.Ql a )
743will be used
744by the kernel as a fallback if there is no matching wedge.
745.It Dv BTINFO_BOOTDISK Va determined by bootblock
746This uses the device number passed by the
747.Tn BIOS
748that distinguishes between floppy, hard drive and
749.Tn CD-ROM
750boot.
751.Bl -tag -width xxx
752.It Floppy
753The kernel searches for the
754.Xr fd 4
755device with the correct unit, the partition number is used
756to select a specific disk format.
757See
758.Xr fd 4
759for details.
760.It Hard drive
761The bootloader passed a partition number and disklabel
762data (offset, type, checksum, packname).
763The kernel searches
764all disks for a matching disklabel.
765If one is found, the
766kernel will use that device and partition number.
767.It Tn CDROM
768The
769.Tn BIOS
770does not distinguish between multiple
771.Tn CD
772devices.
773The kernel searches for the first
774.Xr cd 4
775device.
776So you can only boot from unit 0.
777.El
778.El
779.Sh FILES
780.Bl -tag -width /usr/mdec/bootxx_fstype -compact
781.It Pa /boot
782boot program code loaded by the primary bootstrap
783.It Pa /boot.cfg
784optional configuration file
785.It Pa /netbsd
786system code
787.It Pa /netbsd.gz
788gzip-compressed system code
789.It Pa /usr/mdec/boot
790master copy of the boot program (copy to /boot)
791.It Pa /usr/mdec/bootxx_fstype
792primary bootstrap for file system type fstype, copied to the start of
793the
794.Nx
795partition by
796.Xr installboot 8 .
797.It Pa /usr/mdec/bootia32.efi
798.It Pa /usr/mdec/bootx64.efi
799.Tn UEFI
800bootstraps for
801.Nx Ns /i386
802and
803.Nx Ns /amd64 ,
804which should be copied to the
805.Pa /EFI/boot
806directory in a
807.Tn FAT
808formatted partition of type
809.Tn EFI
810(Either
811.Xr x86/mbr 8
812and
813.Xr gpt 8 ,
814see the
815.Sx BUGS
816section).
817.Nx
818.Tn UEFI
819bootstrap reads its configuration from the
820.Pa /EFI/NetBSD/boot.cfg
821file in the
822.Tn EFI
823partition.
824.El
825.Sh SEE ALSO
826.Xr ddb 4 ,
827.Xr fd 4 ,
828.Xr pciback 4 ,
829.Xr userconf 4 ,
830.Xr boot.cfg 5 ,
831.Xr halt 8 ,
832.Xr installboot 8 ,
833.Xr reboot 8 ,
834.Xr rescue 8 ,
835.Xr shutdown 8 ,
836.Xr x86/boot_console 8 ,
837.Xr x86/dosboot 8 ,
838.Xr x86/mbr 8 ,
839.Xr x86/multiboot 8 ,
840.Xr x86/pxeboot 8 ,
841.Xr boothowto 9
842.Sh BUGS
843The kernel file name must be specified before, not after, the boot options.
844Any
845.Ar filename
846specified after the boot options, e.g.:
847.Pp
848.Dl boot -d netbsd.test
849.Pp
850is ignored, and the default kernel is booted.
851.Pp
852Hard disks are always accessed by
853.Tn BIOS
854functions.
855Unit numbers are
856.Tn BIOS
857device numbers which might differ from numbering in the
858.Nx
859kernel or physical parameters
860.Po
861e.g.,
862.Tn SCSI
863slave numbers
864.Pc .
865There isn't any distinction between
866.Dq sd
867and
868.Dq wd
869devices at the bootloader level.
870This is less a bug of the bootloader code than
871a shortcoming of the PC architecture.
872The default disk device's name printed in the starting message
873is derived from the
874.Dq type
875field of the
876.Nx
877disklabel (if it is a hard disk).
878.Pp
879.Tn UEFI
880implementations are supposed to support either
881.Xr x86/mbr 8
882or
883.Xr gpt 8
884partitioning, but some do not handle the latter.
885.Tn UEFI
886booting
887from a
888.Xr gpt 8
889partitioned disk is still possible in this case, by adding
890an overlapping
891.Tn EFI
892partition in the protective
893.Xr x86/mbr 8
894block.
895This can be achieved using the following commands
896(you must adapt the hard disk and
897.Tn EFI
898partition start end size to fit your setup):
899.Bd -literal -offset indent
900dd if=/dev/rwd0d bs=512 count=1 of=mbr
901fdisk -FIfaui1s 4/34/32768 -c /usr/mdec/mbr mbr
902dd if=mbr bs=512 count=1 of=/dev/rwd0d conv=notrunc
903.Ed
904.Pp
905The resulting
906.Xr x86/mbr 8
907partition table will look like this:
908.Bd -literal -offset indent
9090: GPT Protective MBR (sysid 238)
910    start 1, size 2097151 (1024 MB, Cyls 0-130/138/8)
911        PBR is not bootable: Bad magic number (0x0000)
9121: Primary DOS with 16 bit FAT <32M (sysid 4)
913    start 34, size 32768 (16 MB, Cyls 0/0/35-2/10/42), Active
9142: <UNUSED>
9153: <UNUSED>
916.Ed
917