Re: Booting UEFI with QEMU arm

Laszlo Ersek

On 05/04/21 13:32, Pintu Agarwal wrote:
Is it possible to boot UEFI on a qemu arm based emulator?
Since I am working from home and my uefi related work leads to device crash
many times, which becomes painful for me.

So I wanted to do all my experiments on a qemu environment before I verify
the final changes on a real hardware.
So, I am just wondering is this possible?

According to my search I see its possible but still I could not find a
proper way to do it.
Please help me if someone has already tried it.

I already have the qemu-arm setup on my Linux/Ubuntu PC.
From "qemu-system-arm", it seems like you really mean 32-bit ARM.

Yes, there is support for that in edk2.


$ git submodule update --init --force
$ .
$ nice make -C "$EDK_TOOLS_PATH" -j $(getconf _NPROCESSORS_ONLN)
$ build -a ARM -b DEBUG -p ArmVirtPkg/ArmVirtQemu.dsc -t GCC5
$ for FD in QEMU_EFI.fd QEMU_VARS.fd; do
cat -- \
/dev/zero \
| head -c 64m >| /tmp/"$FD.padded"


$ if ! [ -e vars.fd ]; then
cp /tmp/QEMU_VARS.fd.padded vars.fd
$ qemu-system-arm \
-M virt \
-cpu cortex-a15 \
-m 1024 \
-serial stdio \
-drive if=pflash,unit=0,format=raw,readonly=on,file=/tmp/QEMU_EFI.fd.padded \
-drive if=pflash,unit=1,format=raw,file=vars.fd \
-device virtio-gpu-pci \
-device id=xhci0,driver=qemu-xhci \
-device usb-kbd,bus=xhci0.0 \
-boot menu=on,splash-time=5000 \



Join to automatically receive all group messages.