Supplementary Winter-2023 Course: B. Tech. Branch: Computer Engineering Semester: IV Subject Code & Name: BTCOC402 & Operating System Max Marks: 60 Date: Duration: 3 Hr. Instructions to the Students: 1. All the questions are compulsory. 2. The level of question/expected answer as per OBE or the Course Outcome (CO) on which the question is based is mentioned in ( ) in front of the question. 3. Use of non-programmable scientific calculators is allowed. 4. Assume suitable data wherever necessary and mention it clearly. (Level) Marks Q. 1 Solve Any Two of the following. 12 A) List out different services of Operating Systems and Describe each service. (2) 6 B) What are system calls? Explain different categories of system calls with (2) 6 example? C) Describe different sub-components of an operating system. (2) 6
Q.2 Solve Any Two of the following. 12
A) Consider the following data with burst time given in milliseconds: (3) 6 Process Burst Time Priority Arrival time P1 7 3 0 P2 4 1 2 P3 1 2 4 P4 4 4 5 i) Draw Gantt charts for the execution of these processes using FCFS, non-preemptive and preemptive SJF, and non-preemptive Priority scheduling. ii) What is the Average waiting time of each process for each of the scheduling algorithm. B) Describe the actions taken by a kernel to context switch between kernel (2) 6 level threads C) Suppose the following jobs arrive for processing at the times indicated, (3) 6 each job will run the listed amount of time. Job arrival time burst time 1 0.0 9 2 0.2 5 3 1.2 2 i) Give a Gantt chart illustrating the execution of these jobs using the non- preemptive FCFS and SJF scheduling algorithms. ii) what is turnaround time and wait time of each job for the above algorithms? Q. 3 Solve Any Two of the following. 12 A) Examine banker’s algorithm after applying to the example given below A (3) 6 system has 5 processes, P1, P2, P3, P4 and P5. There are 2 types of resources A, and B. there are 10 instances of A, and 5 instances of B. At time T0, the situation is as follows; Process- Allocation- Maximum A B A B P1 0 1 7 5 P2 2 0 3 2 P3 3 0 9 0 P4 2 1 2 2 P5 0 0 4 3 Is the system in a safe state at time T0? Suppose now a time T1, process P2 requests one additional instance of resource type A.
B) Describe necessary conditions for a deadlock situation to arise. (2) 6
C) What is critical section problem and what are the requirements that need to (2) 6 be satisfied by any solution to critical section problem? Give a solution to a 2 process critical section problem.
Q.4 Solve Any Two of the following. 12
A) Consider a logical address space of 8 pages of 1024 words each, mapped (3) 6 on to a physical memory of 32 frames. How many bits are there in the logical address? How many bits are there in the physical address? B) A process references 6 pages 1, 2, 3, 4, 5, 6 in the following order (3) 6 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6 Assuming that the replacement algorithm is LRU, Optimal and FIFO, find out the number of page faults during the sequence of references, starting with an empty main memory with 3 frames. C) Explain with the help of supporting diagram how TLB improves the per- (2) 6 formance of a demand paging system.
Q. 5 Solve Any Two of the following. 12
A) Consider two files systems A and B, that use contiguous allocation and (3) 6 linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the calculate value of n A + nB. B) Suppose that a disk drive has 200 cylinders, numbered 0 to 199. the drive (3) 6 currently services a request at cylinder 50, and the previous request was at cylinder 25. the queue of pending request in FIFO order is 82,170,43,140,24,16,190 Starting from the current position, what is the to- tal distance (in cylinders) that the disk arm moves to satisfy all pending re- quests, for each of the following algorithms i)FCFS ii) SSFT iii) SCAN iv)LOOK v) C-SCAN vi) C-LOOK. C) What are the three methods for allocating disk space? Explain with help (2) 6 each method suitable diagram, merits and demerits.