Linux Kernel Programming for Newbies

I have been wondering lately how we can develop a team of coders — expert coders — who can take our architecture and idea designs and implement it! The problem is, I have never worked on the kernel code. I would like to start a single post here in which we can get an outline of how a newbie can start with Linux kernel programming. I would like guidelines about:

  • Any books which can be followed
  • The flow of how a newbie (with C/C++) experience can embark upon learning kernel programming
  • Tips (like the LXR) etc
Friday, August 31st, 2007 Resources

18 Comments to Linux Kernel Programming for Newbies

  1. First of all lxr is togh to configure and syill it is not the point where a newbie should take a start because looking at the code he’ll never return. Secondly I have some good books with some small projects like making an http server. Newbie should take a start here and go through the system environment without interacting with the kernel.

    After this there are two small guides which should be followed beej’s guide for network programming and system programming. The network proggraming one is simpler while the system programming requires understanding of the OS.

    Then the next natural flow should be Richard Steven’s famous books on network programming and system programming. Personally I find beej’s guide more than enough.

    I have some links to sites and have also downloaded quite alot of material from them regarding kernel programming but its not for newbies. It requires clear understanding of the underlying hardware architecture. Then what design the OS implements on top of it. What features and how. This means assembly language understanding is a must if not its coding. The coding parts can be borrowed. Thats the fun of free s/w ;-)
    Apart from this I have decided the point of action for my research and thesis and I am almost done with my design but need to formalize the specifications. You’ll love it. Its independant of all policy (somewhat) and MAC implementation. I ‘ve been thinking to start a sourceforge account as soon as it is functionable. Thats a good way of getting proper attention. I’ll be needing ur soldiers and they’ll like the kernel part of it!

    I hope Amin has been straightening his path becuase time is running out.

  2. shazkhan on August 31st, 2007
  3. Oh and try opengrok instead of lxr. It has much more functionality. With out any configuration u can index one project at a time and several with configurations. Its very easy to use and I have the tutorial.

    Everything is here and all u need is to drop by along with ur flash disk.

  4. shazkhan on August 31st, 2007
  5. Ok. One thing. This question is not for me. It’s for the soldier(s). So, you’ll have to be a bit more specific regarding the course of action. I understand the complete course of action but you’ll have to be a bit detailed about the first step.

    What should be done first. You can assume that the newbie is comfortable with C programming. Now! What should be done first? Http server?

    Also, can you please shed some light on the possibility of taking a project up for the final semester of BCS/MCS. I can probably get the project approved and then we can have the soldiers working on the said project full-time. I think I can get this web server approved as their final project. Can you tell me how complex the webserver is… the one you talked about. Gimme a detail of the features and I can discuss it here.

  6. recluze on September 1st, 2007
  7. hmm… let me know how u came to kernel programming while always not being concerned about this side… it seems a nice change anyway…

    web server project so its not that difficult… i ll suggest to first of all study http a bit (format of the get request and response) try a web client … as its functionality is limited although you wont be working on the rendering part of it… and then select certain functionalities of a web server that u can code and get to it… it wont take more than a week… i ll suggest Sheraz baig book for novice network programmers (not kernel side), it give good code examples through which u can understand things easily and quickly…

  8. TaMLeEk on September 1st, 2007
  9. Well, like I said. I’m still on the other side. It’s for potential students who might want to work on this thing. I’m dedicated to Isabelle. Nothing else for me :)

  10. recluze on September 1st, 2007
  11. It means you’ll be a joru ka ghullam too, a one women guy han!

    Ok, I am recommending something simple like a web server because they’ll get used to the linux environment. All they need at the first step is that send a request on port 80 and let a server service listen and reply. The first thing the server can do is say hi and bye to the client. Next they can choose from HTTP RFC ;-) what they should persue. Slowly and gradually they”ll make something nice. The key is starting simple and adding stuff to it.

  12. shazkhan on September 1st, 2007
  13. tell them to study beej’s net programing guide first. when they are into the rfc part they should read the beej sys programing guide. I have sent u some trainer material through email so u can make them take a start. By the they won’t be able to do much without ur help to design the s/w in a way that it can take constant changes.

  14. shazkhan on September 1st, 2007
  15. Anyone care to post a link to this ‘beej’s guide’ ?

  16. recluze on September 1st, 2007
  17. Anybody tried to google it? Both pdf and html formats will be shown in the first ten results!

    beej guide to network programming
    beej guide to system programming

  18. shazkhan on September 1st, 2007
  19. You can also make them do something like a simple remote filesystem access. A stateless file server. This means that the client request has everything and the server sends what it needs. We can skip the security checks. This is what NFS does but it has much more.

  20. shazkhan on September 1st, 2007
  21. Or maybe we can combine both to make a bigger project. That should be nice. This is getting better.

  22. recluze on September 1st, 2007
  23. I went through the material i emailed u, not too tough, it is rather easier. It is well organised and similar to other unix programming strategies. I have gained interest in it. I would love to go through it at least. If ur soldiers are interested we can work it out.

  24. shazkhan on September 1st, 2007
  25. It had modules to read disk and process info and to present it as a web page. Quite interesting!

  26. shazkhan on September 1st, 2007
  27. Yes, I’ve seen beej’s guide too. It’s not that difficult. And it’s fun to read. I’ve downloaded the network guide. I’ll see if I can find the system programming guide. I think it’s good enough to keep someone busy for at least a week. Lemme see what I can do.

  28. recluze on September 3rd, 2007
  29. I can’t find beej’s guide to _system_ programming. All queries seem to result in network programming PDF. Can you help me with this?

    I’ve got this file already:
    http://www.google.com.pk/search?q=beej+guide+to+network+programming

  30. recluze on September 3rd, 2007
  31. “Beej guide to Unix IPC” is its name. And IPC is what system programming is! Its a bit tougher then the network one but the language is as friendly as the network one. Try to find Steven’s unix system programming as chm or pdf. Its the guru’s book. I had it once but now can’t find it.

  32. shazkhan on September 3rd, 2007
  33. As far as LXR is concerned here is a link to how one can set it up. I’ve found this tool very helpful in doing kernel programming. http://tread.wordpress.com/2007/08/25/howto-setup-lxr-on-linux-ubuntu-feisty/

    Now as far as a good book, I’m currently reading
    “Linux Kernel Development” by Robert Love. I find that this book is easier to read than some of the Oreilly books on the Linux kernel though those are good resources as well.

  34. skaoth on October 9th, 2007
  35. About Linux Kernel Development by Robert Love, I think u r right because I’ve also been through it. He’s really made it as simple as possible.

    Secondly, LXR is good but I find OpenGrok a much better option becoz its easier for a newbie with a cool frontend and also a web based interface too. And u can easily index multiple sources (projects/programs) and versions.

  36. shazkhan on October 12th, 2007

Leave a comment