Implementing 64bit optionrom for QEMU

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
anatolik
Posts: 16
Joined: Sun Jul 07, 2013 7:29 pm

Implementing 64bit optionrom for QEMU

Post by anatolik »

I have implemented an UEFI bootloader that allows to boot 64bit ELF applications. The boot interface is similar to multiboot but fixes some of its flaws:
- loads normal ELF applications, no special magic headers needed
- works with 64bit applications. Multiboot is defined only for 32bits, but it is so 90s
- multi-architectual, will work with any arch that is supported by ELF format.
- supports ELFs with multiple loadable segments
- passes extended boot information to the application (memory map, elf segments info, ...)

I have a UEFI loader that works great both with QEMU and real hardware (tested on ASUS Q170).

As I said it works with QEMU, through UEFI ovmf firmware. But I found its boot time quite slow (as well as few more restrictions such as poor virtio implementation). I am thinking of implementing a simple optionrom for QEMU, similar to multiboot.bin.

This ROM starts with Intel real mode, fetches e820 memory info, switches to protected mode, inits hardware FPU/SSE/paging then switches to 64bit mode and jump to the ELF entry point. I am looking for a good tutorial and documentation related to QEMU optionrom development. Any existing examples of 32/64 bit QEMU optionrom would be a big plus.
Post Reply