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 process in the weather of the world
    Turns ghost to ghost; each mothered child
    Sits in their double shade.
    A process blows the moon into the sun,
    Pulls down the shabby curtains of the skin;
    And the heart gives up its dead.
    Dylan Thomas (1914–1953)

    The English, the plain English, of the politest address of a gentleman to a lady is, “I am now, dear Madam, your humble servant: Pray be so good as to let me be your Lord and Master.”
    Samuel Richardson (1689–1761)

    I would have broke mine eye-strings, cracked them, but
    To look upon him, till the diminution
    Of space had pointed him sharp as my needle;
    Nay, followed him till he had melted from
    The smallness of a gnat to air, and then
    Have turned mine eye and wept.
    William Shakespeare (1564–1616)