Where to get ubuntu source code?

What is the best way to explore Linux source code?

  • Sometimes while I'm using a built-in Linux program I get curious about what the source code looks like.  What is the best way to go about exploring it?  I'm running Ubuntu 10.10.

  • Answer:

    Once you've downloaded the source code, one way or another, I highly recommend using cscope or something like it instead of just a plain text editor.  That will allow you to skip up and down call chains quickly, and understand how the pieces relate to one another.  Start with something simple and reasonably self-contained, such as a software-only driver or higher-level networking, before you try to understand some of the more complex and interconnected bits (e.g. scheduler, mm, VFS).  It also wouldn't hurt to read one of the books about the Linux kernel, such as Robert Love's _Linux Kernel Development_.  Come to think of it, I've seen him hanging around here, so maybe he'll chime in.

Jeff Darcy at Quora Visit the source

Was this solution helpful to you?

Other answers

If you want to explore the source code of the Linux kernel, go to http://kernel.org, and download the latest stable version archive. Example : wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.4.tar.bz2 tar -xjf linux-3.1.4.tar.bz2 cd linux-3.1.4/

Baptiste Fontaine

$ cd <src-directory> $ cscope -bqR $ cscope -dp4

Doug Doan

If you have not tried http://lxr.linux.no/ try it. Entities are linked and easy to locate its definition, reference, etc. I found it really helpful to explore the code while still not get lost too fast...

Jim Xu

If your are looking for a kind of : "Linux kernel for newbies", this link is probably for you : http://kernelnewbies.org.

Christ Azika-Eros

apt-get source PACKAGENAME will give you the source of the package you are looking for.

Jonathan Jesse

I'd like suggest Robert Love's book -- Linux Kernel Development. It focus not only on code implementation but also some theoretical stuffs. I am currently reading it and I feel good.

Jianing Yang

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.