Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Debugging the FreeBSD Kernel Transparently

Posted by kdawson on Sun Mar 11, 2007 07:33 PM
from the deep-juju dept.
An anonymous reader writes "To debug the FreeBSD kernel core dump efficiently, it is best to set up a remote debugging session between a development machine and the target machine, and remotely debug the kernel using serial communication. This article shows you how you can debug as many kernel images as you want; it becomes transparent to users once debugging starts, and your system's performance is not affected at all."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Surely... (Score:5, Funny)

    by BluhDeBluh (805090) on Sunday March 11 2007, @07:35PM (#18311398)
    If this news day gets any slower it's just going to just stop.
    • Re:Surely... by MattPat (Score:1) Sunday March 11 2007, @08:00PM
      • Re:Surely... by pembo13 (Score:2) Sunday March 11 2007, @10:25PM
      • 1 reply beneath your current threshold.
    • Re:Surely... by mrbluze (Score:1) Sunday March 11 2007, @08:15PM
    • Re:Surely... by lord_sarpedon (Score:1) Monday March 12 2007, @01:27AM
    • Re:Surely... by Brandybuck (Score:2) Sunday March 11 2007, @10:37PM
    • 1 reply beneath your current threshold.
  • by concernedadmin (1054160) on Sunday March 11 2007, @07:41PM (#18311430)
    Hehe, good to see others saw this as an influential story of the day.
    However, I have a question that perhaps others can answer.
    What does the diagram actually work out?
    Listing 1. 25-Pin NULL modem cabling

    2 3 Transmit Data
    3 2 Receive Data
    4 5 Request to Send
    5 4 Clear to Send
    6 20 Data Set Ready and Carrier Detect
    7 7 Signal Ground
    20 6 Data Terminal Ready

    What does that mean? I thought serial -> serial is merely a connection. Do I have to solder something?

    Regards
  • gdb remote is useful (Score:3, Interesting)

    by EmbeddedJanitor (597831) on Sunday March 11 2007, @07:54PM (#18311498)
    This is a very cool feature in gdb that is very commonly used to debug various embedded systems etc. Sometimes gdb remote uses a serial port or tcp from the host to a stub running in the target (as is the case with Redboot).

    Also, gdb remote is often used to talk to a server that mimics a gdb remote stub and then turns the commands into some other connection into the target (eg. a JTAG debugger).

    All up, this makes debugging embedded systems a lot simpler than it would otherwise be.

  • Stop pissing about (Score:3, Interesting)

    by DrSkwid (118965) on Sunday March 11 2007, @08:10PM (#18311592)
    (http://www.milksucks.com/ | Last Journal: Monday September 15 2003, @12:30PM)
    Get yourselves a system, with a proper debugger [bell-labs.com]
    • 1 reply beneath your current threshold.
  • debugging kernels (Score:3, Funny)

    by digitalderbs (718388) on Sunday March 11 2007, @08:16PM (#18311626)

    This article shows you how you can debug as many kernel images as you want
    including zero.
  • Unfortunately (Score:3, Funny)

    by edderly (549951) on Sunday March 11 2007, @08:47PM (#18311784)
    Jayesh V. Rane works as a Systems Software Engineer for IBM and has five years of experience in product development, mostly working on network programming and storage management software. He has worked extensively on FreeBSD and AIX operating systems. Jayesh is currently working with the IBM India Systems and Technology Lab in Pune, India. You can contact him at jayesh.rane@in.ibm.com. Unfortunately Jayesh doesn't understand that compiling your kernel with -g will in fact affect the systems performance and is currently looking for a job where he can pretend to be a kernel engineer. Contact Jayesh at jayesh.rane@aol.com
  • Wyse terminals work well for this. (Score:3, Interesting)

    by Anonymous Coward on Sunday March 11 2007, @09:58PM (#18312092)
    About 5 years ago I used an old Wyse terminal [wyse.com] I got at a junkyard for exactly this job using a homemade cable, it worked beautifully. Once complete I then used the terminal to control and update the server from the living room couch.

    I also used the same terminal and SoftIce to *ahem* "debug" several windows applications.

    Wyse terminals (at least the older ones) are excellent gear, very sturdy, nice keyboards, though the monochrome monitor was a bit burnt in on the one I used. An industrial strength terminal for a rock solid OS. A match made in heaven. FreeBSD is an excellent OS.

  • by istartedi (132515) on Sunday March 11 2007, @10:48PM (#18312332)
    (Last Journal: Thursday April 18 2002, @07:50PM)

    Something tells me that if the kernel has dumped core and dropped down into a debugger, the users are going to notice something. Just a hunch.

  • It was a dark day for Linux (Score:2, Interesting)

    by Chatz (8725) on Sunday March 11 2007, @11:03PM (#18312446)

    It was a dark day for Linux when Linus said he didn't believe in kernel debuggers.

    Last time I had a good look at what was on offer while developing a filesystem for multiple operating systems, I compared the tools for Linux to Windows, MacOSX, IRIX and Solaris.

    Windows was clearly the best for remote kernel debugging with windbg and I don't see that changing anytime soon. A fully fledged debugger, automatic download of kernel symbols from Microsoft and your own repository, reliable capture of dumps etc. That and the API documentation made the black box nature of the O/S a much smaller issue than the open source community would like us to believe. I was always so much more confident if we had a crash due to our software at a customer site that with Windows we had the best chance of capturing and hopefully identifying the problem.

    For live debugging IRIX was the best with icrash. Its port to Linux, lcrash, was not as good and reliable at the time, maybe its better now but the lack of symbol files it need on Linux always made it frustrating. And now IRIX is dead.

    I've heard some really good things about dtrace, so Solaris and Mac look to have the best live debugging and tracing tool there is today...I see some progress on Linux ports [sun.com] which is great to see.

    But when it comes to kernel debugging on Linux, the picture is still bleak.

  • quantum (Score:1)

    by null-sRc (593143) on Monday March 12 2007, @10:11AM (#18316771)
    maybe the mere act of viewing the event will change it... is debugging ultimately futile?
    • Re:quantum by nuzak (Score:2) Monday March 12 2007, @12:25PM
  • Re:Who cares? (Score:1)

    by King tweak (881610) on Sunday March 11 2007, @08:56PM (#18311840)
    Go away to another land and find your fortune cookie u kinky kernel.
    [ Parent ]
  • Re:DDB (Score:2)

    by Eivind Eklund (5161) on Monday March 12 2007, @08:16AM (#18315217)
    (Last Journal: Friday October 08 2004, @04:53AM)
    DDB is in FreeBSD, too, since always. In fact, DDB was ported from Mach to 386BSD, which predates the FreeBSD/NetBSD split / diverge, which again predates the NetBSD/OpenBSD split.

    Eivind.

    [ Parent ]
  • 10 replies beneath your current threshold.