1. Program vs. Process
- Program: A passive entity stored on secondary storage (like a `.exe` file on a hard disk). It is static.
- Process: An active execution of a program loaded into main memory (RAM). It requires resources (CPU time, registers, memory space).
2. Process States & Transitions
As a process executes, it moves through different states:
- New: The process is being created.
- Ready: The process is loaded in memory and waiting to be allocated to the CPU by the scheduler.
- Running: Instructions are actively being executed by the CPU.
- Blocked/Waiting: The process is waiting for an event to occur (like input from the keyboard, reading a disk sector).
- Terminated: The process has finished execution.
3. Memory Management
- Paging: Memory is split into fixed-size physical blocks called frames, and logical memory is split into blocks of the same size called pages. This avoids external fragmentation.
- Virtual Memory: A technique allowing execution of processes that exceed physical memory capacity. It copies inactive memory pages onto secondary storage (swap file/partition) to free up physical RAM.