This guide walks you through adding Unified.Firmware to a .NET project, verifying that the host system is running in UEFI mode, reading the active boot option, listing the full boot order, and locating the EFI System Partition — all in fewer than five minutes. By the end you will have a working console application that exercises the core API surface.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.
Install the packages
Add the core package and the boot-service package to your project. The core package provides Package Manager Console (Visual Studio)If your boot entries reference specific hardware or media device paths, also install one or both of the protocol extension packages:
FirmwareInterface and FirmwareEnvironment; the boot-service package adds FirmwareBootService and all boot entry types.dotnet CLIVerify UEFI availability
Before calling any firmware API, confirm that the current system was booted in UEFI mode. On unsupported platforms (anything other than Windows or Linux)
FirmwareInterface.Available delegates to the platform backend and returns false on Legacy BIOS systems.FirmwareInterface.CurrentBackend itself throws PlatformNotSupportedException, so guard that access too if you target a broad set of operating systems.Read the current boot option
FirmwareBootService.CurrentLoadOptionIndex returns the BootOptionIndex that the firmware used for the current boot. Pass that index to FirmwareBootService.ReadLoadOption to deserialize the full FirmwareBootOption from NVRAM.FirmwareBootOption inherits from LoadOptionBase, which exposes Attributes (LoadOptionAttributes flags), Description (human-readable label), Protocols (device path array), and OptionalData (raw optional bytes).Enumerate all boot options
FirmwareBootService.EnumerateBootOptions() reads BootOrder from NVRAM and yields a FirmwareBootOption for each index, in boot priority order.FirmwareBootService.LoadOrder, which returns a BootOptionIndex[] that you can read or replace to reorder entries.Get the EFI System Partition
FirmwareInterface.SystemPartition returns a System.IO.DirectoryInfo pointing to the root of the EFI System Partition. Use it with standard System.IO APIs — no separate MountVol or partition GUID look-up required.SystemPartition throws PlatformNotSupportedException when FirmwareInterface.Available is false, so always check availability first (Step 2).On Windows, your process must run as Administrator to read or write UEFI NVRAM variables. Launch Visual Studio, your terminal, or your compiled executable with “Run as administrator”, or embed a UAC manifest that requests
requireAdministrator. Without elevation, calls to FirmwareBootService and FirmwareEnvironment will throw an access-denied exception.