The Linux Programming Interface

(nextflipdebug5) #1

1424 Appendix E


z http://www.kernelnewbies.org/, Linux Kernel Newbies, is a starting point for pro-
grammers who want to learn about and modify the Linux kernel.
z http://lxr.linux.no/linux/, Linux Cross-reference, provides browser access to vari-
ous versions of the Linux kernel source code. Each identifier in a source file is
hyperlinked to make it easy to find the definition and uses of that identifier.

The kernel source code
If none of the preceding sources answer our questions, or if we want to confirm that
documented information is true, then we can read the kernel source code. Although
parts of the source code can be difficult to understand, reading the code of a particu-
lar system call in the Linux kernel source (or a library function in the GNU C library
source) can often prove to be a surprisingly quick way to find the answer to a question.
If the Linux kernel source code has been installed on the system, it can usually
be found in the directory /usr/src/linux. Table E-1 provides summary information
about some of the subdirectories under this directory.

Table E-1: Subdirectories in the Linux kernel source tree

Directory Contents
Documentation Documentation of various aspects of the kernel
arch Architecture-specific code, organized into subdirectories—for example,
alpha, arm, ia64, sparc, and x86
drivers Code for device drivers
fs File system–specific code, organized into subdirectories—for example,
btrfs, ext4, proc (the /proc file system), and vfat
include Header files needed by kernel code
init Initialization code for the kernel
ipc Code for System V IPC and POSIX message queues
kernel Code related to processes, program execution, kernel modules, signals,
time, and timers
lib General-purpose functions used by various parts of the kernel
mm Memory-management code
net Networking code (TCP/IP, UNIX and Internet domain sockets)
scripts Scripts to configure and build the kernel
Free download pdf