Final OS Unit-I
Final OS Unit-I
23CSE2010-OPERATING SYSTEM
Class - [Link](SEM-IV)
Unit - I
INTRODUCTION
AY 2024-2025 SEM-II
1
MIT School of Computing
Department of Computer Science & Engineering
Course Objectives
2
MIT School of Computing
Department of Computer Science & Engineering
Course Outcomes
On completion of the course, learner will be able to–
➢ Explore advanced topics like distributed systems and virtualization with real-
world examples.
3
MIT School of Computing
Department of Computer Science & Engineering
Unit-I Introduction to OS
➢ Evolution of Operating System
➢ OS Definition
➢ Operating System Overview – Objectives and Functions
➢ PLD (Batch OS, Multi-programming
Types of operating systems
OS, Time-sharing OS, Real-time OS)
➢ OS Structure(Monolithic, Microkernel, Layered, Client-Server)
➢ OS services (system calls, interrupt handling)
➢ System Programs, Kernel and user space
➢ OS Generation and System Boot
4
MIT School of Computing
Department of Computer Science & Engineering
Unit-I Introduction to OS
5
MIT School of Computing
Department of Computer Science & Engineering
7
MIT School of Computing
Department of Computer Science & Engineering
8
MIT School of Computing
Department of Computer Science & Engineering
➢ Mobile OS — Android
9
MIT School of Computing
Department of Computer Science & Engineering
Text Books:
10
MIT School of Computing
Department of Computer Science & Engineering
Reference Books:
11
MIT School of Computing
Department of Computer Science & Engineering
Unit-I
PLD
Introduction
to
Operating System
12
MIT School of Computing
Department of Computer Science & Engineering
Unit-I Introduction to OS
➢ Evolution of Operating System
➢ OS Definition
➢ Operating System Overview – Objectives and Functions,
➢ PLD (Batch OS, Multi-programming
Types of operating systems
OS, Time-sharing OS, Real-time OS)
➢ OS Structure(Monolithic, Microkernel, Layered, Client-Server)
➢ OS services (system calls, interrupt handling)
➢ System Programs, Kernel and user space
➢ OS Generation and System Boot
13
MIT School of Computing
Department of Computer Science & Engineering
Unit-I Introduction to OS
14
MIT School of Computing
Department of Computer Science & Engineering
➢ No OS was present
PLD
Disadvantages :
➢ Maintenance problems
16
MIT School of Computing
Department of Computer Science & Engineering
Disadvantages :
➢ Maintenance problems
18
MIT School of Computing
Department of Computer Science & Engineering
19
MIT School of Computing
Department of Computer Science & Engineering
21
MIT School of Computing
Department of Computer Science & Engineering
PLD
22
MIT School of Computing
Department of Computer Science & Engineering
Programming:
➢ Art of designing and implementing the programs/any specific task.
25
MIT School of Computing
Department of Computer Science & Engineering
PLD
26
MIT School of Computing
Department of Computer Science & Engineering
PLD
28
MIT School of Computing
Department of Computer Science & Engineering
PLD
Application Software
➢ The term “application software” refers to software that
performs specific functions for a user.
➢ It runs on the platform which is provided by system
software.
PLD
➢ It’s a specific purpose software.
➢ Application Software is the type of software that runs as
per user request.
➢ Microsoft Word and Excel, as well as popular web
browsers like Firefox and Google Chrome, are examples
of application software.
30
MIT School of Computing
Department of Computer Science & Engineering
31
MIT School of Computing
Department of Computer Science & Engineering
32
MIT School of Computing
Department of Computer Science & Engineering
System Software
➢ System Software is the type of software that is the
interface between application software and the system.
➢ Low-level languages are used to write the system
software. PLD
34
MIT School of Computing
Department of Computer Science & Engineering
➢ Macro Processor
➢ Compiler
➢ Debugger
35
MIT School of Computing
Department of Computer Science & Engineering
Text Editors
➢ Editor is a computer program that allows a user to
create and revise a document.
Ex: Notepad, MS word, etc.
PLD
➢ It is a program in which the primary elements being
edited are character strings.
➢ A text editor is a type of program used for editing plain
text files.
➢ With the help of text editor you can write your own
program(ex- C program or java program)
36
MIT School of Computing
Department of Computer Science & Engineering
Loaders
➢ A loader is a software component in an operating system that loads
executable programs or software modules into memory for
execution by the CPU. It initiates the execution.
PLD
37
MIT School of Computing
Department of Computer Science & Engineering
Loaders
➢ Functions of Loaders are:
Allocation: It allocates space for programs in main memory.
Linking: If we have different modules in our program, then
loader links object modules with
PLD each other.
Relocation: Adjusting all address dependent location.
Loading: Physically loading the machine instructions and
data into main memory.
38
MIT School of Computing
Department of Computer Science & Engineering
Assembler
➢ Assembler is a translator which translates assembly
language program into machine language.
PLD
Macro Processor
➢ Macro allows a sequence of source language code to be
defined once and then referred many times.
➢ A macro processor takes a source with macro definition
and macro calls and replaces
PLD each macro call with its
body.
➢ A macro processor is a program that helps programmers
write code more efficiently by simplifying tasks and
reducing code duplication. It does this by allowing
programmers to define macros, which are groups of
commonly used instructions, expressions, or code blocks
that can be invoked by name.
40
MIT School of Computing
Department of Computer Science & Engineering
Compiler
➢ Programmers use compilers to translate high-level
programming languages into machine code that
computers can understand and execute.
➢ PLD role in the development
Compilers play a critical
process because they help to catch syntax and
semantic errors before we run the code, which saves
time and prevents crashes.
➢ Compilers also optimize the code for efficient
execution and produce faster, more compact
programs.
41
MIT School of Computing
Department of Computer Science & Engineering
Compiler
➢ It is a translator which converts the high level
language into low level language.
➢ Benefits of writing a program in a high level language:
PLD
Increases productivity: It is very easy to write a
program in a high level language.
Machine independence: A program written in a high
level language is machine independent.
42
MIT School of Computing
Department of Computer Science & Engineering
Debugger
➢ It helps programmer for testing and debugging
programs.
➢ A debugger is a software tool that can help the
software development process by identifying coding
errors at various stagesPLDof the operating system or
application development. Some debuggers will
analyze a test run to see what lines of code were not
executed.
➢ It provides some facilities:
Setting breakpoint
Displaying values of variables
43
MIT School of Computing
Department of Computer Science & Engineering
➢ Security
➢ Error-detecting Aids
➢ Scheduling
44
MIT School of Computing
Department of Computer Science & Engineering
45
MIT School of Computing
Department of Computer Science & Engineering
47
MIT School of Computing
Department of Computer Science & Engineering
System Software maintains the system resources Application software is built for specific tasks.
and gives the path for application software to run.
Without system software, the system stops and While Without application software system
can’t run. always runs.
System software runs when the system is turned While application software runs as per the user’s
on and stops when the system is turned off. request.
48
MIT School of Computing
Department of Computer Science & Engineering
The Software that is designed to control, A set of computer programs installed in the user’s
integrate and manage the individual hardware PLD system and designed to perform a specific task is
components and application software is known known as application software.
as system software.
A system software operates the system in the Application software runs in the front end
background until the shutdown of the computer. according to the user’s request.
The system software has no interaction with Application software connects an intermediary
users. It serves as an interface between between the user and the computer.
hardware and the end user.
System software runs independently. Application software is dependent on system
software because they need a set platform for its
functioning.
49
MIT School of Computing
Department of Computer Science & Engineering
OS Services
➢ Resource Management: The operating system manages and allocates
memory, CPU time, and other hardware resources among the various
programs and processes running on the computer.
PLD
➢ Process Management: The operating system is responsible for starting,
stopping, and managing processes and programs. It also controls the
scheduling of processes and allocates resources to them.
50
MIT School of Computing
Department of Computer Science & Engineering
OS Services
➢ Security: The operating system provides a secure environment for
the user, applications, and data by implementing security policies
and mechanisms such as access controls and encryption.
PLD
➢ Job Accounting: It keeps track of time and resources used by
various jobs or users.
51
MIT School of Computing
Department of Computer Science & Engineering
OS Services
➢ Device Management: The operating system manages input/output devices
such as printers, keyboards, mice, and displays. It provides the necessary
drivers and interfaces to enable communication between the devices and the
computer.
PLD
➢ Networking: The operating system provides networking capabilities such as
establishing and managing network connections, handling network
protocols, and sharing resources such as printers and files over a network.
➢ User Interface: The operating system provides a user interface that enables
users to interact with the computer system. This can be a Graphical User
Interface (GUI), a Command-Line Interface (CLI), or a combination of both.
52
MIT School of Computing
Department of Computer Science & Engineering
OS Services
➢ Backup and Recovery: The operating system provides mechanisms for
backing up data and recovering it in case of system failures, errors, or
disasters.
PLD
➢ Virtualization: The operating system provides virtualization capabilities
that allow multiple operating systems or applications to run on a single
physical machine. This can enable efficient use of resources and flexibility
in managing workloads.
53
MIT School of Computing
Department of Computer Science & Engineering
Goals/Objectives of OS
➢ Convenience (user friendly)
➢ Efficiency PLD
➢ Portability
➢ Reliability
➢ Scalability
➢ Robustness
54
MIT School of Computing
Department of Computer Science & Engineering
➢ User Friendly: To make the computer system more interactive with a more
convenient interface for the users.
PLD
1. Batch Operating System
2. Time-sharing Operating System
3. Distributed Operating System
4. Network Operating System
5. Real-time Operating System
6. Multiprocessing Operating System
7. Embedded Operating Systems
56
MIT School of Computing
Department of Computer Science & Engineering
Multi-programming OS 62
MIT School of Computing
Department of Computer Science & Engineering
Multi-Tasking OS 63
MIT School of Computing
Department of Computer Science & Engineering
PLD
➢ Disadvantages
▪ It has difficulty with consistency.
▪ A security and integrity problem with user programs and data.
▪ High Overhead because need for scheduling, context switching.
65
MIT School of Computing
Department of Computer Science & Engineering
PLD
67
MIT School of Computing
Department of Computer Science & Engineering
PLD
68
MIT School of Computing
Department of Computer Science & Engineering
69
MIT School of Computing
Department of Computer Science & Engineering
.Its main objective is to manage hardware Its primary objective is to give local services to
resources. remote users
Distributed OS is less scalable. The process to Network OS is highly scalable. A new machine
add new hardware is complex. PLD can be added very easily.
It has very high fault tolerance. Less fault tolerance as compared to distributed
OS.
Distributed OS-based nodes have the same copy Network OS-based systems have their own
of the operating system. copy of operating systems.
It is difficult to implement a Distributed OS. Network OS-based systems are easy to build
and maintain.
72
MIT School of Computing
Department of Computer Science & Engineering
73
MIT School of Computing
Department of Computer Science & Engineering
74
MIT School of Computing
Department of Computer Science & Engineering
PLD
77
MIT School of Computing
Department of Computer Science & Engineering
Operating-System Structure
1. Simple structure
2. Monolithic structure
3. Layered structure
4. Microkernel structure
79
MIT School of Computing
Department of Computer Science & Engineering
1. Simple OS Structure
➢ Used very beginning and old
Structure
➢ Not having well designed
structure
PLD
➢ Example: MS-DOS
➢ Interface & levels of functionality
are not separated.
80
MIT School of Computing
Department of Computer Science & Engineering
➢ Advantages
▪ Simple to develop
▪ Better application performance
PLD
➢ Disadvantages
▪ Less Secure
▪ If user application fails all OS fails.
▪ Not well design and structured.
81
MIT School of Computing
Department of Computer Science & Engineering
➢ Advantages
▪ Faster execution due to direct access to all the services.
▪ Simple and easy to implement structure.
▪ Fewer lines of codes need to bePLD
written for a monolithic kernel.
➢ Disadvantages
▪ If one component fails, the entire system crashes
▪ Debugging is complex and difficult
▪ It’s difficult to add new functionalities
84
MIT School of Computing
Department of Computer Science & Engineering
85
MIT School of Computing
Department of Computer Science & Engineering
86
MIT School of Computing
Department of Computer Science & Engineering
➢ Disadvantages
▪ Complex and careful implementation
▪ Communication(between adjacent layer)
▪ It’s difficult to add new functionalities
87
MIT School of Computing
Department of Computer Science & Engineering
Operating-System Operations
• PROCESS MANAGEMENT
• MEMORY MANAGEMENT
• SYSTEM MANAGEMENT
• PROTECTION AND SECURITY
PLD
91
MIT School of Computing
Department of Computer Science & Engineering
PROCESS MANAGEMENT
Process Management refers to aligning
processes with an organization's strategic
goals, designing and implementing
process architectures, establishing
process measurement systems that align
with organizational goals, and educating
PLD
and organizing managers so that they will
manage processes effectively.
SUMMARY
92
MIT School of Computing
Department of Computer Science & Engineering
Memory Management
Memory :
Memory is a device that is used to store data or programs on a
PLD in an electronic digital
temporary or permanent basis for use
computer.
93
MIT School of Computing
Department of Computer Science & Engineering
PLD
94
MIT School of Computing
Department of Computer Science & Engineering
95
MIT School of Computing
Department of Computer Science & Engineering
1. Performance
2. Reliability
3. Recoverability
4. Capacity
PLD
96
MIT School of Computing
Department of Computer Science & Engineering
PLD
97
MIT School of Computing
Department of Computer Science & Engineering
•Security is a method used in operating systems that handles the threats from
outside of the system to maintain the proper functioning of the system.
PLD
98
MIT School of Computing
Department of Computer Science & Engineering
OS SECURITY ISSUES
PLD
99
MIT School of Computing
Department of Computer Science & Engineering
System call
➢ A system call is a way for a user program to interface with the
operating system. The program requests several services, and
the OS responds by invoking a series of system calls to satisfy
the request. PLD
➢ A system call can be written in assembly language or a high-
level language like C or Pascal.
➢ System calls are predefined functions that the operating
system may directly invoke if a high-level language is used.
100
MIT School of Computing
Department of Computer Science & Engineering
System call
➢ System Calls in programs can ask the operating system (OS)
for services through a system call. Putting it more simply, it’s a
means via which a program can communicate with the
underlying system, for example, by gaining access to hardware
PLD
resources or by using privileged commands.
101
MIT School of Computing
Department of Computer Science & Engineering
1. Process Control
[Link] Management
3. Device Management
[Link] Maintenance PLD
[Link]
102
MIT School of Computing
Department of Computer Science & Engineering
3. Device Management
Device management is a system call that is used to deal with devices.
Some examples of device management include read, device, write, get
device attributes, release device, etc.
103
MIT School of Computing
Department of Computer Science & Engineering
4. Information Maintenance
Information maintenance is a system call that is used to maintain
information. There are some examples of information maintenance,
including getting system data, setPLD
time or date, get time or date, set
system data, etc.
5. Communication
Communication is a system call that is used for communication. There are some
examples of communication, including create, delete communication
connections, send, receive messages, etc.
104
MIT School of Computing
Department of Computer Science & Engineering
105
MIT School of Computing
Department of Computer Science & Engineering
Program
➢ Program is a set of instructions written to perform a task, stored
in memory.
➢ When we execute a program that was just compiled, the
Operating System will generatePLD a process to execute the
program.
➢ Execution of the program starts via mouse clicks, command line
entry of its name, etc.
➢ A program is a passive entity as it resides in the secondary
memory, such as the contents of a file stored on disk.
➢ One program can have several processes.
106
MIT School of Computing
Department of Computer Science & Engineering
Process
107
MIT School of Computing
Department of Computer Science & Engineering
The program does not have any resource The process has a high resource requirement,
requirement, it only requires memory space for it needs resources like CPU, memory address,
storing the instructions. and I/O during its lifetime.
Process has its control block called Process
The program does not have any control block.
Control Block.
108
MIT School of Computing
Department of Computer Science & Engineering
109
MIT School of Computing
Department of Computer Science & Engineering
System Program
➢ A system program in an operating system (OS) is a software program that helps
manage and control a computer's hardware and resources.
➢ System programs are used to run the OS and other programs on a computer.
PLD
110
MIT School of Computing
Department of Computer Science & Engineering
System Programs
➢ Program Development and Execution can be done
conveniently in System Programs.
➢ Some of the System Programs are simply user
interfaces, others are complex.
➢ It traditionally lies between the user interface and
PLD
system calls.
➢ The system call establishes a connection between the
user software and the operating system's services. The
system program also offers a proper environment for the
development and execution of a program.
➢ For example, a modern operating system includes
system programs such as an assembler, compiler,
editor, loader, etc. These programs enable
programmers to create and run new programs. 111
MIT School of Computing
Department of Computer Science & Engineering
System Programs
➢ What do system programs do?
➢ Manage files: Create, modify, delete, copy, rename, print,
and dump files and directories
➢ Provide a user interface: Allow
PLD
users to interact with the
operating system, such as through a command line
interface (CLI)
➢ Program the OS: Provide software that is used to
program the operating system
➢ Provide a platform for application software: Provide a
convenient environment for application programs to run
on.
112
MIT School of Computing
Department of Computer Science & Engineering
Interrupt
➢ Interrupts are signals or events that divert the attention
of the central processing unit (CPU) from its current task
to handle a specific event.
➢ These events can range PLD from hardware-related issues,
such as a key press or mouse movement, to software-
generated signals like system calls or program errors.
➢ Interrupts allow the operating system to promptly
respond to these events, ensuring a more dynamic and
efficient system.
113
MIT School of Computing
Department of Computer Science & Engineering
Interrupt
➢ Interrupts have two types: Hardware interrupt and
Software interrupt.
➢ The hardware interrupt occurs by the interrupt request
signal from peripheral circuits. On the other hand, the
software interrupt occursPLDby executing a dedicated
instruction.
➢ The hardware interrupt has an external interrupt and
an internal interrupt.
➢ The external interrupt occurs when a specified signal is
input to the dedicated external interrupt terminal.
➢ The internal interrupt occurs by an interrupt request
signal from a peripheral circuit built into the
microcontroller. 114
MIT School of Computing
Department of Computer Science & Engineering
User space
➢ The area of memory where user applications run.
➢ Includes utilities, programming languages, graphical
tools, and applications.
➢ User space applications can't
PLD directly access the system's
hardware resources.
➢ User space applications must use system calls to request
access to the system's hardware resources.
115
MIT School of Computing
Department of Computer Science & Engineering
Kernel space
116
MIT School of Computing
Department of Computer Science & Engineering
PLD
117
MIT School of Computing
Department of Computer Science & Engineering
119
MIT School of Computing
Department of Computer Science & Engineering
120
MIT School of Computing
Department of Computer Science & Engineering
System Boot
121
MIT School of Computing
Department of Computer Science & Engineering
Sequencing of Booting
➢ Booting is a start-up sequence that starts the
operating system of a computer when it is turned on.
➢ A boot sequence is the initial set of operations that the
computer performs whenPLDit is switched on.
➢ Every computer has a boot sequence.
122
MIT School of Computing
Department of Computer Science & Engineering
Sequencing of Booting
➢ Boot Loader:
➢ The program that starts the chain reaction that ends with
the entire operating system being loaded is the boot
loader or bootstrap loader. The boot loader's only job is to
load other software for thePLDoperating system to start.
Sequencing of Booting
➢ Boot Sequence: There is a standard boot sequence that
all personal computers use.
PLD
124
MIT School of Computing
Department of Computer Science & Engineering
125
MIT School of Computing
Department of Computer Science & Engineering
Dual Booting
➢ When two operating systems are installed on the
computer system, then it is called dual booting.
➢ Multiple operating systems can be installed on such a
system. But to know which operating system is to boot, a
PLD multiple file systems and
boot loader that understands
multiple operating systems can occupy the boot space.
➢ Once loaded, it can boot one of the operating systems
available on the disk. The disk can have multiple
partitions, each containing a different type of operating
system. When a computer system turns on, a boot
manager program displays a menu, allowing the user to
choose the operating system to use.
126
MIT School of Computing
Department of Computer Science & Engineering
Process Management
➢ Process Management: Process definition, the process
concept – system programmer’s view of processes –
operating system’s views of processes, States, Process
PLD
Control Block (PCB), Process Creation and Termination (fork,
exec, process hierarchy, exit, wait), Context switching, Types
of schedulers (long-term, short-term, medium-term),
Scheduling algorithms- Preemptive vs. Non-Preemptive
Scheduling (FCFS, SJF, RR, Priority Scheduling)
127
MIT School of Computing
Department of Computer Science & Engineering
Process
➢ Program under execution
➢ An instance of a program
➢ Schedulable/Dispatch unit (CPU)
➢ Unit of execution (CPU) PLD
128
MIT School of Computing
Department of Computer Science & Engineering
129
MIT School of Computing
Department of Computer Science & Engineering
Process
➢ A process is basically a program in execution or instance
of the program execution.
➢ The execution of a process must progress in a sequential
PLD
fashion.
➢ Process is not as same as program code but a lot more
than it.
➢ A process is an 'active' entity as opposed to program
which is considered to be a 'passive' entity.
130
MIT School of Computing
Department of Computer Science & Engineering
Process
➢ A "process" in computing refers to an active instance of a program
that is currently being executed by the system, encompassing not
just the program code itself but also its current state including
memory allocation, CPU registers,
PLD and other relevant data; from a
system programmer's perspective, a process is essentially a
collection of data structures that represent the program's
execution context, while an operating system views a process as an
entity it manages, tracking its state (like running, waiting,
terminated) and allocating system resources to it as needed.
131
MIT School of Computing
Department of Computer Science & Engineering
133
MIT School of Computing
Department of Computer Science & Engineering
135
MIT School of Computing
Department of Computer Science & Engineering
136
MIT School of Computing
Department of Computer Science & Engineering
Process operations
➢ Create (space allocation)
➢ Schedule/run
➢ Wait/Block
PLD
➢ Suspend/Resume
➢ Terminate (space
deallocation)
137
MIT School of Computing
Department of Computer Science & Engineering
139
MIT School of Computing
Department of Computer Science & Engineering
142
MIT School of Computing
Department of Computer Science & Engineering
Context Switching in OS
➢ CPU uses registers to store current process
execution state.
➢ When stopped in between, have to save these
values in PCB to resumePLD
from that point onwards.
➢ Context switching is the process of switching
between tasks or contexts. Basically, the state of
the currently executing process is saved before
moving to the new process. Saving state means
copying all live registers to PCB(Process Control
Block).
143
MIT School of Computing
Department of Computer Science & Engineering
PLD
144
MIT School of Computing
Department of Computer Science & Engineering
PLD
No Multitasking
145
MIT School of Computing
Department of Computer Science & Engineering
PLD
Done Multitasking
146
MIT School of Computing
Department of Computer Science & Engineering
Process States
➢ New: All installed processes are here (SSD, HDD)
➢ Ready: Processes among the installed processes
that are wanting to runPLD
on CPU (in MM)
➢ Running: Running on CPU (MM)
➢ Blocked: Waiting for any I/O or event (MM)
➢ Terminated: All completed processes are in this
state (goes out from the MM)
147
MIT School of Computing
Department of Computer Science & Engineering
Process States
➢ When a new process is formed, OS makes the PCB
➢ In non preemptive process, no factor can force a
running process to come PLDout of CPU. Termination or
going to waiting is only its wish.
➢ PCB will be there in running, ready and waiting
state. In these three states, process will be in MM
only.
148
MIT School of Computing
Department of Computer Science & Engineering
CPU scheduling
➢ Make a selection of ready processes to run on CPU.
➢ Needed for better performance.
➢ Metric for performancePLDmay vary.
➢ Multiple policies according to metric.
149
MIT School of Computing
Department of Computer Science & Engineering
Scheduling Queue
➢ Job queue: To keep all processes in new state.
➢ Ready queue: To keep all processes in ready state.
➢ Device queue: To keep the processes in blocked
PLD
state.
150
MIT School of Computing
Department of Computer Science & Engineering
Scheduling Objectives
➢ Maximize throughput.
➢ Maximize number of users receiving acceptable
response times.
➢ Be predictable. PLD
151
MIT School of Computing
Department of Computer Science & Engineering
152
MIT School of Computing
Department of Computer Science & Engineering
Types of scheduler
➢ Long term scheduler: new to ready
➢ Short term scheduler: ready to running
➢ Mid term scheduler: swapping
PLD is done by this.
Swapping leads to suspension. (Use Secondary
memory to stored process)
153
MIT School of Computing
Department of Computer Science & Engineering
2 Speed is lesser than Speed is fastest than other Speed is between both short and
short term scheduler two schedulers a long term scheduler
154
MIT School of Computing
Department of Computer Science & Engineering
CPU Scheduling
➢ Types: Preemptive and non preemptive
➢ Assumption initially: No process has I/O requirement
➢ Some terminologies:
➢ Arrival Time(AT): Process arrival time(admitted by LTS)
➢ Burst/Service time(BT): burst PLDtime is the time, required the CPU to
execute that job, it is in milli seconds.
➢ Completion time (CT): Time when process completes execution.
➢ Turn around time (TAT): Time from arrival until completion
(TAT=CT-AT)
➢ Waiting time (WT): Waiting for CPU in ready queue (WT=TAT-BT)
➢ Response time: Time from arrival to the first response on CPU
➢ Scheduling length: max(CT)-min(AT)
➢ Throughput: No of processes executed per unit time
155
MIT School of Computing
Department of Computer Science & Engineering
Scheduling Criteria
➢ CPU Utilization
➢ Throughput
➢ Turnaround time
➢ Waiting Time PLD
➢ Response Time
156
MIT School of Computing
Department of Computer Science & Engineering
➢ Priority Scheduling
➢ Round Robin
157
MIT School of Computing
Department of Computer Science & Engineering
158
MIT School of Computing
Department of Computer Science & Engineering
P1 3 4
P2 5 3
PLD
P3 0 2
P4 5 1
P5 4 3
Calculate the average waiting time and average turn around time.
159
MIT School of Computing
Department of Computer Science & Engineering
PLD
P1 7 7–3=4 4–4=0
P2 13 13 – 5 = 8 8–3=5
P3 2 2 – PLD
0=2 2–2=0
P4 14 14 – 5 = 9 9–1=8
P5 10 10 – 4 = 6 6–3=3
➢ Disadvantages
➢ No option of preemption
➢ Convoy effect
162
MIT School of Computing
Department of Computer Science & Engineering
Convoy effect
➢ Only FCFS suffers
➢ If a slow process (large service time) is scheduled first, then it makes
entire system slow
PLD
163
MIT School of Computing
Department of Computer Science & Engineering
SJF
➢ Criteria: min BT first
➢ Mode: Non preemptive
➢ Tie breaker: FCFS
PLD
164
MIT School of Computing
Department of Computer Science & Engineering
Example
PLD
165
MIT School of Computing
Department of Computer Science & Engineering
PLD
166
MIT School of Computing
Department of Computer Science & Engineering
• Disadvantages
• No practical implementation because burst time cannot be known in
advance
• No option of preemption
• Longer processes may suffer from starvation
• No fairness
167
MIT School of Computing
Department of Computer Science & Engineering
Priority Scheduling
PLD
168
MIT School of Computing
Department of Computer Science & Engineering
PLD
169
MIT School of Computing
Department of Computer Science & Engineering
PLD
170
MIT School of Computing
Department of Computer Science & Engineering
PLD
171
MIT School of Computing
Department of Computer Science & Engineering
172
MIT School of Computing
Department of Computer Science & Engineering
PLD
173
MIT School of Computing
Department of Computer Science & Engineering
PLD
174