Question Bank_operating System_unit_1 to 6
Question Bank_operating System_unit_1 to 6
-------------------------------------------------------------------------------------------------------
UNIT: 1
Introduction: Definition, Functions of Operating Systems, Evolution of Operating Systems,
Types of OS, Structural Overview, Services Provided by OS, System Programs and System Calls.
-------------------------------------------------------------------------------------------------------
1) What is operating system? Explain different types of operating systems along with their
advantages and disadvantages.
4) What are the type of services offered by operating system? Discuss in detail.
5) Define Operating System. Explain batch, time sharing and real time operating system in
detail.
8) How does a microkernel differ from conventional kernel? Briefly list the motivation and
difficulties behind this.
9) Describe difference between symmetric and asymmetric multiprocessing. What are the
advantages and disadvantages of multiprocessor system?
10) What is the purpose of system calls? Enumerate five system calls used in process
management or file management.
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
UNIT: 2
Scheduling: Process concept, Process control block, Types of scheduler, Context switch,
Scheduling criteria and different scheduling algorithms
Threads: Overview, Multithreading model
-------------------------------------------------------------------------------------------------------
1) What is process control block? Explain in detail about process control block. Also explain
process state transition.
3) Consider the following set of processes with the length of the CPU-burst time given in
milliseconds.
Process Burst time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
4) Consider the set of processes, with the arrival time (in milliseconds), CPU burst time (in
milliseconds), and priority (0 is the highest priority) shown below. None of the processes
have I/O burst time.
Compute average turnaround time and average waiting time using SJF and Priority CPU
scheduling algorithm.
5) Differentiate between preemptive and non-preemptive scheduling. State why strict non-
preemptive scheduling is unlikely to be used in a computer system?
7) Consider the following set of processes with the arrival time and CPU burst time given below:
Compute average turnaround time and average waiting time using following algorithm.
a) RR Time Slice 2
b) RR Time Slice 3
9) Assume you have the following jobs to execute with one processor with jobs arriving in the
order listed below:
Suppose a system uses RR scheduling with quantum of 15, find avg waiting time, turnaround
time of these jobs.
10) Consider the 4 process P1,P2,P3,P4 with the length of CPU burst time as follows:
Draw Gantts chart for each of the following algorithms and compute average waiting time.
a) FCFS
b) RR(T.S=2MS)
c) PRIORITY (WITH PREEMPTIVE)
11) What is scheduler? What are different types of schedulers? Explain in detail.
12) What are threads and multithreading? Explain different types of threads with neat sketches.
14) Consider four processes P1, P2, P3, P4 with length of CPU burst time.
Find out average waiting time and average turnaround time for the following algorithms:
a) FCFS
b) RR (Slice = 15 ms)
c) SJF Preemptive and Non-Preemptive
17) Discuss in detail about PCB (process control block) & context switching.
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
UNIT: 3
Process cooperation and synchronization: Race condition, Critical section problem, software
and hardware solution, Semaphores, conditional critical regions and monitors, Classical Inter Pro-
cess Communication Problems.
-------------------------------------------------------------------------------------------------------
3) What are the three requirements which must be satisfied by solution to critical section
problem? Discuss about all requirements in detail.
6) How does semaphore is used to implement mutual exclusion? Discuss it with suitable
example.
9) What are P and V operations in process synchronization? Explain these operations with
respect to counting semaphores.
10) Explain in detail about software based solution to critical section problem.
11) What is Semaphore? What is the difference between a binary and counting semaphore?
14) Let m[0]…m[4] be mutexes (binary semaphores) and P[0]…P[4] be processes. Suppose
each process P[i] executes the following:
wait(m[i]; wait(m[i+1]mod4]);
…….
release(m[i]; release(m[i+1]mod4]);
Above program code will be deadlock free or not if processes are executed in concurrent
way? Justify your answer.
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
UNIT: 4
Deadlocks & Protection: Deadlock definition, Prevention, Avoidance, Detection and recovery.
Access Matrix: Goals of Protection, Access matrix, Implementation of access matrix, Security
problem
-------------------------------------------------------------------------------------------------------
3) What is deadlock? What are the necessary conditions for deadlock situation to arise?
Let A, B, and C having resource with instance of 7,3 and 6 respectively. Then compute:
a) What is the contents of NEED matrix?
b) Whether the system in safe state or not?
6) What are several methods for enforcement of protection and security threats? Also compare
Access list and capability list.
7) What security measures can be used to protect your system from unauthorized access.
8) A computer system uses the Bankers algorithm to deal with deadlocks. It’s current state is
shown in tables below, where P0,P1,P2 and processes and R0,R1,R2 are resource types.
10) A single processor system has three resource types X, Y, Z which are shared by three
processes. There are 5 units of each resource type. Consider the following scenario, where
column alloc denotes the number of unit of each resource type allocated to each process,
and the column request denotes number of units of each resource type requested by a
process in order to complete the execution.
alloc request
X Y Z X Y Z
P0 1 2 1 1 0 3
P1 2 0 1 0 1 2
P2 2 2 1 1 2 0
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
UNIT: 5
Memory Management: Contiguous Memory Allocation Schemes, Paging, Segmentation,
Segmentation with paging, Virtual Memory: demand paging, page Faults and instruction restart,
page replacement algorithms, Allocation of Frames, Thrashing.
-------------------------------------------------------------------------------------------------------
1) Differentiate between Internal and External fragmentation.
2) A computer installation has 1000K of memory. The jobs arrive and finish in the following
sequences.
Job 1 requiring 200K arrives
Job 2 requiring 350K arrives
Job 3 requiring 300K arrives
Job 1 finishes
Job 4 requiring 120K arrives
Job 5 requiring 150K arrives
Job 6 require 80K arrives
Between Best Fit and First Fit, which algorithm performs better for this sequence.
4) In a computer system where the best fit algorithm is used for allocating jobs to memory
partitions, the following situation was encountered:
Partition Sizes in KB 4 8 20 2
Job Sizes in KB 2 14 3 6 6 10 20 2
Time for execution 4 10 2 1 4 1 8 6
6) What do you mean by address binding? Suggest the time at which address binding is
achieved during execution.
9) Explain under what circumstances to page fault occur? Describe the action taken by
operating system when a page fault occurs.
10) Assume that a main memory with only 4 pages, each of 16 bytes, is initially empty.
The CPU generates following sequence of virtual addresses and uses LRU policy:
0 4 8 20 24 36 44 12 68 72 80 84 28 32 88 92
a) How many page faults does this sequence cause?
b) What are the page numbers of pages present in the main memory at the end of the
sequence?
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
UNIT: 6
File System: Directory Structure, File-System Mounting, File Sharing & Protection. File-System
Structure, File-System Implementation. Directory Implementation, Disk space management and
space allocation strategies, File Recovery, Disk arm scheduling strategies.
-------------------------------------------------------------------------------------------------------
1) Suppose that a disk has 2000 cylinders, numbered 0 to 1999. The drive is currently serving
a request at cylinder 190 and the previous request at cylinder 143. The queue of pending
requests, in FIFO order is: 86,1890,913,1674,948,1509,1022,1750,183
Starting from the current head position, What is the total distance that the disk arm moves
to satisfy all the pending requests for each of the following disk scheduling algorithms?
a) FCFS
b) SSTF
c) SCAN
d) LOOK
e) C-SCAN
f) C-LOOK
3) What are the pieces of information associated with open file? Explain each of them.
7) A disk has 200 tracks (numbered 0 through 199). At a given time, it was servicing the
request of reading data from track 120, and the previous request, service was for track
90. The pending requests (in order of their arrival) are for track numbers:
30 70 115 130 110 80 20 25
How may time will the head change its direction for the disk scheduling policies SSTF
(Shortest Seek Time First) and FCFS(First Come First serve?
-------------------------------------------------------------------------------------------------------