Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp02.tex V2 - 09/04/2008 6:09pm Page 1143

Appendix B: Working with the Source Code


❑ crypto/contains the files of the crypto layer (which is not discussed in this book). It includes
implementations of various ciphers that are needed primarily to support IPSec (encrypted IP
connection).
❑ Thesecurity/directory is used for security frameworks and key management for cryptogra-
phy. For kernel 2. 6 .24, it contains only the SELinux security framework,^1 but kernel 2. 6 .25, which
was still under development at the time of this writing, will also contain the SMACK framework.
❑ Documentation/contains numerous text files to document various aspects of the kernel. How-
ever, some of this information is very old (documenting software is not the favorite pastime of
kernel developers).
❑ arch/holds all architecture-specific files, both include files and C and Assembler sources.
There is a separate subdirectory for each processor architecture supported by the kernel. The
architecture-specific directories differ only slightly and are similar to the top-level directory of
the kernel in that they include subdirectories such asarch/mm/,arch/kernel,andsoon.
❑ scripts/contains all scripts and utilities needed to compile the kernel or to perform other useful
tasks.

The source size distribution among the various kernel components is illustrated in Figure B-1.

Initialization
IPC
Block Layer
Security Framework
Library Functions
Cryptographic Routines
Memory Management
Scripts
Core Kernel
Documentation
Sound Drivers

Networking Namespaces


Filesystems
Header Files
Architecture-Specific Code
Device Drivers
0 20 40 60 80 100 120 140
Size [MiB]
Figure B-1: Distribution of code sizes among components found in the top-level directory of kernel
2.6.24.

(^1) SELinux extends the classic DAC (discretionary access control) rights model of the kernel to include role-based access control options,
MAC (mandatory access control) and MLS (multilevel security). These special topics aren’t discussed here because their implementa-
tion is lengthy, the underlying concept is complex, and the options are available in only a small number of Linux distributions.

Free download pdf