Hacker News new | comments | show | ask | jobs | submit login

I recently did exactly what you describe. My first contribution to the Linux kernel actually shipped with this release. If I recall correctly it took me about 80 hours to go from no knowledge to first patch. Assuming no knowledge, it is a two step process.

(1) Learn basic OS concepts through xv6.

xv6 is a reimplementation of an early version of Unix, designed to be as simple as possible and accompanied by a whole book of commentary. Get the book and the source cost listing printed and bound: http://pdos.csail.mit.edu/6.828/2012/xv6.html. Work through the book and exercises. Use the lecture videos from 6.828 from 2011 if you need extra material in order to understand: http://pdos.csail.mit.edu/6.828/2011/schedule.html.

(2) Pick a part of OSes that you are interested in. Contribute to that part in Linux.

Figure out where that part is in the Linux kernel. Find a bug in the bug tracker and submit the patch. I found filesystems interesting, so I fixed a small bug in one of the filesystems. Use a cross reference, it will save you a lot of time: http://lxr.free-electrons.com/source/include/linux/cpu.h. Also feel free to subscribe to the Linux kernel subreddit: http://www.reddit.com/r/kernel. I've set up the sidebar with a lot of useful links.

The Linux kernel is large and complex. You need to equipe yourself with a mental model of an OS through xv6 and then pick one small, specific part to attack in Linux. Be tactical! Otherwise you will be overwhelmed.

--

As an aside, I'm actually currently working on a tool that parses the Linux source code to find symbol definitions and then works its way back through the Git history to find the commit message for when the symbol was first defined. These commit messages usually contain really useful information about the original intent of the symbol and implementation details. Currently fighting with a few bugs in my C grammar, but should be able to work through those soon. Please feel free to email me at tsally@atomicpeace.com if you want to be pinged when the tool is released.




Thanks for posting this. It was very helpful to me.


As an aside, I'm actually currently working on a tool that parses the Linux source code to find symbol definitions and then works its way back through the Git history to find the commit message for when the symbol was first defined.

Are you just doing something similar to cscope to find the definition of a symbol, then running git blame on that line? Or are you actually checking earlier revisions as well, to see if the symbol was moved or changed types?


I'm finding the definition of a symbol using a parsing expression grammar for C. I haven't yet decided upon the particular algorithm for finding the first commit, but I plan on using libgit2 to work directly with the repository. In the simplest case, you just iterate through all versions of a file and find the earliest one with the string in question. Obviously care is required when walking the repository history.


Do you know about "git log -S symbol"? It will show the first commit that defined the symbol at the bottom of the output.


Thanks for the pointer. I know I'll find the commit using libgit2, but I hadn't yet gotten to thinking about the algorithm to do so. git log -S seems like a good starting point.


I have literally no interest in doing any of that, but that's a great content-filled post. Thanks for doing so!




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: