Re: how to learn kernel programming

David Woodhouse (Dave@imladris.demon.co.uk)
Fri, 23 Jan 1998 03:40:37 +0000


> > I consider myself fairly competent C(++) programmer. What is a good
> > source of info on kernel and low-level programming? So many books these
> > days are written so you can print "hello world" in a MS window, not how
> > to swap pages of vm. I do not believe reading the source will help
> > much, I am more of a book learner.
>
> Böhme et.al, Linux Kernel Programming, Addison Wesley 1998 (3rd(?) edition)
>
> Regards,
> Martin

Beware, however, that any book is going to be fairly out of date in a number
of areas. Be prepared to refer to the source at frequent intervals.
I usually tell people that their first port of call should be the source code,
then myself, then this list.

The books can be very useful if you are new to the style and layout of the
Linux kernel, or of such low level code in general, but remember to take the
precise definitions of structures etc. with a pinch of salt.

As an aside, I tend to find that I learn virtually nothing from sitting down
and reading source code. I do, however, learn a great deal by tracing source
code in an attempt to examine a particular execution path in detail.

I would recommend a newcomer to the scene to start, as you would with a new
programming language, with a "hello world" program (or module, in this case),
and work your way up. Think of something trivial which you want to change or
implement, and you'll be amazed at how much you learn about the kernel
structure when looking for particular pieces of code in it.

Also, don't be afraid to ask for help - people on this list are almost always
prepared to answer questions if you seem to have made a genuine attempt to
find the answer. It's often quicker to get a response back from the list than
it is to answer your own question.

Happy Hacking.

-- 
----                              ----                              ----
David Woodhouse, Robinson College, CB3 9AN, England.   (+44) 0976 658355
    Dave@imladris.demon.co.uk        http://dwmw2.robinson.cam.ac.uk
	    finger pgp@dwmw2.robinson.cam.ac.uk for PGP key.