1. In this lesson, we will understand, we deal with the concept of process.
Process is the basic context within which the user requested activity is
serviced within operating system. In technical terms, a process comprises
of process stack and data section.
- Process stack holds temporary data such as subroutine parameters,
return addresses, and temporary variables.
- Data section contains global variables
- Process is a program in execution, and current activity is
represented by value in program counter and contents of processor’s
registers.
A process in OS is represented by a data structure called PCB, process
control block (also called task control block). Operating systems have to
ensure multi-tasking by the way scheduling the processes. During the
context switch, the running process is stopped and another process is given
a chance to run. OS copies the values from hardware registers to PCB, and
update the hardware registers with the values from PCB of new process.
Pointer Process state
Process number
Program counter
Registers
Memory limits
List of open files
Other info
2. Figure: PCB Structure
PCBs define the current state of the OS. PCB contains the data of
following categories.
- Process identification data – process id, parent process id, user id,
user group id, …
- Process state data – process state, content of CPU general purpose
registers, program counter, CPU scheduling information, Memory
management information
Program counter indicates address of the next instruction to be executed
in process. CPU Scheduling information consists of process priority,
pointers to scheduling queues, and other scheduling parameters. Memory
manage information consists of value of bases and limit registers, page
tables, segment tables depending on the memory system used by OS.