Professional Documents
Culture Documents
Introduction to PCB
A process control block (PCB) is a data structure used by computer operating systems to
store all the information about a process. It is also known as a process descriptor. When a
process is created (initialized or installed), the operating system creates a corresponding
process control block.Each process is represented in the operating system by a process
control block (PCB) also called a task control block.This specifies the process state that is
new, ready, running, waiting or terminated.
Process control block (PCB) is a data structure which is associated with any process and
provides all the complete information about that process. The process control block is "the
manifestation of a process in an operating system". Process control block is important in a
multiprogramming environment as it captures the information pertaining to the number of
processes running simultaneously.Process control block is used to define the process
state of any process.In other words, process control block refers to the states of the
processes.The process control block (PCB) is used to track the process’s execution
status. Each block of memory contains information about the process state, program
counter, stack pointer, status of opened files, scheduling algorithms, etc. All this
information is required and must be saved when the process is switched from one state to
another. When the process makes a transition from one state to another, the operating
system must update information in the process’s PCB.A process control block (PCB)
contains information about the process, i.e. registers, quantum, priority, etc.
Structure Of PCB
In multitasking operating systems, the PCB stores data needed for correct and efficient
process management.Status tables exist for each relevant entity, like describing memory,
I/O devices, files and processes.Memory tables, for example, contain information about
the allocation of main and secondary (virtual) memory for each process, authorization
attributes for accessing memory areas shared among different processes, etc. I/O tables
may have entries stating the availability of a device or its assignment to a process, the
status of I/O operations, the location of memory buffers used for them, etc.
Though the details of these structures are system-dependent, common elements fall in
three main categories:
● Process identification
● Process state
● Process control
Process identification data include a unique identifier for the process (almost invariably
an integer) and, in a multiuser-multitasking system, data such as the identifier of the
parent process, user identifier, user group identifier, etc. The process id is particularly
relevant since it is often used to cross-reference the tables defined above, e.g. showing
which process is using which I/O devices, or memory areas.
Process state data defines the status of a process when it is suspended, allowing the OS
to restart it later. This always includes the content of general-purpose CPU registers, the
CPU process status word, stack and frame pointers, etc. During the context switch, the
running process is stopped and another process runs. The kernel must stop the execution
of the running process, copy out the values in hardware registers to its PCB, and update
the hardware registers with the values from the PCB of the new process.
Process control information is used by the OS to manage the process itself.The following
are the various information that is contained by the process control block:
Location of PCB
The PCB must be kept in an area of memory protected from normal process access. In
some operating systems the PCB is placed at the beginning of the kernel stack(The kernel
stack is part of the kernel space. Hence, it is not directly accessible from a user process.
Whenever a user process uses a syscall, the CPU mode switches to kernel mode. During
the syscall, the kernel stack of the running process is used.The size of the kernel stack is
configured during compilation and remains fixed.) of the process.The process control
block is kept in a memory area that is protected from normal user access. This is done
because it contains important process information. Some of the operating systems place
the PCB at the beginning of the kernel stack for the process as it is a safe location.PCB is
mostly stored as a per-process kernel stack which is in the kernel space and kernel has
access to this which is kept protected from any users.
Contents Of PCB
● Process Number (PID)–unique identification number for each process (also known
as Process ID) identification of the process distinctly as process id.
● CPU Registers–Register set where process needs to be stored for execution for
running state.a group of registers through accumulator index register, GPR reflects
the path of execution of this process.his information is comprising the various
registers, such as index and stack that are associated with the process. This
information is also managed by the process control block.
● CPU Scheduling Information–information scheduling CPU time. The details about
priority of process.Scheduling information is used to set the priority of different
processes. This is very useful information which is set by the process control block.
In the computer system there were many processes running simultaneously and
each process had its priority. The priority of the primary feature of RAM is higher
than other secondary features. Scheduling information is very useful in managing
any computer system.