Copyright (c) 2014 The FreeBSD Foundation

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

.Dd August 31, 2023 .Dt UEFI 8 .Os .Sh NAME .Nm UEFI .Nd Unified Extensible Firmware Interface bootstrapping procedures .Sh DESCRIPTION The .Nm Unified Extensible Firmware Interface provides boot- and run-time services to operating systems. .Nm is a replacement for the legacy BIOS on the i386 and amd64 CPU architectures, and is also used on arm, arm64 and riscv architectures.

p The UEFI specification is the successor to the Extensible Firmware Interface (EFI) specification. The terms UEFI and EFI are often used interchangeably.

p The .Nm boot process loads system bootstrap code located in an EFI System Partition (ESP). The ESP is a GPT or MBR partition with a specific identifier that contains an .Xr msdosfs 4 FAT file system with a specified file hierarchy. l -column -offset indent "Partition Scheme" "ESP Identifier" t Sy "Partition Scheme" Ta Sy "ESP Identifier" t GPT Ta C12A7328-F81F-11D2-BA4B-00A0C93EC93B t MBR Ta 0xEF .El

p The .Nm boot process proceeds as follows: l -enum -offset indent -compact t .Nm firmware runs at power up and searches for an OS loader in the EFI system partition. The path to the loader may be set by an EFI environment variable managed by .Xr efibootmgr 8 . If not set, an architecture-specific default is used. l -column -offset indent "Architecture" "Default Path" t Sy Architecture Ta Sy Default Path t amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI t arm Ta Pa /EFI/BOOT/BOOTARM.EFI t arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI t i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI t riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI .El

p The default .Nm boot configuration for .Fx installs

a loader.efi in the default path. t

a loader.efi reads boot configuration from

a /boot.config or

a /boot/config . t

a loader.efi loads and boots the kernel, as described in .Xr loader.efi 8 . .El

p The .Xr vt 4 system console is automatically selected when booting via .Nm . .Sh FILES l -tag -width /boot/loader -compact .Nm bootstrap t Pa /boot/loader.efi Final stage bootstrap t Pa /boot/kernel/kernel Default kernel t Pa /boot/kernel.old/kernel Typical non-default kernel (optional) .El .Sh SEE ALSO .Xr vt 4 , .Xr boot.config 5 , .Xr msdosfs 4 , .Xr boot 8 , .Xr efibootmgr 8 , .Xr efidp 8 , .Xr efivar 8 , .Xr gpart 8 , .Xr loader.efi 8 , .Xr uefisign 8 .Sh HISTORY EFI boot support for the ia64 architecture first appeared in .Fx 5.0 . .Nm boot support for amd64 first appeared in .Fx 10.1 ; for arm64 in .Fx 11.0 ; for armv6 and armv7 in .Fx 12.0 ; and for riscv in .Fx 13.0 . .Sh BUGS There is no support for 32-bit i386 booting via UEFI.