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:

    A designer who is not also a couturier, who hasn’t learned the most refined mysteries of physically creating his models, is like a sculptor who gives his drawings to another man, an artisan, to accomplish. For him the truncated process of creating will always be an interrupted act of love, and his style will bear the shame of it, the impoverishment.
    Yves Saint Laurent (b. 1936)

    If you address a ghost as “Thing!”
    Or strike him with a hatchet,
    He is permitted by the King
    To drop all formal parleying—
    And then you’re sure to catch it!
    Lewis Carroll [Charles Lutwidge Dodgson] (1832–1898)

    The flattering, if arbitrary, label, First Lady of the Theatre, takes its toll. The demands are great, not only in energy but eventually in dramatic focus. It is difficult, if not impossible, for a star to occupy an inch of space without bursting seams, cramping everyone else’s style and unbalancing a play. No matter how self-effacing a famous player may be, he makes an entrance as a casual neighbor and the audience interest shifts to the house next door.
    Helen Hayes (1900–1993)