Page 57 - DCAP403_Operating System
P. 57
Operating System
Notes Process, on the other hand, includes:
1. Current value of Program Counter (PC)
2. Contents of the processors registers
3. Value of the variables
4. The process-stack (SP) which typically contains temporary data such as subroutine
parameter, return address, and temporary variables.
5. A data section that contains global variables.
6. A process is the unit of work in a system.
In Process model, all software on the computer is organized into a number of sequential processes.
A process includes PC, registers, and variables. Conceptually, each process has its own virtual
CPU. In reality, the CPU switches back and forth among processes. (The rapid switching back
and forth is called multi-programming).
A process includes, besides instructions to be executed, the temporary data such as subroutine
parameters, return addresses and variables (stored on the stack), data section having global
variables (if any), program counter value, register values and other associated resources.
Although two processes may be associated with the same program, yet they are treated as two
separate processes having their respective set of resources.
Figure 4.1: A Schematic representation of a Process
Code Data
Resources
Process Status
Abstract Machine Environment (OS)
Task Process stack contains temporary data what about program counter.
4.2 PCB (Process Control Blocks)
The operating system groups all information that it needs about a particular process into a data
structure called a process descriptor or a Process Control Block (PCB). Whenever a process is created
(initialized, installed), the operating system creates a corresponding process control block to
serve as its run-time description during the lifetime of the process. When the process terminates,
its PCB is released to the pool of free cells from which new PCBs are drawn. The dormant state
is distinguished from other states because a dormant process has no PCB. A process becomes
known to the O.S. and thus eligible to compete for system resources only when it has an active
PCB associate with it.
Information stored in a PCB typically includes some or all of the following:
1. Process name (ID)
2. Priority
50 LOVELY PROFESSIONAL UNIVERSITY