Linux Kernel Source

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Linux Kernel Source

Post 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?
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Post 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.
User avatar
muisei
Member
Member
Posts: 79
Joined: Sat Sep 23, 2006 2:10 pm
Location: Bulgaria
Contact:

Post 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.
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Post 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
User avatar
muisei
Member
Member
Posts: 79
Joined: Sat Sep 23, 2006 2:10 pm
Location: Bulgaria
Contact:

Post 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.
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Post 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...
Post Reply