Build a complete bootable Linux image (bootloader, rootfs, kernel, etc.) for Aarch64. The rootfs is made minimum with busybox.
./build_image.sh
To emulate bootloader:
qemu-system-aarch64 -machine virt -cpu cortex-a57 -bios u-boot.bin
To emulate kernel and rootfs:
qemu-system-aarch64 -kernel linux/arch/arm64/boot/Image -initrd rootfs.cpio.gz -machine virt -cpu cortex-a53 -m 1G -nographic -append "root=/dev/mem"
To emulate kernel and rootf with 2 network interfaces:
qemu-system-aarch64 -kernel linux/arch/arm64/boot/Image -initrd rootfs.cpio.gz -machine virt -cpu cortex-a53 -m 1G -nographic -append "root=/dev/mem" -netdev user,id=mynet0,hostfwd=tcp::8080-:80 -device e1000,netdev=mynet0 -net nic,macaddr=52:54:aa:12:35:02,model=virtio
TODO: combine anything to final firmware image and emulating on that.