Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer app04.tex V1 - 09/04/2008 6:12pm Page 1226

Appendix D: System Startup


management. The bulk of the initialization work — setting up the central data structures of the various
kernel subsystems — is performed instart_kernelonce the command-line arguments passed to
the kernel at startup have been interpreted. This is a very comprehensive task because it involves
practically all subsystems. It is therefore broken down into a large number of short procedures, which
are described in the subsequent sections. The final step is to generate the idle process that the kernel calls
when it has absolutely nothing else to do. Theinitprocess is also started with PID 1 — this runs the
initialization routines of various subsystems and then starts/sbin/initas the first user space process.
This concludes kernel-side initialization.

Display version banner

Architecture-specfic, high-level setup for memory management

Evaluate command-line arguments

Initialize core data structures of most subsystems

Determine processor and system errors

Start idle process and init thread

start_kernel

Figure D-1: Code flow diagram forstart_kernel.

Architecture-SpecificSetup


As its name clearly suggests,setup_archis an architecture-specific function. It performs setup tasks writ-
ten in C and concerns itself primarily with the initialization of various aspects of memory management.
For example, on most systems, it finalizes enabling of paging and sets up suitable data structures for ker-
nel mode. On some architectures with several variants (IA-64 and Alpha, for example), variant-specific
setup is performed at this point.

For simplicity’s sake, this section examines only the implementation ofsetup_archfor IA-32 systems as
toucheduponbrieflyinChapter3.FigureD-2shows the corresponding code flow diagram.

Determine position of kernel in memory

setup_arch

parse_early_param

setup_memory

paging_init

Figure D-2: Code flow diagram
forsetup_archon IA-32 systems.
Free download pdf