Where to find the kernel source

All of the source code for the Linux kernel can be found on one of the kernel.org sites, a worldwide network of servers that mirror the Linux source code, enabling everyone to find a local server close to him. This allows the main kernel servers to be responsive to the mirror sites, and lets users download the needed files as quickly as possible.

The main http://www.kernel.org. site shows all of the current kernel versions for the various different kernel trees, as shown in Figure 3-2.

The main kernel.org web site

Figure 3-2. The main kernel.org web site

To download the latest stable kernel version, click on the F character on the line for the kernel version. This will download the full source tree. Or you can navigate to the proper subdirectory for all of the 2.6 kernel versions, http://www.us.kernel.org/pub/linux/kernel/v2.6/, shown in Figure 3-3.

The 2.6 kernel source directory

Figure 3-3. The 2.6 kernel source directory

It is also possible to download the kernel source from the command line, using the wget or curl utilities, both of which should come with your Linux distribution.

To download the 2.6.17.8 kernel version using wget, enter:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.8.tar.gz --17:44:55-- http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.8.tar.gz => `linux-2.6.17.8.tar.gz' ...

Get Linux Kernel in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.