Building Canoeboot for Emulation e.g. QEMU


Return to index

Canoeboot on QEMU

Canoeboot supports building for qemu as a target board. The resulting rom can then be tested using qemu.

The qemu board is mostly intended to speed up development by removing the need to flash to bare metal during initial tests. Qemu may also be useful for end users who intend to make changes to their Canoeboot rom without having to flash and reboot their machine.

Building and Testing

Canoeboot can be built for qemu just like any other board.

./mk -b coreboot emulation_qemu_x86_64_12mb_bios

In order to test the resulting roms, you must have qemu installed on the host machine. Test the roms by pointing qemu to the rom in bios mode. For example:

qemu-system-x86_64 -bios bin/emulation_qemu_x86_64_12mb_bios/seagrub_emulation_qemu_x86_64_12mb_bios_libgfxinit_corebootfb_usqwerty.rom

There is basic support for an arm64 virtual machine as well, although the payloads are not as developed as the x86 one:

./mk -b coreboot emulation_qemu_arm64_12mb_uefi
qemu-system-aarch64 -bios bin/qemu_arm64_12mb/uboot_payload_qemu_arm64_12mb_libgfxinit_corebootfb.rom \
	-M virt,secure=on,virtualization=on,acpi=on -cpu cortex-a53 -m 768M -serial stdio -vga none -display none

That command (above) does a serial console.

qemu-system-aarch64 \
    -machine virt,secure=on,virtualization=on \
    -cpu cortex-a72 -m 1G \
    -serial stdio -device VGA \
    -device qemu-xhci \
    -device usb-kbd -device usb-mouse \
    -bios bin/qemu_arm64_12mb/*.rom

Use Cases

While development is the primary motivation for qemu support, the board makes it easy to test minor changes to release roms. For example one can use cbfstool from coreboot to edit the background image in a Canoeboot rom as follows:

cbfstool /path/to/rom remove -n background.png
cbfstool /path/to/rom add -f mynewbackground.png -n background.png -t raw

Using qemu allows the user to verify that the background image renders properly before performing the same operation on their release rom.

Markdown file for this page: https://canoeboot.org/docs/misc/emulation.md

Site map

This HTML page was generated by the Canoeboot Static Site Generator.

Canoeboot is discontinued. A new project was created: RBoot project, a fully free UEFI firmware distribution based on coreboot. RBoot is Canoeboot continued under a new name, with the same maintainer. The canoeboot website and release sources shall be preserved for historical purposes.