qemu 模拟 ARM 从sd卡启动 uboot 内核
https://www.veryarm.com/115692.html
编译uboot
编译内核
用mkimage制作文件
mkimage -n 'linux-2.6.14' -A arm -O linux -T kernel -C none -a 0x60008000 -e 0x60008000 -d zImage zImage.img
制作ext2格式的sd卡
dd if=/dev/zero of=a9rootfs.ext2 bs=1M count=32
mkfs.ext2 a9rootfs.ext2
sudo mkdir tmpfs
sudo mount -t ext2 a9rootfs.ext2 tmpfs/ -o loop
sudo cp zImage.img //将用mkimage制作好的内核文件拷到此处
sudo umount tmpfs启动qemu,
qemu-system-arm -M vexpress-a9 -m 256M -nographic -kernel u-boot -sd a9rootfs.ext2
在qemu环境下:
=> ext2load mmc 0 60008000 zImage.img
1965048 bytes read in 1225 ms (1.5 MiB/s)=> bootm 60008000
Booting kernel from Legacy Image at 60008000 ...
Image Name: linux-2.6.14
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1964984 Bytes = 1.9 MiB
Load Address: 60008000
Entry Point: 60008000
Verifying Checksum ... OK
Loading Kernel Image ... OKStarting kernel ...