0% found this document useful (0 votes)
14 views2 pages

Operating System Question Paper AI-1

This document is a sample question paper for the Operating System subject for Semester 4, totaling 60 marks. It consists of two sections, each with compulsory and optional questions covering various topics such as process scheduling, mutual exclusion, deadlock, memory management, and disk scheduling. Students are instructed to write answers in separate answer books and make suitable assumptions where necessary.

Uploaded by

okkshrutii
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Operating System Question Paper AI-1

This document is a sample question paper for the Operating System subject for Semester 4, totaling 60 marks. It consists of two sections, each with compulsory and optional questions covering various topics such as process scheduling, mutual exclusion, deadlock, memory management, and disk scheduling. Students are instructed to write answers in separate answer books and make suitable assumptions where necessary.

Uploaded by

okkshrutii
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAMPLE QUESTION PAPER AI – 1

Subject Name: Operating System


Semester: 4
Total Marks: 60

Instructions:

1. This question paper comprises of two sections. Write answers of both sections in
separate answer books.
2. From Section A, Q.1 is compulsory, attempt any THREE from Q.2 to Q.5.
3. From Section B, Q.1 is compulsory, attempt any THREE from Q.2 to Q.5.
4. Make suitable assumptions wherever necessary.
5. Start a new question on a new page.

Section-A (30 Marks)


Q.1 Answer the following questions: (All are compulsory and each of two
marks)

1. Define the term Operating System and list its two main functions.
2. What is a Process Control Block (PCB)?
3. Differentiate between Preemptive and Non-Preemptive Scheduling.
4. Explain the concept of Thread and mention its two benefits.
5. What do you mean by Context Switching?

Q.2 Answer the following questions:

A) Explain Round Robin (RR) scheduling algorithm with an example. (4 Marks)


B) Compare FCFS, SJF, and RR Scheduling. (2 Marks)

Q.3 Answer the following questions:

A) Define Mutual Exclusion and explain Peterson’s Solution. (4 Marks)


B) Differentiate between Semaphore and Monitor. (2 Marks)

Q.4 Answer the following questions:

A) Define Deadlock and explain the necessary conditions for deadlock occurrence. (4
Marks)
B) Explain Banker’s Algorithm with an example. (2 Marks)

Q.5 Answer the following questions:


A) What is Dining Philosopher Problem? Explain with a solution. (4 Marks)
B) Discuss Inter-process Communication (IPC) mechanisms. (2 Marks)

Section-B (30 Marks)


Q.1 Answer the following questions: (All are compulsory and each of two
marks)

1. Define Paging and Segmentation.


2. What is Fragmentation? Explain its types.
3. Differentiate between Logical and Physical Address.
4. What is Working Set Model in memory management?
5. Explain FIFO Page Replacement Algorithm with an example.

Q.2 Answer the following questions:

A) Explain Paging and Segmentation with their advantages and disadvantages. (4 Marks)
B) Compare Fixed and Variable Partitioning in memory allocation. (2 Marks)

Q.3 Answer the following questions:

A) Describe Page Replacement Algorithms: Optimal, FIFO, LRU. (4 Marks)


B) What is Thrashing in Virtual Memory? Explain briefly. (2 Marks)

Q.4 Answer the following questions:

A) Explain I/O Scheduling Algorithms (FCFS, SSTF, SCAN, C-SCAN). (4 Marks)


B) What are Bad Blocks and Boot Blocks in disk management? (2 Marks)

Q.5 Answer the following questions:

A) Explain Disk Structure and Disk Scheduling. (4 Marks)


B) What is File Allocation Method? Explain Contiguous and Indexed Allocation. (2
Marks)

End of the Question Paper

Common questions

Powered by AI

The FIFO Page Replacement Algorithm operates by replacing the oldest page in memory when a new page is needed, using a first-in, first-out approach. The simplicity of FIFO makes it easy to implement, but it can lead to efficiency drawbacks such as the Belady's anomaly, where increasing the number of page frames results in more page faults. This occurs because FIFO does not account for page usage patterns or frequency, leading to suboptimal decisions when less frequently used but critical pages are removed before less crucial ones .

Paging divides memory into fixed-size pages corresponding to frames in physical memory, simplifying allocation and avoiding external fragmentation, though it can suffer from internal fragmentation. It provides easy virtual to physical address mapping but does not reflect the logical view of programs. Segmentation allocates memory in variable-size segments based on logical units such as functions or data structures, aligning with the program structure and providing isolated memory spaces for different modules. This facilitates protection and sharing but can lead to external fragmentation .

Fixed Partitioning divides memory into a set number of small fixed-size partitions, leading to internal fragmentation when memory requirements of processes do not match partition sizes. This often results in wasted space but simplifies memory allocation bookkeeping. Variable Partitioning allocates memory dynamically sized to fit process requirements, reducing internal fragmentation but potentially increasing external fragmentation where free space is fragmented into small unusable chunks. Fixed Partitioning is easier to manage and predict but less flexible than Variable Partitioning, which better utilizes memory at the expense of complex management .

Round Robin (RR) scheduling allocates a fixed time slice or quantum to each process in the ready queue, cycling through them and ensuring a fair CPU time distribution. This can lead to increased overhead due to frequent context switches but minimizes process starvation. In contrast, Shortest Job First (SJF) selects the process with the smallest execution time next, which can minimize average waiting time but may cause starvation for longer processes. RR performs better in time-sharing systems where fairness is crucial, while SJF is more efficient in batch systems where minimizing average wait time is prioritized .

Thrashing occurs when a system spends a significant amount of time swapping pages in and out of memory rather than executing processes, drastically reducing performance. It is caused by processes exceeding available physical memory, leading to excessive paging. Strategies to mitigate thrashing include implementing the Working Set Model to ensure processes have enough pages loaded for efficient operation, deploying page replacement algorithms like LRU to prioritize frequently used pages, and increasing physical memory to better handle load demands. These strategies help stabilize memory use and improve overall system throughput .

The Dining Philosopher Problem models the challenges of allocating limited resources (forks) among multiple processes (philosophers) without causing deadlock or resource starvation. It illustrates the complexities of ensuring safe and efficient resource sharing while avoiding deadlock conditions such as circular waiting. A practical solution is using a waiter or an arbitrator that grants forks only when all are available, ensuring that resources are allocated atomically. Alternatively, using semaphores to control fork access can prevent deadlock by breaking the circular wait condition .

Peterson's Solution is effective in achieving mutual exclusion by using two shared variables to alternate access and ensure entry and exit sections control before critical section execution. However, its practical application is limited in modern multiprocessor systems due to assumptions of atomicity in flag setting and checking operations, which may not hold on contemporary architectures with instruction reordering and caching mechanisms. Additionally, Peterson's Solution works only for two processes, limiting its scalability in environments requiring broader concurrency handling .

The Process Control Block (PCB) is crucial in context switching as it stores the information associated with a process, such as its process state, program counter, CPU registers, memory limits, and open files. During a context switch, the operating system must save the state of the currently running process into its PCB and then load the saved state of the next process to be executed. This ensures that processes can be paused and resumed correctly, maintaining their execution state and other vital data .

The Working Set Model plays an important role in memory management by keeping track of the set of pages currently in use by a process, determining the necessary pages that must be loaded to minimize page faults. It addresses thrashing by adjusting the number of allocated frames to a process based on its current working set size, thereby ensuring that each process has sufficient memory to operate efficiently. By tracking the active pages over a specified period, it helps optimize memory utilization and stabilize system performance, reducing the likelihood of thrashing caused by frequent, excessive page swapping .

Banker's Algorithm is effective for deadlock avoidance as it simulates resource allocation requests and ensures a safe state by only approving operations that do not lead to deadlock. It offers a systematic approach to handle resource requests, providing flexibility and control. However, its implementation complexity increases with system size due to the need for constant recalculation of resource availability and process state assessments. It requires precise resource need estimations, which may not always be feasible, and introduces computational overhead, making it less suited for real-time systems .

You might also like