Operating Systems - Unit Wise Questions
1. Define Monolithic and Layered System with suitable examples.
1. Define the
essential properties of following types of operating systems:
a. Batch
b. Interactive
c. Time sharing
d. Real time
e. Handheld
1. List the essential properties for the Batch-Oriented and Interactive operating system. For each of the following application which system (batch or Interactive) is more suitable? State the reason.
a. Word processing
b. Generating
monthly bank statements
c. Computing
pi to million decimal places
d. A
flight simulator
e. Generating
mark statement by university
1.
What is system called? Explain
the system call flow with the help of block a diagram.
1. Explain operating system as a resource manager and extended machine. Distinguish between Batch system and Time sharing systems.
OR
What is real time operating system? List the types. "Operating system is broker between computer System and User". Justify the statement?
3. How physical address is generated from logical address? Explain the process of system call with suitable diagram.
4. What is system call? Discuss process of handling system calls briefly.
4. How operating is as a resource manager? Explain.
4. What is an operating system? Differentiate between time sharing and real time operating system.
4. Classify the following applications as batch-oriented or interactive and explain the reason
a) Word processing
b) Generating
monthly bank statements
c) Computing
pi to a million decimal places
4. What are two modes of OS? Discuss different OS structures briefly.
4.
What is an operating system? Differentiate between time
sharing and real time operating system.
4. Differentiate
between personal computer operating systems and mainframe operating systems.
4. Define the essential properties of following types of operating systems.
a. Batch
b. Interactive
c. Time Sharing
d. Real Time
e. Handheld
11. Differentiate between time sharing and real time system.
12. Write short notes on (any two):
a. System programs
b. Race condition
c. Windows
file system
1. Define the term semaphore. How does semaphore
help in dining philosophers problem? Explain.
1. Defined interactive system goals? List various interactive scheduling algorithms. Consider following process data and compute average waiting time and average turnaround time for RR(quantum 10) and priority scheduling algorithms.
PID | Burst Time | Arrival Time | Priority |
A | 16 | 0 | 1 |
B | 37 | 12 | 2 |
C | 25 | 7 | 3 |
1. What kind of problem arises with sleep and wakeup mechanism of achieving mutual exclusion? Explain with suitable code snippet.
1. What is race condition? Calculate average waiting and average turnaround time of the given set of processes in table below using SJF and RR scheduling algorithm. [Note: Quantum time for RR=3].
Process id |
Arrival Time |
Execution Time |
A |
0 |
8 |
B |
2 |
14 |
C |
9 |
19 |
D |
19 |
7 |
E |
25 |
15 |
1. How semaphore is used for the process synchronization? Do you think semaphore is the best solution for solving critical section problem? Explain using it in Producer-consumer problem.
1. Explain "race condition" and also state how process synchronization is handled using semaphore? Explain with algorithms.
1. For the processes listed in following table, draw a Gantt chart illustrating their execution using:
a. First-come-First-Serve
b. Short-Job-First
c. Shortest-Remaining-Time-Next
d. Round-Robin (quantum=2)
e. Round-Robin (quantum=1)
Processes |
Arrival Time |
CPU Time |
A |
0.000 |
3 |
B |
1.001 |
6 |
C |
4.001 |
4 |
D |
6.002 |
2 |
What is the turnaround time for
each algorithm?
1. How thread based execution minimizes the context switching problem of process based execution? Explain the different multithreading model.
OR
“Using
semaphore is very critical for programmer” Do you support this statement? If
yes, prove the statement with some fact. If not, put your view with some
logical facts against the statement.
OR
Why some process requires
high priority? What would happen if all processes have some the priority?
Mention merits and demerits of assigning priority on process.
2. Round-robin scheduling behaves differently depending on its time quantum. Can the time quantum be set to make round robin behave the same as any of the following algorithms? If so how? Proof the assertion with an example.
a. FCFS
b. SJF
c. SRTN
3. For the processes listed in the following table, draw a
Gantt chart illustrating their execution and calculate the average waiting time
using :
a. First-Come-First-Serve
b. Short-Job-First
c. Shortest-Remaining-Time-Next
d.
Round-Robin (quantum =
2)
e. Round-Robin (quantum = 1)
Process |
Arrival Time |
Burst Time |
A |
0.00 |
4 |
B |
2.01 |
7 |
C |
3.01 |
2 |
D |
3.02 |
2 |
3. Consider following set of processes, with the length of the CPU-burst time and arrival time given in milliseconds.
Process Burst time Arrival time
P1 10 0
P2 15 2
P3 22 3
P4 16 5
P5 5 6
For the given data, draw Gantt charts that illustrate the execution of these processes using SJF and Robin algorithms with quantum 4 milliseconds.
3. Five batch jobs A through E, arrive at a computer center at almost same time. They have estimated running times of 10, 8, 4, 2, and 6. Their priorities are 3, 5, 2, 4 and 1 respectively with 5 being the highest priority. For each of the scheduling algorithms determine the average turn around time and waiting time.
a) Round Robin (Quantum=2)
b) Priority Scheduling
c) SJF
5. For each of the following transitions between the processes states, indicate whether the transition is possible. If it is possible, give an example of one thing that would cause it.
a) Running->Ready
b) Running->Blocked
c) Blocked->Running
5. What is lock variable? Discuss its working and problems associated with it in detail.
5. When threads are better than processes? Explain the concept of user level threads in detail.
4. Do you think a process can exist without any state? Justify your view with the help of process state transition diagram.
4. Explain the Peterson’s concept for the solution
of critical section problem.
5. How does process differ from program? Explain process state with the help of block diagram.
4. What is critical section problem? Why executing critical selection must be mutual exclusive? Explain.
4. What is critical section problem? Why executing critical selection must be mutual exclusive? Explain.
5. Briefly define the term scheduler in the context of any operating system. List three aims of the scheduler in any operating system.
6. Explain how multithreading improves performance over a single threaded solution.
5.
Why thread is necessary? In which circumstances
user-level thread is better that Kernal level thread?
5. Describe how multithreading improves performance over a singled-threaded solution.
5. Show how
sleep and wake up solution is better than busy waiting solution for the
critical section problem.
6. What is critical Section Problem? Describe the criteria to be satisfied for solving this problem.
6. Describe how multithreading improves performance over a single threaded solution.
6. “Using Semaphores is very critical for programmer”. Do you support this statement? If yes, prove the statement with some fact. If not, put your view with some logical facts against the statement.
7. Describe how Peterson’s solution preserve mutual exclusion in process CR execution.
6. Define the term race condition. Differentiate between race conditions and critical regions.
7. Explain how priority scheduling works. In how many ways can priority be assigned?
7. How Produce-Consumer problem can be solved with sleep and wakeup primitives? Explain.
7.
Draw and describe the 3-state process model.
7.
How can you define the term process scheduling?
Differentiate between I/O bound process and CPU bound process.
8. Are there any linkages between semaphore and deadlock condition? If yes, Explain with example.
8. Does window have any concept of process
hierarchy? How does parent control the child?
9. What resources are used when a thread is created? How does it differ from the resources used to create processes?
10. What is problem associated with semaphores? Explain the concept of monitors in brief.
10. Define the essential properties of (a) Batch, (b) Time sharing, (c) Real time operating systems.
10.
Explain why two-level scheduling is commonly used.
11. What are the differences between Busy Waiting and Blocking?
12. What are the scheduling criteria? How does preemptive priority scheduling introduce starvation?
12. What is the purpose of system call in OS? Differentiate between thread and process.
OR
Suppose three peoples are in line waiting for a department store to open for "the big sale". When the door opens, all three rush the door, but the door is not big enough for all them to pass through at once. Describe a solution for addressing this deadlock that will allow three peoples to pass through the door. Which of the 4 necessary deadlock conditions does your solution break? Explain
2. What is deadlock? Explain various conditions for deadlock. Discuss the Banker’s algorithm of multiple resources for avoidance of deadlock with suitable example.
2. What is difference between Deadlock and Starvation? Consider the following four resources A, B, C and D with five processes and answer the questions:
Allocation Max Available
A B C D A B C D A B C D
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
a) Is the system in a safe state? Use Banker algorithm. If yes give the sequence.
b) If a request from process from P1 arrives for (0, 4, 2, 0), can the request be granted immediately?
3. How unsafe state differs from deadlock state? Consider following initial state and identify wheather requested resource is and granted or denies for the given cases.
- What will happen if process D request 1 resource?
- what will happen if process A request 1 resource?
6.
List four necessary conditions for deadlock. Explain each of them briefly
what would be necessary
(in the operating system) to prevent the deadlock.
6. Define deadlock. How deadlock can be prevented?
7. What is deadlock? State the conditions necessary for deadlock to exist. Give reason, why all conditions are necessary.
7. Students working at individual PCs in a computer laboratory send their files to be printed by a server which spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for print spool is limited? How may the deadlock be avoided?
8. What do you mean by deadlock prevention? Mention the mechanism for deadlock prevention.
9. What is deadlock? State the conditions necessary for deadlock to exist. Give reason, all conditions are necessary.
9. Differentiate between deadlock and starvation? Discuss the process of detecting deadlocks when there are multiple resources of each type.
9. What is resource allocation graph? Explain the process of detecting deadlocks when there is single instance of each resource with suitable example?
10. What do you understand by deadlock detection and recovery? Discuss.
9. Why do deadlock occurs? How can you detect and recover from deadlock?
10. Define
the term indefinite postponement. How does it differ from deadlock?
2. Define the first-fit, best-fit and worst-fit strategies of memory placement. Given memory partitions of 10 k, 4 k, 20 k, 18 k, 7 k, 9 k, 12 k, and 15 k (in order). How would each of first- fit, best fit and worst fit algorithms place processes of 12 k, 10 k and 9 k (in order)? Which algorithms make the best use of memory?
2. why OPR is best but not practically feasible page replacement algorithm? Calculate the number of page faults for OPR, LRU and Clock page replacement algorithm for the reference string: 1, 3, 4, 2, 3, 5, 4, 3, 1, 2, 4, 6, 3, 2, 1, 4, 2. Assume that memory size is 3.
OR
Explain the memory management with example.
2. How Second Chance page replacement algorithm differs from FIFO page replacement policy? Discuss the concept of Belady's anomaly with suitable example.
2. What is page fault? Consider the following page reference string; 3, 3, 5, 4, 7, 1, 5, 5, 1, 4, 3, 7, 6, 3, 4, 1. How many page faults would occur for each of the following page replacement algorithms assuming 4 page frames?
a.) LRU page replacement
b.) FIFO page replacement
c.) Optimal page replacement
d.) Clock replacement
2. Given references to the following pages by a program, 0, 9, 0, 1, 8, 1, 8, 7, 8, 7, 1, 2, 8, 2, 7, 8, 2, 3, 8, 3. How many page faults will occur if the program has three page frames for each of the following algorithms?
a. FIFO
b. Optimal
c. Second
Chance
d. LRU
2. How many page faults occur for each of the following page replacement algorithm for the reference string 0 1 7 2 3 2 7 1 0 3 with four page frames and eight pages? Suppose all frames are initially empty.
a. Optimal replacement
b. FIFO replacement
c. LRU replacement
d. Clock replacement
2. Consider the following page reference string 1, 3, 5,4, 7, 1, 5, 6, 1, 2, 3, 7, 6, 3, 4, 1, 3, 8. How many page faults would occur for each of the following page replacement algorithms assuming 3 frames?
a) FIFO
b) OPR
c) LRU
2. Differentiate between:
a) Paging and Segmentation
b) Allocation of Swap Space
c) File attributes
3.
Write short notes on
:
a. Least
recently used page replacement algorithm
b. Segmentation
c. Associative memory
3. Consider the following page reference string :
1, 2, 3, 4, 2, 1, 5, 6, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page fault would occur for the LRU replacement, FIFO replacement and optimal replacement algorithms. Assuming
three, five or seven frames?
Remember all frames
are initially empty,
so your first unique pages
will all cost one fault each.
5. What is thrashing? Explain the cause and solution for thrashing.
5. What must user programs be prohibited from writing to the memory locations containing the interrupt vector?
6. Differentiate between internal and external fragmentation? Suppose that we have memory of 1000 KB with 5 partitions of size 150 KB, 200 KB, 250 KB, 100 KB, and 300 KB. Where the processes A and B of size 175 KB and 125 KB will be loaded, if we used Best-Fit and Worst-Fit strategy?
6. Differentiate between multi programming and Monoprogramming. What will be the CPU utilization with 6 processes with 60% IO waiting time are in memory?
5. When do page fault occur? Describe the actions
taken by an OS when a page fault occurs.
6. Given references to the following pages by a program, 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults will occur if the program has here page frames available to it and uses FIFO replacement?
7. Discuss in detail the use of translation look aside buffer (TLB) in the process of paging. Support your answer with illustration.
7. Differentiate between internal and external fragmentation with example.
7. Why paging is used? Explain with an example.
8. What are the segmentation and paging? Why they are combined into one scheme?
8. Given references to the following pages by a program, 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults will occur if the program has three page frames available to it and uses LRU replacement?
8. What is memory-mapped I/O? Explain with merits and demerits.
9. Write short notes on:
a) Memory Compaction
b) Virtual Machines
8. What is the virtual memory? What are the functions of associative memory?
8. A computer with 32 bit address uses a two level page table. Virtual addresses are split into a 9 bit top level page table field, 11-bit second level page table field and offset. How large the pages? How much maximum space required when page tables loaded into memory if each entry required when page tables loaded into memory if each entry required when page tables loaded into memory if each entry required 4 bytes.
8. What are Segmentation and Paging? Why they are sometimes combine into one scheme?
9. What do you mean by memory fragmentation? Distinguish between the internal and external fragmentation.
9. Two separate systems one implemented in bitmap and another in linked list to manage the fragmentation of 256 MB memory. For bitmap, allocation units are of 512 bytes. For linked list, each holes or segments are of 32 KB, and each node in the list needs a 32 bits. How many bytes of storage is required for each method? Which one is better in terms of memory spare required?
10. What is Fragmentation? Differentiate between internal and external fragmentation.
10. What is swapping? Differentiate contiguous memory allocation with non contiguous memory allocation.
10. Under what circumstances do page fault occur? Describe the action taken by the operating system when a page fault occurs.
10. Distinguish between the paging and segmentation. Why many systems use the combination of both?
11. Why program relocation and protection is important? Explain the technique of achieving program relocation and protection.
11. What approaches are used for managing free disk spaces? Explain linked list approach with suitable example.
10. What is the difference between physical address and virtual address? Explain the conversion of virtual address into physical address by MMU.
11. How many bits would be needed to store the free-space list under the following conditions if a bit map were used to implement?
a. 500,000
blocks total and 200,000 free blocks
b. 1,000,000 blocks total and 0 free blocks.
Also find how much space is required if it need to be stored in
memory.
11. Compare the bitmap and linked list implementation of disk free-space management. How much space required in memory to store bitmap for 20 GB hard disk with 2KB block size.
12. Write short notes: (Any two)
a) Best
Fit vs Worst Fit
b) Swapping
c) Semaphores
11.
What are the main motivations and issues in primary
memory management?
11.
Explain the mapping of virtual address to real address
under segmentation.
12. Explain about bit map and linked list memory management system.
2. Explain how does file allocation table (FAT)
manage the files. Mention the merits and demerits of FAT system. A 200 GB disk
has 1-KB block size, calculate the size of the file allocation table if each
entry of the table has to be 3 bytes.
OR
What do you mean by file system? What are the major
difference between file system interface and file system implementation?
Explain.
2.
Write short notes on
:
a. Disk
scheduling algorithms
b. Error handling and formatting
c. File operations
4. Describe the technique of long file names? In your opinion, which one is most efficient? Give reason to justify your answer.
6. Define file and directories. Explain about protection mechanism.
6.
Explain about hierarchial directory systems with
diagrammatic examples.
7. What is meant by file attributes? Discuss any one technique of implementing directories in detail.
8. Describe the methods for implementing files.
9. Describe the methods for implementing directories with examples.
11. Explain how file allocation table(FAT) manage the files. Mention the merits and demerits of using FAT.
11. Explain how file allocation table (FAT) manages files. Mention the merits and demerits of using FAT
OR
What do you mean by disk
management? What are the major differences between error handling and
formatting?
OR
Suppose that a disk drive has
100 cylinders, numbered 0 to 99. The drive is currently serving a request at
cylinder 43, and previous request was at cylinder 25. The queue of pending
request, in FIFO order is:
86,
70, 13, 74, 48, 9, 22, 50, 30
Starting from the current head
position, what is the total distance (in cylinders) that the disk arm moves to
satisfy all pending requests for each of the following disk scheduling
algorithms?
a. FCFS
b. SCAN
3. What is the main objective of disk scheduling algorithms? why SSTF is not practically feasible? Assume that we have disk with 100 tracks and currently head is at track number 35. What will be the seek time for the algorithms SCAN and LOOK for processing IO requests queue: 52, 67, 27, 11, 43, 85, 18, 75, 92, 8?
3. Suppose the head of a moving head disk with 200 tracks, numbered 0 to 199 is currently serving request at tracks 143 and has finished a request at track 125. The queue it request is kept in the FIFO order 86, 147, 91, 177, 94, 150, 102, 175, 130. What is the total head movements needed to satisfy these request for the following disk-scheduling algorithms?
i) FCFS ii) SSTF iii)SCAN iv)LOOK
3. What do you mean by disk management? Explain the error handling and formatting operation on the disk.
3. A disk has 8 sector track and spins at 600 rpm. It takes the controller time 10ms from the end of one I/O operation before it can issue a subsequent one. How long does it take to read all 8 sectors using the following interleaving system?
a. No interleaving
b. Single interleaving
c. Double interleaving
3. Suppose that the disk drive has 50 cylinders, numbered from 0 to 49. The drive currently serving the request at cylinder 20 and the previous request was at cylinder 25. The queue of pending request is 10, 22, 20, 2, 40, 6 and 38 in the order. A seek takes 6 msec per cylinder moved. How much seek time is needed for the following disk-scheduling algorithms?
a. First-Come, First-Served
b. Shortest
Seek Time First
c. SCAN
d. LOOK
3. Describe the goal of I/O software? What are the functions of Interrupt Handler? Explain.
5. Suppose that a disk drive has the cylinder numbered, 0 to 199 is currently serving a request at cylinder 143. The queue it request is kept in the FIFO order 25, 17, 119, 197, 194, 15, 182, 115, 183. What is the total head movement needed to satisfy these request for the following disk scheduling algorithm.
a) FCFS
b) SSTF
5. Suppose that a disk drive has the cylinder numbered from 0 to 4999. The head is currently at cylinder number 143. The queue for services of cylinder is as 86, 1470, 913, 948, 1509,1774, 1022, 1750 and 130. What is the total head movement in each of the following disk algorithm to satisfy the requests?
a) FCFS
b) SSTF
7. How can you manage free disk space? Explain the linked list approach of managing free disk space with example.
6. What are the differences between the trap and interrupt? What is the use of each function?
7. What is the advantage of interrupt over polling? Explain the working mechanism of interrupt controller.
8. Why the concept of disk interleaving is important? Explain with suitable example.
8. When programmed IO is suitable than other IO handling techniques? Explain the process of IO handling using DMA.
9. What is DMA. Explain how it works.
10. What do you mean by interrupt? Explain the working mechanism of interrupt controller.
9. What are the differences between the trap and interrupt? What is the use of each function?
9.
What do you mean by interrupt? Explain the working
mechanism of interrupt controller.
10. Discuss the concept of SJF and SRTN scheduling algorithms with suitable example.
10. What is “device independence”? Define.
11. How does DMA increase system concurrency? How does it complicate hardware design?
11. A disk queue has the following request to read tracks: 87, 170, 4, 57, 173, 32, 67 and 183. If disk head is initially at cylinder 90 and there are total 200 tracks then calculate total head movement using C-SCAN and C-LOOK algorithm.
12. Write short notes on:
a) Disk formatting
b) Memory
Mapped I/O
11. Discuss the working principles and advantages of Direct Memory Access.
12. What is direct memory access? Discuss its working principle.
12. Which one suited, polling/interrupt, for the following types of system? Give reason.
a. A
system dedicated to controlling single I/O devices.
b. A
work station running as heavily used web server.
12. How does DMA increase system concurrency? How does it complicate the hardware design?
12.
Explain the disk management with example.
12. Compare
the throughput (overall performance) of SCAN with SSTF.
12. Write short notes on:
- Linux File System
- Resource Allocation Graph
12. Write short notes on:
- IPC in Linux
- Disk access