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?)
Code:
$ file main.efi
main.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows, 6 sections
I then followed the "Linux, root required" instructions to create a disk image for it, and booted it as:
Code:
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
But the loader claims "No bootable option or device was found"
Although qemu contained a warning:
Code:
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.
So I suspect the disk image, and so tried these steps instead:
https://wiki.osdev.org/UEFI_Bare_BonesBut still no luck (and same warning).
Any suggestions on how to move forward here?
Thanks,
Jeff