QEMU に昔のソースを

QEMU versatilepb でむかしの ARM-7 のソースを載せてみる。意外と簡単に動いちゃった。まずは qemu の起動。gdb サーバの指定をしておく。

qemu-system-arm -S -gdb tcp::1234 -M versatilepb -m 256 -kernel sdramTest_32bit.elf

で、gdb を起動し接続。

> arm-none-linux-gnueabi-gdb sdramTest_32bit.elf
GNU gdb (Sourcery G++ Lite 2010q1-202)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
Reading symbols from /home/ryos/QEMU-SystemC/os-less/sdramCheckTest/sdramTest_32bit.elf...(no debugging symbols found)...done.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234

(gdb) disassemble 0x60
Dump of assembler code for function main:
   0x0000005c <+0>:     mov     r0, #268435456  ; 0x10000000
   0x00000060 <+4>:     mov     r1, #335544320  ; 0x14000000
   0x00000064 <+8>:     ldr     r2, [pc, #68]   ; 0xb0 <error+4>
   0x00000068 <+12>:    mov     r4, r0
   0x0000006c <+16>:    str     r2, [r4], #4
=> 0x00000070 <+20>:    cmp     r1, r4
   0x00000074 <+24>:    bne     0x6c <main+16>
   0x00000078 <+28>:    mov     r4, r0
   0x0000007c <+32>:    ldr     r5, [r4]
   0x00000080 <+36>:    cmp     r5, r2
   0x00000084 <+40>:    bne     0x98 <main+60>
   0x00000088 <+44>:    add     r4, r4, #4
   0x0000008c <+48>:    cmp     r4, r1
   0x00000090 <+52>:    bne     0x7c <main+32>
   0x00000094 <+56>:    mov     r0, #0
   0x00000098 <+60>:    cmp     r4, r1
   0x0000009c <+64>:    movne   r0, #1
   0x000000a0 <+68>:    cmp     r0, #0
   0x000000a4 <+72>:    bne     0xac <error>

なんとなく動いている。vector とか同じなのか?