Skip to content

Hardware platforms emulation by QEMU | QEMU模拟不同的硬件单板

License

Notifications You must be signed in to change notification settings

openharmony/device_qemu

Repository files navigation

QEMU

Introduction

Quick Emulator (QEMU) can simulate the scenario where a kernel runs on different boards, so that the kernel no longer depends on physical development boards.

Directory Structure

/device/qemu
├── arm_virt                # ARM virt board
│   └── liteos_a            # Configuration related to the LiteOS Cortex-A kernel
│       └── config          # Configuration related to drivers
├── drivers                 # Platform drivers
│   └── libs                # Driver library
│       └── virt            # virt platform
├── riscv32_virt            # RISCV32 virt board
│   ├── driver              # Driver code
│   ├── include             # APIs exposed externally
│   ├── libc                # Basic libc library
│   ├── fs                  # fs configuration
│   ├── test                # Test the demo
│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel
├── arm_mps2_an386          # cortex-m4 mps2_an386 board
│   ├── driver              # Driver code
│   ├── include             # APIs exposed externally
│   ├── libc                # Basic libc library
│   ├── fs                  # fs configuration
│   ├── test                # Test the demo
│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel
├── esp32                   # Xtensa esp32 board
│   ├── hals                # Hardware adaptation layer
│   ├── driver              # Driver code
│   ├── include             # APIs exposed externally
│   ├── libc                # Basic libc library
│   ├── fs                  # fs configuration
│   ├── test                # Test the demo
│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel
├── SmartL_E802             # C-SKY SmartL_E802 board
│   ├── hals                # Hardware adaptation layer
│   ├── driver              # Driver code
│   ├── libc                # Basic libc library
│   ├── fs                  # fs configuration
│   ├── test                # Test the demo
│   └── liteos_m            # Configuration related to the LiteOS Cortex-m kernel

Constraints

QEMU applies only to the OpenHarmony kernel.

QEMU Install

  1. Install dependencies(Ubuntu 18+)

    $ 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
    
  2. Acquiring Source Code

    $ wget https://download.qemu.org/qemu-6.0.0.tar.xz
    

    or

    Download from official website: qemu-6.0.0.tar.xz

  3. Compile and install

    $ tar -xf qemu-6.0.0.tar.xz
    $ cd qemu-6.0.0
    $ mkdir build && cd build
    $ ../configure --prefix=qemu_installation_path
    $ make -j16
    

    Wait for the compilation to finish and execute the installation command:

    $ make install
    

    Finally, add the installation path to the environment variable:

    $ vim ~/.bashrc
    

    Add the following command line to the last line of ~/.bashrc:

    $ export PATH=$PATH:qemu_installation_path
    

Usage

For details about the ARM architecture, see Qemu ARM Virt HOWTO.

For details about the Cortex-m4 architecture, see Qemu Cortex-m4 mps2-an386 HOWTO.

For details about the RISC-V architecture, see Qemu RISC-V Virt HOWTO.

For details about the Xtensa architecture, see Qemu Xtensa Virt HOWTO.

For details about the C-SKY architecture, see Qemu C-SKY Virt HOWTO.

Contribution

How to involve

Commit message spec

Repositories Involved

Kernel subsystem

device_qemu

kernel_liteos_a

kernel_liteos_m

About

Hardware platforms emulation by QEMU | QEMU模拟不同的硬件单板

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages