Re: [DOC] Debugging early kernel hangs

From: Russell King (rmk@arm.linux.org.uk)
Date: Fri Sep 22 2000 - 11:41:01 EST


Keith Owens writes:
> If a kernel hangs early in the boot process (before the console has
> been initialized) then printk is no use because you never see the
> output. There is a technique for using the video display to indicate
> boot progress so you can localize the problem. Reporting "my kernel
> hangs during boot at line nnn in routine xyz" is a lot better than "my
> kernel hangs during boot".

Hmm, good idea, but how does this work on, say, non-x86 architectures
which don't have a VGA text frame buffer, or whose VGA text frame buffer
is not mapped in, or whose VGA text frame buffer is not initialised.

You will still end up with those "my kernel hangs during boot" messages.

A lot of the problems with debugging early kernel hangs is that you
don't have a display set up, or you don't have enough of the memory
subsystem initialised (eg, before pci_init) to be able to access
devices (eg, before paging_init).

We get around all this on ARM by having a set of debugging routines
which are fairly primitive (printascii, printch, printhex8 etc)
which can be instrumented into the code in question as needed. These
can be written to do whatever the machine needs them to do (and
here I'm talking about the 40 or so different ARM platforms). However,
the machine has to supply enough information so that the initial page
table routines can set up the preliminary memory map in such a way that
a serial port or whatever is accessible.

One of the most useful places I've found is actually inside printk itself,
so if you do hit a fault, you get all the usual oops gubbings coming out.
I'm actually thinking about dropping out the debug routines apart from
printascii.

But yes, I'm looking at it from the developers point of view rather than
the users here.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:27 EST