qboot
is a simple x86 firmware that can boot Linux.
It is Paolo Bonzini's answer to the Clear Containers claim that QEMU takes too long to boot a Linux kernel.
qboot
only works as a QEMU firmware as it's bound to QEMU's fw_cfg
NVRAM firmware configuration
device emulation mode.
qboot
relies on QEMU's fw_cfg
device that emulates an NVRAM block holding all firmware configuration
information. The fw_cfg
emulated commands and registers are documented here.
The qboot
build process generates a bios.bin
file that is passed to QEMU through the --bios
command line option.
Before jumping into qboot
's entry point, QEMU will initialize the selected machine type (--machine
) and store the related machine firmware relevant pieces of information into the fw_cfg
device. The QEMU machine type initilization code will generate and store in particular the following data:
- ACPI tables
- e820 maps
- Kernel command line and size
- Kernel data and size
- Initrd data and size
QEMU stores that data at fixed offset into the emulated fw_cfg
NVRAM space. qboot
then reads and interacts with
this emulated storage device.
QEMU jumps to qboot
's entry point and qboot then goes through the following steps:
- Enable all PCI IRQs
- Enable PCI PM
- PIC setup