1.\" $NetBSD: boot.8,v 1.24 2021/04/22 01:36:25 rin 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 rndseed Ar file 621Load the specified 622.Ar file 623and request the kernel to use it as a seed for the 624.Xr rnd 4 625random number generator. 626The 627.Ar file 628should be in the private format used by 629.Xr rndctl 8 , 630and should have been saved by 631.Ql "rndctl -S" 632shortly before the previous shutdown. 633See the 634.Va random_seed 635and 636.Va random_file 637variables in 638.Xr rc.conf 5 , 639and the 640.Pa /etc/rc.d/random_seed 641script, for a way to manage the seed file. 642Using the same seed file on more then one host, 643or for more than one boot on the same host, 644will reduce the quality of random numbers 645and may impact system security. 646.It Ic userconf Ar command 647Pass command 648.Ar command 649to 650.Xr userconf 4 651at boot time. 652These commands are processed before the interactive 653.Xr userconf 4 654shell is executed, if requested. 655.It Ic splash Ar file 656Load a graphical image from the specified 657.Ar file 658and request the kernel to use it as a splash screen. 659The 660.Ar file 661should contain an image in one of these formats: 662JPEG (baseline only, not progressive), 663PNG (8-bit only), 664TGA, 665BMP (non-1bpp, non-RLE), 666GIF, 667PSD (composited view only), 668or 669PIC. 670.It Ic vesa Bro Ar \^modenum \ 671 No \(or Li on \ 672 No \(or Li off \ 673 No \(or Li enabled \ 674 No \(or Li disabled \ 675 No \(or Li list Brc 676Initialise the video card to the specified resolution and bit depth. 677The 678.Ar modenum 679should be in the form of 680.Ql 0x100 , 681.Ql 800x600 , 682.Ql 800x600x32 . 683The values 684.Ql enabled , 685.Ql on 686put the display into the default mode, and 687.Ql disabled , 688.Ql off 689returns the display into standard vga mode. 690The value 691.Ql list 692lists all supported modes. 693.El 694.Pp 695In an emergency, the bootstrap methods described in the 696.Nx 697installation notes for the x86 architectures 698can be used to boot from floppy or other media, 699or over the network. 700.Ss Locating the root file system 701The kernel uses information from the bootloader to locate the 702file system to mount as root. 703There are three methods: 704.Bl -tag -width 04n -offset 04n 705.\" XXX: what this .Va is supposed to mean? 706.It Dv BTINFO_ROOTDEVICE Va from 707.Xr boot.cfg 5 708or multiboot. 709The bootloader passes the root device name as driver, unit, and 710partition (like 711.Ql sd0a Ns ). 712This will be automatically substituted by a 713.Xr dk 4 714wedge if one is discovered. 715.Pp 716The bootloader passes a wedge name as 717.Dq Li wedge: 718followed by the name. 719The kernel will search for a 720.Xr dk 4 721device with that name. 722.It Dv BTINFO_BOOTWEDGE Va determined by bootblock 723The bootloader passes start offset and length of a hard disk partition 724and a offset, size and hash of a 725.Dq boot area . 726Then kernel searches 727all disks and wedges for a block sequence at that offset with a 728matching hash. 729If one is found, the kernel will look for a wedge 730on that device at the same offset. 731.Pp 732An additional partition number is provided if the bootloader also 733passed a 734.Dv BTINFO_BOOTDISK 735record. 736This (or partition 737.Ql a ) 738will be used 739by the kernel as a fallback if there is no matching wedge. 740.It Dv BTINFO_BOOTDISK Va determined by bootblock 741This uses the device number passed by the 742.Tn BIOS 743that distinguishes between floppy, hard drive and 744.Tn CD-ROM 745boot. 746.Bl -tag -width xxx 747.It Floppy 748The kernel searches for the 749.Xr fd 4 750device with the correct unit, the partition number is used 751to select a specific disk format. 752See 753.Xr fd 4 754for details. 755.It Hard drive 756The bootloader passed a partition number and disklabel 757data (offset, type, checksum, packname). 758The kernel searches 759all disks for a matching disklabel. 760If one is found, the 761kernel will use that device and partition number. 762.It Tn CDROM 763The 764.Tn BIOS 765does not distinguish between multiple 766.Tn CD 767devices. 768The kernel searches for the first 769.Xr cd 4 770device. 771So you can only boot from unit 0. 772.El 773.El 774.Sh FILES 775.Bl -tag -width /usr/mdec/bootxx_fstype -compact 776.It Pa /boot 777boot program code loaded by the primary bootstrap 778.It Pa /boot.cfg 779optional configuration file 780.It Pa /netbsd 781system code 782.It Pa /netbsd.gz 783gzip-compressed system code 784.It Pa /usr/mdec/boot 785master copy of the boot program (copy to /boot) 786.It Pa /usr/mdec/bootxx_fstype 787primary bootstrap for file system type fstype, copied to the start of 788the 789.Nx 790partition by 791.Xr installboot 8 . 792.It Pa /usr/mdec/bootia32.efi 793.It Pa /usr/mdec/bootx64.efi 794.Tn UEFI 795bootstraps for 796.Nx Ns /i386 797and 798.Nx Ns /amd64 , 799which should be copied to the 800.Pa /EFI/boot 801directory in a 802.Tn FAT 803formatted partition of type 804.Tn EFI 805(Either 806.Xr x86/mbr 8 807and 808.Xr gpt 8 , 809see the 810.Sx BUGS 811section). 812.Nx 813.Tn UEFI 814bootstrap reads its configuration from the 815.Pa /EFI/NetBSD/boot.cfg 816file in the 817.Tn EFI 818partition. 819.El 820.Sh SEE ALSO 821.Xr ddb 4 , 822.Xr fd 4 , 823.Xr pciback 4 , 824.Xr userconf 4 , 825.Xr boot.cfg 5 , 826.Xr halt 8 , 827.Xr installboot 8 , 828.Xr reboot 8 , 829.Xr rescue 8 , 830.Xr shutdown 8 , 831.Xr x86/boot_console 8 , 832.Xr x86/dosboot 8 , 833.Xr x86/mbr 8 , 834.Xr x86/multiboot 8 , 835.Xr x86/pxeboot 8 , 836.Xr boothowto 9 837.Sh BUGS 838The kernel file name must be specified before, not after, the boot options. 839Any 840.Ar filename 841specified after the boot options, e.g.: 842.Pp 843.Dl boot -d netbsd.test 844.Pp 845is ignored, and the default kernel is booted. 846.Pp 847Hard disks are always accessed by 848.Tn BIOS 849functions. 850Unit numbers are 851.Tn BIOS 852device numbers which might differ from numbering in the 853.Nx 854kernel or physical parameters 855.Po 856e.g., 857.Tn SCSI 858slave numbers 859.Pc . 860There isn't any distinction between 861.Dq sd 862and 863.Dq wd 864devices at the bootloader level. 865This is less a bug of the bootloader code than 866a shortcoming of the PC architecture. 867The default disk device's name printed in the starting message 868is derived from the 869.Dq type 870field of the 871.Nx 872disklabel (if it is a hard disk). 873.Pp 874.Tn UEFI 875implementation are supposed to support either 876.Xr x86/mbr 8 877or 878.Xr gpt 8 879partitioning, but some do not handle the latter. 880.Tn UEFI 881Booting 882from a 883.Xr gpt 8 884partitioned disk is still possible in this case, by adding 885an overlapping 886.Tn EFI 887partition in the protective 888.Xr x86/mbr 8 889block. 890This can be achieved using the following commands 891(you must adapt the hard disk and 892.Tn EFI 893partition start end size to fit your setup): 894.Bd -literal -offset indent 895dd if=/dev/rwd0d bs=512 count=1 of=mbr 896fdisk -FIfaui1s 4/34/32768 -c /usr/mdec/mbr mbr 897dd if=mbr bs=512 count=1 of=/dev/rwd0d conv=notrunc 898.Ed 899.Pp 900The resulting 901.Xr x86/mbr 8 902partition table will look like this: 903.Bd -literal -offset indent 9040: GPT Protective MBR (sysid 238) 905 start 1, size 2097151 (1024 MB, Cyls 0-130/138/8) 906 PBR is not bootable: Bad magic number (0x0000) 9071: Primary DOS with 16 bit FAT <32M (sysid 4) 908 start 34, size 32768 (16 MB, Cyls 0/0/35-2/10/42), Active 9092: <UNUSED> 9103: <UNUSED> 911.Ed 912