系统准备
Ubuntu 18.04.1
qemu准备
apt-get install qemu
内核准备
linux-4.17.2.tar.gz
内核编译
make x86_64_defconfig
make
生成${LINUX_KERNEL_SRC_PATH}/arch/x86_64/boot/bzImage
busybox准备
busybox-1.35.0.tar.bz2
镜像准备
qemu-img create -f raw disk.img 512M
mkfs -t ext4 ./disk.img
mount -o loop,rw ./disk.img /path/to/uwant
运行
qemu-system-x86_64 \
-m 512M \
-smp 4 \
-kernel ./arch/x86_64/boot/bzImage \
-drive format=raw,file=./disk.img \
-append “console=ttyS0,115200 init=/linuxrc root=/dev/sda” \
-nographic