12b6d38a1SWarner Losh.\" 29ecf6e0fSMateusz Piotrowski.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD 39ecf6e0fSMateusz Piotrowski.\" 475a91c70SWarner Losh.\" Copyright (c) 2019-2022 Netflix, Inc 59ecf6e0fSMateusz Piotrowski.\" Copyright (c) 2022 Mateusz Piotrowski <0mp@FreeBSD.org> 6*85c8c0b7SKonstantin Belousov.\" Copyright 2022 The FreeBSD Foundation, Inc. 7*85c8c0b7SKonstantin Belousov.\" 8*85c8c0b7SKonstantin Belousov.\" Part of this documentation was written by 9*85c8c0b7SKonstantin Belousov.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship 10*85c8c0b7SKonstantin 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.\" 332b6d38a1SWarner Losh.\" $FreeBSD$ 342b6d38a1SWarner Losh.\" 35*85c8c0b7SKonstantin Belousov.Dd September 4, 2022 362b6d38a1SWarner Losh.Dt LOADER.EFI 8 372b6d38a1SWarner Losh.Os 382b6d38a1SWarner Losh.Sh NAME 392b6d38a1SWarner Losh.Nm loader.efi 402b6d38a1SWarner Losh.Nd UEFI kernel loader 412b6d38a1SWarner Losh.Sh DESCRIPTION 422b6d38a1SWarner LoshOn UEFI systems, 432b6d38a1SWarner Losh.Nm 442b6d38a1SWarner Loshloads the kernel. 459ecf6e0fSMateusz Piotrowski.Pp 462b6d38a1SWarner Losh.Xr boot1.efi 8 472b6d38a1SWarner Loshis used to load 482b6d38a1SWarner Losh.Nm 4975a91c70SWarner Loshwhen it is placed within a UFS or ZFS file system. 5075a91c70SWarner LoshAlternatively, 5175a91c70SWarner Losh.Nm 5275a91c70SWarner Loshis used directly when configured with 5375a91c70SWarner Losh.Xr efibootmgr 8 , 5475a91c70SWarner Loshor when placed directly as the default boot program as described in 5575a91c70SWarner Losh.Xr uefi 8 . 5675a91c70SWarner LoshWhen a system is built using 5775a91c70SWarner Losh.Xr bsdinstall 8 , 5875a91c70SWarner Losh.Nm 5975a91c70SWarner Loshwill be used directly. 6075a91c70SWarner Losh.Ss Console Considerations 6175a91c70SWarner LoshThe EFI BIOS provides a generic console. 6275a91c70SWarner LoshIn 6375a91c70SWarner Losh.Nm 6475a91c70SWarner Loshthis is selected by specifying 6575a91c70SWarner Losh.Dq efi 6675a91c70SWarner Loshusing the 6775a91c70SWarner Losh.Dv console 6875a91c70SWarner Loshvariable. 6975a91c70SWarner Losh.Nm 7075a91c70SWarner Loshexamines the 7175a91c70SWarner Losh.Dv 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut 7275a91c70SWarner LoshUEFI environment variable to guess what the 7375a91c70SWarner Losh.Dq efi 7475a91c70SWarner Loshconsole points to. 7575a91c70SWarner Losh.Nm 7675a91c70SWarner Loshwill output its prompts and menus to all the places specified by ConOut. 7775a91c70SWarner LoshHowever, the 7875a91c70SWarner Losh.Fx 7975a91c70SWarner Loshkernel has a limitation when more than one console is present. 8075a91c70SWarner LoshThe kernel outputs to all configured consoles. 8175a91c70SWarner LoshOnly the primary console will get the log messages from the 8275a91c70SWarner Losh.Xr rc 8 8375a91c70SWarner Loshsystem, and prompts for things like 8475a91c70SWarner Losh.Xr geli 8 8575a91c70SWarner Loshpasswords. 8675a91c70SWarner LoshIf 8775a91c70SWarner Losh.Nm 8875a91c70SWarner Loshfinds a video device first, then 8975a91c70SWarner Losh.Nm 9075a91c70SWarner Loshtells the kernel to use the video console as primary. 9175a91c70SWarner LoshLikewise, if a serial device is first in the 9275a91c70SWarner Losh.Dv ConOut 9375a91c70SWarner Loshlist, the serial port will be the primary console. 9475a91c70SWarner Losh.Pp 9575a91c70SWarner LoshIf there is no 9675a91c70SWarner Losh.Dv ConOut 9775a91c70SWarner Loshvariable, both serial and video are attempted. 9875a91c70SWarner Losh.Nm 9975a91c70SWarner Loshuses the 10075a91c70SWarner Losh.Dq efi 10175a91c70SWarner Loshconsole for the video (which may or may not work) and 10275a91c70SWarner Losh.Dq comconsole 10375a91c70SWarner Loshfor the serial on 10475a91c70SWarner Losh.Dv COM1 10575a91c70SWarner Loshat the default baud rate. 10675a91c70SWarner LoshThe kernel will use a dual console, with the video console 10775a91c70SWarner Loshprimary if a UEFI graphics device is detected, or the serial console 10875a91c70SWarner Loshas primary if not. 10975a91c70SWarner Losh.Pp 11075a91c70SWarner LoshOn x86 platforms, if you wish to redirect the loader's output to a serial port 11175a91c70SWarner Loshwhen the EFI BIOS doesn't support it, or to a serial port that isn't the one the 11275a91c70SWarner LoshEFI BIOS redirects its output to, set 11375a91c70SWarner Losh.Dv console 11475a91c70SWarner Loshto 11575a91c70SWarner Losh.Dq comconsole . 11675a91c70SWarner LoshThe default port is 11775a91c70SWarner Losh.Dv COM1 11875a91c70SWarner Loshwith an I/O address of 0x3f8. 11975a91c70SWarner Losh.Dv comconsole_port 12075a91c70SWarner Loshis used to set this to a different port address. 12175a91c70SWarner Losh.Dv comconsole_speed 12275a91c70SWarner Loshis used to set the of the serial port (the default is 9600). 12375a91c70SWarner LoshIf you have 12475a91c70SWarner Losh.Dv console 12575a91c70SWarner Loshset to 12675a91c70SWarner Losh.Dq efi,comconsole 12775a91c70SWarner Loshyou will get output on both the EFI console and the serial port. 12875a91c70SWarner LoshIf this causes a doubling of characters, set 12975a91c70SWarner Losh.Dv console 13075a91c70SWarner Loshto 13175a91c70SWarner Losh.Dq efi , 13275a91c70SWarner Loshsince your EFI BIOS is redirecting to the serial port already. 13375a91c70SWarner Losh.Pp 13475a91c70SWarner LoshIf your EFI BIOS redirects the serial port, you may need to tell the kernel 13575a91c70SWarner Loshwhich address to use. 13675a91c70SWarner LoshEFI uses ACPI's UID to identify the serial port, but 13775a91c70SWarner Losh.Nm 13875a91c70SWarner Loshdoes not have an ACPI parser, so it cannot convert that to an I/O port. 13975a91c70SWarner LoshThe 14075a91c70SWarner Losh.Fx 14175a91c70SWarner Loshkernel initializes its consoles before it can decode ACPI resources. 14275a91c70SWarner LoshThe 14375a91c70SWarner Losh.Fx 14475a91c70SWarner Loshkernel will look at the 14575a91c70SWarner Losh.Dv hw.uart.console 14675a91c70SWarner Loshvariable to set its serial console. 14775a91c70SWarner LoshIts format should be described in 14875a91c70SWarner Losh.Xr uart 4 14975a91c70SWarner Loshbut is not. 15075a91c70SWarner LoshSet it to 15175a91c70SWarner Losh.Dq io:0x3f8,br:115200 15275a91c70SWarner Loshwith the proper port address. 15375a91c70SWarner LoshPCI or memory mapped ports are beyond the scope of this man page. 15475a91c70SWarner Losh.Pp 15575a91c70SWarner LoshThe serial ports are assigned as follows on IBM PC compatible systems: 15675a91c70SWarner Losh.Bl -column -offset indent ".Sy Windows Name" ".Sy I/O Port Address" ".Sy Typical FreeBSD device" 15775a91c70SWarner Losh.It Sy Windows Name Ta Sy I/O Port Address Ta Sy Typical FreeBSD device 15875a91c70SWarner Losh.It COM1 Ta 0x3f8 Ta Pa /dev/uart0 15975a91c70SWarner Losh.It COM2 Ta 0x2f8 Ta Pa /dev/uart1 16075a91c70SWarner Losh.It COM3 Ta 0x3e8 Ta Pa /dev/uart2 16175a91c70SWarner Losh.It COM4 Ta 0x2e8 Ta Pa /dev/uart3 16275a91c70SWarner Losh.El 16375a91c70SWarner LoshThough 16475a91c70SWarner Losh.Dv COM3 16575a91c70SWarner Loshand 16675a91c70SWarner Losh.Dv COM4 16775a91c70SWarner Loshcan vary. 16875a91c70SWarner Losh.Pp 16975a91c70SWarner Losh.Ss Primary Console 17075a91c70SWarner LoshThe primary console is set using the boot flags. 17175a91c70SWarner LoshThese command line arguments set corresponding flags for the kernel. 17275a91c70SWarner LoshThese flags can be controlled by setting loader environment variables 17375a91c70SWarner Loshto 17475a91c70SWarner Losh.Dq yes 17575a91c70SWarner Loshor 17675a91c70SWarner Losh.Dq no . 17775a91c70SWarner LoshBoot flags may be set on the command line to the boot command. 17875a91c70SWarner LoshInside the kernel, the RB_ flags are used to control behavior, sometimes 17975a91c70SWarner Loshin architecturally specific ways and are included to aid in discovery 18075a91c70SWarner Loshof any behavior not covered in this document. 18175a91c70SWarner Losh.Bl -column -offset indent ".Sy boot flag" ".Sy loader variable" ".Sy Kernel RB_ flag" 18275a91c70SWarner Losh.It Sy boot flag Ta Sy loader variable Ta Sy Kernel RB_ flag 18375a91c70SWarner Losh.It Fl a Ta Dv boot_askme Ta Va RB_ASKNAME 18475a91c70SWarner Losh.It Fl c Ta Dv boot_cdrom Ta Va RB_CDROM 18575a91c70SWarner Losh.It Fl d Ta Dv boot_ddb Ta Va RB_KDB 18675a91c70SWarner Losh.It Fl r Ta Dv boot_dfltroot Ta Va RB_DFLTROOT 18775a91c70SWarner Losh.It Fl D Ta Dv boot_multiple Ta Va RB_MULTIPLE 18875a91c70SWarner Losh.It Fl m Ta Dv boot_mute Ta Va RB_MUTE 18975a91c70SWarner Losh.It Fl g Ta Dv boot_gdb Ta Va RB_GDB 19075a91c70SWarner Losh.It Fl h Ta Dv boot_serial Ta Va RB_SERIAL 19175a91c70SWarner Losh.It Fl p Ta Dv boot_pause Ta Va RB_PAUSE 19275a91c70SWarner Losh.It Fl P Ta Dv boot_probe Ta Va RB_PROBE 19375a91c70SWarner Losh.It Fl s Ta Dv boot_single Ta Va RB_SINGLE 19475a91c70SWarner Losh.It Fl v Ta Dv boot_verbose Ta Va RB_VERBOSE 19575a91c70SWarner Losh.El 19675a91c70SWarner LoshAnd the following flags determine the primary console: 19775a91c70SWarner Losh.Bl -column -offset indent ".Sy Flags" ".Sy Kernel Flags" ".Sy Kernel Consoles" ".Sy Primary Console" 19875a91c70SWarner Losh.It Sy Flags Ta Sy Kernel Flags Ta Sy Kernel Consoles Ta Sy Primary Console 19975a91c70SWarner Losh.It none Ta 0 Ta Video Ta Video 20075a91c70SWarner Losh.It Fl h Ta RB_SERIAL Ta Serial Ta Serial 20175a91c70SWarner Losh.It Fl D Ta RB_MULTIPLE Ta Serial, Video Ta Video 20275a91c70SWarner Losh.It Fl Dh Ta RB_SERIAL | RB_MULTIPLE Ta Serial, Video Ta Serial 20375a91c70SWarner Losh.El 20475a91c70SWarner Losh.Pp 20575a91c70SWarner Losh.Nm 20675a91c70SWarner Loshdoes not implement the probe 20775a91c70SWarner Losh.Fl P 20875a91c70SWarner Loshfunctionality where we use the video console if a keyboard is connected and a 20975a91c70SWarner Loshserial console otherwise. 210*85c8c0b7SKonstantin Belousov.Ss Staging Slop 211*85c8c0b7SKonstantin BelousovThe kernel must parse the firmware memory map tables to know what memory 212*85c8c0b7SKonstantin Belousovit can use. 213*85c8c0b7SKonstantin BelousovSince it must allocate memory to do this, 214*85c8c0b7SKonstantin Belousov.Nm 215*85c8c0b7SKonstantin Belousovensures there's extra memory available, called 216*85c8c0b7SKonstantin Belousov.Dq slop , 217*85c8c0b7SKonstantin Belousovafter everything it loads 218*85c8c0b7SKonstantin Belousov.Po 219*85c8c0b7SKonstantin Belousovthe kernel, modules and metadata 220*85c8c0b7SKonstantin Belousov.Pc 221*85c8c0b7SKonstantin Belousovfor the kernel to bootstrap the memory allocator. 222*85c8c0b7SKonstantin Belousov.Pp 223*85c8c0b7SKonstantin BelousovBy default, amd64 reserves 8MB. 224*85c8c0b7SKonstantin BelousovThe 225*85c8c0b7SKonstantin Belousov.Ic staging_slop 226*85c8c0b7SKonstantin Belousovcommand allows for tuning the slop size. 227*85c8c0b7SKonstantin BelousovIt takes a single argument, the size of the slop in bytes. 228*85c8c0b7SKonstantin Belousov.Ss amd64 Nocopy 229*85c8c0b7SKonstantin Belousov.Nm 230*85c8c0b7SKonstantin Belousovwill load the kernel into memory that is 2MB aligned below 4GB. 231*85c8c0b7SKonstantin BelousovIt cannot load to a fixed address because the UEFI firmware may reserve 232*85c8c0b7SKonstantin Belousovarbitrary memory for its use at runtime. 233*85c8c0b7SKonstantin BelousovPrior to 234*85c8c0b7SKonstantin Belousov.Fx 13.1 , 235*85c8c0b7SKonstantin Belousovkernels retained the old BIOS-boot protocol of loading at exactly 2MB. 236*85c8c0b7SKonstantin BelousovSuch kernels must be copied from their loaded location to 2MB prior 237*85c8c0b7SKonstantin Belousovstarting them up. 238*85c8c0b7SKonstantin BelousovThe 239*85c8c0b7SKonstantin Belousov.Ic copy_staging 240*85c8c0b7SKonstantin Belousovcommand is used to enable this copying for older kernels. 241*85c8c0b7SKonstantin BelousovIt takes a single argument 242*85c8c0b7SKonstantin Belousovwhich can be one of 243*85c8c0b7SKonstantin Belousov.Bl -tag -width disable 244*85c8c0b7SKonstantin Belousov.It Ar disable 245*85c8c0b7SKonstantin BelousovForce-disable copying staging area to 246*85c8c0b7SKonstantin Belousov.Ad 2M . 247*85c8c0b7SKonstantin Belousov.It Ar enable 248*85c8c0b7SKonstantin BelousovForce-enable copying staging area to 249*85c8c0b7SKonstantin Belousov.Ad 2M . 250*85c8c0b7SKonstantin Belousov.It Ar auto 251*85c8c0b7SKonstantin BelousovSelects the behaviour based on the kernel's capability of boostraping 252*85c8c0b7SKonstantin Belousovfrom non-2M physical base. 253*85c8c0b7SKonstantin BelousovThe kernel reports this capability by exporting the symbol 254*85c8c0b7SKonstantin Belousov.Va kernphys . 255*85c8c0b7SKonstantin Belousov.El 256*85c8c0b7SKonstantin Belousov.Pp 257*85c8c0b7SKonstantin BelousovArm64 loaders have operated in the 258*85c8c0b7SKonstantin Belousov.Sq nocopy 259*85c8c0b7SKonstantin Belousovmode from their inception, so there is no 260*85c8c0b7SKonstantin Belousov.Ic copy_staging 261*85c8c0b7SKonstantin Belousovcommand on that platform. 262*85c8c0b7SKonstantin BelousovRiscv, 32-bit arm and arm64 have always loaded at any 263*85c8c0b7SKonstantin Belousov.Ad 2MB 264*85c8c0b7SKonstantin Belousovaligned location, so do not provide 265*85c8c0b7SKonstantin Belousov.Ic copy_staging . 266*85c8c0b7SKonstantin Belousov.Pp 267*85c8c0b7SKonstantin Belousov.Bd -ragged -offset indent 268*85c8c0b7SKonstantin Belousov.Sy Note. 269*85c8c0b7SKonstantin BelousovBIOS loaders on i386 and amd64 put the staging area starting 270*85c8c0b7SKonstantin Belousovat the physical address 271*85c8c0b7SKonstantin Belousov.Ad 2M , 272*85c8c0b7SKonstantin Belousovthen enable paging with identical mapping for the low 273*85c8c0b7SKonstantin Belousov.Ad 1G . 274*85c8c0b7SKonstantin BelousovThe initial port of 275*85c8c0b7SKonstantin Belousov.Nm 276*85c8c0b7SKonstantin Belousovfollowed the same scheme for handing control to the kernel, 277*85c8c0b7SKonstantin Belousovsince it avoided modifications for the loader/kernel hand-off protocol, 278*85c8c0b7SKonstantin Belousovand for the kernel page table bootstrap. 279*85c8c0b7SKonstantin Belousov.Pp 280*85c8c0b7SKonstantin BelousovThis approach is incompatible with the UEFI specification, 281*85c8c0b7SKonstantin Belousovand as a practical matter, caused troubles on many boards, 282*85c8c0b7SKonstantin Belousovbecause UEFI firmware is free to use any memory for its own needs. 283*85c8c0b7SKonstantin BelousovApplications like 284*85c8c0b7SKonstantin Belousov.Nm 285*85c8c0b7SKonstantin Belousovmust only use memory explicitly allocated using boot interfaces. 286*85c8c0b7SKonstantin BelousovThe original way also potentially destroyed UEFI runtime interfaces data. 287*85c8c0b7SKonstantin Belousov.Pp 288*85c8c0b7SKonstantin BelousovEventually, 289*85c8c0b7SKonstantin Belousov.Nm 290*85c8c0b7SKonstantin Belousovand the kernel were improved to avoid this problem. 291*85c8c0b7SKonstantin Belousov.Ed 292*85c8c0b7SKonstantin Belousov.Ss amd64 Faults 293*85c8c0b7SKonstantin BelousovBecause it executes in x86 protected mode, the amd64 version of 294*85c8c0b7SKonstantin Belousov.Nm 295*85c8c0b7SKonstantin Belousovis susceptible to CPU faults due to programmer mistakes and 296*85c8c0b7SKonstantin Belousovmemory corruption. 297*85c8c0b7SKonstantin BelousovTo make debugging such faults easier, amd64 298*85c8c0b7SKonstantin Belousov.Nm 299*85c8c0b7SKonstantin Belousovcan provide detailed reporting of the CPU state at the time 300*85c8c0b7SKonstantin Belousovof the fault. 301*85c8c0b7SKonstantin Belousov.Pp 302*85c8c0b7SKonstantin BelousovThe 303*85c8c0b7SKonstantin Belousov.Ic grab_faults 304*85c8c0b7SKonstantin Belousovcommand installs a handler for faults directly in the IDT, 305*85c8c0b7SKonstantin Belousovavoiding the use of the UEFI debugging interface 306*85c8c0b7SKonstantin Belousov.Fn EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback . 307*85c8c0b7SKonstantin BelousovThat interface is left available for advanced debuggers in 308*85c8c0b7SKonstantin Belousovthe UEFI environment. 309*85c8c0b7SKonstantin BelousovThe 310*85c8c0b7SKonstantin Belousov.Ic ungrab_faults 311*85c8c0b7SKonstantin Belousovcommand tries to deinstall the fault handler, returning TSS and IDT 312*85c8c0b7SKonstantin BelousovCPU tables to their pre-installation state. 313*85c8c0b7SKonstantin BelousovThe 314*85c8c0b7SKonstantin Belousov.Ic fault 315*85c8c0b7SKonstantin Belousovcommand produces a fault in the 316*85c8c0b7SKonstantin Belousov.Nm 317*85c8c0b7SKonstantin Belousovenvironment for testing purposes, by executing the 318*85c8c0b7SKonstantin Belousov.Ic ud2 319*85c8c0b7SKonstantin Belousovprocessor instruction. 3209ecf6e0fSMateusz Piotrowski.Sh FILES 3219ecf6e0fSMateusz Piotrowski.Bl -tag -width "/boot/loader.efi" 3229ecf6e0fSMateusz Piotrowski.It Pa /boot/loader.efi 3239ecf6e0fSMateusz PiotrowskiThe location of the UEFI kernel loader within the system. 3249ecf6e0fSMateusz Piotrowski.El 3259ecf6e0fSMateusz Piotrowski.Ss EFI System Partition 3269ecf6e0fSMateusz Piotrowski.Nm 32775a91c70SWarner Loshis installed on the ESP (EFI System Partition) in one of the following locations: 3289ecf6e0fSMateusz Piotrowski.Bl -tag -width "efi/freebsd/loader.efi" 3299ecf6e0fSMateusz Piotrowski.It Pa efi/boot/bootXXX.efi 3309ecf6e0fSMateusz PiotrowskiThe default location for any EFI loader 3319ecf6e0fSMateusz Piotrowski.Po see 3329ecf6e0fSMateusz Piotrowski.Xr uefi 8 3339ecf6e0fSMateusz Piotrowskifor values to replace 3349ecf6e0fSMateusz Piotrowski.Ql XXX 3359ecf6e0fSMateusz Piotrowskiwith 3369ecf6e0fSMateusz Piotrowski.Pc . 3379ecf6e0fSMateusz Piotrowski.It Pa efi/freebsd/loader.efi 3389ecf6e0fSMateusz PiotrowskiThe location reserved specifically for the 3399ecf6e0fSMateusz Piotrowski.Fx 3409ecf6e0fSMateusz PiotrowskiEFI loader. 3419ecf6e0fSMateusz Piotrowski.El 3429ecf6e0fSMateusz Piotrowski.Pp 3439ecf6e0fSMateusz PiotrowskiThe default location for the ESP mount point is documented in 3449ecf6e0fSMateusz Piotrowski.Xr hier 7 . 3459ecf6e0fSMateusz Piotrowski.Sh EXAMPLES 34675a91c70SWarner Losh.Ss Updating loader.efi on the ESP 3479ecf6e0fSMateusz PiotrowskiThe following examples shows how to install a new 3489ecf6e0fSMateusz Piotrowski.Nm 34975a91c70SWarner Loshon the ESP. 3509ecf6e0fSMateusz Piotrowski.Pp 3519ecf6e0fSMateusz PiotrowskiFirst, find the partition of type 3529ecf6e0fSMateusz Piotrowski.Dq efi : 3539ecf6e0fSMateusz Piotrowski.Bd -literal -offset indent 3549ecf6e0fSMateusz Piotrowski# gpart list | grep -Ew '(Name|efi)' 3559ecf6e0fSMateusz Piotrowski1. Name: nvd0p1 3569ecf6e0fSMateusz Piotrowski type: efi 3579ecf6e0fSMateusz Piotrowski2. Name: nvd0p2 3589ecf6e0fSMateusz Piotrowski3. Name: nvd0p3 3599ecf6e0fSMateusz Piotrowski4. Name: nvd0p4 3609ecf6e0fSMateusz Piotrowski1. Name: nvd0 3619ecf6e0fSMateusz Piotrowski.Ed 3629ecf6e0fSMateusz Piotrowski.Pp 36375a91c70SWarner LoshThe name of the ESP on this system is 3649ecf6e0fSMateusz Piotrowski.Pa nvd0p1 . 3659ecf6e0fSMateusz Piotrowski.Pp 36675a91c70SWarner LoshSecond, let's mount the ESP, copy 3679ecf6e0fSMateusz Piotrowski.Nm 3689ecf6e0fSMateusz Piotrowskito the special location reserved for 3699ecf6e0fSMateusz Piotrowski.Fx 3709ecf6e0fSMateusz PiotrowskiEFI loaders, and unmount once finished: 3719ecf6e0fSMateusz Piotrowski.Bd -literal -offset indent 3729ecf6e0fSMateusz Piotrowski# mount_msdosfs /dev/nvd0p1 /boot/efi 3739ecf6e0fSMateusz Piotrowski# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi 3749ecf6e0fSMateusz Piotrowski# umount /boot/efi 37575a91c70SWarner Losh.Ed 3769ecf6e0fSMateusz Piotrowski.Sh SEE ALSO 377f70de61eSEd Maste.Xr loader 8 , 3789ecf6e0fSMateusz Piotrowski.Xr uefi 8 37975a91c70SWarner Losh.Sh BUGS 38075a91c70SWarner LoshSystems that do not have a 38175a91c70SWarner Losh.Dv ConOut 38275a91c70SWarner Loshvariable set are not conformant with the standard, and likely have unexpected 38375a91c70SWarner Loshresults. 38475a91c70SWarner Losh.Pp 38575a91c70SWarner LoshNon-x86 serial console handling is even more confusing and less well documented. 38675a91c70SWarner Losh.Pp 38775a91c70SWarner LoshSometimes when the serial port speed isn't set, 9600 is used. 38875a91c70SWarner LoshOther times the result is typically 115200 since the speed remains unchanged 38975a91c70SWarner Loshfrom the default. 390