EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Suggestion: debug Linux in general

Started by John Black September 7, 2004
Hi,
    I am trying to boot Linux on my development board and it stucks
somewhere, -- I do not see log in prompt on my Hyper Terminal. I am new
to embedded Linux stuff, and not sure how to debug this.

    In standalone mode, I usually start GDB to trace the software and
see on which code is the problem, but how should I do for Linux? I was
told briefly that Linux turns on MMU in the very early stage which makes
it very difficault to debug kernel. How true is it?

    I wonder if there are very good book/tutorial about Linux debug in
this booting phase? I checked out "Building Embedded Linux", it mentions
some linux debug using GDB, but not in details and seems only for
application.

    Any suggestion is higjly appreciated.

Thanks.


John Black wrote:

> Hi, > I am trying to boot Linux on my development board and it stucks > somewhere, -- I do not see log in prompt on my Hyper Terminal. I am new > to embedded Linux stuff, and not sure how to debug this. > > In standalone mode, I usually start GDB to trace the software and > see on which code is the problem, but how should I do for Linux? I was > told briefly that Linux turns on MMU in the very early stage which makes > it very difficault to debug kernel. How true is it? > > I wonder if there are very good book/tutorial about Linux debug in > this booting phase? I checked out "Building Embedded Linux", it mentions > some linux debug using GDB, but not in details and seems only for > application. > > Any suggestion is higjly appreciated.
Are you sure you want to debug lots of software you didn't write yourself ? Wouldn't it be quicker to get someone that fixes your problem ? Rene
John Black <black@eed.com> writes:

> In standalone mode, I usually start GDB to trace the software and >see on which code is the problem, but how should I do for Linux? I was >told briefly that Linux turns on MMU in the very early stage which makes >it very difficault to debug kernel. How true is it?
It is true that Linux enables the MMU very early, and it is true that many of the tools from traditional RTOS vendors don't work well then. Your options depend on the target architecture. On x86, you're more or less stuck with kgdb - that's a fine and powerful tool, but it requires that some parts of the system are still running. On ARM, MIPS and PowerPC you can use a BDM / JTAG debugger; the de-facto standard tool is the BDI2000 by Abatron, which understands how to doeal with the MMU, and which has an interface to GDB, so you can still use your well known toolchain.
> I wonder if there are very good book/tutorial about Linux debug in >this booting phase? I checked out "Building Embedded Linux", it mentions
See http://www.denx.de/twiki/bin/view/DULG/DebuggingLinuxKernel for a start. Hope this helps. Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Web: www.denx.de The only person who always got his work done by Friday was Robinson Crusoe.
Wolfgang Denk wrote:
> John Black <black@eed.com> writes: > >> In standalone mode, I usually start GDB to trace the software and >> see on which code is the problem, but how should I do for Linux? I >> was told briefly that Linux turns on MMU in the very early stage >> which makes it very difficault to debug kernel. How true is it? > > It is true that Linux enables the MMU very early, and it is true that > many of the tools from traditional RTOS vendors don't work well then. > > Your options depend on the target architecture. On x86, you're more > or less stuck with kgdb - that's a fine and powerful tool, but it > requires that some parts of the system are still running.
Just for curiousity, how does SOFTICE do on debugging Linux? I have no idea. -- "I'm a war president. I make decisions here in the Oval Office in foreign policy matters with war on my mind." - Bush. "If I knew then what I know today, I would still have invaded Iraq. It was the right decision" - G.W. Bush, 2004-08-02

The 2024 Embedded Online Conference