In this lesson, we will understand, we deal with the concept of process.Process is the basic context within which the user requested activity isserviced within operating system. In technical terms, a process comprisesof 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, processcontrol block (also called task control block). Operating systems have toensure multi-tasking by the way scheduling the processes. During thecontext switch, the running process is stopped and another process is givena chance to run. OS copies the values from hardware registers to PCB, andupdate 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
Figure: PCB StructurePCBs define the current state of the OS. PCB contains the data offollowing 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 informationProgram counter indicates address of the next instruction to be executedin process. CPU Scheduling information consists of process priority,pointers to scheduling queues, and other scheduling parameters. Memorymanage information consists of value of bases and limit registers, pagetables, segment tables depending on the memory system used by OS.