Page 1 of 1

Linux Kernel Source

Posted: Sat Mar 10, 2007 12:12 pm
by salil_bhagurkar
I find the linux kernel source very cryptic. I can see that there are many abstractions in it. I go through the source daily finding stuff that i can understand. But in any source file i find macros and functions that have not been declared in that same file. It is an advantage to keep all commonly required macros and functions in a single header file. But i have to open 10 different files to trace all the unknown macros/functions.

I have heard people say that it is easy to understand linux kernel source. What is so easy about it. I am interested in understanding the linux kernel and would like to know whether my method of trying to understand the code is bad. What can i do to understand the kernel?

Posted: Sat Mar 10, 2007 12:37 pm
by Alboin
I'm pretty sure that the newest versions of the kernel are not that easy to understand. (There are even several books on the subject.) When they say "it's easy to understand", I think they might mean an earlier version. (0.01, 0.02, 0.91, etc.) Which are a little easier to understand.

Posted: Sat Mar 10, 2007 1:15 pm
by ~
When they say that "it's easy to understand", then you should ask back "then, how does [some code in some file/s] get to [do such thing]?".

Or "then, how do I get to understand macros that are spread among so many files?"

If they give some valious pointers that actually make you advance, then you can say that they are being sincere when they say it's easy and takes up some more knowledge; but if they tell you "it's easy but I have no time at all" and not even give you an extremely brief practical pointer, then it's most likely that either they are playing with you or don't want to share.

I firmly believe, and I think it's clearly visible, that the Linux kernel as well as virtually any other open source project has not been thought to be understood by newbies, but only best for those who live around its development. VERY probably they have done it to keep some exclusivity and have developed methods to make hard-to-read code but since they developed that programming style it's easy for them.

Even it it's made by millions of people, I don't see how it couldn't be more clearly code and do the same things or even better.

Keep making them the questions you post here to them, so you can have more chances to get valid answers from the true ones.

Posted: Sat Mar 10, 2007 1:33 pm
by muisei
Somewhere I'v read that you need a source code browser to read the code, but I can't remember the names of those browsers.My suggestion is to do some searching in google for such browsers.

Posted: Sat Mar 10, 2007 2:14 pm
by gaf
salil_bhagurkar wrote:I have heard people say that it is easy to understand linux kernel source
You're entirely sure that they said linux and not minix ?
muisei wrote:Somewhere I'v read that you need a source code browser to read the code, but I can't remember the names of those browsers
Browsing the source online might help resolving the dependencies as links to other files are automatically provided

regards,
gaf

Posted: Sat Mar 10, 2007 3:13 pm
by muisei
The online sources are not so comfortable to read.One can easily get lost while clicking on the references.I was talking about programs which run on your PC .They search the code faster and can offer a lot of advantages for easier browsing.

Posted: Sun Mar 11, 2007 9:59 am
by salil_bhagurkar
They make hard-to-read code? Thats news for me... I think i feel a bit comfortable about my problem and yes i will search for programs that allow me to browse the code easily... That will surely make a difference...