Skip to main content

Documentation 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.

FirmwareBootOption is the standard, ready-to-use implementation of LoadOptionBase in the Unified.Firmware.BootService.LoadOption namespace. It represents a single UEFI Boot#### entry and carries all four fields defined by the UEFI specification: boot-behavior Attributes, a human-readable Description shown in the firmware menu, a Protocols array describing the device path to the EFI image, and an OptionalData byte buffer forwarded to the loaded image. Use FirmwareBootOption directly for the vast majority of scenarios; only subclass LoadOptionBase when you need custom deserialization logic.

Namespace

namespace Unified.Firmware.BootService.LoadOption;

Inheritance

LoadOptionBase
  └─ FirmwareBootOption

Constructors

FirmwareBootOption()

public FirmwareBootOption()
Creates a new FirmwareBootOption with default values. Attributes is initialized to LoadOptionAttributes.CATEGORY_BOOT and Description is set to an empty string (string.Empty). Protocols and OptionalData inherit the LoadOptionBase defaults of empty arrays. Use this constructor when you intend to set every property manually before passing the instance to FirmwareBootService.
FirmwareBootOption option = new FirmwareBootOption();
option.Attributes   = LoadOptionAttributes.ACTIVE;
option.Description  = "My Boot Entry";
option.Protocols    = new DevicePathProtocolBase[] { /* ... */ };

FirmwareBootOption(LoadOptionAttributes, string)

public FirmwareBootOption(LoadOptionAttributes attributes, string description)
Creates a new FirmwareBootOption with the specified Attributes and Description. Protocols and OptionalData are left as empty arrays. Parameters
attributes
LoadOptionAttributes
required
Boot-behavior flags for this entry. Combine members of LoadOptionAttributes with the bitwise OR operator. A typical active boot entry uses LoadOptionAttributes.ACTIVE.
description
string
required
The human-readable name shown in the firmware boot menu (e.g. "Windows Boot Manager"). Must not be null.
FirmwareBootOption option = new FirmwareBootOption(
    LoadOptionAttributes.ACTIVE,
    "My OS Loader");

FirmwareBootOption(LoadOptionAttributes, string, DevicePathProtocolBase[], byte[])

public FirmwareBootOption(
    LoadOptionAttributes     attributes,
    string                   description,
    DevicePathProtocolBase[] protocols,
    byte[]                   optionalData)
Creates a fully-specified FirmwareBootOption. This is the constructor to prefer when you know all four fields upfront, such as when creating a brand-new boot entry via FirmwareBootService.CreateLoadOption. Internally this constructor calls this(attributes, description) and then sets Protocols and OptionalData. Parameters
attributes
LoadOptionAttributes
required
Boot-behavior flags.
description
string
required
Human-readable menu label.
protocols
DevicePathProtocolBase[]
required
Device path array describing the path to the EFI image to load. Corresponds to the FilePathList field of EFI_LOAD_OPTION. The first element must identify the device; subsequent elements are optional and OS-vendor-specific. Pass an empty array [] when no device path is required.
optionalData
byte[]
required
Binary data passed verbatim to the loaded EFI image. Pass an empty array [] when no data is needed.
DevicePathProtocolBase[] protocols =
[
    // Partition containing the bootloader, identified by GUID
    new HardDriveProtocol(new Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")),

    // Path to the EFI application within that partition
    new FilePathProtocol("EFI\\MyApplication\\bootx64.efi"),
];

FirmwareBootOption bootOption = new FirmwareBootOption(
    LoadOptionAttributes.ACTIVE,
    "MyLoader",
    protocols,
    []);

BootOptionIndex newIndex = FirmwareBootService.CreateLoadOption(bootOption, AddFirst: true);
Console.WriteLine("Boot option created at index: {0}", newIndex);

Properties

All properties are inherited from LoadOptionBase. They are documented here for convenience.
Attributes
LoadOptionAttributes
Gets or sets the boot-behavior flags for this entry. The default value is LoadOptionAttributes.CATEGORY_BOOT. Combine flag members with the bitwise OR operator to express compound behavior — for example, ACTIVE marks the entry for automatic boot, HIDDEN hides it from the firmware menu, and CATEGORY_APP classifies it as a selectable application rather than a normal boot path.See LoadOptionAttributes for the full flags reference.
Description
string
Gets or sets the human-readable name displayed in the UEFI boot selection menu (e.g. "Windows Boot Manager", "ubuntu"). The default value is an empty string.
Protocols
DevicePathProtocolBase[]
Gets or sets the packed device-path protocol array that tells the firmware where to find the EFI image. This corresponds to the FilePathList field of EFI_LOAD_OPTION. The first element identifies the target device or partition; additional elements are optional. The default value is an empty array.
OptionalData
byte[]
Gets or sets a raw binary buffer forwarded to the loaded EFI image. Corresponds to the OptionalData field of EFI_LOAD_OPTION. The firmware passes a NULL pointer to the image when this array is empty. The default value is an empty array.

Build docs developers (and LLMs) love