flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > UEFI Test Bootloader

Author
Thread Post new topic Reply to topic
Core i7



Joined: 14 Nov 2024
Posts: 181
Location: Socket on motherboard
Core i7 09 Nov 2026, 06:51
I’ve been learning UEFI programming and have written a small bootloader.
I’m running it in a QEMU virtual machine on Windows; if you have some time, could you please test the application on your end so I can fix any bugs?

Attached is a screenshot of the bootloader window, along with the contents of my Windows batch file.
It is important to include the "-smbios type=1" flag, as the code reads data from the SMBIOS table. The last line specifies a virtual disk to be used as the boot drive. You will need to create a directory structure—"\Bootdrv\EFI\Boot\"—anywhere on your system and place my bootloader image, "Bootx64.efi" (do not change the filename), inside it.

Please run the batch file from within the QEMU folder so that it can locate the EFI firmware ("qemu\share\edk2-x86_64-code.fd") instead of the legacy BIOS. Thanks in advance!

Code:
qemu-system-x86_64 ^
-smp 2 -m 1024M -machine q35 -smbios type=1 ^
-netdev user,id=net0,hostfwd=tcp::5555-:80 ^
-device virtio-net-pci,netdev=net0,vectors=4 ^
-drive if=pflash,format=raw,readonly=on,file=share\edk2-x86_64-code.fd ^
-drive file=fat:rw:D:\_vm\bootdrv,format=raw,if=virtio     


Description:
Filesize: 8.05 KB
Viewed: 90 Time(s)

EfiTest.png


Description:
Download
Filename: BootX64.zip
Filesize: 6.14 KB
Downloaded: 16 Time(s)

Post 09 Nov 2026, 06:51
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4665
Location: vpcmpistri
bitRAKE 09 Nov 2026, 07:41
It worked in QEMU and real hardware.

QEMU looks exactly the same.

Hardware boot has an orange title bar - no text, on titlebar - rest is good.
Post 09 Nov 2026, 07:41
View user's profile Send private message Visit poster's website Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 181
Location: Socket on motherboard
Core i7 09 Nov 2026, 08:07
bitRAKE, thank you very much, ..especially for testing it on physical hardware.
I will try to fix the issue with the text in the header. Currently, I’m reading the UEFI version string from the SMBIOS table; it seems there’s something wrong with that, even though I’m also pulling the core count and memory size from SMBIOS.
Post 09 Nov 2026, 08:07
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.