• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# QEMU(Quick Emulator)<a name="ZH-CN_TOPIC_0000001101286951"></a>
2
3-   [简介](#section11660541593)
4-   [约束](#section119744591305)
5-   [QEMU安装](#section119744591307)
6-   [使用说明](#section169045116126)
7-   [贡献](#section169045116136)
8-   [相关仓](#section1371113476307)
9
10## 简介<a name="section11660541593"></a>
11
12QEMU可以模拟内核运行在不同的单板,解除对物理开发板的依赖。
13
14## 约束<a name="section119744591305"></a>
15
16只适用于OpenHarmony内核。
17
18## QEMU安装<a name="section119744591307"></a>
19
201. 安装依赖(Ubuntu 18+)
21
22   ```
23   sudo apt install build-essential zlib1g-dev pkg-config libglib2.0-dev  binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev virtualenv flex bison
24   ```
25
262. 获取源码
27
28   ```
29   wget https://download.qemu.org/qemu-6.2.0.tar.xz
30   ```
31
3233
34   [官网下载: qemu-6.2.0.tar.xz](https://download.qemu.org/qemu-6.2.0.tar.xz)
35
363. 编译安装
37
38   ```
39   tar -xf qemu-6.2.0.tar.xz
40   cd qemu-6.2.0
41   mkdir build && cd build
42   ../configure --prefix=qemu_installation_path
43   make -j16
44   ```
45
46   等待编译结束, 执行安装命令:
47
48   ```
49   make install
50   ```
51
52   最后将安装路径添加到环境变量中:
53
54   ```
55   vim ~/.bashrc
56   ```
57
58   在~/.bashrc最末尾加入:
59
60   ```
61   export PATH=$PATH:qemu_installation_path
62   ```
63
64## 使用说明<a name="section169045116126"></a>
65
66arm架构参考:
67- [QEMU教程 for arm - liteos_a](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/liteos_a/README_zh.md)
68- [QEMU教程 for arm - linux](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/linux/README_zh.md)
69
70cortex-m4架构参考[QEMU教程 for cortex-m4](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps2_an386/README_zh.md)71
72cortex-m55架构参考[QEMU教程 for cortex-m55](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps3_an547/README_zh.md)73
74risc-v架构参考[QEMU教程 for risc-v](https://gitee.com/openharmony/device_qemu/blob/HEAD/riscv32_virt/README_zh.md)75
76Xtensa架构参考[QEMU教程 for Xtensa](https://gitee.com/openharmony/device_qemu/blob/HEAD/esp32/README_zh.md)77
78C-SKY架构参考[QEMU教程 for C-SKY](https://gitee.com/openharmony/device_qemu/blob/HEAD/SmartL_E802/README_zh.md)79
80## 贡献<a name="section169045116136"></a>
81
82[如何参与](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md)
83
84[Commit message规范](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83?sort_id=4042860)
85
86## 相关仓<a name="section1371113476307"></a>
87
88[内核子系统](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/readme/%E5%86%85%E6%A0%B8%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
89
90**device\_qemu**
91
92[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/HEAD/README_zh.md)
93
94[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/HEAD/README_zh.md)
95