1# QEMU Arm Virt for Standard System Tutorial 2 3## 1. Overview 4 5The `arm_virt/linux` directory contains code that has been verified on the QEMU Arm Virt platform for adapting to Linux kernel. The code includes the driver and board configurations. 6 7The Arm Virt platform is a `qemu-system-arm` target device that simulates a general-purpose board running on the Arm architecture. 8The board whose **machine** is **virt** in QEMU is configurable. For example, you can select the core type and quantity, memory size, and security extensions when configuring the board. 9 10This tutorial guides you through the configuration of a board based on the Cortex-A7 architecture, with one CPU, extended secure features, Generic Interrupt Controller versions 2 (GICv2), and 1 GB memory. 11The system memory is hardcoded to 1024 MB. 12 13## 2. Setting Up the Environment 14 15For details, see [Environment Setup](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/quick-start/quickstart-standard.md) 16 17## 3. Obtaining the Source Code 18 19For details, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/get-code/sourcecode-acquire.md). 20 21## 4. Building the Source Code 22 23In the root directory of the obtained source code, run the following command: 24 25``` 26./build.sh --product-name qemu-arm-linux-min --ccache --jobs 4 27./build.sh --product-name qemu-arm-linux-headless --ccache --jobs 4 28``` 29 30After this command is executed, the image files for standard system are generated in out/qemu-arm-linux/packages/phone/images/ directory. 31qemu-arm-linux-min means product with minimum set of components. 32qemu-arm-linux-headless add application framework related components based on qemu-arm-linux-min. 33 34## 5. Running an Image in QEMU 35 36a) If `qemu-system-arm` has not been installed, install it. For details, see [Qemu Installation](https://gitee.com/openharmony/device_qemu/blob/HEAD/README.md). 37 38Note: The introduced functions have been tested on the target machine of virt-5.1, but are not available for all QEMU versions. Therefore, you must ensure that the qemu-system-arm version is 5.1 or later. 39 40 41b) Run the images. 42 43After the source code is built, run the `./vendor/ohemu/qemu_arm_linux_min/qemu_run.sh` or `./vendor/ohemu/qemu_arm_linux_headless/qemu_run.sh` command, the images built in step 4 will be started. 44 45c) Exit QEMU. 46 47Press `Ctrl-A + x` to exit the QEMU virtual environment. 48 49