BIT204 ยท TU past paper
Operating Systems 2080 question paper
The complete TU 2080 exam paper for Operating Systems (BIT204), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- Q1.10 marksTranslation Lookaside BufferHideAnswer
Why virtual memory technique is used in the computer system? What is logical address? Explain the process of conversion of logical address to physical address using TLB.[10]
- Q2.10 marksNumericalOptimal page replacement algorithmHideAnswer
Why Optimal Page Replacement is best but not practically feasible page replacement algorithm? Calculate the number of page faults for Optimal, LRU and FIFO replacement algorithm for the reference string: 1, 3, 4, 2, 3, 5, 4, 3, 1, 2, 4, 6, 3, 2, 1, 4, 2 using 3 page frames.[10]
- Q3.10 marksNumericalTurnaround time calculationHideAnswer
CPU Scheduling Analysis
Find Average waiting time and turn-around time for the following example using FIFO, SRTF and Round Robin scheduling algorithm. Assume quantum as 4 ms.
Process id Arrival time Burst time (ms) P1 0 8 P2 1 5 P3 1 10 P4 2 13 P5 2 17 [10]
- Q4.5 marksNumericalFile Allocation TableHideAnswer
A 2 GB disk has a 4-KB block size, calculate the size of the file allocation table if each entry of the table is 4 bytes. [5]
- Q5.5 marksCoalescing and compaction techniquesHideAnswer
Write down the basic difference between coalescing and compaction with diagram. [5]
- Q6.5 marksNumericalDisk scheduling algorithmsHideAnswer
Suppose that a disk drive has the cylinder numbered, 0 to 199 is currently serving a request at cylinder 143. The request queue is kept in the FIFO order 25, 17, 119, 197, 194, 15, 182, 115, and 183. What is the total head movement needed to satisfy these request for the following disk scheduling algorithm. a) FCFS b) SSTF [5]
Disk Scheduling: FCFS and SSTF
Given Data
- Cylinder range: 0 to 199
- Current head position: 143
- Request queue (FIFO): 25, 17, 119, 197, 194, 15, 182, 115, 183
a) FCFS (First Come First Served)
Service order: 143 โ 25 โ 17 โ 119 โ 197 โ 194 โ 15 โ 182 โ 115 โ 183
From To Distance 143 25 118 25 17 8 17 119 102 119 197 78 197 194 3 194 15 179 15 182 167 182 115 67 115 183 68 $$\text{Total} = 118+8+102+78+3+179+167+67+68 = 790$$
FCFS total head movement = 790 cylinders
b) SSTF (Shortest Seek Time First)
Always move to the nearest pending request.
At every step the head jumps to whichever pending cylinder is closest, so the distances to all remaining requests are compared before each move.
Current Nearest pending options Chosen Distance 143 119 (24), 115 (28), 182 (39) 119 24 119 115 (4), 182 (63), 183 (64) 115 4 115 182 (67), 183 (68), 25 (90) 182 67 182 183 (1), 194 (12), 197 (15) 183 1 183 194 (11), 197 (14) 194 11 194 197 (3), 25 (169) 197 3 197 25 (172), 17 (180) 25 172 25 17 (8), 15 (10) 17 8 17 15 (2) 15 2 Service order: 143 โ 119 โ 115 โ 182 โ 183 โ 194 โ 197 โ 25 โ 17 โ 15
$$\text{Total} = 24+4+67+1+11+3+172+8+2 = 292$$
SSTF total head movement = 292 cylinders
Note that 119 has to be taken before 115, since $|143-119| = 24$ is smaller than $|143-115| = 28$. Servicing 115 first would violate the shortest-seek rule even though the two requests sit close together.
Summary
Algorithm Total Head Movement FCFS 790 cylinders SSTF 292 cylinders SSTF greatly reduces head movement versus FCFS, at the risk of starvation for distant requests.
- Q7.5 marks3-state process modelHideAnswer
What is process? Explain 3 state process models with suitable diagram. [5]
Process and 3-State Process Model
What is a Process?
A process is a program in execution. It is an active entity that requires resources such as CPU time, memory, files, and I/O devices to accomplish its task. A process is more than just program code (text section); it also includes the current activity represented by the value of the program counter, processor registers, stack, and data section.
In simple terms: Program + Execution State = Process
3-State Process Model
As a process executes, it moves through different states. In the 3-state (three-state) process model, a process can be in one of the following three states:
States
State Description Running The process is currently being executed by the CPU. Ready The process is ready to execute but is waiting for the CPU to be assigned to it. Blocked (Waiting) The process is waiting for some event to occur (e.g., I/O completion, signal) and cannot proceed until that event happens.
State Transition Diagram
Dispatch +--------->---------+ | | | v READY RUNNING ^ | | Timeout/ | +-------<-----------+ (Preempt) | | Wait for | I/O or Event v BLOCKED | | I/O or Event | Completes | +--------->-----> READY
Explanation of Transitions
-
Ready โ Running (Dispatch)
- The OS scheduler selects the process from the ready queue and assigns the CPU to it.
-
Running โ Ready (Timeout / Preemption)
- The running process is preempted because its time slice (quantum) has expired, or a higher-priority process becomes ready. The process goes back to the ready queue.
-
Running โ Blocked (Wait for I/O or Event)
- The running process requests an I/O operation or waits for an event (e.g., reading from disk). Since it cannot continue, it moves to the blocked state.
-
Blocked โ Ready (I/O or Event Completes)
- When the awaited I/O or event is complete, the process moves back to the ready state and waits for CPU allocation.
Key Points
- Only one process can be in the Running state at a time on a single-processor system.
- Multiple processes can be in the Ready or Blocked state simultaneously.
- A process never goes directly from Blocked to Running; it must pass through Ready first.
- This model forms the foundation for more complex models (5-state, 7-state models).
-
- Q8.5 marksMemory mapped I/OHideAnswer
What is memory mapped I/O? Explain about device independent I/O software. [5]
- Q9.5 marksDeadlock versus starvationHideAnswer
Differentiate between deadlock and starvation? Discuss the process of detecting deadlocks when there are multiple resources of each type. [5]
- Q10.5 marksProgram versus process distinctionHideAnswer
Differentiate between process and a program. What is PCB? [5]
- Q11.5 marksProducer consumer problem with message pasHideAnswer
Write down the Solving technique of the producer consumer problem with Message passing? [5]
- Q12.5 marksSystem call definition and objectivesHideAnswer
What is system call? Explain the system call process in detail. [5]