lkml.org 
[lkml]   [1998]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Kernel debugger anyone?
From
Date
Keith Owens <kaos@ocs.com.au> writes:

> On Thu, 11 Jun 1998 13:08:19 +1000 (EST),
> David Burrows <snadge@gemcorp.com.au> wrote:
> >I'm just wondering about the inclusion of a real kernel debugger.. I was
> >playing around with NetBSD on my Dec VAXStation 3100, and the kernel
> >crashed, and up popped a nice debugging prompt. Is there some reason that
> >Linux doesn't do this?
>
> ftp://ftp.ocs.com.au/pub/patch-ikd-2.1.105.gz. The real problem with
> the current approach is that it relies totally on the kernel to debug
> the kernel. So if the kernel is totally dead, you cannot debug it.
> Makes me wish for the multi-ring hardware model, run kernel at ring 1,
> debugger at ring 0. No chance on x86.

Actually recent x86 (pII etc) have this. It is called the System Management
Mode, but generally hard to use above BIOS level (because the BIOS already
uses it to handle stuff like the ATX soft power off). There is a standard
API for it too (ACPI), but it is mostly intended for power-saving
("APM on stereoids"). SMM uses special protected memory that cannot even
accessed by the kernel.

But there are simpler ways:

Add a low level serial driver (that does not depend on the regular one) to
the kgdb stub. I think David Grote's kgdb stub for 2.0 does this. Then the
kernel can be debugged with gdb running on a second box (this means deadlocks
are more unlikely).

Wire the kgdb stub to the NMI. The NMI can be simply triggered by a pin
on the ISA bus, so control could be passed all the time to the KGDB stub.


-Andi (who wishes the standard i386 kernel had kgdb hooks, because he's
sick of patching all the time)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.046 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site