SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
OOppeerraattiinngg SSyysstteemm
FFoorr
CCoommppuutteerr SScciieennccee
&&
IInnffoorrmmaattiioonn TTeecchhnnoollooggyy
By
www.thegateacademy.com
Syllabus Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com
Syllabus for Operating System
Processes, Threads, Inter-process communication, Concurrency, Synchronization, Deadlock, CPU
scheduling, Memory management and virtual memory, File systems, I/O systems, Protection and
security.
Analysis of GATE Papers
(Operating System)
Year Percentage of marks Overall Percentage
2013 12.00
8.12%
2012 9.33
2011 5.00
2010 7.00
2009 8.00
2008 9.33
2007 9.33
2006 11.33
2005 2.67
2004 7.33
2003 8.00
Contents Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page i
CC OO NN TT EE NN TT SS
Chapters Page No.
#1. Introduction to Operating System 1 – 10
 Introduction 1
 Evolution of Operating System 2 – 3
 Major Achievements 3 – 5
 Operating System Operations 5 – 6
 Micro Kernel Architecture 6 – 8
 Assignment 9
 Answer Keys 10
 Explanations 10
#2. Process Management 11 – 45
 Process 11
 Process vs Program 11
 Process State 11
 Process Creation 12 – 13
 Process Termination 13 – 14
 Process Scheduling 14
 Interprocess Communication, Concurrency
and Synchronization 14 – 17
 The Critical Section Problem 17 – 19
 Bakery Algorithm 19 – 20
 Semaphores 20 – 23
 The Readers and Writers Problem 23 – 26
 Monitors 26 – 29
 Solved Examples 30 – 33
 Assignment 1 34 – 38
 Assignment 2 38 – 41
 Answer Keys 42
 Explanations 42 – 45
#3. Threads 46 -52
 Thread 46
 Life Cycle Of Threads 46 – 47
 Multithreading 47
 Process Vs Thread 48
 User Level and Kernel Level Threads 48 – 50
 Assignment 50 – 51
 Answer Keys 52
 Explanations 52
Contents Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page ii
#4. CPU Scheduling 53 – 77
 Basic Concept 53
 Schedulers 53 – 54
 Scheduling Methodology 54
 CPU Scheduling Algorithm 54 – 62
 Solved Examples 63 – 67
 Assignment 1 68 – 72
 Assignment 2 72 – 73
 Answer Keys 74
 Explanations 74 – 77
#5. Deadlocks 78 -92
 Definition 78
 Resource Allocation Graph 78
 Condition for Deadlock 78 – 79
 Deadlock Prevention 79
 Deadlock Avoidance 79 – 82
 Deadlock Detection 82 – 83
 Recovery From Deadlock 84
 Assignment 1 85 – 88
 Assignment 2 88 – 89
 Answer Keys 90
 Explanations 90 – 92
#6. Memory Management 93-134
 Introduction 93
 Logical and Physical Address Space 93 – 94
 Memory Management Requirements 94 – 96
 Memory Allocation Method 96 – 102
 Paging 102 – 106
 Segmentation 106 – 109
 Page Replacement Algorithm 110 – 112
 Thrashing 112 – 113
 Solved Examples 114 – 125
 Assignment 1 126 – 128
 Assignment 2 128 – 129
 Answer Keys 130
 Explanations 130 – 134
#7. File System 135 – 153
 Introdution 135
 File Concept 135 – 137
 Access Methods 137 – 138
Contents Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page iii
 Directory Structure 138 – 140
 Protection 140 – 144
 Free Space Management 144 – 145
 Solved Examples 146 – 147
 Assignment 1 148 – 149
 Assignment 2 150 – 151
 Answer Keys 152
 Explanation 152 – 153
#8. I/O System 154 - 172
 Kernel I/O Subsystem 154
 Disk Structure 154 – 155
 Disk Scheduling 155 – 157
 Disk Management 157 – 158
 RAID 158 – 159
 Solved Examples 160 – 163
 Assignment 1 164 – 167
 Assignment 2 167 – 168
 Answer Keys 169
 Explanations 169 – 172
#9. Protection and Security 173 – 185
 Domain of Protection 173
 Access Matrix 173 – 176
 The Security Problem 176 – 178
 Solved Examples 179 – 180
 Assignment 1 181 – 182
 Assignment 2 182 – 183
 Answer Keys 184
 Explanations 184 – 185
Module Test 186 –199
 Test Questions 186 – 194
 Answer Keys 195
 Explanations 195 – 199
Reference Books 200
Chapter 1 Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 1
CHAPTER 1
Introduction to Operating System
What is an Operating System?
An operating system is a collection of programs and utilities. It act as the interface between user
and computer. It creates a user friendly environment. The Operating System act as a Resource
Manager. (A Computer system has many resources (Hardware and Software) which may require
for completing a task). The computer uses resources like input/output device, memory, file,
storage space, CPU time and so on. The operating system acts as a manager of these resources
and allocates them to specific program and users as necessary for their tasks. Therefore we can
say an operating system act as a resource manager. Generally resource sharing in two ways ‘in
time’ and ‘in space’. For example a CPU is a time sharing resource and the main memory is a
space sharing resource. The main difference between in time sharing and in space sharing
resource is ‘in time’ resource is not divided into units, where as in space resources is divided
into units.
Structure of Operating System
The structure of operating system consists of 4 layers; these are hardware, software, system
program and application program. The hardware part consists of CPU, main memory, I/O device,
Secondary storage etc. The software includes process management routines, memory
management routines, I/O control routines, file management routines. The system program
layer consist of complier, assembler etc. Last one is the application program that depends on
users.
Components of a Computer System
Chapter 1 Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 2
Evolution of Operating System
i. Serial Processing: Before 1950 the programmer directly interacts with hardware. There
was no operating system at that time, if the programmer wish to execute a program on
these days, the following steps are necessary.
 Type the program on punch card
 Convert punched card to card reader
 Submit to the computing machine, is there any error, the condition was indicated
by lights.
 The programmer examines the registers and main memory to identify the cause of
error.
 Take the output of error.
 Take the output on the printers.
 Then the programmer ready for the next program
This type of processing takes much time and next program should wait for the completion of
previous one. The programs are submitted to the machine one after one. Therefore this
machine is said to be serial processing.
ii. Batch Processing: In older days (before 1960), it was difficult to execute a program using
computer. Because the computer located in three rooms. One room for card reader
second room for executing the program third room for printing the result. The user or
machine operator needs to run between these three rooms to complete a job. We can
solve this problem using Batch processing. In batch processing same type of task are
grouped together and execute at a time. The carrier carries the group of job at a time
from one room to another. Therefore the programmer need not to run between these 3
rooms several times.
iii. Multiprogramming: Multiprogramming is a technique to execute number of programs
simultaneously by a single processor. In multiprogramming more than one process can
reside in main memory at a time. The operating system picks and begins execute one of
the jobs in the main memory.
In non multiprogramming system, the CPU can execute only one program at a time. If the
running program is waiting for any I/O device, the CPU becomes idle, so it will effect the
performance of the CPU. But in multiprocessing environment, any I/O wait happened in
a process and then the CPU switches from the job to another job in the job pool. So the
CPU is not idle at any time.
iv. Time Sharing System: Time sharing or multitasking is a logical extension of
multiprocessing. In time sharing system the CPU selects a job from the ready queue and
switches the CPU to that job. When the time slot is expired the CPU switches from this
job to another, in this method CPU is shared by different process, so it is said to be “Time
Sharing System.” The main advantage of time sharing system over the batch processing
system is the user can interact with the job when it is executing but it is not possible in
batch system. Another advantage of time sharing system is efficient CPU utilization.
v. Parallel System: If a system has more than one processor in close communication,
sharing the computer bus, the clock, memory and peripheral devices, this system is
referred as “tightly coupled” system. A system consisting of more than one processor and
if it is a tightly coupled and then the system is called parallel system. One advantage of
Chapter 1 Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 3
parallel system is increased “Throughput”. The performance of CPU is measured in terms
of Throughput. The number of jobs completed by a CPU with in a time period is said to be
“Throughput”.
Multiprocessor can also save money compared to multiple single system because the
processor can share peripherals, cabinet and power supply. Another advantages of
multiprocessor system is that they increase reliability.
vi. Distributed System: In distributed system, the processor can’t share memory or clock,
each processor has its own local memory. The processor communicate one another
though various communication lines. These system are usually called loosely coupled
system. The advantage of distributed system are:
1. Resource sharing
2. Computation speed up
3. Reliability
vii. Real Time System
 Used when there are rigid time requirements on the operating of a processor or the
flow of data.
 Systems that control scientific experiments, medical imaging systems, industrial
control systems and some display system are real time systems.
 Two types of real time systems are:
 A hard real time system: guarantees that critical tasks completed on time.
 Soft real time system: A less restrictive type of real time system is a soft real
time system. Given their date of deadline support they are risky to use for
industrial control and robotics
Spooling
The expansion of spooling is simultaneous peripheral operations on line. Simultaneous
means for example if two or more user issue print command and the printer accept the
request even the printer is printing some other jobs. The printer printing one job at the
same time the spool disk can load some other jobs.
Operating System Functions
1. Program creation
2. Programs execution
3. Input output operation
4. Error detection
5. Resource allocation
6. Accounting
7. Protection
Major Achievements
The major achievement of operating system are
Process Management
A process is a program in execution: (A program is passive in nature while a process is active)
A process has resources (CPU time, files) and attribute that must be managed.
Chapter 1 Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 4
Management of Processes Includes:
 Process scheduling (priority, time management,…)
 Creation/termination
 Block/Unblock (suspension/resumption)
 Synchronization
 Communication
 Deadlock handling
 Debugging
Main Memory Management
 Allocation/de-allocation for processes, files, I/O
 Maintenance of several processes at a time
 Keep track of who’s using what memory
 Movement of process memory to/from secondary storage.
File Management
A file is a collection of related information defined by its creator, commonly files represent
program (both source and object forms) and data.
The operating system is responsible for the following activities in connections with file
management:
 File creation and deletion
 Directory creation and deletion
 Support of primitives for manipulating files and directories
 Mapping files onto secondary storage
 File backup on stable (non volatile) storage media
I/O Management
 Buffer caching system
 Generic device driver code
 Drivers for each device- translate requests into position commands
Secondary Storage Management
 Disk, tapes, optical
 Free space management ( paging/swapping)
 Storage allocation (what data goes where on disk)
 Disk scheduling
Networking
 Communication system between distributed processors.
 Getting information about files/processes/etc. on remote machine.
Chapter 1 Operating System
THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th
Cross, 10th
Main, Jayanagar 4th
Block, Bangalore-11
: 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 5
 Can use either a message passing or a shared memory model.
Protection
 Of files, memory, CPU, etc.
 Means controlling of access
 Depends on the attributes of the file and user
System Program
 Command Interpreters – Program that accepts control statements (shell, GUI interface,
etc.)
 Compilers/linkers
 Communication (ftp, telnet, etc.)
System Tailoring
Modifying the operating System program for a particular machine. The goal is to include all the
necessary pieces but not too many extra ones.
 Typically a System can support many possible devices but any one installation has only a
few of these possibilities.
 Plug and play allows for detection of device and automatic inclusion of the code (driver)
necessary to drive these devices.
 A system is usually a link of many OS routines/modules in order to produce an
executable code to run the drivers.
Operating System Operations
Modern operating systems are interrupt driven. If there are no processes to execute, no I/O
devices to service and no users to respond, an operating system will quietly waiting for
something to happen. Events are almost always signaled by the occurrence of an interrupt or a
trap.
Traps and interrupts are events that disrupt the normal sequence of instruction executed by the
CPU. A trap is an abnormal condition detected by the CPU, that usually is an indicative of an
error.
Trap condition can occur in following ways
(a) Dividing by zero
(b) Trying to access a memory location that does not exists or for which the program does
not have access
(c) Executing an instruction with an undefined opcode,
(d) Trying to access a nonexistent I/O device.
An interrupt is a signal sent to the CPU by an external device, typically an I/O device. It is the
CPU’s equivalent of a pager, a signal requesting the CPU to interrupt its current activities to
attend to the interrupting device needs. A CPU will check interrupts only after it has completed
the processing of one instruction and before it fetches a subsequent one.
The CPU responds to traps and interrupts by saving the current value of the program counter
and resetting the program counter to a new address. This allows the CPU to return to the
executing point where the trap or interrupt occurred, after it has executed a procedure for
handling the trap or interrupt.
Computer Science Engineering : Operating system, THE GATE ACADEMY

Weitere ähnliche Inhalte

Andere mochten auch

Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemShafaan Khaliq Bhatti
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating Systempriya_sinha02
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its functionNikhi Jain
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagnesarankumar4445
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts pptRajendraPrasad Alladi
 

Andere mochten auch (7)

Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating System
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its function
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
 

Mehr von klirantga

Mechanical Engineering : Engineering mechanics, THE GATE ACADEMY
Mechanical Engineering  : Engineering mechanics, THE GATE ACADEMYMechanical Engineering  : Engineering mechanics, THE GATE ACADEMY
Mechanical Engineering : Engineering mechanics, THE GATE ACADEMYklirantga
 
Instrumentation Engineering : Transducers, THE GATE ACADEMY
 Instrumentation Engineering : Transducers, THE GATE ACADEMY Instrumentation Engineering : Transducers, THE GATE ACADEMY
Instrumentation Engineering : Transducers, THE GATE ACADEMYklirantga
 
Instrumentation Engineering : Signals & systems, THE GATE ACADEMY
Instrumentation Engineering : Signals & systems, THE GATE ACADEMYInstrumentation Engineering : Signals & systems, THE GATE ACADEMY
Instrumentation Engineering : Signals & systems, THE GATE ACADEMYklirantga
 
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMY
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMYElectrical and Electronics Engineering : Power electronics, THE GATE ACADEMY
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMYklirantga
 
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMYElectronics and Communication Engineering : Digital circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMYklirantga
 
Electronics and Communication Engineering : Control systems, THE GATE ACADEMY
 Electronics and Communication Engineering  : Control systems, THE GATE ACADEMY Electronics and Communication Engineering  : Control systems, THE GATE ACADEMY
Electronics and Communication Engineering : Control systems, THE GATE ACADEMYklirantga
 
Electronics and Communication Engineering : Communications, THE GATE ACADEMY
Electronics and Communication Engineering : Communications, THE GATE ACADEMYElectronics and Communication Engineering : Communications, THE GATE ACADEMY
Electronics and Communication Engineering : Communications, THE GATE ACADEMYklirantga
 
Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY
 Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMYklirantga
 
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYComputer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYklirantga
 
Civil Engineering : Rcc & steel structures, THE GATE ACADEMY
Civil Engineering : Rcc & steel structures, THE GATE ACADEMYCivil Engineering : Rcc & steel structures, THE GATE ACADEMY
Civil Engineering : Rcc & steel structures, THE GATE ACADEMYklirantga
 
Gate material civil engineering, environmental engineering
Gate material   civil engineering, environmental engineeringGate material   civil engineering, environmental engineering
Gate material civil engineering, environmental engineeringklirantga
 

Mehr von klirantga (11)

Mechanical Engineering : Engineering mechanics, THE GATE ACADEMY
Mechanical Engineering  : Engineering mechanics, THE GATE ACADEMYMechanical Engineering  : Engineering mechanics, THE GATE ACADEMY
Mechanical Engineering : Engineering mechanics, THE GATE ACADEMY
 
Instrumentation Engineering : Transducers, THE GATE ACADEMY
 Instrumentation Engineering : Transducers, THE GATE ACADEMY Instrumentation Engineering : Transducers, THE GATE ACADEMY
Instrumentation Engineering : Transducers, THE GATE ACADEMY
 
Instrumentation Engineering : Signals & systems, THE GATE ACADEMY
Instrumentation Engineering : Signals & systems, THE GATE ACADEMYInstrumentation Engineering : Signals & systems, THE GATE ACADEMY
Instrumentation Engineering : Signals & systems, THE GATE ACADEMY
 
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMY
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMYElectrical and Electronics Engineering : Power electronics, THE GATE ACADEMY
Electrical and Electronics Engineering : Power electronics, THE GATE ACADEMY
 
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMYElectronics and Communication Engineering : Digital circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Digital circuits, THE GATE ACADEMY
 
Electronics and Communication Engineering : Control systems, THE GATE ACADEMY
 Electronics and Communication Engineering  : Control systems, THE GATE ACADEMY Electronics and Communication Engineering  : Control systems, THE GATE ACADEMY
Electronics and Communication Engineering : Control systems, THE GATE ACADEMY
 
Electronics and Communication Engineering : Communications, THE GATE ACADEMY
Electronics and Communication Engineering : Communications, THE GATE ACADEMYElectronics and Communication Engineering : Communications, THE GATE ACADEMY
Electronics and Communication Engineering : Communications, THE GATE ACADEMY
 
Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY
 Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY
Electronics and Communication Engineering : Analog circuits, THE GATE ACADEMY
 
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYComputer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
 
Civil Engineering : Rcc & steel structures, THE GATE ACADEMY
Civil Engineering : Rcc & steel structures, THE GATE ACADEMYCivil Engineering : Rcc & steel structures, THE GATE ACADEMY
Civil Engineering : Rcc & steel structures, THE GATE ACADEMY
 
Gate material civil engineering, environmental engineering
Gate material   civil engineering, environmental engineeringGate material   civil engineering, environmental engineering
Gate material civil engineering, environmental engineering
 

Kürzlich hochgeladen

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 

Kürzlich hochgeladen (20)

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 

Computer Science Engineering : Operating system, THE GATE ACADEMY

  • 1.
  • 3. Syllabus Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Syllabus for Operating System Processes, Threads, Inter-process communication, Concurrency, Synchronization, Deadlock, CPU scheduling, Memory management and virtual memory, File systems, I/O systems, Protection and security. Analysis of GATE Papers (Operating System) Year Percentage of marks Overall Percentage 2013 12.00 8.12% 2012 9.33 2011 5.00 2010 7.00 2009 8.00 2008 9.33 2007 9.33 2006 11.33 2005 2.67 2004 7.33 2003 8.00
  • 4. Contents Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page i CC OO NN TT EE NN TT SS Chapters Page No. #1. Introduction to Operating System 1 – 10  Introduction 1  Evolution of Operating System 2 – 3  Major Achievements 3 – 5  Operating System Operations 5 – 6  Micro Kernel Architecture 6 – 8  Assignment 9  Answer Keys 10  Explanations 10 #2. Process Management 11 – 45  Process 11  Process vs Program 11  Process State 11  Process Creation 12 – 13  Process Termination 13 – 14  Process Scheduling 14  Interprocess Communication, Concurrency and Synchronization 14 – 17  The Critical Section Problem 17 – 19  Bakery Algorithm 19 – 20  Semaphores 20 – 23  The Readers and Writers Problem 23 – 26  Monitors 26 – 29  Solved Examples 30 – 33  Assignment 1 34 – 38  Assignment 2 38 – 41  Answer Keys 42  Explanations 42 – 45 #3. Threads 46 -52  Thread 46  Life Cycle Of Threads 46 – 47  Multithreading 47  Process Vs Thread 48  User Level and Kernel Level Threads 48 – 50  Assignment 50 – 51  Answer Keys 52  Explanations 52
  • 5. Contents Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page ii #4. CPU Scheduling 53 – 77  Basic Concept 53  Schedulers 53 – 54  Scheduling Methodology 54  CPU Scheduling Algorithm 54 – 62  Solved Examples 63 – 67  Assignment 1 68 – 72  Assignment 2 72 – 73  Answer Keys 74  Explanations 74 – 77 #5. Deadlocks 78 -92  Definition 78  Resource Allocation Graph 78  Condition for Deadlock 78 – 79  Deadlock Prevention 79  Deadlock Avoidance 79 – 82  Deadlock Detection 82 – 83  Recovery From Deadlock 84  Assignment 1 85 – 88  Assignment 2 88 – 89  Answer Keys 90  Explanations 90 – 92 #6. Memory Management 93-134  Introduction 93  Logical and Physical Address Space 93 – 94  Memory Management Requirements 94 – 96  Memory Allocation Method 96 – 102  Paging 102 – 106  Segmentation 106 – 109  Page Replacement Algorithm 110 – 112  Thrashing 112 – 113  Solved Examples 114 – 125  Assignment 1 126 – 128  Assignment 2 128 – 129  Answer Keys 130  Explanations 130 – 134 #7. File System 135 – 153  Introdution 135  File Concept 135 – 137  Access Methods 137 – 138
  • 6. Contents Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page iii  Directory Structure 138 – 140  Protection 140 – 144  Free Space Management 144 – 145  Solved Examples 146 – 147  Assignment 1 148 – 149  Assignment 2 150 – 151  Answer Keys 152  Explanation 152 – 153 #8. I/O System 154 - 172  Kernel I/O Subsystem 154  Disk Structure 154 – 155  Disk Scheduling 155 – 157  Disk Management 157 – 158  RAID 158 – 159  Solved Examples 160 – 163  Assignment 1 164 – 167  Assignment 2 167 – 168  Answer Keys 169  Explanations 169 – 172 #9. Protection and Security 173 – 185  Domain of Protection 173  Access Matrix 173 – 176  The Security Problem 176 – 178  Solved Examples 179 – 180  Assignment 1 181 – 182  Assignment 2 182 – 183  Answer Keys 184  Explanations 184 – 185 Module Test 186 –199  Test Questions 186 – 194  Answer Keys 195  Explanations 195 – 199 Reference Books 200
  • 7. Chapter 1 Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 1 CHAPTER 1 Introduction to Operating System What is an Operating System? An operating system is a collection of programs and utilities. It act as the interface between user and computer. It creates a user friendly environment. The Operating System act as a Resource Manager. (A Computer system has many resources (Hardware and Software) which may require for completing a task). The computer uses resources like input/output device, memory, file, storage space, CPU time and so on. The operating system acts as a manager of these resources and allocates them to specific program and users as necessary for their tasks. Therefore we can say an operating system act as a resource manager. Generally resource sharing in two ways ‘in time’ and ‘in space’. For example a CPU is a time sharing resource and the main memory is a space sharing resource. The main difference between in time sharing and in space sharing resource is ‘in time’ resource is not divided into units, where as in space resources is divided into units. Structure of Operating System The structure of operating system consists of 4 layers; these are hardware, software, system program and application program. The hardware part consists of CPU, main memory, I/O device, Secondary storage etc. The software includes process management routines, memory management routines, I/O control routines, file management routines. The system program layer consist of complier, assembler etc. Last one is the application program that depends on users. Components of a Computer System
  • 8. Chapter 1 Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 2 Evolution of Operating System i. Serial Processing: Before 1950 the programmer directly interacts with hardware. There was no operating system at that time, if the programmer wish to execute a program on these days, the following steps are necessary.  Type the program on punch card  Convert punched card to card reader  Submit to the computing machine, is there any error, the condition was indicated by lights.  The programmer examines the registers and main memory to identify the cause of error.  Take the output of error.  Take the output on the printers.  Then the programmer ready for the next program This type of processing takes much time and next program should wait for the completion of previous one. The programs are submitted to the machine one after one. Therefore this machine is said to be serial processing. ii. Batch Processing: In older days (before 1960), it was difficult to execute a program using computer. Because the computer located in three rooms. One room for card reader second room for executing the program third room for printing the result. The user or machine operator needs to run between these three rooms to complete a job. We can solve this problem using Batch processing. In batch processing same type of task are grouped together and execute at a time. The carrier carries the group of job at a time from one room to another. Therefore the programmer need not to run between these 3 rooms several times. iii. Multiprogramming: Multiprogramming is a technique to execute number of programs simultaneously by a single processor. In multiprogramming more than one process can reside in main memory at a time. The operating system picks and begins execute one of the jobs in the main memory. In non multiprogramming system, the CPU can execute only one program at a time. If the running program is waiting for any I/O device, the CPU becomes idle, so it will effect the performance of the CPU. But in multiprocessing environment, any I/O wait happened in a process and then the CPU switches from the job to another job in the job pool. So the CPU is not idle at any time. iv. Time Sharing System: Time sharing or multitasking is a logical extension of multiprocessing. In time sharing system the CPU selects a job from the ready queue and switches the CPU to that job. When the time slot is expired the CPU switches from this job to another, in this method CPU is shared by different process, so it is said to be “Time Sharing System.” The main advantage of time sharing system over the batch processing system is the user can interact with the job when it is executing but it is not possible in batch system. Another advantage of time sharing system is efficient CPU utilization. v. Parallel System: If a system has more than one processor in close communication, sharing the computer bus, the clock, memory and peripheral devices, this system is referred as “tightly coupled” system. A system consisting of more than one processor and if it is a tightly coupled and then the system is called parallel system. One advantage of
  • 9. Chapter 1 Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 3 parallel system is increased “Throughput”. The performance of CPU is measured in terms of Throughput. The number of jobs completed by a CPU with in a time period is said to be “Throughput”. Multiprocessor can also save money compared to multiple single system because the processor can share peripherals, cabinet and power supply. Another advantages of multiprocessor system is that they increase reliability. vi. Distributed System: In distributed system, the processor can’t share memory or clock, each processor has its own local memory. The processor communicate one another though various communication lines. These system are usually called loosely coupled system. The advantage of distributed system are: 1. Resource sharing 2. Computation speed up 3. Reliability vii. Real Time System  Used when there are rigid time requirements on the operating of a processor or the flow of data.  Systems that control scientific experiments, medical imaging systems, industrial control systems and some display system are real time systems.  Two types of real time systems are:  A hard real time system: guarantees that critical tasks completed on time.  Soft real time system: A less restrictive type of real time system is a soft real time system. Given their date of deadline support they are risky to use for industrial control and robotics Spooling The expansion of spooling is simultaneous peripheral operations on line. Simultaneous means for example if two or more user issue print command and the printer accept the request even the printer is printing some other jobs. The printer printing one job at the same time the spool disk can load some other jobs. Operating System Functions 1. Program creation 2. Programs execution 3. Input output operation 4. Error detection 5. Resource allocation 6. Accounting 7. Protection Major Achievements The major achievement of operating system are Process Management A process is a program in execution: (A program is passive in nature while a process is active) A process has resources (CPU time, files) and attribute that must be managed.
  • 10. Chapter 1 Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 4 Management of Processes Includes:  Process scheduling (priority, time management,…)  Creation/termination  Block/Unblock (suspension/resumption)  Synchronization  Communication  Deadlock handling  Debugging Main Memory Management  Allocation/de-allocation for processes, files, I/O  Maintenance of several processes at a time  Keep track of who’s using what memory  Movement of process memory to/from secondary storage. File Management A file is a collection of related information defined by its creator, commonly files represent program (both source and object forms) and data. The operating system is responsible for the following activities in connections with file management:  File creation and deletion  Directory creation and deletion  Support of primitives for manipulating files and directories  Mapping files onto secondary storage  File backup on stable (non volatile) storage media I/O Management  Buffer caching system  Generic device driver code  Drivers for each device- translate requests into position commands Secondary Storage Management  Disk, tapes, optical  Free space management ( paging/swapping)  Storage allocation (what data goes where on disk)  Disk scheduling Networking  Communication system between distributed processors.  Getting information about files/processes/etc. on remote machine.
  • 11. Chapter 1 Operating System THE GATE ACADEMY PVT.LTD. H.O.: #74, Keshava Krupa (third Floor), 30th Cross, 10th Main, Jayanagar 4th Block, Bangalore-11 : 080-65700750,  info@thegateacademy.com © Copyright reserved. Web: www.thegateacademy.com Page 5  Can use either a message passing or a shared memory model. Protection  Of files, memory, CPU, etc.  Means controlling of access  Depends on the attributes of the file and user System Program  Command Interpreters – Program that accepts control statements (shell, GUI interface, etc.)  Compilers/linkers  Communication (ftp, telnet, etc.) System Tailoring Modifying the operating System program for a particular machine. The goal is to include all the necessary pieces but not too many extra ones.  Typically a System can support many possible devices but any one installation has only a few of these possibilities.  Plug and play allows for detection of device and automatic inclusion of the code (driver) necessary to drive these devices.  A system is usually a link of many OS routines/modules in order to produce an executable code to run the drivers. Operating System Operations Modern operating systems are interrupt driven. If there are no processes to execute, no I/O devices to service and no users to respond, an operating system will quietly waiting for something to happen. Events are almost always signaled by the occurrence of an interrupt or a trap. Traps and interrupts are events that disrupt the normal sequence of instruction executed by the CPU. A trap is an abnormal condition detected by the CPU, that usually is an indicative of an error. Trap condition can occur in following ways (a) Dividing by zero (b) Trying to access a memory location that does not exists or for which the program does not have access (c) Executing an instruction with an undefined opcode, (d) Trying to access a nonexistent I/O device. An interrupt is a signal sent to the CPU by an external device, typically an I/O device. It is the CPU’s equivalent of a pager, a signal requesting the CPU to interrupt its current activities to attend to the interrupting device needs. A CPU will check interrupts only after it has completed the processing of one instruction and before it fetches a subsequent one. The CPU responds to traps and interrupts by saving the current value of the program counter and resetting the program counter to a new address. This allows the CPU to return to the executing point where the trap or interrupt occurred, after it has executed a procedure for handling the trap or interrupt.