operating-systems

Definition

Process Creation

Process creation is the procedure by which a new process is added to the system. During this phase, the operating system allocates a unique PID, initialises a PCB, and allocates the necessary memory and resources.

Triggers

A process can be created for several reasons:

  • System Initialisation: When the OS boots, several background processes (daemons) are started.
  • User Login: When a user logs in (e.g., via shell or GUI), a session process is created.
  • Execution of a User Command: Starting an application like a text processor or browser.
  • Process Spawning: An existing process creates a new one to perform a sub-task (forming a Process Hierarchy).

Creation Steps

  1. Assign PID: The OS finds an available slot in the Process Table.
  2. Allocate Space: Memory segments (Text, Data, Stack) are allocated.
  3. Initialise PCB: The state is set to “New” or “Ready,” and registers are initialised.
  4. Linkage: The process is linked to its parent and admitted to the ready queue.