Chapter 2: Process Management and Scheduling
❑ Thetext segmentcontains the executable code of the program.start_codeandend_code
specify the area in address space where the segment resides.
❑ The pre-initialized data (variables supplied with a specific value at compilation time) are
located betweenstart_dataandend_dataand are mapped from the corresponding seg-
ment of the executable file.
❑ Theheapused for dynamic memory allocation is placed in virtual address space;start_brk
andbrkspecify its boundaries.
❑ The position of the stack is defined bystart_stack; the stack grows downward automati-
cally on nearly all machines. The only exception is currently PA-Risc. The inverse direction
of stack growth must be noted by the architecture by setting the configuration symbol
STACK_GROWSUP.
❑ The program arguments and the environment are mapped into the virtual address space
and are located betweenarg_startandarg_endandenv_startandenv_end,respec-
tively.
❑ The instruction pointer of the process and some other architecture-specific registers are set so
that the main function of the program is executed when the scheduler selects the process.
How the ELF format populates the virtual address space will be discussed in more detail in Section 4.2.1.
Table 2-2: Binary Formats Supported by Linux.
Name Meaning
flat_format The flat format is used on embedded CPUs without a memory manage-
ment unit (MMU). To save space, the data in the executable can also be
compressed (if zlib support is available in the kernel).
script_format This is a dummy format used to run scripts using the she-bang mechanism.
By looking at the first line of the file, the kernel knows which interpreter to
use and starts the appropriate application (e.g., Perl for#! /usr/bin/perl).
misc_format This is also a dummy format used to start applications requiring an external
interpreter. In contrast to the#!mechanism, the interpreter need not be
specified explicitly but is determined by reference to special file identifiers
(suffix, header, etc.). This format is used, for example, to execute Java byte
code or to run Windows programs withWine.
elf_format This is a machine- and architecture-independent format for 32 and 64 bits.
It is the standard format under Linux.
elf_fdpic_format ELF format with special features for systems without an MMU.
irix_format ELF format with Irix-specific features.
som_format HP-UX-specific format used on PA-Risc machines.
aout_format a.out is the former standard format for Linux used before ELF was intro-
duced. It is rarely used today because it is too inflexible.