Page 58 - DCAP403_Operating System
P. 58
Unit 4: Process Management
3. State (ready, running, suspended) Notes
4. Hardware state.
5. Scheduling information and usage statistics
6. Memory management information (registers, tables)
7. I/O Status (allocated devices, pending operations)
8. File management information
9. Accounting information.
Once constructed for a newly created process, the PCB is filled with the programmer defi ned
attributes found in the process template or specified as the parameters of the CREATE-PROCESS
operating system call. Whenever a process is suspended, the contents of the processor registers
are usually saved on the stack, and the pointer to the related stack frame is stored in the PCB. In
this way, the hardware state can be restored when the process is scheduled to run again.
A process control block or PCB is a data structure (a table) that holds information about a process.
Every process or program that runs needs a PCB. When a user requests to run a particular
program, the operating system constructs a process control block for that program.
Typical information that is stored in a process control block is:
1. The location the process in memory
2. The priority of the process
3. A unique process identification number (called PID)
4. The current process state (ready, running, blocked)
5. Associated data for the process.
The PCB is a certain store that allows the operating systems to locate key information about a
process. Thus, the PCB is the data structure that defines a process to the operating systems.
Figure 4.2: Process Control Block or PCB
Process state
Process number
Parent process number
Program counter
Register
Memory limits
List of open files
4.3 Operation on Processes
Modern operating systems, such as UNIX, execute processes concurrently. Although there is a
single Central Processor (CPU), which execute the instructions of only one program at a time, the
operating system rapidly switches the processor between different processes (usually allowing
LOVELY PROFESSIONAL UNIVERSITY 51