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.
FirmwareInterface is the static gateway to every UEFI capability in Unified.Firmware. It handles platform backend selection, availability checking, EFI System Partition discovery, and boot-to-firmware-UI signalling — all from a single, dependency-free class that requires no instantiation.
Platform Backend Selection
Unified.Firmware ships two platform backends:Win32PlatformBackend for Windows and LinuxPlatfromBackend for Linux. FirmwareInterface.CurrentBackend picks the right one automatically by inspecting Environment.OSVersion.Platform the first time it is accessed, then caches the result for the lifetime of the process.
CurrentBackend directly — higher-level APIs such as FirmwareEnvironment.Global and FirmwareBootService consume it internally. Access it only when you need to pass the backend to a FirmwareEnvironment instance you are constructing yourself.
Availability Check
Before calling any UEFI API, verify that the current system was actually booted through UEFI and that the firmware exposes the required runtime services. Calling UEFI APIs on a BIOS/Legacy-boot system or inside a VM without firmware support will throw aPlatformNotSupportedException.
Available delegates to CurrentBackend.CheckFirmwareAvailablity(). It returns false when the platform is not UEFI or the process lacks the privileges needed to call firmware runtime services.
On Windows, reading or writing UEFI variables requires the process to hold the
SE_SYSTEM_ENVIRONMENT_NAME privilege. You must run your application elevated (as Administrator) or explicitly acquire the privilege before UEFI APIs will succeed.EFI System Partition
The EFI System Partition (ESP) is a FAT-formatted partition that stores boot loaders, firmware applications, and related files.FirmwareInterface.SystemPartition searches the mounted volumes for the one flagged as the ESP and returns a DirectoryInfo pointing to its root.
PlatformNotSupportedException if Available is false, ensuring callers never receive a stale or invalid path.
Boot to Firmware UI
BootToUserInterface() sets the BOOT_TO_FW_UI flag in the OsIndications global UEFI variable. On the next reboot the firmware reads this flag and drops straight into its setup utility instead of starting the normal boot sequence. The call does not reboot the computer — it only sets the condition for the following restart.
OsIndicationsSupported contains the BOOT_TO_FW_UI bit. If the firmware does not advertise support for this feature, a PlatformNotSupportedException is thrown rather than writing an unsupported flag.
Custom Backend
IFirmwareBackend is the interface both built-in backends implement. You can provide your own implementation for unit testing, emulation, or exotic platforms by assigning it to CurrentBackend before any other call is made.
For the full interface contract, see IFirmwareBackend.
Firmware Environment
Read and write UEFI NVRAM variables in global and vendor namespaces
Boot Service
Enumerate, create, update, and delete UEFI boot entries