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.

#![no_main]
#![no_std]

use vmbase::{main, println};

main!(main);

pub fn main(arg0: u64, arg1: u64, arg2: u64, arg3: u64) {
    println!("Hello world");
}
  • main! 宏用于标记需从 vmbase 入口点调用的 main 函数。
  • vmbase 入口点用于处理控制台初始化,并在 main 函数返回时发送 PSCI_SYSTEM_OFF 命令以关闭虚拟机。