ยง2023-10-20
- Download Example Files
You can use your browser, or use web get to get the example files tarball.
> Create a working folder, and move into it.
$ mkdir odroidu2 && cd odroidu2/
> Get the example files
$ wget http://odroid.us/odroid/users/osterluk/qemu-example/qemu-example.tgz
$ tar -xvf qemu-example.tgz
./
./launch-no-bridge
./zImage
./rootfs.tar.gz
./mnt/
./vexpress_defconfig
./launch
./launch-ubuntu
./rootfs-buildroot.ext2
./vexpress_odroid_qemu_defconfig
$ ls
launch launch-no-bridge launch-ubuntu mnt qemu-example.tgz rootfs-buildroot.ext2 rootfs.tar.gz vexpress_defconfig vexpress_odroid_qemu_defconfig zImage
Here are the files we now have:
- zImage A kernel built for vexpress-a9 machine, from linux-3.2 source. That machine will not build on HK sources at this point.
- rootfs.tar.gz A root file system tarball, from the buildroot/busybox tutorial
- rootfs-buildroot.ext2 A root file system partition image, converted from rootfs.tar.gz
- launch-no-bridge A simple script to launch with the root file system isolated on its own virtual LAN
- launch A more involved launch script that uses a network bridge for full networking support by sharing the host network interface
- launch-ubuntu Launches on rootfs-ubuntu.ext4 that you can extract from your favorite SD-Card image
- vexpress_defconfig default kernel config for linux-3.2.0
- vexpress_odroid_qemu_defconfig kernel config I used for this tutorial, created zImage with it.
- See if you already have qemu installed:
$ qemu-system-arm --version
QEMU emulator version 8.1.2
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
$ qemu-system-arm -cpu ? | grep cortex-a9
cortex-a9
$ qemu-system-arm -M ? | grep vexpress-a9
vexpress-a9 ARM Versatile Express for Cortex-A9
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure --prefix=/usr/local --static --disable-kvm --target-list=arm-linux-user
time make -j8
sudo make install
[alexlai@orgpi58G qemu]$ sudo make install
[sudo] password for alexlai:
changing dir to build for make "install"...
make[1]: Entering directory '/opt/xfs/qemu-proj/qemu/build'
[1/4] Generating qemu-version.h with a custom command (wrapped by meson to capture output)
[1/2] Installing files.
Installing trace/trace-events-all to /usr/local/share/qemu
Installing qemu-arm to /usr/local/bin
File 'pc-bios/bamboo.dtb' not found, skipping
File 'pc-bios/canyonlands.dtb' not found, skipping
File 'pc-bios/petalogix-s3adsp1800.dtb' not found, skipping
File 'pc-bios/petalogix-ml605.dtb' not found, skipping
Installing /opt/xfs/qemu-proj/qemu/pc-bios/bios.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/bios-256k.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/bios-microvm.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/qboot.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-cirrus.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-stdvga.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-vmware.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-qxl.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-virtio.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-ramfb.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-bochs-display.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vgabios-ati.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/openbios-sparc32 to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/openbios-sparc64 to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/openbios-ppc to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/QEMU,tcx.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/QEMU,cgthree.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-e1000.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-eepro100.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-ne2k_pci.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-pcnet.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-rtl8139.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pxe-virtio.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-e1000.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-eepro100.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-ne2k_pci.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-pcnet.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-rtl8139.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-virtio.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-e1000e.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/efi-vmxnet3.rom to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/qemu-nsis.bmp to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/multiboot.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/multiboot_dma.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/linuxboot.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/linuxboot_dma.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/kvmvapic.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/pvh.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/s390-ccw.img to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/s390-netboot.img to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/slof.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/skiboot.lid to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/palcode-clipper to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/u-boot.e500 to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/u-boot-sam460-20100605.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/qemu_vga.ndrv to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/edk2-licenses.txt to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/hppa-firmware.img to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/npcm7xx_bootrom.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vof.bin to /usr/local/share/qemu
Installing /opt/xfs/qemu-proj/qemu/pc-bios/vof-nvram.bin to /usr/local/share/qemu
make[1]: Leaving directory '/opt/xfs/qemu-proj/qemu/build'
configuring QEMU with --target-list=arm-linux-user, you are telling QEMU to focus on providing support for running ARM user-mode applications on your host system.
./configure make