qemu在xilinx-zynq-a9机器上运行裸机组装程序

时间:2019-08-25 12:00:53

标签: assembly arm qemu bare-metal zynq

我正在遵循this guide进行手臂仿真设置。该指南以连接机为例制作。我想遵循该指南,但是使用xilinx-zynq-a9机器,因为我有一些使用zynq板的经验。

因此,按照本教程,我制作了一个.bin文件。在本教程中,它说连接板具有16MB闪存,并且CPU从地址0x0开始执行。但这不是zynq SoC的情况,它具有OCM(片上内存)(bootrom + RAM),因此,如果我要运行应用程序,通常会将程序下载到OCM并重置板以开始执行。 / p>

下面是我执行的命令及其输出:

$dd if=/dev/zero of=bin/FLASH_hello_arm.bin bs=131072 count=512
512+0 records in
512+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.231956 s, 289 MB/s
$dd if=bin/hello_arm.bin of=bin/FLASH_hello_arm.bin bs=4096 conv=notrunc
0+1 records in
0+1 records out
16 bytes copied, 0.0037652 s, 4.2 kB/s
$qemu-system-arm -M xilinx-zynq-a9 -pflash bin/FLASH_hello_arm.bin -m size=512M -nographic -serial /dev/null -serial /dev/null -singlestep
WARNING: Image format was not specified for 'bin/FLASH_hello_arm.bin' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
QEMU 2.5.0 monitor - type 'help' for more information
(qemu) xp /4iw 0x0
0x00000000:  00000000      andeq    r0, r0, r0
0x00000004:  00000000      andeq    r0, r0, r0
0x00000008:  00000000      andeq    r0, r0, r0
0x0000000c:  00000000      andeq    r0, r0, r0
(qemu) info registers 
R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=02b2ff24
PSR=400001d3 -Z-- A svc32
s00=00000000 s01=00000000 d00=0000000000000000
s02=00000000 s03=00000000 d01=0000000000000000
s04=00000000 s05=00000000 d02=0000000000000000
s06=00000000 s07=00000000 d03=0000000000000000
s08=00000000 s09=00000000 d04=0000000000000000
s10=00000000 s11=00000000 d05=0000000000000000
s12=00000000 s13=00000000 d06=0000000000000000
s14=00000000 s15=00000000 d07=0000000000000000
s16=00000000 s17=00000000 d08=0000000000000000
s18=00000000 s19=00000000 d09=0000000000000000
s20=00000000 s21=00000000 d10=0000000000000000
s22=00000000 s23=00000000 d11=0000000000000000
s24=00000000 s25=00000000 d12=0000000000000000
s26=00000000 s27=00000000 d13=0000000000000000
s28=00000000 s29=00000000 d14=0000000000000000
s30=00000000 s31=00000000 d15=0000000000000000
s32=00000000 s33=00000000 d16=0000000000000000
s34=00000000 s35=00000000 d17=0000000000000000
s36=00000000 s37=00000000 d18=0000000000000000
s38=00000000 s39=00000000 d19=0000000000000000
s40=00000000 s41=00000000 d20=0000000000000000
s42=00000000 s43=00000000 d21=0000000000000000
s44=00000000 s45=00000000 d22=0000000000000000
s46=00000000 s47=00000000 d23=0000000000000000
s48=00000000 s49=00000000 d24=0000000000000000
s50=00000000 s51=00000000 d25=0000000000000000
s52=00000000 s53=00000000 d26=0000000000000000
s54=00000000 s55=00000000 d27=0000000000000000
s56=00000000 s57=00000000 d28=0000000000000000
s58=00000000 s59=00000000 d29=0000000000000000
s60=00000000 s61=00000000 d30=0000000000000000
s62=00000000 s63=00000000 d31=0000000000000000
FPSCR: 00000000

如所见,代码未加载到0x0位置,是否有任何方式可以为qemu“编程” zynq的OCM,就像我们使用dd工具编程flash一样? 该模型是否也从OCM开始执行?或者有什么不同?

0 个答案:

没有答案