# Vm base info configs
#
[base]
# Guest vm id.
id = 1
# Guest vm name.
name = "linux-qemu-uefi"
# Virtualization type.
vm_type = 1
# The number of virtual CPUs.
cpu_num = 1
# Guest vm physical cpu sets.
phys_cpu_sets = [1]

#
# Vm kernel configs
#
[kernel]
# The entry point of the UEFI firmware reset vector.
entry_point = 0xffff_fff0
# The location of image: "memory" | "fs".
image_location = "fs"
# The file path of the Linux x86_64 UEFI guest image.
kernel_path = "/guest/linux/qemu-x86_64"
# The load address of the guest image.
kernel_load_addr = 0x20_0000
# Enable external firmware image loading.
enable_bios = true
# Select UEFI firmware flow instead of the legacy axvm-bios multiboot trampoline.
boot_protocol = "uefi"
# The file path of the UEFI firmware image, for example OVMF_CODE.fd.
uefi_firmware_path = "/guest/linux/OVMF_CODE.fd"
# Load the UEFI firmware near the top of the 32-bit address space.
bios_load_addr = 0xffc0_0000
# The file path of the ramdisk image.
ramdisk_path = "/guest/linux/initramfs.cpio.gz"
# The load address of the ramdisk image.
ramdisk_load_addr = 0x40_0000

## The path of the disk image.
# disk_path = ""

# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`, 2 means `MAP_RESERVED`.
memory_regions = [
  [0x0000_0000, 0x200_0000, 0x7, 0], # Low RAM 32M 0b111 R|W|EXECUTE
  [0xffc0_0000, 0x40_0000, 0x7, 0], # UEFI firmware window 4M
]

#
# Device specifications
#
[devices]
# The interrupt mode.
interrupt_mode = "passthrough"

# Emu_devices.
# Name Base-Ipa Ipa_len Alloc-Irq Emu-Type EmuConfig.
emu_devices = []

# Pass-through devices.
# Name Base-Ipa Base-Pa Length Alloc-Irq.
passthrough_devices = [
  [
    "IO APIC",
    0xfec0_0000,
    0xfec0_0000,
    0x1000,
    0x1,
  ],
  [
    "HPET",
    0xfed0_0000,
    0xfed0_0000,
    0x1000,
    0x1,
  ],
]
