Skip to contentSkip to conversation

MIPS little endian user space emulation

Qemu-devel Dirk Behme 3 participants 9 messages Sep 8, 2006 – Sep 9, 2006

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

Hi,

anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception 0x1a - aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.

Seems to me that it gets a wrong jump address via gp in t9:

0x401fa00c: lw t9,-32600(gp)
...
0x401fa01c: jalr t9

Any ideas?

Many thanks

Dirk

hello_world> cat hello_world.c
#include <stdio.h>

int main(void) {

  printf("Hello world\n");

return 0;
}
hello_world> mipsel-linux-gcc hello_world.c -o hello_world
hello_world> file hello_world
hello_world: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped hello_world> ./qemu-mipsel -L /usr/mips/mipsel-linux/mipsel-linux -d out_asm,in_asm,op,int,exec,cpu hello_world
qemu: unhandled CPU exception 0x1a - aborting
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c00 t6 401f3f00 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3be8 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

    Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT1: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT2: w:00000000 d:0000000000000000 fd:0 fs:5.75452
f00: w:00000000 d:0000000000000000 fd:0 fs:5.75452
...
f30: w:00000000 d:0000000000000000 fd:0 fs:5.75452
qemu: uncaught target signal 6 (Aborted) - exiting

Exctract of end of log file:

...
------------------------------------------------
pc=0x401f9c28 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

    Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:

0x401f9c28:  lw v0,60(a2)
0x401f9c2c:  nop
0x401f9c30:  bnez       v0,0x401fa000
0x401f9c34:  nop

OP:
0x0000: load_gpr_T0_gpr6
0x0001: set_T1 0x3c
0x0002: add
0x0003: lw_raw
0x0004: store_T0_gpr_gpr2
0x0005: load_gpr_T0_gpr2
0x0006: reset_T1
0x0007: ne
0x0008: set_bcond
0x0009: jnz_T2 0x0
0x000a: goto_tb1
0x000b: save_pc 0x401f9c38
0x000c: set_T0 0x800cd4a1
0x000d: exit_tb
0x000e: save_pc 0x401fa000
0x000f: set_T0 0x0
0x0010: exit_tb
0x0011: reset_T0
0x0012: exit_tb
0x0013: end

---------------- 2 00000003
OUT: [size=80]

0x810cd980:  mov    0x18(%ebp),%ebx
0x810cd983:  mov    $0x3c,%esi
0x810cd988:  add    %esi,%ebx
0x810cd98a:  mov    (%ebx),%ebx
0x810cd98c:  mov    %ebx,0x8(%ebp)
0x810cd98f:  mov    0x8(%ebp),%ebx
0x810cd992:  xor    %esi,%esi
0x810cd994:  cmp    %esi,%ebx
0x810cd996:  setne  %al
0x810cd999:  xor    %ebx,%ebx
0x810cd99b:  mov    %al,%bl
0x810cd99d:  mov    %ebx,%edi
0x810cd99f:  test   %edi,%edi
0x810cd9a1:  je     0x810cd9a8
0x810cd9a3:  jmp    0x810cd9bd
0x810cd9a8:  jmp    0x83151d34
0x810cd9ad:  movl   $0x401f9c38,0x80(%ebp)
0x810cd9b7:  mov    $0x800cd4a1,%ebx
0x810cd9bc:  ret
0x810cd9bd:  movl   $0x401fa000,0x80(%ebp)
0x810cd9c7:  mov    $0x0,%ebx
0x810cd9cc:  ret
0x810cd9cd:  xor    %ebx,%ebx
0x810cd9cf:  ret

------------------------------------------------
pc=0x401fa000 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

    Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:

0x401fa000:  lw a0,-32692(gp)
0x401fa004:  lw a1,-32692(gp)
0x401fa008:  lw a3,-32692(gp)
0x401fa00c:  lw t9,-32600(gp)
0x401fa010:  addiu      a0,a0,30820
0x401fa014:  addiu      a1,a1,29452
0x401fa018:  addiu      a3,a3,25856
0x401fa01c:  jalr       t9
0x401fa020:  li a2,161

OP:
0x0000: load_gpr_T0_gpr28
0x0001: set_T1 0xffff804c
0x0002: add
0x0003: lw_raw
0x0004: store_T0_gpr_gpr4
0x0005: load_gpr_T0_gpr28
0x0006: set_T1 0xffff804c
0x0007: add
0x0008: lw_raw
0x0009: store_T0_gpr_gpr5
0x000a: load_gpr_T0_gpr28
0x000b: set_T1 0xffff804c
0x000c: add
0x000d: lw_raw
0x000e: store_T0_gpr_gpr7
0x000f: load_gpr_T0_gpr28
0x0010: set_T1 0xffff80a8
0x0011: add
0x0012: lw_raw
0x0013: store_T0_gpr_gpr25
0x0014: load_gpr_T0_gpr4
0x0015: set_T1 0x7864
0x0016: add
0x0017: store_T0_gpr_gpr4
0x0018: load_gpr_T0_gpr5
0x0019: set_T1 0x730c
0x001a: add
0x001b: store_T0_gpr_gpr5
0x001c: load_gpr_T0_gpr7
0x001d: set_T1 0x6500
0x001e: add
0x001f: store_T0_gpr_gpr7
0x0020: load_gpr_T2_gpr25
0x0021: set_T0 0x401fa024
0x0022: store_T0_gpr_gpr31
0x0023: reset_T0
0x0024: set_T1 0xa1
0x0025: add
0x0026: store_T0_gpr_gpr6
0x0027: breg
0x0028: reset_T0
0x0029: exit_tb
0x002a: end

---------------- 2 00000003
OUT: [size=131]

0x810cd9d0:  mov    0x70(%ebp),%ebx
0x810cd9d3:  mov    $0xffff804c,%esi
0x810cd9d8:  add    %esi,%ebx
0x810cd9da:  mov    (%ebx),%ebx
0x810cd9dc:  mov    %ebx,0x10(%ebp)
0x810cd9df:  mov    0x70(%ebp),%ebx
0x810cd9e2:  mov    $0xffff804c,%esi
0x810cd9e7:  add    %esi,%ebx
0x810cd9e9:  mov    (%ebx),%ebx
0x810cd9eb:  mov    %ebx,0x14(%ebp)
0x810cd9ee:  mov    0x70(%ebp),%ebx
0x810cd9f1:  mov    $0xffff804c,%esi
0x810cd9f6:  add    %esi,%ebx
0x810cd9f8:  mov    (%ebx),%ebx
0x810cd9fa:  mov    %ebx,0x1c(%ebp)
0x810cd9fd:  mov    0x70(%ebp),%ebx
0x810cda00:  mov    $0xffff80a8,%esi
0x810cda05:  add    %esi,%ebx
0x810cda07:  mov    (%ebx),%ebx
0x810cda09:  mov    %ebx,0x64(%ebp)
0x810cda0c:  mov    0x10(%ebp),%ebx
0x810cda0f:  mov    $0x7864,%esi
0x810cda14:  add    %esi,%ebx
0x810cda16:  mov    %ebx,0x10(%ebp)
0x810cda19:  mov    0x14(%ebp),%ebx
0x810cda1c:  mov    $0x730c,%esi
0x810cda21:  add    %esi,%ebx
0x810cda23:  mov    %ebx,0x14(%ebp)
0x810cda26:  mov    0x1c(%ebp),%ebx
0x810cda29:  mov    $0x6500,%esi
0x810cda2e:  add    %esi,%ebx
0x810cda30:  mov    %ebx,0x1c(%ebp)
0x810cda33:  mov    0x64(%ebp),%edi
0x810cda36:  mov    $0x401fa024,%ebx
0x810cda3b:  mov    %ebx,0x7c(%ebp)
0x810cda3e:  xor    %ebx,%ebx
0x810cda40:  mov    $0xa1,%esi
0x810cda45:  add    %esi,%ebx
0x810cda47:  mov    %ebx,0x18(%ebp)
0x810cda4a:  mov    %edi,0x80(%ebp)
0x810cda50:  xor    %ebx,%ebx
0x810cda52:  ret

------------------------------------------------
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

    Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 cpu_mips_handle_mmu_fault pc 00012a2c ad 00012a2c rw 0 is_user 1 smmu 0
do_raise_exception_err: 26 1

#1 lore raw
Quoted 8 lines · Dirk Behme

Hi,

anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception 0x1a - aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.

My CVS snapshot works:

$ mipsel-user/qemu-mipsel -L /nfsroot /nfsroot/bin/busybox ls /
bin   dev   etc   lib   mnt   proc  sbin  tmp   usr

Stefan

author
#2 lore raw
Quoted 11 lines · Stefan Weil
Quoted 8 lines · Dirk Behme

Hi,

anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception 0x1a - aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.

Quoted 4 lines

My CVS snapshot works:

$ mipsel-user/qemu-mipsel -L /nfsroot /nfsroot/bin/busybox ls /
bin   dev   etc   lib   mnt   proc  sbin  tmp   usr

Busybox statically or dynamically linked?

Which toolchain?

Dirk

#3 lore raw
Quoted 7 lines

Busybox statically or dynamically linked?

Which toolchain?

Dirk

Hello Dirk,

here is my working configuration:

host tools:
gcc-Version 3.3.6 (Debian 1:3.3.6-13)

cross tools (mipsel):
gcc with patches from OpenWrt: mipsel-linux-gcc (GCC) 3.4.5 (OpenWrt-2.0) GNU binutils version 2.16.1
busybox: BusyBox v1.1.2 (2006.04.24-20:20+0000) multi-call binary (dynamically linked)
uClib-3.4.5

Maybe you want to try your hello_world compiled with my toolchain? I send a binary with this mail (it is only 2 KB, so it should be ok for the list).

$ mipsel-linux-gcc hello_world.c -o hello_world
$ file hello_world
hello_world: ELF 32-bit LSB executable, MIPS, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
$ mipsel-user/qemu-mipsel -L /nfsroot.ok hello_world
Hello world

Note the different output of the "file" command!

Regards
Stefan

#4 lore raw

Khi Thứ bảy 09 Tháng chín 2006 8:00 chiều, Stefan Weil viết:

Quoted 31 lines
Quoted 5 lines

Busybox statically or dynamically linked?

Which toolchain?

Dirk

Hello Dirk,

here is my working configuration:

host tools:
gcc-Version 3.3.6 (Debian 1:3.3.6-13)

cross tools (mipsel):
gcc with patches from OpenWrt: mipsel-linux-gcc (GCC) 3.4.5 (OpenWrt-2.0) GNU binutils version 2.16.1
busybox: BusyBox v1.1.2 (2006.04.24-20:20+0000) multi-call binary (dynamically linked)
uClib-3.4.5

Maybe you want to try your hello_world compiled with my toolchain? I send a binary with this mail (it is only 2 KB, so it should be ok for the list).

$ mipsel-linux-gcc hello_world.c -o hello_world
$ file hello_world
hello_world: ELF 32-bit LSB executable, MIPS, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
$ mipsel-user/qemu-mipsel -L /nfsroot.ok hello_world
Hello world
Quoted 4 lines

Note the different output of the "file" command!

Regards
Stefan

hi stefan,
this is with uclibc ! (mine works too) but not with mipsel-glibc toolchain ! some people want glibc for more versatility maybe .

#5 lore raw
In reply to Dirk Behme

Khi Thứ sáu 08 Tháng chín 2006 6:35 chiều, Dirk Behme viết:

Quoted 320 lines

Hi,

anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu:
unhandled CPU exception 0x1a - aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.

Seems to me that it gets a wrong jump address via gp in t9:

0x401fa00c: lw t9,-32600(gp)
...
0x401fa01c: jalr t9

Any ideas?

Many thanks

Dirk

hello_world> cat hello_world.c
#include <stdio.h>

int main(void) {

   printf("Hello world\n");
   return 0;
}

hello_world> mipsel-linux-gcc hello_world.c -o hello_world hello_world> file hello_world
hello_world: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped
hello_world> ./qemu-mipsel -L /usr/mips/mipsel-linux/mipsel-linux -d out_asm,in_asm,op,int,exec,cpu hello_world
qemu: unhandled CPU exception 0x1a - aborting pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c00 t6 401f3f00 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3be8 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

     Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT1: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT2: w:00000000 d:0000000000000000 fd:0 fs:5.75452
f00: w:00000000 d:0000000000000000 fd:0 fs:5.75452
...
f30: w:00000000 d:0000000000000000 fd:0 fs:5.75452
qemu: uncaught target signal 6 (Aborted) - exiting

Exctract of end of log file:

...
------------------------------------------------
pc=0x401f9c28 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

     Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:

0x401f9c28:  lw v0,60(a2)
0x401f9c2c:  nop
0x401f9c30:  bnez       v0,0x401fa000
0x401f9c34:  nop

OP:
0x0000: load_gpr_T0_gpr6
0x0001: set_T1 0x3c
0x0002: add
0x0003: lw_raw
0x0004: store_T0_gpr_gpr2
0x0005: load_gpr_T0_gpr2
0x0006: reset_T1
0x0007: ne
0x0008: set_bcond
0x0009: jnz_T2 0x0
0x000a: goto_tb1
0x000b: save_pc 0x401f9c38
0x000c: set_T0 0x800cd4a1
0x000d: exit_tb
0x000e: save_pc 0x401fa000
0x000f: set_T0 0x0
0x0010: exit_tb
0x0011: reset_T0
0x0012: exit_tb
0x0013: end

---------------- 2 00000003
OUT: [size=80]

0x810cd980:  mov    0x18(%ebp),%ebx
0x810cd983:  mov    $0x3c,%esi
0x810cd988:  add    %esi,%ebx
0x810cd98a:  mov    (%ebx),%ebx
0x810cd98c:  mov    %ebx,0x8(%ebp)
0x810cd98f:  mov    0x8(%ebp),%ebx
0x810cd992:  xor    %esi,%esi
0x810cd994:  cmp    %esi,%ebx
0x810cd996:  setne  %al
0x810cd999:  xor    %ebx,%ebx
0x810cd99b:  mov    %al,%bl
0x810cd99d:  mov    %ebx,%edi
0x810cd99f:  test   %edi,%edi
0x810cd9a1:  je     0x810cd9a8
0x810cd9a3:  jmp    0x810cd9bd
0x810cd9a8:  jmp    0x83151d34
0x810cd9ad:  movl   $0x401f9c38,0x80(%ebp)
0x810cd9b7:  mov    $0x800cd4a1,%ebx
0x810cd9bc:  ret
0x810cd9bd:  movl   $0x401fa000,0x80(%ebp)
0x810cd9c7:  mov    $0x0,%ebx
0x810cd9cc:  ret
0x810cd9cd:  xor    %ebx,%ebx
0x810cd9cf:  ret

------------------------------------------------
pc=0x401fa000 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

     Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:

0x401fa000:  lw a0,-32692(gp)
0x401fa004:  lw a1,-32692(gp)
0x401fa008:  lw a3,-32692(gp)
0x401fa00c:  lw t9,-32600(gp)
0x401fa010:  addiu      a0,a0,30820
0x401fa014:  addiu      a1,a1,29452
0x401fa018:  addiu      a3,a3,25856
0x401fa01c:  jalr       t9
0x401fa020:  li a2,161

OP:
0x0000: load_gpr_T0_gpr28
0x0001: set_T1 0xffff804c
0x0002: add
0x0003: lw_raw
0x0004: store_T0_gpr_gpr4
0x0005: load_gpr_T0_gpr28
0x0006: set_T1 0xffff804c
0x0007: add
0x0008: lw_raw
0x0009: store_T0_gpr_gpr5
0x000a: load_gpr_T0_gpr28
0x000b: set_T1 0xffff804c
0x000c: add
0x000d: lw_raw
0x000e: store_T0_gpr_gpr7
0x000f: load_gpr_T0_gpr28
0x0010: set_T1 0xffff80a8
0x0011: add
0x0012: lw_raw
0x0013: store_T0_gpr_gpr25
0x0014: load_gpr_T0_gpr4
0x0015: set_T1 0x7864
0x0016: add
0x0017: store_T0_gpr_gpr4
0x0018: load_gpr_T0_gpr5
0x0019: set_T1 0x730c
0x001a: add
0x001b: store_T0_gpr_gpr5
0x001c: load_gpr_T0_gpr7
0x001d: set_T1 0x6500
0x001e: add
0x001f: store_T0_gpr_gpr7
0x0020: load_gpr_T2_gpr25
0x0021: set_T0 0x401fa024
0x0022: store_T0_gpr_gpr31
0x0023: reset_T0
0x0024: set_T1 0xa1
0x0025: add
0x0026: store_T0_gpr_gpr6
0x0027: breg
0x0028: reset_T0
0x0029: exit_tb
0x002a: end

---------------- 2 00000003
OUT: [size=131]

0x810cd9d0:  mov    0x70(%ebp),%ebx
0x810cd9d3:  mov    $0xffff804c,%esi
0x810cd9d8:  add    %esi,%ebx
0x810cd9da:  mov    (%ebx),%ebx
0x810cd9dc:  mov    %ebx,0x10(%ebp)
0x810cd9df:  mov    0x70(%ebp),%ebx
0x810cd9e2:  mov    $0xffff804c,%esi
0x810cd9e7:  add    %esi,%ebx
0x810cd9e9:  mov    (%ebx),%ebx
0x810cd9eb:  mov    %ebx,0x14(%ebp)
0x810cd9ee:  mov    0x70(%ebp),%ebx
0x810cd9f1:  mov    $0xffff804c,%esi
0x810cd9f6:  add    %esi,%ebx
0x810cd9f8:  mov    (%ebx),%ebx
0x810cd9fa:  mov    %ebx,0x1c(%ebp)
0x810cd9fd:  mov    0x70(%ebp),%ebx
0x810cda00:  mov    $0xffff80a8,%esi
0x810cda05:  add    %esi,%ebx
0x810cda07:  mov    (%ebx),%ebx
0x810cda09:  mov    %ebx,0x64(%ebp)
0x810cda0c:  mov    0x10(%ebp),%ebx
0x810cda0f:  mov    $0x7864,%esi
0x810cda14:  add    %esi,%ebx
0x810cda16:  mov    %ebx,0x10(%ebp)
0x810cda19:  mov    0x14(%ebp),%ebx
0x810cda1c:  mov    $0x730c,%esi
0x810cda21:  add    %esi,%ebx
0x810cda23:  mov    %ebx,0x14(%ebp)
0x810cda26:  mov    0x1c(%ebp),%ebx
0x810cda29:  mov    $0x6500,%esi
0x810cda2e:  add    %esi,%ebx
0x810cda30:  mov    %ebx,0x1c(%ebp)
0x810cda33:  mov    0x64(%ebp),%edi
0x810cda36:  mov    $0x401fa024,%ebx
0x810cda3b:  mov    %ebx,0x7c(%ebp)
0x810cda3e:  xor    %ebx,%ebx
0x810cda40:  mov    $0xa1,%esi
0x810cda45:  add    %esi,%ebx
0x810cda47:  mov    %ebx,0x18(%ebp)
0x810cda4a:  mov    %edi,0x80(%ebp)
0x810cda50:  xor    %ebx,%ebx
0x810cda52:  ret

------------------------------------------------
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

     Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 cpu_mips_handle_mmu_fault pc 00012a2c ad 00012a2c rw 0 is_user 1 smmu 0
do_raise_exception_err: 26 1

Quoted 4 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

yes,I got similar error,but if I "static" compile then everything looks ok !

[sbox-mipselglibc: ~] > gcc /scratchbox/packages/hello.c -ohello -static [sbox-mipselglibc: ~] > qemu-mipsel hello
hello world

wangji@laixa:/scratchbox/users/wangji/targets/mipselglibc/bin$ file busybox
busybox: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for 
GNU/Linux 2.4.3, statically linked, stripped
wangji@laixa:/scratchbox/users/wangji/targets/mipselglibc/bin$ qemu-mipsel 
busybox

BusyBox v1.00 (2006.08.27-10:16+0000) multi-call binary

Usage: busybox [function] [arguments]... ----cut here --
qemu-0.82 ,crosstool-0.38 from my latest livecdToolkit
http://mirror.opf.slu.cz/scratchbox/iso/ScratchboxMultiCpu-2.3.iso

author
#6 lore raw
Quoted 5 lines · wangji
Quoted 5 lines

Seems to me that it gets a wrong jump address via gp in t9:

0x401fa00c: lw t9,-32600(gp)
...
0x401fa01c: jalr t9

...

Quoted 1 line

yes,I got similar error,but if I "static" compile then everything looks ok !

Thanks for the hint! static works for me as well.

So, maybe a toolchain (glibc?) issue?

Quoted 2 lines

qemu-0.82 ,crosstool-0.38 from my latest livecdToolkit
http://mirror.opf.slu.cz/scratchbox/iso/ScratchboxMultiCpu-2.3.iso

I use qemu-snapshot-2006-09-07_23 and toolchain created with crosstool-0.42 configuration

cat mipsel.dat gcc-3.4.1-glibc-2.3.2.dat

Regards

Dirk

Btw: Do you can connect and then step/continue with gdb to qemu-mipsel?

#7 lore raw

Khi Thứ bảy 09 Tháng chín 2006 9:16 Sáng, Dirk Behme viết:

Quoted 4 lines

Dirk

Btw: Do you can connect and then step/continue with gdb to qemu-mipsel?

alas ! no ! cont on gdb_session gives :

[sbox-mipselglibc: ~] > qemu-mipsel -g 1234 hello
qemu: unhandled CPU exception 0x10002 - aborting pc=0x004001a8 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000000
GPR04: a0 00000000 a1 00000000 a2 00000000 a3 00000000
GPR08: t0 00000000 t1 00000000 t2 00000000 t3 00000000
GPR12: t4 00000000 t5 00000000 t6 00000000 t7 00000000
GPR16: s0 00000000 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 00000000 t9 00000000 k0 00000000 k1 00000000
GPR28: gp 00000000 sp b7fcf7d0 s8 00000000 ra 004001a8
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000

    Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000

CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
FT1: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
FT2: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f00: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f02: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f04: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f06: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f08: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f10: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f12: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f14: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f16: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f18: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f20: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f22: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f24: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f26: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f28: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f30: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
qemu: uncaught target signal 6 (Aborted) - exiting

Quoted 8 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#8 lore raw
In reply to Dirk Behme

Khi Thứ bảy 09 Tháng chín 2006 9:16 Sáng, Dirk Behme viết:

Quoted 2 lines

So, maybe a toolchain (glibc?) issue?

you are certaily right,
doing the same "compile hello.c,and cont on gdb session " but with mipsel-uclibc works fine !!!
I did all that from my scratchboxmulticpu-2.3