Unified.Firmware.BootService
1.3.3
dotnet add package Unified.Firmware.BootService --version 1.3.3
NuGet\Install-Package Unified.Firmware.BootService -Version 1.3.3
<PackageReference Include="Unified.Firmware.BootService" Version="1.3.3" />
<PackageVersion Include="Unified.Firmware.BootService" Version="1.3.3" />
<PackageReference Include="Unified.Firmware.BootService" />
paket add Unified.Firmware.BootService --version 1.3.3
#r "nuget: Unified.Firmware.BootService, 1.3.3"
#:package Unified.Firmware.BootService@1.3.3
#addin nuget:?package=Unified.Firmware.BootService&version=1.3.3
#tool nuget:?package=Unified.Firmware.BootService&version=1.3.3
Unified.Firmware
Description
ExtensibleFirmware is a .NET class library for working with UEFI firmware. It provides tools for editing the boot process, allowing developers to modify and configure boot parameters for enhanced flexibility.
Features
- Getting EFI system partition
- Editing and creating boot entries.
- Editing global variables for firmware.
Installation
# Install via NuGet Package manager
Install-Package Unified.Firmware
# Install via dotnet CLI
dotnet add package Unified.Firmware
Usage Examples
Example 1: Getting ESP
using Unified.Firmware.SystemPartition;
using System.IO;
namespace Examples
{
class Program
{
public static void Main()
{
// Getting 'EFI system partition' volume path
string EspVolumePath = EfiPartition.GetFullPath();
// Example reading config file from ESP using volume path, instead of using MountVol
string configText = File.ReadAllText(Path.Combine(EspVolumePath, "EFI", "Ubuntu", "grub.cfg"));
// Dumping result
Console.WriteLine(configText);
}
}
}
Example 2: Reading boot option
using Unified.Firmware.BootService;
using Unified.Firmware.BootService.DevicePathProtocols;
using Unified.Firmware.BootService.LoadOption;
using System;
namespace Examples
{
class Program
{
public static void Main()
{
// Reading boot option
FirmwareBootOption bootOption = FirmwareBootService.ReadLoadOption(0x0003); // <-- Set here your variable index
// Showing basic information
Console.WriteLine("Option name : \"{0}\"", bootOption.Description);
Console.WriteLine("Attributes : {0}", bootOption.Attributes);
// Enumerating all protocols
foreach (DevicePathProtocolBase protocol in bootOption.OptionProtocols)
Console.WriteLine(protocol.ToString()); // Getting string representation of protocol
}
}
}
Example 3: Enumearating boot options
using Unified.Firmware.BootService;
using Unified.Firmware.BootService.DevicePathProtocols;
using Unified.Firmware.BootService.LoadOption;
namespace Unified.Firmware.TestsApplication
{
public static class BootManagerTests
{
public static void RunTests()
{
// Enumerating all boot options in boot order
int index = 0;
foreach (FirmwareBootOption bootOption in FirmwareBootService.EnumerateBootOptions())
{
// Showing basic information
Console.WriteLine("\n===[ Boot option #" + index++ + " ]" + new string('=', 60));
Console.WriteLine("Option name : \"{0}\"", bootOption.Description);
Console.WriteLine("Attributes : {0}", bootOption.Attributes);
// Enumerating all protocols
foreach (DevicePathProtocolBase protocol in bootOption.OptionProtocols)
Console.WriteLine(protocol.ToString()); // Getting string representation of protocol
}
}
}
}
Example 4: Creating boot option
using Unified.Firmware.BootService;
using Unified.Firmware.BootService.DevicePathProtocols;
using Unified.Firmware.BootService.LoadOption;
using Unified.Firmware.MediaDevicePathProtocols;
using System;
namespace Examples
{
class Program
{
public static void Main()
{
// Setting device path protocols
// This protocols instructions boot service how to load your option
DevicePathProtocolBase[] protocols = new DevicePathProtocolBase[]
{
new HardDriveMediaDevicePath(new Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")), // The partition on which the bootloader is located
new FilePathMediaDevicePath("EFI\\MyApplication\\bootx64.efi") // Path to the EFI application to be loaded
};
// Creating simple load option
FirmwareBootOption bootOption = new FirmwareBootOption(LoadOptionAttributes.ACTIVE, "MyLoader", Array.Empty<byte>(), protocols);
// Creating new load option
ushort newLoadOptionIndex = FirmwareBootService.CreateLoadOption(bootOption, true);
// Logging new boot option index
Console.WriteLine("Boot option sucessfully created, new option index : {0}", newLoadOptionIndex);
}
}
}
Requirements
Most functionality will work on every Windows system that supports uefi, except EfiExecutableInfo and VolumenName pathes, the will only work on Windows 8 or above
Resources
If you want to learn more about UEFI and how this library works, read the documentation at the following links :
License
This project is licensed under the GNU GPL License. See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Unified.Firmware (>= 1.3.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Unified.Firmware.BootService:
| Package | Downloads |
|---|---|
|
Unified.Firmware.DevicePathProtocols.Media
C# Library providing convenient abstractions and tools for working with UEFI firmware (United Extensible Firmware Interface) |
|
|
Unified.Firmware.DevicePathProtocols.Hardware
C# Library providing convenient abstractions and tools for working with UEFI firmware (United Extensible Firmware Interface) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.3 | 162 | 3/3/2026 |