• Home
Name Date Size #Lines LOC

..--

arm_mps2_an386/12-May-2024-2,0651,182

arm_virt/12-May-2024-2,8571,878

drivers/12-May-2024-4,6613,605

hardware/display/12-May-2024-958838

riscv32_virt/12-May-2024-1,7611,123

LICENSED12-May-202410.1 KiB177150

OAT.xmlD12-May-20245.8 KiB8637

README.mdD12-May-20244 KiB11479

README_zh.mdD12-May-20243.6 KiB11479

README.md

1# QEMU<a name="EN-US_TOPIC_0000001101286951"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section161941989596)
5-   [Constraints](#section119744591305)
6-   [QEMU Install](#section119744591307)
7-   [Usage](#section169045116126)
8-   [Contribution](#section169045116136)
9-   [Repositories Involved](#section1371113476307)
10
11## Introduction<a name="section11660541593"></a>
12
13Quick Emulator \(QEMU\) can simulate the scenario where a kernel runs on different boards, so that the kernel no longer depends on physical development boards.
14
15## Directory Structure<a name="section161941989596"></a>
16
17```
18/device/qemu
19├── arm_virt                # ARM virt board
20│   └── liteos_a            # Configuration related to the LiteOS Cortex-A kernel
21│       └── config          # Configuration related to drivers
22├── drivers                 # Platform drivers
23│   └── libs                # Driver library
24│       └── virt            # virt platform
25├── riscv32_virt            # RISCV32 virt board
26│   ├── driver              # Driver code
27│   ├── include             # APIs exposed externally
28│   ├── libc                # Basic libc library
29│   ├── fs                  # fs configuration
30│   ├── test                # Test the demo
31│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel
32├── arm_mps2_an386          # cortex-m4 mps2_an386 board
33│   ├── driver              # Driver code
34│   ├── include             # APIs exposed externally
35│   ├── libc                # Basic libc library
36│   ├── fs                  # fs configuration
37│   ├── test                # Test the demo
38│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel
39```
40
41## Constraints<a name="section119744591305"></a>
42
43QEMU applies only to the OpenHarmony kernel.
44
45## QEMU Install<a name="section119744591307"></a>
46
471. Install dependencies(Ubuntu 18+)
48
49   ```
50   $ 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
51   ```
52
532. Acquiring Source Code
54
55   ```
56   $ wget https://download.qemu.org/qemu-6.0.0.tar.xz
57   ```
58
59   or
60
61   [Download from official website: qemu-6.0.0.tar.xz](https://download.qemu.org/qemu-6.0.0.tar.xz)
62
633. Compile and install
64
65   ```
66   $ tar -xf qemu-6.0.0.tar.xz
67   $ cd qemu-6.0.0
68   $ mkdir build && cd build
69   $ ../configure --prefix=qemu_installation_path
70   $ make -j16
71   ```
72
73   Wait for the compilation to finish and execute the installation command:
74
75   ```
76   $ make install
77   ```
78
79   Finally, add the installation path to the environment variable:
80
81   ```
82   $ vim ~/.bashrc
83   ```
84
85   Add the following command line to the last line of ~/.bashrc:
86
87   ```
88   $ export PATH=$PATH:qemu_installation_path
89   ```
90
91## Usage<a name="section169045116126"></a>
92
93For details about the ARM architecture, see  [Qemu ARM Virt HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/README.md).
94
95For details about the Cortex-m4 architecture, see  [Qemu Cortex-m4 mps2-an386 HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps2_an386/README.md).
96
97For details about the RISC-V architecture, see  [Qemu RISC-V Virt HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/riscv32_virt/README.md).
98
99## Contribution<a name="section169045116136"></a>
100
101[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution.md)
102
103[Commit message spec](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83?sort_id=4042860)
104
105## Repositories Involved<a name="section1371113476307"></a>
106
107[Kernel subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel.md)
108
109**device\_qemu**
110
111[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/HEAD/README.md)
112
113[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/HEAD/README.md)
114

README_zh.md

1# QEMU(Quick Emulator)<a name="ZH-CN_TOPIC_0000001101286951"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section161941989596)
5-   [约束](#section119744591305)
6-   [QEMU安装](#section119744591307)
7-   [使用说明](#section169045116126)
8-   [贡献](#section169045116136)
9-   [相关仓](#section1371113476307)
10
11## 简介<a name="section11660541593"></a>
12
13QEMU可以模拟内核运行在不同的单板,解除对物理开发板的依赖。
14
15## 目录<a name="section161941989596"></a>
16
17```
18/device/qemu
19├── arm_virt                # arm virt单板
20│   └── liteos_a            # 与liteos_a内核相关的配置
21│       └── config          # 驱动相关配置
22├── drivers                 # 与平台相关的驱动目录
23│   └── libs                # 驱动库
24│       └── virt            # virt平台
25├── riscv32_virt            # riscv32 virt单板
26│   ├── driver              # 驱动目录
27│   ├── include             # 对外接口存放目录
28│   ├── libc                # 基础libc库
29│   ├── fs                  # fs 配置
30│   ├── test                # 测试样例
31│   └── liteos_m            # 与liteos_m内核相关的配置
32├── arm_mps2_an386          # cortex-m4 mps2_an386单板
33│   ├── driver              # 驱动目录
34│   ├── include             # 对外接口存放目录
35│   ├── libc                # 基础libc库
36│   ├── fs                  # fs 配置
37│   ├── test                # 测试样例
38│   └── liteos_m            # 与liteos_m内核相关的配置
39```
40
41## 约束<a name="section119744591305"></a>
42
43只适用于OpenHarmony内核。
44
45## QEMU安装<a name="section119744591307"></a>
46
471. 安装依赖(Ubuntu 18+)
48
49   ```
50   $ 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
51   ```
52
532. 获取源码
54
55   ```
56   $ wget https://download.qemu.org/qemu-6.0.0.tar.xz
57   ```
58
5960
61   [官网下载: qemu-6.0.0.tar.xz](https://download.qemu.org/qemu-6.0.0.tar.xz)
62
633. 编译安装
64
65   ```
66   $ tar -xf qemu-6.0.0.tar.xz
67   $ cd qemu-6.0.0
68   $ mkdir build && cd build
69   $ ../configure --prefix=qemu_installation_path
70   $ make -j16
71   ```
72
73   等待编译结束, 执行安装命令:
74
75   ```
76   $ make install
77   ```
78
79   最后将安装路径添加到环境变量中:
80
81   ```
82   $ vim ~/.bashrc
83   ```
84
85   在~/.bashrc最末尾加入:
86
87   ```
88   $ export PATH=$PATH:qemu_installation_path
89   ```
90
91## 使用说明<a name="section169045116126"></a>
92
93arm架构参考[QEMU教程 for arm](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/README_zh.md)94
95cortex-m4架构参考[QEMU教程 for cortex-m4](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps2_an386/README_zh.md)96
97risc-v架构参考[QEMU教程 for risc-v](https://gitee.com/openharmony/device_qemu/blob/HEAD/riscv32_virt/README_zh.md)98
99## 贡献<a name="section169045116136"></a>
100
101[如何参与](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md)
102
103[Commit message规范](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83?sort_id=4042860)
104
105## 相关仓<a name="section1371113476307"></a>
106
107[内核子系统](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)
108
109**device\_qemu**
110
111[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/HEAD/README_zh.md)
112
113[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/HEAD/README_zh.md)
114