problem with kernel debug using BDI2000
hb fei
ghbfei at gmail.com
Thu Jul 6 06:11:48 EST 2006
Hi there,
I met some problems when I tried to debug the 2.5.16 kernel with BDI2000
for a customerized MPC8xx.
I listed my two trials, can any one tell me what is wrong with my approachs,
[Try 1] =============================================>
(1) Build the kernel image, the map file -- System.map file
.....
c0000000 T _start
c0000000 T __start
c0000000 T _stext
c0000018 t turn_on_mmu
c0000100 t Reset
.....
(2) Copy the vmlinux into /tftpboot for load the iamge
(3) I mapped the logic address 0xc0000000 into physical address 0x00100000
in target
by loading the file through BDI telnet console, the telnet screen shows
BDI>load 0x40100000 vmlinux elf
Loading vmlinux , please wait ....
- File offset 0x00010000 to address 0x00100000 size 1728646
Loading program file passed
(4) Start the GDB command, and single step from address 0x00100000.
I tried two version of ppc gdb, both have the same result. The location of
one of
the gdb (through DENX) is,
$ which ppc_8xx-gdb
/opt/eldk/usr/bin/ppc_8xx-gdb
(5) And start the gdb through the following command,
$ ppc_8xx-gdb vmlinux (under kernel top directory)
(gdb) target remote 10.199.5.234:2001
Remote debugging using 10.199.5.234:2001
(gdb) si
0x0010000c in ?? ()
(gdb)
0x00100010 in ?? ()
(gdb)
0x00100014 in ?? ()
....
Things go well till I reach the
(gdb)
0x00100030 in ?? ()
(gdb)
Program received signal SIGSTOP, Stopped (signal).
0x00100030 in ?? ()
(gdb)
Program received signal SIGSTOP, Stopped (signal).
0x00100030 in ?? ()
(gdb)
If I check the code carefully in /arch/ppc/kernel_8xx.S, 0x00100030 address
matches the rfi comamnd in
turn_on_mmu:
mfmsr r0
ori r0,r0,MSR_DR|MSR_IR
mtspr SPRN_SRR1,r0
lis r0,start_here at h
ori r0,r0,start_here at l
mtspr SPRN_SRR0,r0
SYNC
rfi /* enables MMU */
(6) I check the BDI configuration (8xx.cfg) file, seems I had enabled the
MMI
[TARGET]
CPUCLOCK 32000000 ;the CPU clock rate after processing the init list
BDIMODE AGENT ;the BDI working mode (LOADONLY | AGENT)
BREAKMODE SOFT ;SOFT or HARD, HARD uses PPC hardware breakpoints
;STEPMODE HWBP ;TRACE or HWBP, HWPB uses one or two hardware breakpoints
;STARTUP STOP 5000 ;let the monitor initialize the system
;DCACHE FLUSH ;flush data cache, needs a workspace of 32 bytes
;WORKSPACE 0x00000040 ;workspace in target RAM for data cache flush
MMU XLAT ;translate effective to physical address
;PTBASE 0x00000f0 ;????
;REGLIST SPR ;select register to transfer to GDB
REGLIST ALL ;select register to transfer to GDB
I assume I do not need set PTBASE, since I am working on the very new
version of kernel
(2.6.15).
Question, seems to me the MMU in BDI does still map the logic address into
physical
address correctly, what did I miss here?
[Try 2 ] ===================================================>
Exactly follow the BDI user manual,
(1) load image, BDI telnet screen shows
BDI>load 0x40100000 vmlinux elf
Loading vmlinux , please wait ....
- File offset 0x00010000 to address 0x00100000 size 1728646
Loading program file passed
(2) set hardware break point
BDI>bi 0xc0000000 0xc00fffff
Breakpoint identification is 0
(3) issue go comamnd from telnet screen
BDI>go
- TARGET: stopped
(4) Disable hardware break point
BDI> ci
(5) Start gdb from another terminal,
$ ppc_8xx-gdb vmlinux
(6) Attached target,
(gdb) target remote 10.199.5.234:2001
Remote debugging using 10.199.5.234:2001
0x00001100 in ?? ()
(7) Set software break point,
(gdb) b start_kernel
(8) let go
(gdb) c
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00001100 in ?? ()
Seems to me the MMU still not work with BDI.
Can any one one point out what is the problem?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060705/4c7a993d/attachment.htm
More information about the Linuxppc-embedded
mailing list