Linux Kernel Architecture

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

Working with the Source


Code


Over the years, Linux has grown from a minor hacker project to a gigantic system that effortlessly
competes with the largest and most complex software systems. As a result, developers must deal
with more than just the technical problems relating to how the kernel functions. The organization
and structure of the sources are also key issues whose importance should be not underestimated.
This appendix addresses the two most interesting questions in this context. How can the kernel
be configured so that the corresponding parts of the source can be selected not only for a given
architecture but also for a specific computer configuration? And how is the compilation process
controlled? The second question is of particular importance when the kernel is repeatedly compiled
for different configurations. Parts not involved in a configuration change obviously need not be
recompiled, and this can save a great deal of time.

Everyone concerned with the kernel sources is impressed by their sheer size. Because the prime pur-
pose of this book is to promote an understandingof the sources, this appendix examines various
methods that are best suited to browsing and analyzing the source code. These include predom-
inantly hypertext systems. This appendix also describes the options available to debug running
kernels and to provide an insight into their structures — both are useful aids to understanding. The
appendix delves into User-Mode Linux (UML), a kernel port that runs as a user process on a Linux
system and was incorporated into the official sources during the development of version 2.5. It also
discusses the debugging facilities available to analyze a kernel running on a real system — with all
the benefits of modern debuggers, including single-stepping through assembler statements.

B.1 Organization of the Kernel Sources


The source files are spread over a widely ramifiednetwork of directories to help keep track of
related kernel components. This is no easy task because it is not always clear to which category a
particular file belongs.
Free download pdf