Definition
Process Image
A process image is the physical manifestation of a process in the system’s memory. It consists of all the data, code, and control information necessary for the operating system to manage and execute that process.
Structure
The process image is an aggregate of several memory segments:
- User Program (Code (Programming)): The static machine code instructions to be executed by the processor.
- User Data: Global variables, constants, and dynamic memory (heap) used during program execution.
- User Stack: A LIFO structure used for function calls and local variables in user mode.
- Kernel Stack: A separate stack used when the process executes in kernel mode (e.g., during system calls).
- Process Control Block (PCB): The data structure holding the process context, including its state and registers.
Location and Access
The Code, Data, and User Stack segments are usually located in user space. The PCB and the Kernel Stack reside in kernel space, protected from direct modification by user processes. This separation allows the OS to safely perform a context switch by saving the current hardware state into the PCB and loading a new image.