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");
}
Speaker Notes
- این ماکرو
main!
عملکرد اصلی شما را مشخص میکند تا از نقطه ورودیvmbase
فراخوانی شود. - نقطه ورودی
vmbase
مقدار دهی اولیه کنسول را کنترل میکند و در صورت بازگشت main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر میکند.