12b6d38a1SWarner Losh.\" 24d846d26SWarner Losh.\" SPDX-License-Identifier: BSD-2-Clause 39ecf6e0fSMateusz Piotrowski.\" 475a91c70SWarner Losh.\" Copyright (c) 2019-2022 Netflix, Inc 59ecf6e0fSMateusz Piotrowski.\" Copyright (c) 2022 Mateusz Piotrowski <0mp@FreeBSD.org> 685c8c0b7SKonstantin Belousov.\" Copyright 2022 The FreeBSD Foundation, Inc. 785c8c0b7SKonstantin Belousov.\" 885c8c0b7SKonstantin Belousov.\" Part of this documentation was written by 985c8c0b7SKonstantin Belousov.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship 1085c8c0b7SKonstantin Belousov.\" from the FreeBSD Foundation. 112b6d38a1SWarner Losh.\" 122b6d38a1SWarner Losh.\" Redistribution and use in source and binary forms, with or without 132b6d38a1SWarner Losh.\" modification, are permitted provided that the following conditions 142b6d38a1SWarner Losh.\" are met: 152b6d38a1SWarner Losh.\" 1. Redistributions of source code must retain the above copyright 162b6d38a1SWarner Losh.\" notice, this list of conditions and the following disclaimer. 172b6d38a1SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 182b6d38a1SWarner Losh.\" notice, this list of conditions and the following disclaimer in the 192b6d38a1SWarner Losh.\" documentation and/or other materials provided with the distribution. 202b6d38a1SWarner Losh.\" 212b6d38a1SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 222b6d38a1SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 232b6d38a1SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 242b6d38a1SWarner Losh.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 252b6d38a1SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 262b6d38a1SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 272b6d38a1SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 282b6d38a1SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 292b6d38a1SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 302b6d38a1SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 312b6d38a1SWarner Losh.\" SUCH DAMAGE. 322b6d38a1SWarner Losh.\" 3385c8c0b7SKonstantin Belousov.Dd September 4, 2022 342b6d38a1SWarner Losh.Dt LOADER.EFI 8 352b6d38a1SWarner Losh.Os 362b6d38a1SWarner Losh.Sh NAME 372b6d38a1SWarner Losh.Nm loader.efi 382b6d38a1SWarner Losh.Nd UEFI kernel loader 392b6d38a1SWarner Losh.Sh DESCRIPTION 402b6d38a1SWarner LoshOn UEFI systems, 412b6d38a1SWarner Losh.Nm 422b6d38a1SWarner Loshloads the kernel. 439ecf6e0fSMateusz Piotrowski.Pp 442b6d38a1SWarner Losh.Xr boot1.efi 8 452b6d38a1SWarner Loshis used to load 462b6d38a1SWarner Losh.Nm 4775a91c70SWarner Loshwhen it is placed within a UFS or ZFS file system. 4875a91c70SWarner LoshAlternatively, 4975a91c70SWarner Losh.Nm 5075a91c70SWarner Loshis used directly when configured with 5175a91c70SWarner Losh.Xr efibootmgr 8 , 5275a91c70SWarner Loshor when placed directly as the default boot program as described in 5375a91c70SWarner Losh.Xr uefi 8 . 5475a91c70SWarner LoshWhen a system is built using 5575a91c70SWarner Losh.Xr bsdinstall 8 , 5675a91c70SWarner Losh.Nm 5775a91c70SWarner Loshwill be used directly. 5875a91c70SWarner Losh.Ss Console Considerations 5975a91c70SWarner LoshThe EFI BIOS provides a generic console. 6075a91c70SWarner LoshIn 6175a91c70SWarner Losh.Nm 6275a91c70SWarner Loshthis is selected by specifying 6375a91c70SWarner Losh.Dq efi 6475a91c70SWarner Loshusing the 6575a91c70SWarner Losh.Dv console 6675a91c70SWarner Loshvariable. 6775a91c70SWarner Losh.Nm 6875a91c70SWarner Loshexamines the 6975a91c70SWarner Losh.Dv 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut 7075a91c70SWarner LoshUEFI environment variable to guess what the 7175a91c70SWarner Losh.Dq efi 7275a91c70SWarner Loshconsole points to. 7375a91c70SWarner Losh.Nm 7475a91c70SWarner Loshwill output its prompts and menus to all the places specified by ConOut. 7575a91c70SWarner LoshHowever, the 7675a91c70SWarner Losh.Fx 7775a91c70SWarner Loshkernel has a limitation when more than one console is present. 7875a91c70SWarner LoshThe kernel outputs to all configured consoles. 7975a91c70SWarner LoshOnly the primary console will get the log messages from the 8075a91c70SWarner Losh.Xr rc 8 8175a91c70SWarner Loshsystem, and prompts for things like 8275a91c70SWarner Losh.Xr geli 8 8375a91c70SWarner Loshpasswords. 8475a91c70SWarner LoshIf 8575a91c70SWarner Losh.Nm 8675a91c70SWarner Loshfinds a video device first, then 8775a91c70SWarner Losh.Nm 8875a91c70SWarner Loshtells the kernel to use the video console as primary. 8975a91c70SWarner LoshLikewise, if a serial device is first in the 9075a91c70SWarner Losh.Dv ConOut 9175a91c70SWarner Loshlist, the serial port will be the primary console. 9275a91c70SWarner Losh.Pp 9375a91c70SWarner LoshIf there is no 9475a91c70SWarner Losh.Dv ConOut 9575a91c70SWarner Loshvariable, both serial and video are attempted. 9675a91c70SWarner Losh.Nm 9775a91c70SWarner Loshuses the 9875a91c70SWarner Losh.Dq efi 9975a91c70SWarner Loshconsole for the video (which may or may not work) and 10075a91c70SWarner Losh.Dq comconsole 10175a91c70SWarner Loshfor the serial on 10275a91c70SWarner Losh.Dv COM1 10375a91c70SWarner Loshat the default baud rate. 10475a91c70SWarner LoshThe kernel will use a dual console, with the video console 10575a91c70SWarner Loshprimary if a UEFI graphics device is detected, or the serial console 10675a91c70SWarner Loshas primary if not. 10775a91c70SWarner Losh.Pp 10875a91c70SWarner LoshOn x86 platforms, if you wish to redirect the loader's output to a serial port 10975a91c70SWarner Loshwhen the EFI BIOS doesn't support it, or to a serial port that isn't the one the 11075a91c70SWarner LoshEFI BIOS redirects its output to, set 11175a91c70SWarner Losh.Dv console 11275a91c70SWarner Loshto 11375a91c70SWarner Losh.Dq comconsole . 11475a91c70SWarner LoshThe default port is 11575a91c70SWarner Losh.Dv COM1 11675a91c70SWarner Loshwith an I/O address of 0x3f8. 11775a91c70SWarner Losh.Dv comconsole_port 11875a91c70SWarner Loshis used to set this to a different port address. 11975a91c70SWarner Losh.Dv comconsole_speed 12075a91c70SWarner Loshis used to set the of the serial port (the default is 9600). 12175a91c70SWarner LoshIf you have 12275a91c70SWarner Losh.Dv console 12375a91c70SWarner Loshset to 12475a91c70SWarner Losh.Dq efi,comconsole 12575a91c70SWarner Loshyou will get output on both the EFI console and the serial port. 12675a91c70SWarner LoshIf this causes a doubling of characters, set 12775a91c70SWarner Losh.Dv console 12875a91c70SWarner Loshto 12975a91c70SWarner Losh.Dq efi , 13075a91c70SWarner Loshsince your EFI BIOS is redirecting to the serial port already. 13175a91c70SWarner Losh.Pp 13275a91c70SWarner LoshIf your EFI BIOS redirects the serial port, you may need to tell the kernel 13375a91c70SWarner Loshwhich address to use. 13475a91c70SWarner LoshEFI uses ACPI's UID to identify the serial port, but 13575a91c70SWarner Losh.Nm 13675a91c70SWarner Loshdoes not have an ACPI parser, so it cannot convert that to an I/O port. 13775a91c70SWarner LoshThe 13875a91c70SWarner Losh.Fx 13975a91c70SWarner Loshkernel initializes its consoles before it can decode ACPI resources. 14075a91c70SWarner LoshThe 14175a91c70SWarner Losh.Fx 14275a91c70SWarner Loshkernel will look at the 14375a91c70SWarner Losh.Dv hw.uart.console 14475a91c70SWarner Loshvariable to set its serial console. 14575a91c70SWarner LoshIts format should be described in 14675a91c70SWarner Losh.Xr uart 4 14775a91c70SWarner Loshbut is not. 14875a91c70SWarner LoshSet it to 14975a91c70SWarner Losh.Dq io:0x3f8,br:115200 15075a91c70SWarner Loshwith the proper port address. 15175a91c70SWarner LoshPCI or memory mapped ports are beyond the scope of this man page. 15275a91c70SWarner Losh.Pp 15375a91c70SWarner LoshThe serial ports are assigned as follows on IBM PC compatible systems: 15475a91c70SWarner Losh.Bl -column -offset indent ".Sy Windows Name" ".Sy I/O Port Address" ".Sy Typical FreeBSD device" 15575a91c70SWarner Losh.It Sy Windows Name Ta Sy I/O Port Address Ta Sy Typical FreeBSD device 15675a91c70SWarner Losh.It COM1 Ta 0x3f8 Ta Pa /dev/uart0 15775a91c70SWarner Losh.It COM2 Ta 0x2f8 Ta Pa /dev/uart1 15875a91c70SWarner Losh.It COM3 Ta 0x3e8 Ta Pa /dev/uart2 15975a91c70SWarner Losh.It COM4 Ta 0x2e8 Ta Pa /dev/uart3 16075a91c70SWarner Losh.El 16175a91c70SWarner LoshThough 16275a91c70SWarner Losh.Dv COM3 16375a91c70SWarner Loshand 16475a91c70SWarner Losh.Dv COM4 16575a91c70SWarner Loshcan vary. 16675a91c70SWarner Losh.Pp 16775a91c70SWarner Losh.Ss Primary Console 16875a91c70SWarner LoshThe primary console is set using the boot flags. 16975a91c70SWarner LoshThese command line arguments set corresponding flags for the kernel. 17075a91c70SWarner LoshThese flags can be controlled by setting loader environment variables 17175a91c70SWarner Loshto 17275a91c70SWarner Losh.Dq yes 17375a91c70SWarner Loshor 17475a91c70SWarner Losh.Dq no . 17575a91c70SWarner LoshBoot flags may be set on the command line to the boot command. 17675a91c70SWarner LoshInside the kernel, the RB_ flags are used to control behavior, sometimes 17775a91c70SWarner Loshin architecturally specific ways and are included to aid in discovery 17875a91c70SWarner Loshof any behavior not covered in this document. 17975a91c70SWarner Losh.Bl -column -offset indent ".Sy boot flag" ".Sy loader variable" ".Sy Kernel RB_ flag" 18075a91c70SWarner Losh.It Sy boot flag Ta Sy loader variable Ta Sy Kernel RB_ flag 18175a91c70SWarner Losh.It Fl a Ta Dv boot_askme Ta Va RB_ASKNAME 18275a91c70SWarner Losh.It Fl c Ta Dv boot_cdrom Ta Va RB_CDROM 18375a91c70SWarner Losh.It Fl d Ta Dv boot_ddb Ta Va RB_KDB 18475a91c70SWarner Losh.It Fl r Ta Dv boot_dfltroot Ta Va RB_DFLTROOT 18575a91c70SWarner Losh.It Fl D Ta Dv boot_multiple Ta Va RB_MULTIPLE 18675a91c70SWarner Losh.It Fl m Ta Dv boot_mute Ta Va RB_MUTE 18775a91c70SWarner Losh.It Fl g Ta Dv boot_gdb Ta Va RB_GDB 18875a91c70SWarner Losh.It Fl h Ta Dv boot_serial Ta Va RB_SERIAL 18975a91c70SWarner Losh.It Fl p Ta Dv boot_pause Ta Va RB_PAUSE 19075a91c70SWarner Losh.It Fl P Ta Dv boot_probe Ta Va RB_PROBE 19175a91c70SWarner Losh.It Fl s Ta Dv boot_single Ta Va RB_SINGLE 19275a91c70SWarner Losh.It Fl v Ta Dv boot_verbose Ta Va RB_VERBOSE 19375a91c70SWarner Losh.El 19475a91c70SWarner LoshAnd the following flags determine the primary console: 19575a91c70SWarner Losh.Bl -column -offset indent ".Sy Flags" ".Sy Kernel Flags" ".Sy Kernel Consoles" ".Sy Primary Console" 19675a91c70SWarner Losh.It Sy Flags Ta Sy Kernel Flags Ta Sy Kernel Consoles Ta Sy Primary Console 19775a91c70SWarner Losh.It none Ta 0 Ta Video Ta Video 19875a91c70SWarner Losh.It Fl h Ta RB_SERIAL Ta Serial Ta Serial 19975a91c70SWarner Losh.It Fl D Ta RB_MULTIPLE Ta Serial, Video Ta Video 20075a91c70SWarner Losh.It Fl Dh Ta RB_SERIAL | RB_MULTIPLE Ta Serial, Video Ta Serial 20175a91c70SWarner Losh.El 20275a91c70SWarner Losh.Pp 20375a91c70SWarner Losh.Nm 20475a91c70SWarner Loshdoes not implement the probe 20575a91c70SWarner Losh.Fl P 20675a91c70SWarner Loshfunctionality where we use the video console if a keyboard is connected and a 20775a91c70SWarner Loshserial console otherwise. 208*bce72871SGuido Falsi.Ss Additional Environment Variables 209*bce72871SGuido Falsi.Nm 210*bce72871SGuido Falsiloads some extra variables early in startup from 211*bce72871SGuido Falsi.Pa /efi/freebsd/loader.env 212*bce72871SGuido Falsifrom the EFI partition. Only simple variables can be set here. It can be useful to specify the root filesystem: 213*bce72871SGuido Falsi.Bd -literal -offset indent 214*bce72871SGuido Falsirootdev=disk0s1a 215*bce72871SGuido Falsi.Ed 21685c8c0b7SKonstantin Belousov.Ss Staging Slop 21785c8c0b7SKonstantin BelousovThe kernel must parse the firmware memory map tables to know what memory 21885c8c0b7SKonstantin Belousovit can use. 21985c8c0b7SKonstantin BelousovSince it must allocate memory to do this, 22085c8c0b7SKonstantin Belousov.Nm 22185c8c0b7SKonstantin Belousovensures there's extra memory available, called 22285c8c0b7SKonstantin Belousov.Dq slop , 22385c8c0b7SKonstantin Belousovafter everything it loads 22485c8c0b7SKonstantin Belousov.Po 22585c8c0b7SKonstantin Belousovthe kernel, modules and metadata 22685c8c0b7SKonstantin Belousov.Pc 22785c8c0b7SKonstantin Belousovfor the kernel to bootstrap the memory allocator. 22885c8c0b7SKonstantin Belousov.Pp 22985c8c0b7SKonstantin BelousovBy default, amd64 reserves 8MB. 23085c8c0b7SKonstantin BelousovThe 23185c8c0b7SKonstantin Belousov.Ic staging_slop 23285c8c0b7SKonstantin Belousovcommand allows for tuning the slop size. 23385c8c0b7SKonstantin BelousovIt takes a single argument, the size of the slop in bytes. 23485c8c0b7SKonstantin Belousov.Ss amd64 Nocopy 23585c8c0b7SKonstantin Belousov.Nm 23685c8c0b7SKonstantin Belousovwill load the kernel into memory that is 2MB aligned below 4GB. 23785c8c0b7SKonstantin BelousovIt cannot load to a fixed address because the UEFI firmware may reserve 23885c8c0b7SKonstantin Belousovarbitrary memory for its use at runtime. 23985c8c0b7SKonstantin BelousovPrior to 24085c8c0b7SKonstantin Belousov.Fx 13.1 , 24185c8c0b7SKonstantin Belousovkernels retained the old BIOS-boot protocol of loading at exactly 2MB. 24285c8c0b7SKonstantin BelousovSuch kernels must be copied from their loaded location to 2MB prior 24385c8c0b7SKonstantin Belousovstarting them up. 24485c8c0b7SKonstantin BelousovThe 24585c8c0b7SKonstantin Belousov.Ic copy_staging 24685c8c0b7SKonstantin Belousovcommand is used to enable this copying for older kernels. 24785c8c0b7SKonstantin BelousovIt takes a single argument 24885c8c0b7SKonstantin Belousovwhich can be one of 24985c8c0b7SKonstantin Belousov.Bl -tag -width disable 25085c8c0b7SKonstantin Belousov.It Ar disable 25185c8c0b7SKonstantin BelousovForce-disable copying staging area to 25285c8c0b7SKonstantin Belousov.Ad 2M . 25385c8c0b7SKonstantin Belousov.It Ar enable 25485c8c0b7SKonstantin BelousovForce-enable copying staging area to 25585c8c0b7SKonstantin Belousov.Ad 2M . 25685c8c0b7SKonstantin Belousov.It Ar auto 25785c8c0b7SKonstantin BelousovSelects the behaviour based on the kernel's capability of boostraping 25885c8c0b7SKonstantin Belousovfrom non-2M physical base. 25985c8c0b7SKonstantin BelousovThe kernel reports this capability by exporting the symbol 26085c8c0b7SKonstantin Belousov.Va kernphys . 26185c8c0b7SKonstantin Belousov.El 26285c8c0b7SKonstantin Belousov.Pp 26385c8c0b7SKonstantin BelousovArm64 loaders have operated in the 26485c8c0b7SKonstantin Belousov.Sq nocopy 26585c8c0b7SKonstantin Belousovmode from their inception, so there is no 26685c8c0b7SKonstantin Belousov.Ic copy_staging 26785c8c0b7SKonstantin Belousovcommand on that platform. 26885c8c0b7SKonstantin BelousovRiscv, 32-bit arm and arm64 have always loaded at any 26985c8c0b7SKonstantin Belousov.Ad 2MB 27085c8c0b7SKonstantin Belousovaligned location, so do not provide 27185c8c0b7SKonstantin Belousov.Ic copy_staging . 27285c8c0b7SKonstantin Belousov.Pp 27385c8c0b7SKonstantin Belousov.Bd -ragged -offset indent 27485c8c0b7SKonstantin Belousov.Sy Note. 27585c8c0b7SKonstantin BelousovBIOS loaders on i386 and amd64 put the staging area starting 27685c8c0b7SKonstantin Belousovat the physical address 27785c8c0b7SKonstantin Belousov.Ad 2M , 27885c8c0b7SKonstantin Belousovthen enable paging with identical mapping for the low 27985c8c0b7SKonstantin Belousov.Ad 1G . 28085c8c0b7SKonstantin BelousovThe initial port of 28185c8c0b7SKonstantin Belousov.Nm 28285c8c0b7SKonstantin Belousovfollowed the same scheme for handing control to the kernel, 28385c8c0b7SKonstantin Belousovsince it avoided modifications for the loader/kernel hand-off protocol, 28485c8c0b7SKonstantin Belousovand for the kernel page table bootstrap. 28585c8c0b7SKonstantin Belousov.Pp 28685c8c0b7SKonstantin BelousovThis approach is incompatible with the UEFI specification, 28785c8c0b7SKonstantin Belousovand as a practical matter, caused troubles on many boards, 28885c8c0b7SKonstantin Belousovbecause UEFI firmware is free to use any memory for its own needs. 28985c8c0b7SKonstantin BelousovApplications like 29085c8c0b7SKonstantin Belousov.Nm 29185c8c0b7SKonstantin Belousovmust only use memory explicitly allocated using boot interfaces. 29285c8c0b7SKonstantin BelousovThe original way also potentially destroyed UEFI runtime interfaces data. 29385c8c0b7SKonstantin Belousov.Pp 29485c8c0b7SKonstantin BelousovEventually, 29585c8c0b7SKonstantin Belousov.Nm 29685c8c0b7SKonstantin Belousovand the kernel were improved to avoid this problem. 29785c8c0b7SKonstantin Belousov.Ed 29885c8c0b7SKonstantin Belousov.Ss amd64 Faults 29985c8c0b7SKonstantin BelousovBecause it executes in x86 protected mode, the amd64 version of 30085c8c0b7SKonstantin Belousov.Nm 30185c8c0b7SKonstantin Belousovis susceptible to CPU faults due to programmer mistakes and 30285c8c0b7SKonstantin Belousovmemory corruption. 30385c8c0b7SKonstantin BelousovTo make debugging such faults easier, amd64 30485c8c0b7SKonstantin Belousov.Nm 30585c8c0b7SKonstantin Belousovcan provide detailed reporting of the CPU state at the time 30685c8c0b7SKonstantin Belousovof the fault. 30785c8c0b7SKonstantin Belousov.Pp 30885c8c0b7SKonstantin BelousovThe 30985c8c0b7SKonstantin Belousov.Ic grab_faults 31085c8c0b7SKonstantin Belousovcommand installs a handler for faults directly in the IDT, 31185c8c0b7SKonstantin Belousovavoiding the use of the UEFI debugging interface 31285c8c0b7SKonstantin Belousov.Fn EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback . 31385c8c0b7SKonstantin BelousovThat interface is left available for advanced debuggers in 31485c8c0b7SKonstantin Belousovthe UEFI environment. 31585c8c0b7SKonstantin BelousovThe 31685c8c0b7SKonstantin Belousov.Ic ungrab_faults 31785c8c0b7SKonstantin Belousovcommand tries to deinstall the fault handler, returning TSS and IDT 31885c8c0b7SKonstantin BelousovCPU tables to their pre-installation state. 31985c8c0b7SKonstantin BelousovThe 32085c8c0b7SKonstantin Belousov.Ic fault 32185c8c0b7SKonstantin Belousovcommand produces a fault in the 32285c8c0b7SKonstantin Belousov.Nm 32385c8c0b7SKonstantin Belousovenvironment for testing purposes, by executing the 32485c8c0b7SKonstantin Belousov.Ic ud2 32585c8c0b7SKonstantin Belousovprocessor instruction. 3269ecf6e0fSMateusz Piotrowski.Sh FILES 3279ecf6e0fSMateusz Piotrowski.Bl -tag -width "/boot/loader.efi" 3289ecf6e0fSMateusz Piotrowski.It Pa /boot/loader.efi 3299ecf6e0fSMateusz PiotrowskiThe location of the UEFI kernel loader within the system. 3309ecf6e0fSMateusz Piotrowski.El 3319ecf6e0fSMateusz Piotrowski.Ss EFI System Partition 3329ecf6e0fSMateusz Piotrowski.Nm 33375a91c70SWarner Loshis installed on the ESP (EFI System Partition) in one of the following locations: 3349ecf6e0fSMateusz Piotrowski.Bl -tag -width "efi/freebsd/loader.efi" 3359ecf6e0fSMateusz Piotrowski.It Pa efi/boot/bootXXX.efi 3369ecf6e0fSMateusz PiotrowskiThe default location for any EFI loader 3379ecf6e0fSMateusz Piotrowski.Po see 3389ecf6e0fSMateusz Piotrowski.Xr uefi 8 3399ecf6e0fSMateusz Piotrowskifor values to replace 3409ecf6e0fSMateusz Piotrowski.Ql XXX 3419ecf6e0fSMateusz Piotrowskiwith 3429ecf6e0fSMateusz Piotrowski.Pc . 3439ecf6e0fSMateusz Piotrowski.It Pa efi/freebsd/loader.efi 3449ecf6e0fSMateusz PiotrowskiThe location reserved specifically for the 3459ecf6e0fSMateusz Piotrowski.Fx 3469ecf6e0fSMateusz PiotrowskiEFI loader. 3479ecf6e0fSMateusz Piotrowski.El 3489ecf6e0fSMateusz Piotrowski.Pp 3499ecf6e0fSMateusz PiotrowskiThe default location for the ESP mount point is documented in 3509ecf6e0fSMateusz Piotrowski.Xr hier 7 . 3519ecf6e0fSMateusz Piotrowski.Sh EXAMPLES 35275a91c70SWarner Losh.Ss Updating loader.efi on the ESP 3539ecf6e0fSMateusz PiotrowskiThe following examples shows how to install a new 3549ecf6e0fSMateusz Piotrowski.Nm 35575a91c70SWarner Loshon the ESP. 3569ecf6e0fSMateusz Piotrowski.Pp 3579ecf6e0fSMateusz PiotrowskiFirst, find the partition of type 3589ecf6e0fSMateusz Piotrowski.Dq efi : 3599ecf6e0fSMateusz Piotrowski.Bd -literal -offset indent 3609ecf6e0fSMateusz Piotrowski# gpart list | grep -Ew '(Name|efi)' 3619ecf6e0fSMateusz Piotrowski1. Name: nvd0p1 3629ecf6e0fSMateusz Piotrowski type: efi 3639ecf6e0fSMateusz Piotrowski2. Name: nvd0p2 3649ecf6e0fSMateusz Piotrowski3. Name: nvd0p3 3659ecf6e0fSMateusz Piotrowski4. Name: nvd0p4 3669ecf6e0fSMateusz Piotrowski1. Name: nvd0 3679ecf6e0fSMateusz Piotrowski.Ed 3689ecf6e0fSMateusz Piotrowski.Pp 36975a91c70SWarner LoshThe name of the ESP on this system is 3709ecf6e0fSMateusz Piotrowski.Pa nvd0p1 . 3719ecf6e0fSMateusz Piotrowski.Pp 37275a91c70SWarner LoshSecond, let's mount the ESP, copy 3739ecf6e0fSMateusz Piotrowski.Nm 3749ecf6e0fSMateusz Piotrowskito the special location reserved for 3759ecf6e0fSMateusz Piotrowski.Fx 3769ecf6e0fSMateusz PiotrowskiEFI loaders, and unmount once finished: 3779ecf6e0fSMateusz Piotrowski.Bd -literal -offset indent 3789ecf6e0fSMateusz Piotrowski# mount_msdosfs /dev/nvd0p1 /boot/efi 3799ecf6e0fSMateusz Piotrowski# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi 3809ecf6e0fSMateusz Piotrowski# umount /boot/efi 38175a91c70SWarner Losh.Ed 3829ecf6e0fSMateusz Piotrowski.Sh SEE ALSO 383f70de61eSEd Maste.Xr loader 8 , 3849ecf6e0fSMateusz Piotrowski.Xr uefi 8 38575a91c70SWarner Losh.Sh BUGS 38675a91c70SWarner LoshSystems that do not have a 38775a91c70SWarner Losh.Dv ConOut 38875a91c70SWarner Loshvariable set are not conformant with the standard, and likely have unexpected 38975a91c70SWarner Loshresults. 39075a91c70SWarner Losh.Pp 39175a91c70SWarner LoshNon-x86 serial console handling is even more confusing and less well documented. 39275a91c70SWarner Losh.Pp 39375a91c70SWarner LoshSometimes when the serial port speed isn't set, 9600 is used. 39475a91c70SWarner LoshOther times the result is typically 115200 since the speed remains unchanged 39575a91c70SWarner Loshfrom the default. 396