我有一本相当旧的(2009 年出版)嵌入式 ARM Linux 书,其中使用u-boot
and qemu
。
的用法qemu
与u-boot
书中对二进制的解释如下:
qemu-system-arm -M connex -pflash u-boot.bin -nographic
它使用qemu 0.9.1,我的是2.1.0:
qemu-system-arm --version
QEMU emulator version 2.1.0, Copyright (c) 2003-2008 Fabrice Bellard
然而,当我执行相同的命令时,我收到了这些错误消息。
qemu-system-arm: failed to read the initial flash content
qemu-system-arm: Initialization of device cfi.pflash01 failed
可能出了什么问题?这是来自新命令参数吗?我有这个网站 http://emreboy.wordpress.com/2012/12/15/how-to-cross-compile-u-boot-and-work-it-on-qemu/使用不同的命令,但是当我尝试时,我看到一个空白屏幕。
qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin
我使用 Mac OS X maverick 来运行 qemu。
我已经尝试过这个:
dd if=/dev/zero of=flash.bin bs=4096 count=4096
arm-linux-gnueabihf-as -o add.o add.S
arm-linux-gnueabihf-ld -Ttext=0x0 -o add.elf add.o
arm-linux-gnueabihf-objcopy -O binary add.elf add.bin
dd if=add.bin of=flash.bin bs=4096 conv=notrunc
qemu-system-arm -M connex -pflash flash.bin -nographic -serial /dev/null -gdb tcp::1234 -S
其中 add.S 是:
.text
entry: b start
arr: .byte 1, 2, 3, 4, 5, 6
eoa:
.align
start:
ldr r0, =eoa
ldr r1, =arr
mov r3, #0
loop:
ldrb r2, [r1], #1
add r3, r2, r3
cmp r1, r0
bne loop
stop: b stop
而且看起来该程序运行良好......
qemu-system-arm --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.5), Copyright (c) 2003-2008 Fabrice Bellard
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)