Process Segments
A process (executing program) has text, data and system data segments. A process's address space consists of the text and data segments. The system data segment is part of the process but is maintained by the system and is accessible by the process only via system calls.
 
Text/Instruction Segment
The text segment consists of program code. It is read-only and is initialized from the program executable file.
 
User Data Segment
 
System Data Segment
This is the u or user area consisting of, among other things: The system maintains a second data structure for each process, the proc structure, which technically is not part of the system data segment, and consists of info needed even if the process is not running. It includes: The system/kernel is actually implemented with several apparent processes. PID 1 is init which handles login and is the ancestor of most processes. PID 0 is the scheduler and PID 2 is the memory pager. Despite appearances PID 0 and PID 2 are usually the same process, the kernel, however, most modern kernels will have many separate threads of control running in it.

Some additional data maintained in the kernel includes:

  • Open files (``v-nodes''). This structure describes the open file:
    type,
    pointers to functions acting on the file,
    i-node (owner, size, etc.), and
    pointer to data blocks. The environment is nowhere here. It is created and passed between processes by exec*( ) and fork( ). It exists solely on the stack.

    Note this is a guide only and the actual implementation can vary. For example, open file tables and file descriptor tables need not be implemented as arrays.

    Last update: 2001 January 1