Short Description
These notes are derived from Chapter 3 of the course material based on the textbook Operating Systems Concepts. This chapter introduces the concept of processes, process control blocks (PCBs), process states, and inter-process communication (IPC). It also covers process creation, termination, and the use of system calls such as fork()
and exec()
for process management.
Process
A process is a program in execution. While a program is a passive entity stored on a disk (e.g., an executable file), a process is an active entity once it is loaded into memory and executed.
Key Properties of a Process:
- Program code (text section)
- Current activity (represented by the program counter, register contents, etc.)
- Process stack (contains temporary data like function parameters and local variables)
- Data section (contains global variables)
- Heap (contains memory dynamically allocated during runtime)
Process Control Block (PCB)
The Process Control Block (PCB) stores all information associated with a process:
- Process State: Running, waiting, etc.
- Process ID (PID): A unique identifier for the process.
- Program Counter: Contains the address of the next instruction to be executed.
- CPU Registers: All register information used by the process.
- Memory Management Information: Information about the memory allocated to the process.
- Scheduling Information: Priorities, pointers to scheduling queues.
- Accounting Information: Time spent executing, time limits.