OS Update Blow UP KCS401
OS Update Blow UP KCS401
OPERATING SYSTEM
KCS-401
COURSE DESCRIPTION: This course is designed to help the students gain an understanding
of the Operating System and its application in different contexts. It’s also gives a better glimpse
of the design and the Implementation of the OS and also encompasses the various issues either
related with the technical or theoretical.
Course OutComes
Program OutComes
PO2: Problem Analysis: Identify, Formulate, review research literature and analyze complex
engineering problems related to CSE and reaching substantiated conclusions using first
principles of mathematics, natural sciences and engineering sciences.
PO12: Life-Long Learning: Recognize the need for and have the preparation and ability to
engage in independent and life-long learning the broadest context of technological change.
PSO2: Foundation of Computer System: the ability to interpret the fundamental concepts and
methodology of computer systems. Students can understand the functionality of hardware and
software aspects of computer systems.
Operating System is system software that manages computer hardware and software resources
and provides common services for computer programs. The operating system is a component of
the system software in a computer system. Application programs usually require an operating
system to function. Time-sharing operating systems schedule tasks for efficient use of the system
and may also include accounting software for cost allocation of processor time, mass storage,
printing, and other resources.
For hardware functions such as input and output and memory allocation, the operating system
acts as an intermediary between programs and the computer hardware, although the application
code is usually executed directly by the hardware and frequently makes system calls to an OS
function or is interrupted by it. Operating systems are found on many devices that contain a
computer—from cellular phones and video game consoles to web servers and supercomputers.
No. of REFEREN
UNIT TOPIC DETAILS Page No.
Lecture CE
Introduction to Operating 1
system, functions of Operating
system PgNo.3 - 10
I. Classification of Operating 1 Silberschatz,
systems Galvin and PgNo.12- 17
Operating System Structure 1 Gagne PgNo.18,70
Components of Operating 1
Introduction systems PgNo.18-31
Operating System Services 1 PgNo.55-66
Kernels/shell Introduction 1 PgNo. 10-15
Richard
Monolithic and Microkernel 1 Peterson
Systems PgNo. 18-22
Process Concept, Process States 1 PgNo.101-103
Process Control Block (PCB) 1 PgNo. 103
Process address space , Process 1
III. identification information PgNo. 105
Inter Process Communication 1
models, Process generation Silberschatz, PgNo. 116-123
Threads and Multi Thread 1 Galvin and
Management Gagne PgNo. 153-158
CPU Schedulers 1 PgNo. 108
Scheduling Scheduling Concepts, 1
Performance Criteria PgNo.183-188
Scheduling Algorithms 1 PgNo. 188-199
Multiprocessor Scheduling 1 PgNo.200-206
Principle of 1
Concurrency/Synchronization PgNo.225-227
Critical Section and Critical 1 Silberschatz,
Section Problem Galvin and PgNo. 227
II. Peterson’s solution 1 Gagne
PgNo. 229
Concurrent Dekker’s solution 1 PgNo. 268
Processes
Semaphores 1 PgNo.234-237
Silberschatz,
Test and Set operation 1
Galvin and PgNo. 231-233
Classical Problem in 1 Gagne
Concurrency PgNo. 239-244
Deadlock : System model, 1
III. Deadlock characterization PgNo. 283-289
Deadlock Prevention 1 Silberschatz PgNo. 291-294
, Galvin and
Deadlock Deadlock Avoidance 1 PgNo. 294-300
Gagne
Handling Daedlock Detection and 1
Recovery PgNo. 301-305
Basic bare machine, resident 1
monitors PgNo. 315-317
IV. Memory Allocation Schemes 1 PgNo. 318-327
Paging & protection 1 Silberschatz PgNo. 328-341
Segmentation 1 , Galvin and PgNo. 342-344
Memory Virtual Memory, Demand 1 Gagne
Management paging PgNo.357-367
Page replacement algorithms 1 PgNo. 369-375
Thrashing 1 PgNo. 386-388
Cache memory organization 1 Morris
Mano PgNo.238
File System Introduction 1 PgNo. 421-430
Access mechanism 1 PgNo. 430-432
V. File directories and File sharing 1 PgNo. 433-450
File System Implementation 1
and Protection Silberschatz PgNo.451, 464
I/O Disk Scheduling 1 , Galvin and
PgNo. 510-516
Management Gagne
Disk Management 1 PgNo. 516-519
and Disk
RAID Structure 1 PgNo.522-529
Scheduling
I/O devices and I/O subsystems 1 PgNo. 566-570
I/O buffering, Disk storage 1 PgNo. 572-574
References:
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley
2. M. Morris Mano, “Computer System Architecture", Pearson Education
3. Richard Peterson, “Linux: The Complete Reference”, Osborne McGraw-Hill
TUTORIAL SHEETS
OPERATING SYSTEM
TUTORIAL SHEET-1
Q1. What do you understand by user mode and kernel mode? Differentiate between multi
programming, Time sharing and multiprocessing operating system.
Q2. Define the components of an operating system? [AKTU2013-14]
Q3. What is operating System? Discuss its any four functions? [AKTU2013-14]
Q4. What is spooling? [AKTU2014-15]
Q5. Why operating system is needed ? Justify “operating system is the control program of the
system”. [AKTU2014-15]
TUTORIAL SHEET – 2
Q1. Justify the statement that Operating System is a reactive program. Explain the concept of
Kernel in Operating System. Also differentiate monolithic and micro-kernel system.
Q2. Discuss essential properties of Distributed operating system. [AKTU2012-13]
Q3. Differentiate between general purpose OS and real time OS with example. [AKTU2013-14]
Q4. What are the differences between shell and kernel? [AKTU2014-15]
Q5. Explain layered structure of an operating system? Also explain advantages and
disadvantages of the layered approach to system design. [AKTU2014-15]
TUTORIAL SHEET – 3
Q1. What are three requirements of any solution to the critical sections problem? Why are the
requirements needed?
Q2. State and Describe Producer & Consumer problem with its suitable solution? [AKTU2013-
14]
Q3. Explain Dekker’s Solution briefly. [AKTU2014-15]
Q4.Synchronization in the classical readers and writers problem can be achieved through use of
semaphores. In the following incomplete code for readers-writers problem, two binary
semaphores mutex and wrt are used to obtain synchronization. [GATE 2007]
wait (wrt)
writing is performed
signal (wrt)
wait (mutex)
readcount = readcount + 1
if readcount = 1 then S1
S2
reading is performed
S3
readcount = readcount - 1
if readcount = 0 then S4
signal (mutex)
The values of S1, S2, S3, S4, (in that order) are
1.signal (mutex), wait (wrt), signal (wrt), wait (mutex)
2.signal (wrt), signal (mutex), wait (mutex), wait (wrt)
3.wait (wrt), signal (mutex), wait (mutex), signal (wrt)
4.signal (mutex), wait (mutex), signal (mutex), wait (mutex)
Q5. Consider the methods used by processes P1 and P2 for accessing their critical sections
whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are
randomly assigned.
Method Used by P1
while (S1 == S2) ;
Critica1 Section
S1 = S2;
Method Used by P2
while (S1 != S2) ;
Critica1 Section
S2 = not (S1);
Which one of the following statements describes the properties achieved and why? [GATE
2010]
A-Mutual exclusion but not progress
B-Progress but not mutual exclusion
C-Neither mutual exclusion nor progress
D-Both mutual exclusion and progress
TUTORIAL SHEET – 4
Q1. What is Inter Process Communication? How the process communicate using Shared
Memory.
Q2. Define Semaphore. Give a scheme for implementation of semaphore primitives?
[AKTU2012-13]
Q3 Consider the following snapshot of the system: [AKTU2015-16]
TUTORIAL SHEET – 5
Q.1. What is a thread control block? How is it different from the process control block? Mention
some (two) of the parameters in TCB.
Q.2. Draw & Explain Process Control Block (PCB) with all its components. Also brief why
context switching is an overhead in the system? [AKTU2014-15]
Q.3. Consider the processes, CPU burst time and Arrival time given below: [AKTU2015-16]
Process Arrival Time Burst Time
P1 0.0 8
P2 1.0 4
P3 2.0 9
P4 3.0 5
Draw the Gantt chart and calculate the following by using SJF/SRTF CPU Scheduling Algorithm
(i) Average Waiting Time. (ii) Average Turn Around Time.
Q4.Which of the following is NOT a valid deadlock prevention scheme and explain why?
[GATE 2000]
a) Release all resources before requesting a new resource
b) Number the resources uniquely and never request a lower numbered resource than the last one
requested.
c) Never request a resource after releasing any resource
d) Request and all required resources be allocated before execution.
Q5. An operating system uses shortest remaining time first scheduling algorithm for pre-emptive
scheduling of processes. Consider the following set of processes with their arrival times and
CPU burst times (in milliseconds):
Q6. Consider the following CPU process with arrival time (in milliseconds).[GATE 2017}
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the
processes, then what is average waiting time across all processes ?
TUTORIAL SHEET – 6
What is the total waiting time for process P2? [GATE 2007]
Q5.For the processes listed in the following table, which scheduling schemes will give the lowest
average turnaround time? [GATE 2015]
Q1. What is partitioned memory allocation? Describe first-fit and best-fit strategies for disk
space allocation, with their merits and demerits.
Q2. Explain segmentation with diagram. [AKTU2014-15]
Q3. Explain the difference between internal and external fragmentation by taking suitable
example. Which one occurs in Pure Paging, Pure Segmentation, Demand Paging and Paged
Segmentation? [AKTU2014-15]
Q4. A system uses 3 page frames for storing process pages in main memory. It uses the Least
Recently Used (LRU) page replacement policy. Assume that all the page frames are initially
empty. What is the total number of page faults that will occur while processing the page
reference string given below?
4, 7, 6, 1, 7, 6, 1, 2, 7, 2 [GATE-2014]
Q5.Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB, and 250
KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes
357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which
partitions are NOT allotted to any process? [GATE 2015].
Q6. Consider a main memory with five page frames and the following sequence of page
preferences 3,8,2,3,9,1,6,3,8,9,3,6,2,1,3. Then find the total number of page fault oocured using
FIFO and LRU page replacement algorithm. [GATE 2015]
TUTORIAL SHEET – 8
Q.1. Explain thrashing with suitable diagram. What is a translation look-aside buffer?
Q.2. What do you mean by Belady’s anomaly? Which algorithm suffers from Belady’s anomaly?
[AKTU 2014-15]
Q.3. Consider the following reference string 12342156212376321236
How many page faults will occur for? [AKTU 2015-16]
(i) FIFO
(ii) LRU Page Replacement Algorithm.
Q4. Consider a paging hardware with a TLB. Assume that the entire page table and all the pages
are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to
access the physical memory. If the TLB hit ratio is 0.6, what is the effective memory access time
(in milliseconds)? [GATE 2014]
Q5.A computer system implements a 40 bit virtual address, page size of 8 kilobytes, and a 128-
entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume
that the TLB tag does not store any process id. What is the minimum length of the TLB tag in
bits? [GATE 2015]
TUTORIAL SHEET – 9
TUTORIAL SHEET – 10
Q6. Consider a disk pack with a seek time of 4ms and rotational speed of 10000 rotation per
minute. It has 600 sector per track and each sector can store 512 bytes of data . Consider a file
stored in the disk. The file contains 2000 sectors Assume that every sector access necessitates a
seek and the average rotational latency for accessing each sector is half of the time for one
complete rotation . Then what is the total time ( in ms) needed to read the entire file is?[GATE
2015]
MODEL PAPER
OPERATING SYSTEM
KCS-401
Time : 3 Hours MM: 100
SECTION A
a) What do you understand by the term soft real time operating system?
b) What are the differences between multiprocessing and multi programming?
c) Explain shortest job first cpu scheduling algorithm?
d) Explain virtual memory ?
e) What do you understand by the term page fault?
f) Explain term TLB?
g) What is paging, segmentation and fragmentation?
h) What is starvation?
i) What do you understand by locality of reference?
j) What is compaction?
SECTION B
SECTION C
(i) Create need matrix (ii) Use the safety algorithm to test if the system is in a safe
state.
(iii) If the system is in a safe state, can the following requests be granted, why or why not?
Please also run the safety algorithm on each request as necessary.
a. P1 requests (2,1,1,0) b.P1 requests (0,2,1,0)
SECTION B
2. Attempt any three of the following: 7 x 3 = 21
a. Define Process. Explain various steps involved in change of a
process state with neat transition diagram.
b. Explain Batch operating system with example.
c. What is a Critical Section problem? Give the conditions that a
solution to the critical section problem must satisfy.
d. Illustrate the page-replacement algorithms
(i) FIFO
(ii) Optimal Page Replacement
use the reference string 7, 0,1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2,1, 2, 0, 1, 7, 0,1
for a memory with three frames.
e. A hard disk having 2000 cylinders, numbered from 0 to 1999.
the drive is currently serving the request at cylinder 143,and
the previous request was at cylinder 125.The status of the
queue is as follows
86, 1470, 913, 1774,948,1509,1022,1750,130
What is the total distance (in cylinders) that the disk arm moves to satisfy the
entire pending request for each of the following disk-scheduling algorithms?
(i) SSTF
(ii) FCFS
SECTION C
3. Attempt any one part of the following: 7x1=7
(a) What is an Operating system? Describe the Operating-System Functions
(b) Write about monolithic kernel, layered, and microkernel
structures of operating systems.