编译Qemu在arm64手机上运行

  1. 下载最新qemu

https://download.qemu.org/qemu-8.0.0-rc0.tar.bz2

  1. 解压qemu-8.0.0-rc0.tar.bz2

  1. 在解压根目录执行

./configure \
    --target-list=aarch64-softmmu \
    --cross-prefix=aarch64-linux-gnu- \
    --with-coroutine=gthread \
    --enable-fdt \
    --enable-kvm \
    --disable-werror \
    --audio-drv-list="" \
    --static
  1. 编译

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  BOOTARGS='"root=/dev/vda consolelog=9 rw console=ttyAMA0"' -j8
  1. 将./build/qemu-system-aarch64文件push 到手机的/data/local/tmp/路径下

  1. 运行qemu

./qemu-system-aarch64 -enable-kvm -m 512 -M virt -cpu host  -nographic \
-kernel kern5100324virtblk -drive if=none,file=disk_oe64.img,id=fs -device virtio-blk-device,drive=fs \
-append "earlyprintk console=ttyAMA0 mem=512M rootwait root=/dev/vda rw"

你可能感兴趣的:(学习)