embedded - Can ARM qemu system emulator boot from card image without kernel param? -
i've seen lot of examples how run qemu arm board emulator. in every case, besides sd card image param, qemu supplied kernel param, i.e.:
qemu-system-arm -m versatilepb \ -kernel vmlinuz-2.6.18-6-versatile \ #kernel param here -initrd initrd.gz \ -hda hda.img -append "root=/dev/ram"
i palying bootloaders , want create own bootable sd card, don't have real board yet , want learn emulated one. however, if run described above, qemu skips bootloader stage , runs kernel.
so should emulate full boot sequence on qemu executes bootloader? should rom dump , pass -bios param?
you can feeding uboot image. never used rom dump.
qemu boot sqeuqnce:
on real, physical boards boot process involves non-volatile memory (e.g. flash) containing boot-loader , operating system. on power on, core loads , runs boot-loader, in turn loads , runs operating system.
qemu has possibility emulate flash memory on many platforms, not on versatilepb. there patches ad procedures available can add flash support, wanted leave qemu is.
qemu can load linux kernel using -kernel , -initrd options; @ low level, these options have effect of loading 2 binary files emulated memory: kernel binary @ address 0x10000 (64kib) , ramdisk binary @ address 0x800000 (8mib).
then qemu prepares kernel arguments , jumps @ 0x10000 (64kib) execute linux. wanted recreate same situation using u-boot, , keep situation similar real 1 wanted create single binary image containing whole system, having flash on board. -kernel option in qemu used load flash binary emulated memory, , means starting address of binary image 0x10000 (64kib).
this example based of arm versatilepb board
make cross_compile=arm-none-eabi- versatilepb_config make cross_compile=arm-none-eabi-
creating flash image * download u-boot-xxx.x source tree , extract * cd source tree directory , build it
mkimage -a arm -c none -o linux -t kernel -d zimage -a 0x00010000 -e 0x00010000 zimage.uimg mkimage -a arm -c none -o linux -t ramdisk -d rootfs.img.gz -a 0x00800000 -e 0x00800000 rootfs.uimg dd if=/dev/zero of=flash.bin bs=1 count=6m dd if=u-boot.bin of=flash.bin conv=notrunc bs=1 dd if=zimage.uimg of=flash.bin conv=notrunc bs=1 seek=2m dd if=rootfs.uimg of=flash.bin conv=notrunc bs=1 seek=4m
booting linux
to boot linux can call:
qemu-system-arm -m versatilepb -m 128m -kernel flash.bin -serial stdio
Comments
Post a Comment