(λ [blog] KING)   KING Is Not Genera, but it will be

U Boot, I Boot, We All Boot for U Boot!

Progress report

Well I got u-boot, a bootloader for ARM systems (and others) to run in QEMU After installing the requisite dependencies and cross-compiling u-boot for arm, I ran it, and it ran.

qemu-system-aarch64 -curses -machine virt -cpu cortex-a57 -bios u-boot.bin

You can hit Esc+1 to get into QEMU’s monitoring interface, and Esc+2 to get into a u-boot command line. Note that you have to hold it for a couple seconds, and it may take a couple tries for QEMU to respond. I don’t know why this is. But the point is I can emulate an ARM processor and bootloader!

Now I just have to write something for it to boot.

Addenda: For my own memory, this is how I compiled u-boot:

export CROSS_COMPILE=aarch64-linux-gnu-
make qemu_arm64_defconfig
make

You need to install gcc-aarch64-linux-gnu

Resources: Pandy Song’s Blog