Running U-Boot & Linux Kernel in QEMU

Donotalo
17.5K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Let's build QEMU from source code so that it can simulate a RISC-V host.

For this tutorial, QEMU v7.2.0 will be used. Let's checkout the source code and build QEMU for RISC-V. Run the following in the root working directory:

# Download source code
git clone https://gitlab.com/qemu-project/qemu.git

# Checkout required version
cd qemu
git checkout v7.2.0

# Prepare QEMU for build
git submodule init
git submodule update --recursive

# Build QEMU for RISC-V
./configure --target-list=riscv64-softmmu
make -j$(nproc)
  • --target-list=riscv64-softmmu = Configure QEMU to run 64 bit RISC-V architecture code only, without this parameter QEMU will be built for all available targets

The executable is ./build/qemu-system-riscv64.

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content