qemu-arm64.sh (1070B)
1 #!/bin/sh 2 3 # NOTE: replace this with the path to a downloaded OVMF image 4 FIRMWARE="/usr/share/qemu/edk2-aarch64-code.fd" 5 6 EFI_CODE="$(dirname $1)/uefi-aarch64-code.fd" 7 EFI_VARS="$(dirname $1)/uefi-aarch64-vars.fd" 8 9 set -e 10 11 if [ ! -f $EFI_CODE ]; then 12 dd if=/dev/zero of=$EFI_CODE bs=1M count=64 status=none 13 dd if=$FIRMWARE of=$EFI_CODE conv=notrunc status=none 14 fi 15 16 if [ ! -f $EFI_VARS ]; then 17 dd if=/dev/zero of=$EFI_VARS bs=1M count=64 status=none 18 fi 19 20 qemu-system-aarch64 \ 21 -machine virt \ 22 -cpu max \ 23 -m 128M \ 24 -smp sockets=1,cpus=2 \ 25 -drive if=pflash,format=raw,unit=0,file=$EFI_CODE,readonly=on \ 26 -drive if=pflash,format=raw,unit=1,file=$EFI_VARS \ 27 -drive if=none,format=raw,id=disk0,file="$1" \ 28 -device nvme,serial=12345678,drive=disk0 \ 29 -net none \ 30 -nographic 31 32 #-chardev stdio,id=char0,logfile="serial.log",signal=off \ 33 #-serial chardev:char0 \ 34 35 ## alternative disk controllers: 36 37 ## ahci 38 # -device ahci,id=ahci \ 39 # -device ide-hd,drive=disk0,bus=ahci.0 \ 40 41 ## ide 42 # -device ide-hd,drive=disk0,bus=ide.0 \ 43 44 ## virtio 45 # -device virtio-blk,drive=disk0 \