vmbase

For VMs running under crosvm on aarch64, the vmbase library provides a linker script and useful defaults for the build rules, along with an entry point, UART console logging and more.

  1. #![no_main]
  2. #![no_std]
  3. use vmbase::{main, println};
  4. main!(main);
  5. pub fn main(arg0: u64, arg1: u64, arg2: u64, arg3: u64) {
  6.     println!("Hello world");
  7. }
  • The main! macro marks your main function, to be called from the vmbase entry point.
  • The vmbase entry point handles console initialisation, and issues a PSCI_SYSTEM_OFF to shutdown the VM if your main function returns.