>_
EngineeringNotes
← Back to OS Internals
Chapter 05

Process Management

Understanding how programs transform into living processes, their memory architecture, and the lifecycle of computation.

01

The Soul of Execution

What is a Program?

A Program is simply compiled code sitting on a disk, ready to execute. It is a passive entity.

What is a Process?

A Process is a program under execution. It is active, loaded in main memory, and using CPU resources.

Converting Program to Process

01
Memory Loading

Load the program and its static data into Main Memory (RAM).

02
Stack Allocation

Allocate a run-time Stack. Used for local variables, function arguments, and return values.

03
Heap Allocation

Allocate a Heap for dynamic memory (e.g., malloc in C, new in Java).

04
PCB Setup

Set up the Process Control Block (PCB) to store metadata like PID and registers.

05
I/O Descriptors

Initialize standardized descriptors: i/p (taking input), o/p (showing output), and Error Handling.

06
Final Handoff

OS handoffs control to main() or JVM. Program Counter is set to the entry point.

02

Attributes & Process Table

Process Table

A centralized data structure where the OS tracks every active process. Think of it as the "Register" for living code.

  • Each entry in this table is a PCB.
  • Enables OS search/management of specific PIDs.
Attributes

These are features that allow the OS to identify and manage each process uniquely:

Unique PID
Owner/User
Priority
Resources Used
Memory Map
Parent PID