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:

    You can read the best experts on child care. You can listen to those who have been there. You can take a whole childbirth and child-care course without missing a lesson. But you won’t really know a thing about yourselves and each other as parents, or your baby as a child, until you have her in your arms. That’s the moment when the lifelong process of bringing up a child into the fold of the family begins.
    Stella Chess (20th century)

    Death is hacking away at my address book and party lists.
    Mason Cooley (b. 1927)

    But alas! I never could keep a promise. I do not blame myself for this weakness, because the fault must lie in my physical organization. It is likely that such a very liberal amount of space was given to the organ which enables me to make promises, that the organ which should enable me to keep them was crowded out. But I grieve not. I like no half-way things. I had rather have one faculty nobly developed than two faculties of mere ordinary capacity.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)