next up previous contents
Next: Where to Start Looking Up: The Linux Kernel Sources Previous: Where to Get The

How The Kernel Sources Are Arranged

At the very top level of the source tree /usr/src/linux you will see a number of directories:

arch
The arch subdirectory contains all of the architecture specific kernel code. It has further subdirectories, one per supported architecture, for example i386 and alpha.
include
The include subdirectory contains most of the include files needed to build the kernel code. It too has further subdirectories including one for every architecture supported. The /include/asm subdirectory is a soft link to the real include directory needed for this architecture, for example /include/asm-i386. To change architectures you need to edit the kernel makefile and rerun the Linux kernel configuration program.
init
This directory contains the initialization code for the kernel and it is a very good place to start looking at how the kernel works.
mm
This directory contains all of the memory management code. The architecture specific memory management code lives down in /arch/*/mm/, for example /arch/i386/mm/fault.c.
drivers
All of the system's device drivers live in this directory. They are further sub-divided into classes of device driver, for example block.
ipc
This directory contains the kernels inter-process communications code.
modules
This is simply a directory used to hold built modules.
fs
All of the file system code. This is further sub-divided into directories, one per supported file system, for example vfat and ext2.
kernel
The main kernel code. Again, the architecture specific kernel code is in /arch/*/kernel.
net
The kernel's networking code.
lib
This directory contains the kernel's library code. The architecture specific library code can be found in /arch/*/lib/.
scripts
This directory contains the scripts (for example awk  and tk  scripts) that are used when the kernel is configured.



David A. Rusling
david.rusling@reo.mts.dec.com