Back
Close

Running U-Boot & Linux Kernel in QEMU

Donotalo
1,384 views

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

For this tutorial, QEMU v7.1.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.1.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.

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io