Thursday, April 28, 2016

booting a sd card image in qemu

I want to boot an AArch64 sd card image in qemu. The image has uefi boot and is from here http://mirror.centos.org/altarch/7/isos/aarch64/

To do this, I needed to grab some firmware to support UEFI booting on ARM. I got this from here:
http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/716/QEMU-AARCH64/RELEASE_GCC49/

This page has the details:
https://wiki.linaro.org/LEG/UEFIforQEMU

Once I did that, I could run the following command to get the image to boot.

qemu-system-aarch64 -M virt -cpu cortex-a57 -m 1024 -smp 1 -bios ./QEMU_EFI.fd -serial stdio -drive if=none,file=./CentOS-aarch64.img,id=hd0 -device virtio-blk-device,drive=hd0