UEFI boot options are named variables stored in NVRAM — eachDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Rikitav/Unified.Firmware/llms.txt
Use this file to discover all available pages before exploring further.
Boot#### entry holds a human-readable description, a set of attributes, and a packed device path that tells the firmware exactly which EFI application to launch. This guide walks through every read-side operation provided by FirmwareBootService: enumerating all entries in boot order, reading a single entry by index, checking the current and next boot selection, and inspecting the device path protocols attached to each option.
All operations that read firmware variables require elevated privileges. On Windows, run your process as Administrator. On Linux, the calling user must have root access or the
CAP_SYS_ADMIN capability so that the kernel’s efivarfs or GetFirmwareEnvironmentVariable syscall succeeds.Enumerate all boot options
FirmwareBootService.EnumerateBootOptions() returns all boot entries in the order defined by the BootOrder variable. Each element is a FirmwareBootOption with a Description, an Attributes flags value, and a Protocols array containing the decoded device path.
Read a specific option by index
When you know the exactBoot#### index, call FirmwareBootService.ReadLoadOption(index) directly. The index is a ushort and can be written as a hexadecimal literal for readability.
FirmwareBootOption is a fully deserialized in-memory object; modifying its properties does not automatically persist changes back to NVRAM.
Access the boot order
TheBootOrder NVRAM variable holds the sequence in which the firmware tries each Boot#### entry. FirmwareBootService.LoadOrder exposes this as a BootOptionIndex[] array.
BootOptionIndex implicitly converts to and from ushort and provides a ToString() that formats the value as Boot#### (four uppercase hex digits with leading zeroes).
Get the current boot option
FirmwareBootService.CurrentLoadOptionIndex reads the BootCurrent NVRAM variable, which the firmware sets before transferring control to the OS. Its value is the index of the entry that was actually used to boot.
Inspect device path protocols
EachFirmwareBootOption carries a Protocols array of DevicePathProtocolBase instances representing the UEFI device path nodes. Calling ToString() on each protocol produces a compact human-readable summary:
| Protocol class | ToString() output |
|---|---|
PciProtocol | Pci(0x{Device:X}, 0x{Function:X}) |
HardDriveProtocol | The GPT partition GUID as a string |
FilePathProtocol | The EFI file path string, e.g. EFI\ubuntu\grubx64.efi |
CdRomProtocol | The boot entry number as a string |
Read as a custom type
If you need to deserialize a boot entry into your own strongly-typed model, derive a class fromLoadOptionBase and call the generic overload: