Apex Institute of Technology: Department of Computer Science & Engineering
Apex Institute of Technology: Department of Computer Science & Engineering
TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
OPERATING SYSTEM
Faculty: Ms. Anudeep Kaur(E16380)
CO2 Understand Process and Disk scheduling algorithms and apply the best scheduling
algorithm for a given problem instance.
CO3 Apply an algorithm for process scheduling, deadlock avoidance and file management.
CO4 Identify and analyze memory management techniques and apply them for memory
management related problems.
Operating System Introduction to Operating Systems, Operating System Structure, Main Functions and
characteristics of Operating Systems, Types of Operating Systems, System calls, Types of
Overview system calls, System programs, Reentrant Kernels, Monolithic and Microkernel Systems
Process Process Concept, Process Control Block, Process Scheduling, Threads, CPU Scheduling:
Preemptive/Non-Preemptive Scheduling, Scheduling Criteria, Scheduling Algorithms
Management (FCFS, SJF, RR), Priority, real-time scheduling.
1 New
A process is created but has not yet been admitted to
the ready queue.
2 Ready
The process is waiting to be assigned to a processor.
3 Running
The process is currently being executed by a processor.
The Process Control Block (PCB)
An Operating System helps in process creation, scheduling, and termination with the help of Process Control Block.
The Process Control Block (PCB), which is part of the Operating System, aids in managing how processes operate.
Every OS process has a Process Control Block related to it. By keeping data on different things including their state,
I/O status, and CPU Scheduling, a PCB maintains track of processes.
Process Control Block (PCB) Cont…
1. In some operating systems, a Process Control Block (PCB), sometimes known as a Task Control
Block (TCB), is a data structure that stores and maintains critical process information. It serves as a
central repository for information relevant to a specific process, allowing the operating system to
manage
2. The mainand control
purpose of a process execution
PCB is to enable the OSmore effectively.
to manage multiple processes efficiently by keeping track of the state of each
process and allocating system resources accordingly.
3. When a process is created, the OS creates a PCB for that process and stores all the necessary information about the process
in it. The OS then uses the information in the PCB to manage the process and ensure that it runs efficiently.
4. PCBs are used by the OS for many tasks, including process scheduling, process synchronization, and process communication.
5. The information stored in a PCB is used by the OS to make decisions about which process to run next, which resources to
allocate, and when to switch between processes.
In summary, a Process Control Block in OS is a vital component of modern operating systems that enables the efficient
management of processes. It provides the OS with all the necessary information about a process to ensure that it runs
efficiently and effectively.
Role of the PCB
•Process Identification: The PCB includes a unique process identifier (PID) which is essential for distinguishing
between different processes.
•Process State: The PCB keeps track of the current state of the process, which can be running, ready, blocked, etc.
This information is critical for process scheduling.
•CPU Scheduling Information: The PCB contains information used by the CPU scheduler, such as process priority,
pointers to scheduling queues, and other scheduling parameters.
•Memory Management Information: It includes information about the process's memory allocation, such as base
and limit registers, page tables, or segment tables, ensuring proper memory management and protection.
•Accounting Information: The PCB stores accounting details like CPU usage, clock time used, time limits, account
numbers, and other resource utilization statistics, which are useful for system monitoring and billing.
•I/O Status Information: The PCB records information on the process's I/O operations, including a list of open files,
I/O devices allocated to the process, and other I/O-related details.
•Context Switching: During a context switch, the operating system saves the state of the currently running process
in its PCB and loads the state of the next process from its PCB, enabling smooth and efficient process transitions.
Information Typically Stored in a PCB
1.Process ID (PID): Unique identifier for the process.
2.Process State: Current state of the process (e.g., running, waiting, ready, terminated).
3.Program Counter (PC): Address of the next instruction to be executed for the process.
4.CPU Registers: Contents of all process-specific registers, including general-purpose registers, stack pointers, and flags.
5.CPU Scheduling Information: Priority of the process, pointers to scheduling queues, and other scheduling parameters.
6.Memory Management Information: Base and limit registers, page tables, segment tables, and other data structures related
to the process's memory space.
7.Accounting Information: CPU usage statistics, total execution time, time limits, account numbers, etc.
8.I/O Status Information: List of I/O devices allocated to the process, open file descriptors, pointers to I/O request queues, etc.
9.Pointer to Parent Process: Information about the parent process, facilitating process hierarchy and management.
10.Pointers to Child Processes: Information about child processes, if any, managed by the operating system.
11.Other Resources: Information about other resources allocated to the process, such as locks, signals, and inter-process
communication mechanisms.
The PCB is a vital structure that ensures efficient process management, context switching, and resource allocation, making it
indispensable for the proper functioning of an operating system.
Back Exercise
•Define the term "process" in the context of an operating system.
•Explain the concept of a process in an operating system. How does it differ from a program?
•Describe the different states a process can be in during its lifecycle.
•What is a Process Control Block (PCB), and what information does it contain?
•How does the operating system manage the transition of a process from one state to another?
•Describe the role of process scheduling in an operating system. Why is it important?
E-Video Links
https://www.youtube.com/watch?v=bkSWJJZNgf8&list=PLxCzCOWd
7aiGz9donHRrE9I3Mwn6XdP8p
• https://www.youtube.com/watch?v=vBURTt97EkA&list=PLBlnK6fE
yqRiVhbXDGLXDk_OQAeuVcp2O
• https://nptel.ac.in/courses/106/108/106108101/
.