The kernel tree layout might seem a little bit chaotic. It is heavily influenced by kernel evolution in the past years, namely that Linux has been designed as an Intel-only operating system and then other ports have been added.
initdirectory contains generic kernel initialization, whenever you want to find the order in which some things are initialized, it is best to look at
start_kernelroutine. This directory is also a place to look for parsing kernel arguments, how is init process spawned etc.
kerneldirectory contains kernel scheduler, generic system call implementations and generic signal handling. System calls code is usually in routines sys_systemcallname, in some cases do_systemcallname (in that case some argument processing is done by architecture dependent wrapper in platform specific code and that code calls the body do_systemcallname routine.
mmdirectory contains generic kernel memory management code, page cache, memory and page allocator.
libdirectory contains a set of most commonly used libc routines which can then be used in the kernel. Most of these routines are overrided in platform dependant directories and headers.
ipcdirectory contains SYSV IPC code, the
scriptsdirectory utilities used during kernel build.
fsdirectory contains code for supported filesystems (every filesystem has a separated subdirectory in this tree), buffer cache and generic filesystem oriented system calls (like open, read etc.). Buffer cache and system call code is located directly in the
fs/nfsdcontains source for kernel NFS daemon.
driversdirectory is the largest one in the kernel. Unfortunately, it is not very well laid out, so there is a huge mess of drivers in this subtree. Some drivers are grouped by platform they are written for (
sgi), some by the type of the drivers (
charfor character devices,
blockfor block devices,
scsifor scsi drivers,
netfor network adapter drivers (excluding isdn, which has a separate subdirectory
videofor fbcon type of console drivers (other console drivers are spread into
archdirectory hold architecture dependant code. For every platform, you'll find there architecture specific Makefile, configuration script and platform specific counterparts of
includedirectory contains header files, in subdirectories
scsiplatform independant and in
asm-*platform specific header files. Note, the asm in the name of platform specific directories is a historical cruft from the time when
linuxsubdirectory contained C includes and
asmcontained assembly includes. Current
asmsubdirectories contain both assembly and C includes. For all
includeheader files, always keep in mind that they are visible to non-kernel code as well, so one has always to decide what values to "export" to userland and what to keep as kernel implementation secrets. The
Documentationdirectory has been recently created to collect the README files which were floating among the whole kernel tree. It is also a place where to look for
Configure.help, a text file containing help messages for configurable kernel options.