EFIDEV(4)
π efidev(4) / efirtc β user-mode access to UEFI runtime services β¨ (Kernel Interfaces Manual)
β¨ NAME β¨
Bestie, meet efidev and efirtc: your user-mode access pass to UEFI runtime services. Yes, both names are in the group chat. π
π οΈ SYNOPSIS π οΈ
To compile this driver into the kernel, place the following lines in your kernel configuration file:
options EFIRT
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
efirt_load="YES"
The driver may be disabled by setting the loader(8) tunable efi.rt.disabled to β1β.
π DESCRIPTION π
The efidev device gives you user-mode access to UEFI runtime services. It also includes a driver that provides a time-of-day clock using the UEFI real time clock (RTC). But plot twist: the RTC may not always be available, based on the UEFI firmware. If the RTC is not available, it will not be registered as a time-of-day clock, and the time-related ioctls below will not be functional. No cap. π
All the ioctls below are defined in <sys/efiio.h>, with supplemental structures and constants defined in <sys/efi.h>.
π
EFIIOC_GET_TABLE (struct efi_get_table_ioc)
Copy the UEFI table specified by the uuid field of the struct efi_get_table_ioc into the buf field. You can query the memory size for the buf field by passing a NULL pointer as a buf value. The required size will be stored in the table_len field. The size of the allocated memory must be specified in the buf_len field.
struct efi_get_table_ioc {
void *buf;
struct uuid uuid;
size_t table_len;
size_t buf_len;
};
π
EFIIOC_GET_TIME (struct efi_tm)
Get the time from the RTC, if the RTC is available. The struct efi_tm passed is populated with the current time, unless an error occurs.
struct efi_tm {
uint16_t tm_year;
uint8_t tm_mon
uint8_t tm_mday
uint8_t tm_hour;
uint8_t tm_min;
uint8_t tm_sec;
uint8_t __pad1;
uint32_t tm_nsec;
int16_t tm_tz;
uint8_t tm_dst;
uint8_t __pad2;
};
π
EFIIOC_SET_TIME (struct efi_tm)
Sets the time stored by the RTC, if the RTC is available. Clock-setting main character energy, fr fr. β°
π
EFIIOC_VAR_GET (struct efi_var_ioc)
Gets data from the variable described by the vendor and name fields of the struct efi_var_ioc into the data field. EFIIOC_VAR_GET (struct efi_var_ioc) will also populate the attrib field.
struct efi_var_ioc {
efi_char *name;
size_t namesize;
struct uuid vendor;
uint32_t attrib;
void *data;
size_t datasize;
};
π
EFIIOC_VAR_NEXT (struct efi_var_ioc)
Used for enumerating all UEFI variables. The initial call should use an empty string for the name attribute. Subsequent calls should supply the vendor uuid and name of the last variable returned. It's giving variable-by-variable tour, iykyk. π¦
π
EFIIOC_VAR_SET (struct efi_var_ioc)
Sets data and attributes for the variable described by the name and vendor in the struct efi_var_ioc.
π FILES π
/dev/efi
π SEE ALSO π
π°οΈ HISTORY π°οΈ
A efidev device first appeared in FreeBSD 11.1. Periodt.
π BUGS π
efidev is currently only available on amd64 and arm64. That's the whole bug note, bestie.
π source/version vibe: Debian. date: June 18, 2021. This EFIDEV(4) page said what it needed to say β bye bestie π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms