Hi eric,

I once wrote Andrea Arcangeli on how to start kernel hacking. 
Basically he told me to start by reading the code.

And looking at the current linux-kernel group, it would seem that
they follow the "IBM" method of solving bugs...that is to read the
code, understand what's happening and then make a fix. Quite well
and good, if you wrote the code...  There is another method which I
call the "Microsoft" method; it assumes that you don't have to know
how the whole system works, just use a debugger to localize the
problem and then analyze the state (variables, flow, etc.) to fix the 
problem. I think there must be a need for both styles to fix a system.

Anyway, the biggest problem with debugging a kernel is concurrency.
The kernel is not just one program with a single entry/exit point;
it is constantly juggling a lot of running processes. Setting a
breakpoint (to check the state of your new code) would cause a 
lot of processes to stop (i.e. no mouse response since the mouse 
input cannot be processed, etc.)

But there has been some efforts to allow for safe debugging:

  - kgdb patches for the kernel
       - http://lwn.net/2000/0914/a/ko-debugger.php3
       - http://oss.sgi.com/projects/kgdb/
    The idea here is to patch the "live" kernel for GDB.
    This enables you to set breakpoints and do step-tracing over
    the code. This works best if you run GDB on another machine
    and it connects to the target machine via a serial link.
    This is also similar to the NuMega Remote Debugger or
    TurboDebugger for Microsoft Windows.

  - User Mode Kernel
       - http://user-mode-linux.sourceforge.net/
    This allows you to create your own "vmlinux" program
    that runs in user-mode (just like any other program).
    It should allow you to gdb with no problems (I think)

I would like to get:
  - Understanding the Linux Kernel, O'Reilly 2000
  - Linux Device Drivers, 2nd Ed. O'Reilly 2001
  - UNIX Systems For Modern Architectures, Addison-Wesley, 1994
      - outdated but great intro on SMP concepts such as spinlocks

Of course, I also would like to hear actual kernel-hackers debug
the code...

Ambo

eric pareja wrote:
> 
> Hello Juan et Alice,
> 
> I'm curious who on the list is into serious kernel hacking, or even just
> interested in working on parts of the kernel? I know there are
> existing mailing lists elsewhere that deal with the kernel, but the
> traffic is sometimes way too heavy. If there's an interest, maybe we can
> have a small list for discussions amongst Filipinos who want to get a grip
> of Linux kernel internals and perhaps do a little work on it?
> 
> As an aside, I'm scouting around for the Coriolis book on the Linux kernel
> with commentary. The last time I saw it was at Macromind in Megamall but
> it was quickly sold out, the next time I visited, they no longer had
> copies.
> 
> xen
> 
> ___ eric pareja ([EMAIL PROTECTED]) ~-=[O]=-~ Here, have a clue. Get the picture.
> \@/ PGP key at http://gra.ph/~xenos/xenos.pgp <|PLUG|> http://gra.ph
>  v  "Even the smallest person can change the course of the future."
>     - Lady Galadriel in J.R.R. Tolkien's "The Lord of the Rings"
> 
> _
> Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
> To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
> 
> To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
>[EMAIL PROTECTED]
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to