我正在读这个:
https://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/
Baremtal编程
QEMU +裸机应用程序(下面的Makefile):
prepimg:
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin
mkimg:
mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg
launch_test:
qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel test.uimg
有效。代码在正确的地址执行(r15证明)。
QEMU + baremetal + U-boot
prepimg:
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin
mkimg:
mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg
cat_them:
cat u-boot-2016.07/u-boot test.uimg > u-boot-2016.07/flash.bin
launch_qemu:
qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel u-boot-2016.07/flash.bin
然后,我得到:
Wrong Image Format for bootm command
ERROR: can't get kernel image!
我不知道发生了什么。
答案 0 :(得分:1)
最后,
我通过tftp删除了我的文件并完成了工作。