xref: /device/qemu/riscv64_virt/README_zh.md (revision d6aed566)
1d6aed566Sopenharmony_ci# Qemu RISCV-64 Virt 标准系统教程
2d6aed566Sopenharmony_ci
3d6aed566Sopenharmony_ci## 简介
4d6aed566Sopenharmony_ci
5d6aed566Sopenharmony_ci`riscv64_virt/linux` 子目录包含部分Qemu RISCV-64虚拟化平台验证的Linux kernel的适配代码,含驱动配置、板端配置等。
6d6aed566Sopenharmony_ci
7d6aed566Sopenharmony_ciRISCV-64 虚拟化平台是一个 `qemu-system-riscv64` 的目标设备,通过它来模拟一个通用的、基于RISCV-64架构的单板。
8d6aed566Sopenharmony_ci
9d6aed566Sopenharmony_ci
10d6aed566Sopenharmony_ci提示: 系统内存硬编码为2048MB。
11d6aed566Sopenharmony_ci
12d6aed566Sopenharmony_ci## 环境搭建
13d6aed566Sopenharmony_ci
14d6aed566Sopenharmony_ci参考链接: [环境搭建](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/device-dev/quick-start/quickstart-standard.md)
15d6aed566Sopenharmony_ci
16d6aed566Sopenharmony_ci## 源码构建
17d6aed566Sopenharmony_ci
18d6aed566Sopenharmony_ci在已经获取的源码根目录,请输入:
19d6aed566Sopenharmony_ci
20d6aed566Sopenharmony_ci```
21d6aed566Sopenharmony_ci./build.sh --product-name qemu-riscv64-linux-min
22d6aed566Sopenharmony_ci```
23d6aed566Sopenharmony_ci
24d6aed566Sopenharmony_ci在构建完成之后,对应的镜像文件在out/qemu-riscv64-linux/packages/phone/images/目录下。
25d6aed566Sopenharmony_ciqemu-riscv64-linux-min表示部件最小集合的产品。
26d6aed566Sopenharmony_ci
27d6aed566Sopenharmony_ci## 运行镜像
28d6aed566Sopenharmony_ci
29d6aed566Sopenharmony_ci如果没有安装 `qemu-system-riscv64` ,安装请参考链接 [Qemu installation](https://gitee.com/openharmony/device_qemu/blob/HEAD/README_zh.md)
30d6aed566Sopenharmony_ci
31d6aed566Sopenharmony_ci提示:当前引入的功能在virt-5.1的目标machine已经完成测试,不保证所有的Qemu版本都能够运行成功,因此需要保证你的qemu-system-riscv64
32d6aed566Sopenharmony_ci版本尽可能在5.1及以上。
33d6aed566Sopenharmony_ci
34d6aed566Sopenharmony_ci## 退出qemu环境
35d6aed566Sopenharmony_ci
36d6aed566Sopenharmony_ci先按组合键`Ctrl+a` 再单按`x`键,可退出qemu虚拟环境。
37