Fork (operating System) - Process Address Space

Process Address Space

Whenever an executable file is executed, it becomes a process. An executable file contains binary code grouped into a number of blocks called segments. Each segment is used for storing a particular type of data. A few segment names of a typical ELF executable file are listed below.

  • text — Segment containing executable code
  • .bss — Segment containing data initialized to zero
  • data — Segment containing initialized data
  • symtab — Segment containing the program symbols (e.g., function name, variable names, etc.)
  • interp — Segment containing the name of the interpreter to be used

The readelf command can provide further details of the ELF file. When such a file is loaded in the memory for execution, the segments are loaded in memory. It is not necessary for the entire executable to be loaded in contiguous memory locations. Memory is divided into equal sized partitions called pages (typically 4KB). Hence when the executable is loaded in the memory, different parts of the executable are placed in different pages (which might not be contiguous). Consider an ELF executable file of size 10K. If the page size supported by the OS is 4K, then the file will be split into three pieces (also called frames) of size 4K, 4K, and 2K respectively. These three frames will be accommodated in any three free pages in memory.

Read more about this topic:  Fork (operating System)

Famous quotes containing the words process, address and/or space:

    We tend to be so bombarded with information, and we move so quickly, that there’s a tendency to treat everything on the surface level and process things quickly. This is antithetical to the kind of openness and perception you have to have to be receptive to poetry. ... poetry seems to exist in a parallel universe outside daily life in America.
    Rita Dove (b. 1952)

    It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. We address ourselves, not to their humanity but to their self-love, and never talk to them of our necessities but of their advantages.
    Adam Smith (1723–1790)

    Sir Walter Raleigh might well be studied, if only for the excellence of his style, for he is remarkable in the midst of so many masters. There is a natural emphasis in his style, like a man’s tread, and a breathing space between the sentences, which the best of modern writing does not furnish. His chapters are like English parks, or say rather like a Western forest, where the larger growth keeps down the underwood, and one may ride on horseback through the openings.
    Henry David Thoreau (1817–1862)