Running U-Boot & Linux Kernel in QEMU

Donotalo
18.1K views

Open Source Your Knowledge, Become a Contributor

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

Create Content

Confession

I'm a beginner in the field of U-Boot and QEMU. I felt like it'd be good to have all the resources that I used to run U-Boot and Linux in QEMU in one place. I've written this tutorial with that in mind. At the same time I tried to make it as beginner friendly as possible.

Prologue

The purpose of this tutorial is to show how to run U-Boot and Linux in QEMU and to list necessary resources all in one place. Because the code will be running on emulated machine, there is no need for real hardware. The chosen architecture is RISC-V.

This tutorial is inspired by and heavily followed the contents of this amazing talk: Embedded Linux from scratch in RISC-V.

A fairly simple way is illustrated in this tutorial to run U-Boot and Linux kernel in QEMU. Advanced users may try different options when configuring/building various stuff throughout the tutorial.

Useful Links

  • U-Boot is a universal bootloader.
  • Linux is a free Operating System which can be run on many architectures.
  • QEMU is a machine emulator.
  • RISC-V is a free and open source instruction set hardware architecture.
  • OpenSBI is the open source implementation of supervisor binary interface recommended for RISC-V. It interfaces between Operating System and machine hardware running bootloader in M-mode (machine mode).

The readers are requested to install necessary software in their host machine to try the scripts of this tutorial. This tutorial is developed on Debian 11.6.

Following tutorials and references are handy, but not required to understand this playground.

Let's start.

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