41

EFI Boot Application in C#

 5 years ago
source link: https://www.tuicool.com/articles/hit/uMzQRz3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

EFI boot application in C#

This sample is a EFI boot application written in C# that displays Hello World. It runs without an OS, on x64 bare metal hardware.

raei2uJ.png!web

Building the program

Refer to the general instructions at the root of the repo.

Booting the generated program

Running build.cmd should produce a BOOTX64.EFI file in the current directory. There are multiple ways to run this. QEMU with an EFI firmware should work. I use Hyper-V.

Running build.cmd vhd will produce a VHDX file for you that you can run on Hyper-V directly (it prompts for elevation, so don't be surprised). You need to create a new Gen 2 virtual machine in Hyper-V and attach the generated disk. Make sure to turn off Secure boot in the virtual machine: the EFI image is not signed.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK