LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "hb fei" <ghbfei@gmail.com>
To: linuxppc-embedded@ozlabs.org
Subject: problem with kernel debug using BDI2000
Date: Wed, 5 Jul 2006 16:11:48 -0400	[thread overview]
Message-ID: <960972fa0607051311w5fb9178fm9bfa090b4613597a@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3724 bytes --]

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@h

ori r0,r0,start_here@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!

[-- Attachment #2: Type: text/html, Size: 4809 bytes --]

                 reply	other threads:[~2006-07-05 20:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=960972fa0607051311w5fb9178fm9bfa090b4613597a@mail.gmail.com \
    --to=ghbfei@gmail.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox