Creating a UEFI boot entry means serializing a device path — the chain of protocol nodes that describes where your EFI application lives — along with a human-readable label and attribute flags, then writing the result into a freeDocumentation 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#### NVRAM variable and registering its index in the BootOrder list. This guide walks through each part of that process using FirmwareBootService.CreateLoadOption.
Choose your device path protocols
The Assemble the two nodes into an array in order — partition first, then file path:
Protocols array on a FirmwareBootOption encodes the UEFI device path. Each node narrows the location of the bootloader further — typically you need at least a partition node and a file path node.HardDriveProtocol identifies a GPT partition by its unique partition GUID. Pass the partition’s GUID directly, and the library queries the OS for the matching partition geometry:FilePathProtocol provides the path to the EFI executable within the partition, using backslashes as separators (the UEFI convention):Create a FirmwareBootOption
Construct a
FirmwareBootOption using the four-argument constructor. Pass the desired attributes, a display name, the protocols array, and an optional data byte array (use Array.Empty<byte>() if you have no data to pass to the loaded image):Write to NVRAM
Call If no free slot is found (all 65 535 indices are occupied), a
FirmwareBootService.CreateLoadOption to find the first free Boot#### slot, write the serialized entry, and insert its index into BootOrder. Pass AddFirst: true to prepend the new entry to the top of the boot order:FreeLoadOptionIndexNotFound exception is thrown.Full example
LoadOptionAttributes
LoadOptionAttributes is a [Flags] enum. The most common values are:
| Flag | Value | Description |
|---|---|---|
ACTIVE | 0x00000001 | The firmware will attempt to boot this entry automatically. Entries without this flag are skipped during normal boot processing. |
HIDDEN | 0x00000008 | The entry will not appear in the firmware’s boot menu, though it can still be selected programmatically. |
CATEGORY_BOOT | 0x00000000 | Default category; the entry is part of normal OS boot processing. This is the zero value and is always present unless CATEGORY_APP is set. |
CATEGORY_APP | 0x00000100 | Marks the entry as an EFI application (e.g. a diagnostic tool) rather than an OS loader. These entries are excluded from the normal boot sequence and are accessible only via hot key or explicit selection. |
HardDriveProtocol constructors
Two constructors are available depending on what partition information you have at hand:InvalidDataException, and an empty GUID throws ArgumentException.
OptionalData
TheOptionalData byte array is appended verbatim to the EFI_LOAD_OPTION structure and is passed as a pointer to the loaded EFI image. Most OS bootloaders ignore it, but some EFI applications use it to receive configuration parameters or device paths for chained loading. Pass Array.Empty<byte>() if you have no data to supply.