debugging uefi
Posted: Sat Jan 21, 2023 3:13 pm
Hello,
I've gotten back into osdev after a long hiatus, and I'm trying to stitch together some uefi info online to produce a simple uefi bootable image, but each attempt results in qemu not finding any bootable images.
I first went through this tutorial ( https://wiki.osdev.org/UEFI ) to produce a PE executable using gnu-efi, which appears to produce a correct app (but how else to assert that this is a loadable UEFI application?)
I then followed the "Linux, root required" instructions to create a disk image for it, and booted it as:
But the loader claims "No bootable option or device was found"
Although qemu contained a warning:
So I suspect the disk image, and so tried these steps instead:
https://wiki.osdev.org/UEFI_Bare_Bones
But still no luck (and same warning).
Any suggestions on how to move forward here?
Thanks,
Jeff
I've gotten back into osdev after a long hiatus, and I'm trying to stitch together some uefi info online to produce a simple uefi bootable image, but each attempt results in qemu not finding any bootable images.
I first went through this tutorial ( https://wiki.osdev.org/UEFI ) to produce a PE executable using gnu-efi, which appears to produce a correct app (but how else to assert that this is a loadable UEFI application?)
Code: Select all
$ file main.efi
main.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows, 6 sections
Code: Select all
qemu-system-x86_64 -drive if=pflash,format=raw,unit=0,file=./ovmf-x86_64-code.bin,readonly=on -drive if=pflash,format=raw,unit=1,file=./ovmf-x86_64-vars.bin -net none -hda hdimage.bin
Although qemu contained a warning:
Code: Select all
WARNING: Image format was not specified for 'hdimage.bin' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
https://wiki.osdev.org/UEFI_Bare_Bones
But still no luck (and same warning).
Any suggestions on how to move forward here?
Thanks,
Jeff