EFIRT(9)
β¨ NAME β¨
okay bestie, welcome to efirt(9) β that's the kernel access to UEFI runtime services page, and yes it's giving very "deep magic, do not touch unless you know what you're doing" energy π
the whole fam is here: efirt, efi_rt_ok, efi_get_table, efi_get_time, efi_get_time_capabilities, efi_reset_system, efi_set_time, efi_var_get, efi_var_nextname, efi_var_set.
πΈ SYNOPSIS πΈ
options EFIRT
#include <sys/efi.h>
int
efi_rt_ok(void);
int
efi_get_table(struct uuid *uuid, void **ptr);
int
efi_get_time(struct efi_tm *tm);
int
efi_get_time_capabilities(struct efi_tmcap *tmcap);
int
efi_reset_system(void);
int
efi_set_time(struct efi_tm *tm);
int
efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
size_t *datasize, void *data);
int
efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor);
int
efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
size_t *datasize, void *data);
π¦ DESCRIPTION π¦
okay so first thing, the group-chat announcement: every single one of these calls returns ENXIO if UEFI runtime services aren't available. no services, no vibes. and also, efirt is currently only available on amd64 and arm64 β so if you're on something else, this whole page is just β¨aestheticβ¨ for you.
efi_rt_ok() π
returns 0 if UEFI runtime services are present and functional, or ENXIO if not. that's it. that's the vibe check.
efi_get_table() π
gets a table by uuid from the UEFI system table. returns 0 if the table was found, and populates *ptr with the address. returns ENXIO if the configuration table or system table are unset. returns ENOENT if the requested table cannot be found. (rip, the table ghosted you.)
efi_get_time() β°
gets the current time from the RTC, if it's available. returns 0 and populates the struct efi_tm on success. returns EINVAL if the struct efi_tm is NULL, or EIO if the time could not be retrieved due to a hardware error.
efi_get_time_capabilities() π
gets the capabilities from the RTC. returns 0 and populates the struct efi_tmcap on success. returns EINVAL if the struct efi_tm is NULL, or EIO if the time could not be retrieved due to a hardware error.
efi_reset_system() π
requests a warm reset and reboot of the system. yeah. that's a whole thing. it just asks for it, no arguments, no return value to check. main character move tbh.
efi_set_time() π°οΈ
sets the time on the RTC to the time described by the struct efi_tm passed in. returns 0 on success, EINVAL if a time field is out of range, or EIO if the time could not be set due to a hardware error.
efi_var_get() π
fetches the variable identified by vendor and name. returns 0 and populates attrib, datasize, and data on success. otherwise, one of these little guys comes back at you:
ENOENTβ the variable was not found.EOVERFLOWβ datasize is not sufficient to hold the variable data. namesize is updated to reflect the size needed to complete the request.EINVALβ one of name, vendor, or datasize areNULL. alternatively, datasize is large enough to hold the response but data isNULL.EIOβ the variable could not be retrieved due to a hardware error.EDOOFUSβ the variable could not be retired due to an authentication failure.
not the EDOOFUS. iconic error name, honestly. no notes. π
efi_var_nextname() π
this one's for enumeration of variables, aka scrolling the list. on the initial call to efi_var_nextname(), name should be an empty string. subsequent calls should pass in the last name and vendor returned, until ENOENT is returned. returns 0 and populates namesize, name, and vendor with the next variable's data. otherwise, returns one of the following:
ENOENTβ the next variable was not found.EOVERFLOWβ datasize is not sufficient to hold the variable data. namesize is updated to reflect the size needed to complete the request.EINVALβ one of name, vendor, or datasize areNULL.EIOβ the variable could not be retrieved due to a hardware error.
efi_var_set() β¨
sets the variable described by name and vendor. returns 0 if the variable has been successfully. otherwise, returns one of the following:
EINVALβ either attrib was an invalid combination of attributes, datasize exceeds the maximum allowed size, or name is an empty Unicode string.EAGAINβ not enough storage is available to hold the variable and its data.EIOβ the variable could not be saved due to a hardware error.EROFSβ the variable in question is read-only or may not be deleted.EDOOFUSβ the variable could not be set due to an authentication failure.ENOENTβ the variable trying to be updated or deleted was not found.
π SEE ALSO π
π«Ά AUTHORS π«Ά
this manual page was written by Kyle Evans <kevans@FreeBSD.org>. thank you Kyle, you ate π
and that's the whole page bestie, no cap β this beauty came from Debian, dated August 12, 2018, and it lives in section EFIRT(9) of the Kernel Developer's Manual. go forth and talk to your firmware responsibly π§β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- π the page's license: BSD-2-Clause-FreeBSD
- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms