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
18 Comments to Linux Kernel Programming for Newbies
Leave a comment
Search
Recent Comments
- Khushal Khan on Dynamic Behavioral Attestation for Mobile Platforms
- Dynamic Behavioral Attestation for Mobile Platforms - Project « recluze on DBAMP
- shazkhan on Backing up OpenMoko FR before bricking it and getting your custom kernel and rootfs onto it …
- shazkhan on Getting Java on Openmoko
- shazkhan on A Standardized .bib File
Archives
- January 2009 (1)
- December 2008 (1)
- November 2008 (7)
- October 2008 (4)
- September 2008 (2)
- August 2008 (4)
- July 2008 (1)
- June 2008 (5)
- January 2008 (5)
- December 2007 (5)
- November 2007 (5)
- October 2007 (3)
- September 2007 (6)
- August 2007 (14)
- July 2007 (25)
- June 2007 (24)
- May 2007 (33)
- April 2007 (70)
Categories
- Achievements (7)
- Announcements (17)
- Blogroll (1)
- Conferences (11)
- Formal Methods (8)
- Ideas (11)
- Isabelle (6)
- Linux (18)
- News (28)
- Publications (1)
- Resources (31)
- SELinux (10)
- Trusted Computing (11)
- Uncategorized (106)
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.
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.
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.
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…
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
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.
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.
Anyone care to post a link to this ‘beej’s guide’ ?
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
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.
Or maybe we can combine both to make a bigger project. That should be nice. This is getting better.
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.
It had modules to read disk and process info and to present it as a web page. Quite interesting!
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.
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
“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.
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.
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.