问题描述
我有一本使用 u-boot
和 qemu
的嵌入式 ARM linux 书籍,相当旧(2009 年出版).书中解释的qemu
与u-boot
二进制的用法如下:
I have a rather old (published in 2009) embedded ARM linux book that uses u-boot
and qemu
.The usage of qemu
with the u-boot
binary explained in the book is as follows:
qemu-system-arm -M connex -pflash u-boot.bin -nographic
它使用的是 qemu 0.9.1,而我的是 2.1.0:
It uses qemu 0.9.1, and mine is 2.1.0:
qemu-system-arm --version
QEMU emulator version 2.1.0, Copyright (c) 2003-2008 Fabrice Bellard
然而,当我执行相同的命令时,我收到了这些错误消息.
When I executed the same command, however, I got these error messages.
qemu-system-arm: failed to read the initial flash content
qemu-system-arm: Initialization of device cfi.pflash01 failed
可能有什么问题?这是来自新的命令参数吗?我有 this site 使用不同的命令,但是当我尝试使用它时,我看到一个空白屏幕.
What might be wrong? Is this from the new command parameter? I have this site that uses different command, but when I tried that I see a blank screen.
qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin
我使用 Mac OS X 特立独行的 qemu.
I use Mac OS X maverick for 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 是:
where add.S is:
.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
看起来程序运行良好......
And it seems that program works fine ...
qemu-system-arm --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.5), Copyright (c) 2003-2008 Fabrice Bellard
这篇关于Qemu 闪存启动不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!