|
4 | 4 |
|
5 | 5 | </div> --> |
6 | 6 |
|
7 | | -<h2 align="center">AxVisor</h1> |
| 7 | +<h1 align="center">AxVisor</h1> |
8 | 8 |
|
9 | | -<p align="center">A unified modular hypervisor based on ArceOS.</p> |
| 9 | +<p align="center">A unified modular Type I hypervisor</p> |
10 | 10 |
|
11 | 11 | <div align="center"> |
12 | 12 |
|
|
16 | 16 |
|
17 | 17 | </div> |
18 | 18 |
|
19 | | -English | [中文](README_CN.md) |
| 19 | +[English](README.md) | [中文](README_CN.md) |
20 | 20 |
|
21 | 21 | # Introduction |
22 | 22 |
|
23 | | -AxVisor is a Hypervisor implemented based on the ArceOS unikernel framework. Its goal is to leverage the basic operating system functionalities provided by ArceOS as a foundation to build a unified and componentized Hypervisor. |
| 23 | +AxVisor is a Hypervisor implemented based on the ArceOS kernel. Its goal is to leverage the basic operating system functionalities provided by ArceOS as a foundation to implement a lightweight unified modular Hypervisor. |
24 | 24 |
|
25 | | -**Unified** means using the same codebase to support three architectures—x86_64, Arm (aarch64), and RISC-V—maximizing the reuse of architecture-agnostic code and simplifying development and maintenance efforts. |
| 25 | +- **Unified** means using the same codebase to support three architectures—x86_64, Arm (aarch64), and RISC-V—maximizing the reuse of architecture-agnostic code and simplifying development and maintenance costs. |
26 | 26 |
|
27 | | -**Componentized** means that the Hypervisor's functionalities are decomposed into multiple independently usable components. Each component implements a specific function, and components communicate through standardized interfaces to achieve decoupling and reusability. |
| 27 | +- **Modular** means that the Hypervisor's functionalities are decomposed into multiple independently usable components. Each component implements a specific function, and components communicate through standardized interfaces to achieve decoupling and reusability. |
28 | 28 |
|
29 | 29 | ## Architecture |
30 | 30 |
|
31 | | -The software architecture of AxVisor is divided into five layers as shown in the diagram below. Each box represents an independent module, and the modules communicate with each other through standard interfaces. |
| 31 | +The software architecture of AxVisor is divided into five layers as shown in the diagram below. Each box represents an independent component, and components communicate with each other through standard interfaces. The complete architecture description can be found in the [documentation](https://arceos-hypervisor.github.io/axvisorbook/docs/overview). |
32 | 32 |
|
33 | 33 |  |
34 | 34 |
|
35 | | -The complete architecture description can be found in the [documentation](https://arceos-hypervisor.github.io/doc/arch_cn.html). |
| 35 | +## Hardware Platforms |
36 | 36 |
|
37 | | -## Hardwares |
| 37 | +AxVisor has been verified on multiple hardware platforms, covering extensive support from virtualization environments to actual physical devices. To facilitate rapid user deployment, we provide one-click build scripts for each platform in the [axvisor-guest](https://github.com/arceos-hypervisor/axvisor-guest) repository, which can automatically generate corresponding image files. |
38 | 38 |
|
39 | | -Currently, AxVisor has been verified on the following platforms: |
| 39 | +| Platform Name | Architecture Support | Key Features | |
| 40 | +|---------------|---------------------|--------------| |
| 41 | +| QEMU | ARM64, x86_64 | Virtualization platform, supports multiple architectures, for development and testing | |
| 42 | +| Orange Pi 5 Plus | ARM64 | Development board based on Rockchip RK3588, high-performance ARM platform | |
| 43 | +| Phytium Pi | ARM64 | Development board based on Phytium E2000Q processor, domestic ARM platform | |
| 44 | +| ROC-RK3568-PC | ARM64 | Development board based on Rockchip RK3568, suitable for industrial applications | |
| 45 | +| EVM3588 | ARM64 | Evaluation board based on Rockchip RK3588, enterprise-level applications | |
40 | 46 |
|
41 | | -- [x] QEMU ARM64 virt (qemu-max) |
42 | | -- [x] Rockchip RK3568 / RK3588 |
43 | | -- [x] PhytiumPi |
| 47 | +## Guest Systems |
44 | 48 |
|
45 | | -## Guest VMs |
| 49 | +AxVisor supports multiple operating systems as guests, with good compatibility from lightweight microkernels to mature macrokernel systems. To simplify the user deployment process, we provide one-click build scripts for different guest systems in the [axvisor-guest](https://github.com/arceos-hypervisor/axvisor-guest) repository, which can quickly generate adapted guest images. |
46 | 50 |
|
47 | | -Currently, AxVisor has been verified in scenarios with the following systems as guests: |
| 51 | +| Guest System | System Type | Architecture Support | Feature Description | |
| 52 | +|--------------|-------------|---------------------|-------------------| |
| 53 | +| [ArceOS](https://github.com/arceos-org/arceos) | Unikernel | ARM64, x86_64, RISC-V | Rust-based componentized operating system, lightweight and high-performance | |
| 54 | +| [Starry-OS](https://github.com/Starry-OS) | Macrokernel OS | ARM64, x86_64 | Real-time operating system for embedded scenarios | |
| 55 | +| [NimbOS](https://github.com/equation314/nimbos) | RTOS System | ARM64, x86_64, RISC-V | Concise Unix-like system, supports POSIX interface | |
| 56 | +| Linux | Macrokernel OS | ARM64, x86_64, RISC-V | Mature and stable general-purpose operating system, rich software ecosystem | |
48 | 57 |
|
49 | | -- [ArceOS](https://github.com/arceos-org/arceos) |
50 | | -- [Starry-OS](https://github.com/Starry-OS) |
51 | | -- [NimbOS](https://github.com/equation314/nimbos) |
52 | | -- Linux |
| 58 | +# Build |
53 | 59 |
|
54 | | -## Shell Management |
55 | | - |
56 | | -AxVisor provides an interactive shell interface for managing virtual machines and file operations. |
57 | | - |
58 | | -For detailed information about shell features, commands, and usage, see: [Shell模块介绍.md](doc/Shell模块介绍.md) |
59 | | - |
60 | | -# Build and Run |
61 | | - |
62 | | -After AxVisor starts, it loads and starts the guest based on the information in the guest configuration file. Currently, AxVisor supports loading guest images from a FAT32 file system and also supports binding guest images to the hypervisor image through static compilation (using include_bytes). |
| 60 | +AxVisor is built based on the Rust ecosystem, providing complete project build, configuration management, and debugging support through the extended xtask toolchain, offering developers a unified and efficient development experience. |
63 | 61 |
|
64 | 62 | ## Build Environment |
65 | 63 |
|
66 | | -AxVisor is written in the Rust programming language, so you need to install the Rust development environment following the instructions on the official Rust website. Additionally, you need to install cargo-binutils to use tools like rust-objcopy and rust-objdump. |
| 64 | +First, in a Linux environment, you need to install basic development tool packages such as `libssl-dev libssl-dev gcc libudev-dev pkg-config`. |
67 | 65 |
|
68 | | -```console |
69 | | -cargo install cargo-binutils |
70 | | -``` |
| 66 | +Second, AxVisor is written in the Rust programming language, so you need to install the Rust development environment according to the official Rust website instructions, and use the `cargo install cargo-binutils` command to install [cargo-binutils](https://github.com/rust-embedded/cargo-binutils) to use tools like `rust-objcopy` and `rust-objdump`. |
71 | 67 |
|
72 | | -If necessary, you may also need to install [musl-gcc](http://musl.cc/x86_64-linux-musl-cross.tgz) to build guest applications. |
| 68 | +> If necessary, you may also need to install [musl-gcc](http://musl.cc/x86_64-linux-musl-cross.tgz) to build guest applications. |
73 | 69 |
|
74 | 70 | ## Configuration Files |
75 | 71 |
|
76 | | -Since guest configuration is a complex process, AxVisor chooses to use toml files to manage guest configurations, which include the virtual machine ID, virtual machine name, virtual machine type, number of CPU cores, memory size, virtual devices, and passthrough devices. |
77 | | - |
78 | | -- In the source code's `./config/vms` directory, there are some example templates for guest configurations. The configuration files are named in the format `<os>-<arch>-board_or_cpu-smpx`, where: |
79 | | - - `<os>` is the guest operating system name |
80 | | - - `<arch>` is the architecture |
81 | | - - `board_or_cpu` is the name of the hardware development board or CPU (different strings are concatenated with `_`) |
82 | | - - `smpx` refers to the number of CPUs allocated to the guest, where `x` is the specific value |
83 | | - - The different components are concatenated with `-` to form the whole name |
84 | | - |
85 | | -- Additionally, you can also use the [axvmconfig](https://github.com/arceos-hypervisor/axvmconfig) tool to generate a custom configuration file. For detailed information, please refer to [axvmconfig](https://arceos-hypervisor.github.io/axvmconfig/axvmconfig/index.html). |
86 | | - |
87 | | -## Load and run from file system |
88 | | - |
89 | | -Loading from the filesystem refers to the method where the AxVisor image, Linux guest image, and its device tree are independently deployed in the filesystem on the storage. After AxVisor starts, it loads the guest image and its device tree from the filesystem to boot the guest. |
90 | | - |
91 | | -### NimbOS as guest |
92 | | - |
93 | | -1. Execute script to download and prepare NimbOS image. |
94 | | - |
95 | | - ```shell |
96 | | - ./scripts/nimbos.sh --arch aarch64 |
97 | | - ``` |
98 | | - |
99 | | -2. Execute `./axvisor.sh run --plat aarch64-generic --features fs,ept-level-4 --arceos-args BUS=mmio,BLK=y,DISK_IMG=tmp/nimbos-aarch64.img,LOG=info --vmconfigs configs/vms/nimbos-aarch64-qemu-smp1.toml` to build AxVisor and start it in QEMU. |
| 72 | +AxVisor uses a layered configuration system, including hardware platform configuration and guest configuration, both in TOML format. |
100 | 73 |
|
101 | | -3. After that, you can directly run `./axvisor.sh run` to start it, and modify `.hvconfig.toml` to change the startup parameters. |
| 74 | +### Hardware Platform Configuration |
102 | 75 |
|
103 | | -### More guest |
| 76 | +Hardware platform configuration files are located in the `configs/board/` directory, with each configuration file corresponding to a development board (or QEMU platform architecture) that we have verified. They specify the target architecture, feature sets, driver support, log levels, and build options. |
104 | 77 |
|
105 | | - TODO |
| 78 | +> The guest configuration item `vm_configs` is not specified by default and needs to be specified in actual use! |
106 | 79 |
|
107 | | -## Load and run from memory |
| 80 | +### Guest Configuration |
108 | 81 |
|
109 | | -Loading from memory refers to a method where the AxVisor image, guest image, and its device tree are already packaged together during the build phase. Only AxVisor itself needs to be deployed in the file system on the storage device. After AxVisor starts, it loads the guest image and its device tree from memory to boot the guest. |
| 82 | +Guest configuration files are located in the `configs/vms/` directory, defining the runtime parameters of guests, including basic information, kernel configuration, memory regions, and device configuration details. |
110 | 83 |
|
111 | | -### linux as guest |
| 84 | +The configuration file naming format is `<os>-<arch>-board_or_cpu-smpx`, where `<os>` is the guest system name (such as `arceos`, `linux`, `nimbos`), `<arch>` is the architecture (such as `aarch64`, `x86_64`, `riscv64`), `board_or_cpu` is the hardware development board or CPU name, and `smpx` is the number of CPUs allocated to the guest. |
112 | 85 |
|
113 | | -1. Prepare working directory |
114 | | - ```console |
115 | | - mkdir -p tmp |
116 | | - cp configs/vms/linux-aarch64-qemu-smp1.toml tmp/ |
117 | | - cp configs/vms/linux-aarch64-qemu-smp1.dts tmp/ |
118 | | - ``` |
| 86 | +## Compilation |
119 | 87 |
|
120 | | -2. [See Linux build help](https://github.com/arceos-hypervisor/guest-test-linux) to get the guest Image and rootfs.img, then copy them to the `tmp` directory. |
| 88 | +AxVisor uses the xtask tool for build management, supporting multiple hardware platforms and configuration options. For a quick build and run of AxVisor, please refer to the [Quick Start](https://arceos-hypervisor.github.io/axvisorbook/docs/category/quickstart) chapter in the configuration documentation. |
121 | 89 |
|
122 | | -3. Execute `dtc -O dtb -I dts -o tmp/linux-aarch64-qemu-smp1.dtb tmp/linux-aarch64-qemu-smp1.dts` to build the guest device tree file |
| 90 | +1. **Generate Configuration**: Use `cargo xtask defconfig <board_name>` to select the target hardware platform configuration from the `configs/board/` directory. This command copies the corresponding board-level configuration to `.build.toml` as the build configuration. |
123 | 91 |
|
124 | | -4. Execute `./axvisor.sh defconfig`, then edit the `.hvconfig.toml` file, set the `vmconfigs` item to your guest machine configuration file path, with the following content: |
| 92 | +2. **Modify Configuration**: Use `cargo xtask menuconfig` to launch the interactive configuration interface, where you can adjust the target architecture, feature sets, log levels, and other parameters. |
125 | 93 |
|
126 | | - ```toml |
127 | | - arceos_args = [ |
128 | | - "BUS=mmio", |
129 | | - "BLK=y", |
130 | | - "MEM=8g", |
131 | | - "LOG=debug", |
132 | | - "QEMU_ARGS=\"-machine gic-version=3 -cpu cortex-a72 \"", |
133 | | - "DISK_IMG=\"tmp/rootfs.img\"", |
134 | | - ] |
135 | | - vmconfigs = [ "tmp/linux-aarch64-qemu-smp1.toml"] |
136 | | - ``` |
137 | | - |
138 | | -4. Execute `./axvisor.sh run` to build AxVisor and start it in QEMU. |
139 | | - |
140 | | -### More guest |
141 | | - |
142 | | - TODO |
| 94 | +3. **Execute Build**: Use `cargo xtask build` to compile the project according to the `.build.toml` configuration file, generating the target platform binary file. |
143 | 95 |
|
144 | 96 | # Contributing |
145 | 97 |
|
146 | | -Feel free to fork this repository and submit a pull request. |
147 | | - |
148 | | -You can refer to these [discussions]((https://github.com/arceos-hypervisor/axvisor/discussions)) to gain deeper insights into the project's ideas and future development direction. |
149 | | - |
150 | | -## Development |
151 | | - |
152 | | -To contribute to AxVisor, you can follow these steps: |
153 | | - |
154 | | -1. Fork the repository on GitHub. |
155 | | -2. Clone your forked repository to your local machine. |
156 | | -3. Create a new branch for your feature or bug fix. |
157 | | -4. Make your changes and commit them with clear messages. |
158 | | -5. Push your changes to your forked repository. |
159 | | -6. Open a pull request against the main branch of the original repository. |
160 | | - |
161 | | -To develop crates used by AxVisor, you can use the following command to build and run the project: |
162 | | - |
163 | | -```bash |
164 | | -cargo install cargo-lpatch |
165 | | -cargo lpatch -n deps_crate_name |
166 | | -``` |
167 | | - |
168 | | -Then you can modify the code in the `crates/deps_crate_name` directory, and it will be automatically used by AxVisor. |
169 | | - |
170 | | -## Contributors |
171 | | - |
172 | | -This project exists thanks to all the people who contribute. |
| 98 | +Welcome to fork this repository and submit pull requests. The existence and development of this project thanks to the support of all contributors. |
173 | 99 |
|
174 | 100 | <a href="https://github.com/arceos-hypervisor/axvisor/graphs/contributors"> |
175 | 101 | <img src="https://contrib.rocks/image?repo=arceos-hypervisor/axvisor" /> |
176 | 102 | </a> |
177 | 103 |
|
178 | 104 | # License |
179 | 105 |
|
180 | | -AxVisor uses the following open-source license: |
| 106 | +AxVisor uses the following open-source licenses: |
181 | 107 |
|
182 | 108 | - Apache-2.0 |
183 | 109 | - MulanPubL-2.0 |
184 | 110 | - MulanPSL2 |
185 | | -- GPL-3.0-or-later |
| 111 | +- GPL-3.0-or-later |
0 commit comments