跳到主要内容

Axvisor

Axvisor 是 TGOSKits 的 Hypervisor 子系统。与 ArceOS(app 模块化)和 StarryOS(单内核)不同,Axvisor 编译的是虚拟机监控器本身,同时需要管理一个或多个 Guest VM 的配置(--vmconfigs)、Guest 镜像和 rootfs。Axvisor 也是唯一支持 test uboot 测试模式和**唯一需要 LVZ 扩展版 QEMU(loongarch64)**的子系统。

本目录详细描述 Axvisor 的全部命令。深入的主题有独立文档:

  • Axvisor 构建:Hypervisor 编译、旧平台选择项过滤、板卡配置自动复制
  • Axvisor 运行:QEMU / U-Boot / 板卡、loongarch64 LVZ QEMU、Guest UEFI firmware
  • Axvisor 测试:QEMU / U-Boot / Board 三种测试模式(含 Axvisor 独有的 test uboot

通用的参数解析、Snapshot、Build Info 和动态平台构建约定详见 参数与配置

子命令

cargo xtask axvisor <subcommand> [options]
子命令说明详细文档
build编译 Axvisor构建
qemu编译并在 QEMU 中运行(含 rootfs/guest 镜像准备)运行
uboot编译并通过 U-Boot 运行运行
board编译并在远程板卡运行运行
test qemuQEMU 测试测试
test ubootU-Boot 测试(Axvisor 独有)测试
test board板级测试测试
defconfig <board>生成默认板卡配置见下文
config ls列出可用板卡名称见下文

参数

通用参数build / qemu / uboot / board):--arch--target--config--smp--debug--vmconfigs。默认架构 aarch64

QEMU 额外参数--qemu-config <PATH>--rootfs <IMAGE> Board 额外参数--board-config <PATH>-b/--board-type <TYPE>--server <HOST>--port <PORT> U-Boot 测试参数test uboot):--board <TYPE>(必需)、--guest <IMAGE>--uboot-config <CFG>

特有行为

--vmconfigs:多 Guest VM 配置

Axvisor 的核心特有参数 --vmconfigs <PATH>... 指定一个或多个 VM 配置文件列表。每个 VM 配置描述一个 Guest(如 Linux、StarryOS guest)的内存、CPU、设备和启动来源。Axvisor 在 QEMU 运行前会准备所有引用的 rootfs 和 guest 镜像。详见 Axvisor 构建Axvisor 运行

旧平台选择项过滤

Axvisor 旧配置中可能出现 defplatmyplatplat-dynaxplat-dyn/* 等平台选择项。当前构建固定走动态平台路径,axbuild 会过滤这些旧 feature;Build Info 中的旧 plat_dyn 字段会被拒绝。详见 Axvisor 构建

LoongArch LVZ QEMU

loongarch64 需要定制 QEMU(LVZ 扩展),axbuild 自动定位,详见 Axvisor 运行

独有的 test uboot 模式

Axvisor 是唯一支持 U-Boot 测试模式的子系统,验证"U-Boot → Axvisor → Guest"引导链路。详见 Axvisor 测试

defconfig:生成默认板卡配置

cargo xtask axvisor defconfig <board>

把对应板卡的默认配置复制到默认构建配置位置(tmp/axbuild/config/<pkg>/build-<target>.toml),并更新 Axvisor 命令快照。之后的 build/qemu/uboot/board 会沿用该配置。

config ls:列出可用板卡名称

cargo xtask axvisor config ls

输出 os/axvisor/configs/board/ 目录下所有可用的板卡配置名称,供 defconfig <board> 使用。

用法示例

# 构建 + QEMU 运行(默认 aarch64)
cargo axvisor build
cargo axvisor qemu --vmconfigs os/axvisor/configs/vm/aarch64-linux.toml

# 多个 Guest
cargo axvisor qemu \
--vmconfigs configs/vm/aarch64-linux.toml \
--vmconfigs configs/vm/aarch64-starry.toml

# 板卡流程
cargo axvisor config ls
cargo axvisor defconfig <board>
cargo axvisor board

# loongarch64(自动定位 LVZ QEMU)
cargo axvisor qemu --arch loongarch64 --vmconfigs configs/vm/loongarch64-linux.toml

# U-Boot 测试(Axvisor 独有)
cargo axvisor test uboot --board OrangePi-5-Plus --guest <image>