microvm
The x86_64 microvm implementation targets QEMU's microvm machine type. See: https://www.qemu.org/docs/master/system/i386/microvm.html
There is no bootloader: QEMU boots the kernel directly (-kernel) using the PVH ELF note (see asm/notes.asm), and hands over boot information (command line, initrd, memory map) via a hvm_start_info structure (see core/pvh.c).
Compared to pc, this board is headless (serial console only, no VGA/ framebuffer, no keyboard) and has no PCI bus (no networking yet).
Config file
ARCH = x86_64
BOARD = microvm
# This is only useful when QEMU is used.
CONFIG_SEMIHOSTING = 1
Boot options
It is possible to change the command line by passing the CMDLINE variable to make (or add it to your config file):
$ make clean run-debug CMDLINE="/bin/init foo bar"
Early boot sequence
- QEMU loads the kernel ELF directly and finds the PVH entry point
- QEMU builds the hvm_start_info structure (command line, initrd, memory map) and jumps to the entry point (start), passing its address in ebx
- Various checks are performed to make sure we can continue the boot process
- The page tables and paging are configured and enabled
- A 64-bit Global Descriptor Table is loaded
- A Task State Segment is loaded
- All the data segment registers are reloaded
- The C kmain() function is called, which validates the hvm_start_info structure and parses the boot information
- Eventually, the kernel switches to user mode and calls /bin/init by default
See the x86_64 architecture page for memory management/layout details shared with other boards.