<aside>
💡
A process is an instance of a running program
We can add more to a process!
</aside>
Summary
The OS has to:
- Maintain process control blocks, including state
- Create new processes
- Load a program, and re-initialize a process with context
Process Control Block
PCBs contain all information, this is the task_struct
in Linux and contains the following:
- Process state
- CPU registers
- Scheduling information
- Memory management information
- I/O status information
- Any other type of accounting information
- Each process gets a unique process ID (PID) to keep track of it!
Process State Diagram
How a kernel loads a program into memory
- Created: kernel initializes the PCB and loads the program’s code, data, stack, and heap into memory
- Waiting: process is ready to run but waiting for the CPU to be available