| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| SmartL_E802/ | 12-May-2024 | - | 12,988 | 5,928 | ||
| arm_mps2_an386/ | 12-May-2024 | - | 4,364 | 2,535 | ||
| arm_mps3_an547/ | 12-May-2024 | - | 2,173 | 1,263 | ||
| arm_virt/ | 12-May-2024 | - | 3,511 | 2,487 | ||
| drivers/ | 12-May-2024 | - | 6,052 | 4,664 | ||
| esp32/ | 12-May-2024 | - | 1,912 | 1,166 | ||
| hardware/display/ | 12-May-2024 | - | 958 | 838 | ||
| riscv32_virt/ | 12-May-2024 | - | 8,065 | 5,527 | ||
| LICENSE | D | 12-May-2024 | 10.1 KiB | 177 | 150 | |
| OAT.xml | D | 12-May-2024 | 7.7 KiB | 105 | 56 | |
| README.md | D | 12-May-2024 | 5.8 KiB | 144 | 106 | |
| README_zh.md | D | 12-May-2024 | 5.3 KiB | 144 | 106 |
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├── arm_mps3_an547 # cortex-m55 mps3_an547 board 40│ ├── driver # Driver code 41│ ├── include # APIs exposed externally 42│ ├── libc # Basic libc library 43│ ├── fs # fs configuration 44│ ├── test # Test the demo 45│ └── liteos_m # Configuration related to the LiteOS Cortex-m kernel 46├── esp32 # Xtensa esp32 board 47│ ├── hals # Hardware adaptation layer 48│ ├── driver # Driver code 49│ ├── include # APIs exposed externally 50│ ├── libc # Basic libc library 51│ ├── fs # fs configuration 52│ ├── test # Test the demo 53│ └── liteos_m # Configuration related to the LiteOS Cortex-m kernel 54├── SmartL_E802 # C-SKY SmartL_E802 board 55│ ├── hals # Hardware adaptation layer 56│ ├── driver # Driver code 57│ ├── libc # Basic libc library 58│ ├── fs # fs configuration 59│ ├── test # Test the demo 60│ └── liteos_m # Configuration related to the LiteOS Cortex-m kernel 61``` 62 63## Constraints<a name="section119744591305"></a> 64 65QEMU applies only to the OpenHarmony kernel. 66 67## QEMU Install<a name="section119744591307"></a> 68 691. Install dependencies(Ubuntu 18+) 70 71 ``` 72 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 73 ``` 74 752. Acquiring Source Code 76 77 ``` 78 wget https://download.qemu.org/qemu-6.2.0.tar.xz 79 ``` 80 81 or 82 83 [Download from official website: qemu-6.2.0.tar.xz](https://download.qemu.org/qemu-6.2.0.tar.xz) 84 853. Compile and install 86 87 ``` 88 tar -xf qemu-6.2.0.tar.xz 89 cd qemu-6.2.0 90 mkdir build && cd build 91 ../configure --prefix=qemu_installation_path 92 make -j16 93 ``` 94 95 Wait for the compilation to finish and execute the installation command: 96 97 ``` 98 make install 99 ``` 100 101 Finally, add the installation path to the environment variable: 102 103 ``` 104 vim ~/.bashrc 105 ``` 106 107 Add the following command line to the last line of ~/.bashrc: 108 109 ``` 110 export PATH=$PATH:qemu_installation_path 111 ``` 112 113## Usage<a name="section169045116126"></a> 114 115For details about the ARM architectures: 116- [Qemu ARM Virt HOWTO - liteos_a](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/liteos_a/README.md) 117- [Qemu ARM Virt HOWTO - linux](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/linux/README.md) 118 119For 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). 120 121For details about the Cortex-m55 architecture, see [Qemu Cortex-m55 mps3-an547 HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps3_an547/README.md). 122 123For details about the RISC-V architecture, see [Qemu RISC-V Virt HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/riscv32_virt/README.md). 124 125For details about the Xtensa architecture, see [Qemu Xtensa Virt HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/esp32/README.md). 126 127For details about the C-SKY architecture, see [Qemu C-SKY Virt HOWTO](https://gitee.com/openharmony/device_qemu/blob/HEAD/SmartL_E802/README.md). 128 129## Contribution<a name="section169045116136"></a> 130 131[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution.md) 132 133[Commit message spec](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83?sort_id=4042860) 134 135## Repositories Involved<a name="section1371113476307"></a> 136 137[Kernel subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel.md) 138 139**device\_qemu** 140 141[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/HEAD/README.md) 142 143[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/HEAD/README.md) 144
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├── arm_mps3_an547 # cortex-m55 mps3_an547单板 40│ ├── driver # 驱动目录 41│ ├── include # 对外接口存放目录 42│ ├── libc # 基础libc库 43│ ├── fs # fs 配置 44│ ├── test # 测试样例 45│ └── liteos_m # 与liteos_m内核相关的配置 46├── esp32 # Xtensa LX6 esp32单板 47│ ├── hals # 硬件适配层 48│ ├── driver # 驱动目录 49│ ├── include # 对外接口存放目录 50│ ├── libc # 基础libc库 51│ ├── fs # fs 配置 52│ ├── test # 测试样例 53│ └── liteos_m # 与liteos_m内核相关的配置 54├── SmartL_E802 # C-SKY SmartL虚拟单板 55│ ├── hals # 硬件适配层 56│ ├── driver # 驱动目录 57│ ├── libc # 基础libc库 58│ ├── fs # fs 配置 59│ ├── test # 测试样例 60│ └── liteos_m # 与liteos_m内核相关的配置 61``` 62 63## 约束<a name="section119744591305"></a> 64 65只适用于OpenHarmony内核。 66 67## QEMU安装<a name="section119744591307"></a> 68 691. 安装依赖(Ubuntu 18+) 70 71 ``` 72 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 73 ``` 74 752. 获取源码 76 77 ``` 78 wget https://download.qemu.org/qemu-6.2.0.tar.xz 79 ``` 80 81 或 82 83 [官网下载: qemu-6.2.0.tar.xz](https://download.qemu.org/qemu-6.2.0.tar.xz) 84 853. 编译安装 86 87 ``` 88 tar -xf qemu-6.2.0.tar.xz 89 cd qemu-6.2.0 90 mkdir build && cd build 91 ../configure --prefix=qemu_installation_path 92 make -j16 93 ``` 94 95 等待编译结束, 执行安装命令: 96 97 ``` 98 make install 99 ``` 100 101 最后将安装路径添加到环境变量中: 102 103 ``` 104 vim ~/.bashrc 105 ``` 106 107 在~/.bashrc最末尾加入: 108 109 ``` 110 export PATH=$PATH:qemu_installation_path 111 ``` 112 113## 使用说明<a name="section169045116126"></a> 114 115arm架构参考: 116- [QEMU教程 for arm - liteos_a](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/liteos_a/README_zh.md) 117- [QEMU教程 for arm - linux](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_virt/linux/README_zh.md) 118 119cortex-m4架构参考[QEMU教程 for cortex-m4](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps2_an386/README_zh.md)。 120 121cortex-m55架构参考[QEMU教程 for cortex-m55](https://gitee.com/openharmony/device_qemu/blob/HEAD/arm_mps3_an547/README_zh.md)。 122 123risc-v架构参考[QEMU教程 for risc-v](https://gitee.com/openharmony/device_qemu/blob/HEAD/riscv32_virt/README_zh.md)。 124 125Xtensa架构参考[QEMU教程 for Xtensa](https://gitee.com/openharmony/device_qemu/blob/HEAD/esp32/README_zh.md)。 126 127C-SKY架构参考[QEMU教程 for C-SKY](https://gitee.com/openharmony/device_qemu/blob/HEAD/SmartL_E802/README_zh.md)。 128 129## 贡献<a name="section169045116136"></a> 130 131[如何参与](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md) 132 133[Commit message规范](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83?sort_id=4042860) 134 135## 相关仓<a name="section1371113476307"></a> 136 137[内核子系统](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) 138 139**device\_qemu** 140 141[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/HEAD/README_zh.md) 142 143[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/HEAD/README_zh.md) 144