Hi BenLunt,
Thanks for the tip. I did a lot of tests with different options. I'm using the qemu shipped with my distro, and I've downloaded the OVMF from
http://www.tianocore.org/ovmf/, but that page has been removed since (but see below). In all cases I was looking for the first message that indicated the boot loader (to omit PXE and other net related overhead), however without UEFI I could only observe the whole boot time, it's that fast.
First, the non-UEFI versions:
"qemu -option-rom bootboot.bin" boots the OS in less than a sec. Probably millisecs to the "Booting OS..." message
"qemu -kernel bootboot.bin" less than a sec.
"qemu -bios coreboot.rom" less than a sec.
Now the UEFI versions, first with the OVMF.fd I've downloaded, with the original, unmodified OVMF-VARS.fd:
"qemu -bios"
"qemu -drive if=pflash"
"qemu -M q35 -bios"
"qemu -M q35 -drive if=pflash"
I've also tried all combination with "-sdl", but in all cases there's a "Guest hasn't initialized the display yet." message for at least 2-3 seconds. Then at least 3-5 seconds on the "TianoCore" boot screen with the "X bytes of system memory tested OK." message. Only after that it shows "Boot Failed. EFI Floppy", "Boot Failed. EFI DVD/CDROM" etc. The entire qemu command line looked like this:
Code: Select all
qemu-system-x86_64 (varied options, see above) -m 64 -drive file=disk-x86.img,format=raw -serial stdio
Then I've tried alternative OVMF.fd
bios64.bin from
here, same results.
I've also tried an OVMF that I compiled using the package shipped with my distro (edk2-ovmf 202005-3). However I'm sure I've misconfigured something during compilation, because it is even slower that the two binaries I've downloaded, takes more than a minute until the first "Boot Failed. EFI Floppy" message shows up.
I've repeated all test with my OVMF-VARS.fd, where I've changed the boot order so FS0:\EFI\BOOT\BOOTX86.EFI to be the first. Same results, except there are no "Boot Failed. X" messages, it is the "Booting OS..." message that shows up as first (printed by my boot loader). I do not use STARTUP.NSH, I've just changed the boot order. (Press ESC on the TianoCore boot screen, then it will start the configuration screen. Select "Boot Maintenance Manager", then "Boot Options", then "Change Boot Order". Move "EFI Harddrive" to the top).
Finally, I've tested with VirtualBox too. There without "Enable EFI (special OSes only)" it boots in a little bit more than a sec (spends some time showing "Press F12..." message, otherwise fast). With "Enable EFI (special OSes)" option, it boots just a little bit longer, in 2 secs. A lot better than any TianoCore configuration, but still slower than the BIOS version. However this 2 secs overhead is reasonable and perfectly acceptable.
You can find the images I've used
here (and option rom in ../dist/bootboot.bin), along with most of the qemu commands (see Makefile). For VirtualBox, I've used it's GUI, and I've converted the disk image to vdi with
Code: Select all
VBoxManage convertfromraw disk-x86.img disk-x86.vdi
Cheers,
bzt