Previous year question paper 2024
Section A (2 Marks Questions)
1. Mention the different operating system components.
Operating system components include process control block (PCB), system calls,
schedulers, and directory structures.
2. What is the difference between multi-tasking and multi-user system?
○ Multi-tasking system: This allows multiple tasks to run concurrently on a single
CPU.
○ Multi-user system: This allows multiple users to share a single computer system
simultaneously3.
3. What is scheduling?
Scheduling is the process of managing and prioritizing the execution of processes or
threads by the CPU
4. What is mutual exclusion?
Mutual exclusion is a condition that ensures that only one process can access a shared
resource at a time, preventing race conditions.
5. What are the necessary conditions for deadlock?
The necessary conditions for deadlock are: Mutual Exclusion, Hold and Wait, No
Preemption, and Circular Wait.
6. What is aging?
Aging is a technique used to prevent starvation in scheduling algorithms by gradually
increasing the priority of processes that have been waiting for a long time.
7. What is virtual memory?
Virtual memory is a memory management technique that allows the execution of
processes that are not entirely in memory. It creates the illusion of a larger main memory
than physically available
8. What is demand paging?
Demand paging is a virtual memory technique where pages are loaded into memory only
when they are needed or accessed, rather than pre-loading them.
9. Mention any four file operations.
Four file operations are: create, delete, read, and write.
Section B (6 Marks Questions)
10.What is operating system? Give four functions of operating system.
An operating system is a software that manages computer hardware and software
resources and provides common services for computer programs..
Four functions of an operating system are:
○ Process Management
○ Memory Management
○ File Management
○ Device Management
11.What is process? Draw a process state transition diagram and explain.
A process is a program in execution.
A process state transition diagram typically includes states such as:
○ New: The process is being created.
○ Ready: The process is waiting to be assigned to a processor.
○ Running: Instructions are being executed.
○ Waiting: The process is waiting for some event to occur (e.g., I/O completion1.
○ Terminated: The process has finished execution. (A diagram cannot be drawn in
text, but the states and transitions would be explained with arrows between them,
e.g., New to Ready, Ready to Running, Running to Waiting/Ready/Terminated, Waiting
to Ready).
12.Explain the requirement to critical section problems.
The critical section problem involves designing a protocol that processes can use to
cooperate. The key requirements to solve the critical section problem are:
○ Mutual Exclusion: Only one process can be in its critical section at any given time24.
○ Progress: If no process is executing in its critical section and some processes wish
to enter their critical sections, then only those processes that are not executing in
their remainder section can participate in deciding which will enter its critical section
next, and this selection cannot be postponed indefinitely.
○ Bounded Waiting: A bound must exist on the number of times that other processes
are allowed to enter their critical sections after a process has made a request to
enter its critical section and before that request is granted26.
13.Explain Banker's algorithm.
Banker's algorithm is a deadlock-avoidance algorithm that dynamically examines the
state of the system to ensure that there can never be a circular-wait condition27. It is
used to check if a state is safe by simulating the allocation of resources to find a safe
sequence of processes. If a safe sequence can be found, the state is considered safe;
otherwise, it is unsafe
14.Explain FIFO page replacement algorithm with an example.
The First-In, First-Out (FIFO) page replacement algorithm replaces the page that has
been in memory for the longest time.. It is simple to implement, as it only requires
keeping track of the order in which pages are brought into memory31313131.
Example:
Consider a page reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1
And memory with 3 frames.
(A detailed step-by-step example with a table showing page frames and page faults
would be provided in an actual answer, demonstrating how the oldest page is replaced.)
15.What are different file accessing methods? Explain.
Different file accessing methods include:
○ Sequential Access: Information in the file is processed in order, one record after the
other. This is the most common access method33333333.
○ Direct Access (Relative Access): Files are made up of fixed-length logical records
that allow programs to read and write records rapidly in no particular order34343434.
○ Indexed Sequential Access: This method builds an index for the file, which contains
pointers to various blocks. To find a record, the index is searched35353535.
Section C (8 Marks Questions)
16.a) Explain Process Control Block.
A Process Control Block (PCB) is a data structure in the operating system kernel which
contains the information needed to manage a process. It acts as the repository for any
information that may vary from process to process.
Information typically stored in a PCB includes:
○ Process State (new, ready, running, waiting, halted) Program Counter (address of the
next instruction to be executed)
○ CPU registers.
○ CPU scheduling information (priorities, pointers to scheduling queues)
○ Memory-management information (base and limit registers, page tables)
○ Accounting information (CPU used, time limits, process ID)
○ I/O status information (list of open files, I/O devices allocated)
b) Write a note on system calls.System calls provide an interface to the services made
available by the operating system. They are the programmatic way in which a computer
program requests a service from the kernel of the operating system. System calls are
generally written in C or C++, while some are written in assembly. Examples include calls
for process control (e.g., create process, terminate process), file manipulation (e.g.,
open, read, write, close), device manipulation (e.g., request device, release device),
information maintenance (e.g., get time, set time), and communication (e.g., create pipe,
send message).
17.a) Write a note on Multiprocessor scheduling.
Multiprocessor scheduling involves managing multiple CPUs and assigning processes to
them49. Key issues include:
○ Load Sharing: Distributing processes evenly among the processors to maximize CPU
utilization50.
○ Symmetric Multiprocessing (SMP): Each processor is self-scheduling, and all
processes are in a common ready queue51.
○ Asymmetric Multiprocessing: One processor (the master server) handles all
scheduling decisions, I/O processing, and other system activities52.
○ Processor Affinity: A process tries to run on the same processor to take advantage
of cache memory.
b) Write a note on Real-Time CPU Scheduling.Real-time CPU scheduling is concerned
with meeting deadlines for tasks54. Real-time systems are classified as:
○ Hard Real-Time Systems: Guarantee that critical tasks complete on time. Failure to
do so would result in system failure55. They are often used in industrial control and
robotics.
○ Soft Real-Time Systems: Provide no guarantee as to when a critical real-time task
will be complete, but rather guarantee that the task will be given preference over less
critical tasks57. Multimedia and networked applications are examples58. Common
algorithms include Rate Monotonic Scheduling (RMS) and Earliest Deadline First
(EDF) scheduling59.
18.Explain deadlock detection and recovery algorithms.
Deadlock detection and recovery algorithms are used when deadlocks are allowed to
occur60.
Deadlock Detection:
○ If a system has only one instance of each resource type, a cycle-detection algorithm
can be used in the resource-allocation graph61.
○ If a system has several instances of a resource type, the Banker's algorithm's safety
algorithm can be modified to determine if a system is in a deadlocked state62. The
algorithm checks for a sequence of processes that can complete their execution63.
Deadlock Recovery:Once a deadlock is detected, the system must recover. Common
recovery methods include:
○ Process Termination:
■ Terminate all deadlocked processes. This is simple but costly64.
■ Terminate one process at a time until the deadlock cycle is eliminated. This
requires re-invoking the detection algorithm after each termination65.
○ Resource Preemption:
■ Preempt resources from some processes and give them to others. This involves
selecting a victim process and rolling back its state66.
■ Rollback: Return a process to a safe state, and restart it from that state67.
■ Starvation: Ensure that a process is not always chosen as a victim68.
19.a) Write a short note on Thrashing.
Thrashing is a phenomenon in virtual memory systems where a computer spends most of
its time swapping pages in and out of active physical memory, rather than executing
application code69696969. This happens when a process does not have enough pages in
memory to meet its immediate needs, leading to frequent page faults. The CPU utilization
drops dramatically, and the system becomes largely unproductive. Thrashing can be
prevented by providing a process with enough frames to avoid excessive page faults or
by using working set model.
b) What is virtual memory? Explain.
Virtual memory is a memory management technique that allows the execution of
processes that are not entirely in memory. It separates user logical memory from physical
memory. This abstraction allows programs to address memory as if they have a
contiguous, large address space, even if the physical memory is fragmented or smaller
than the virtual address space. It enables greater program sizes than physical memory
and permits more programs to run concurrently. Demand paging is a common
implementation of virtual memory.
20.a) Explain file allocation methods.
File allocation methods determine how disk space is allocated to files78. The main
methods are:
○ Contiguous Allocation: Each file occupies a set of contiguous blocks on the disk79.
This method is simple to implement and provides excellent read performance but
suffers from external fragmentation80.
○ Linked Allocation: Each file is a linked list of disk blocks. Each block contains a
pointer to the next block81. This eliminates external fragmentation but requires
traversing the list for access and does not support direct access efficiently82.
○ Indexed Allocation: All the pointers to the file blocks are brought together into one
location called the index block83. Each file has its own index block. This supports
direct access and is efficient, but the size of the index block can be a limitation for
very large files
○
b) Explain directory structures.
A directory structure organizes files on a disk. Common directory structures include:
○ Single-Level Directory: All files are contained in a single directory.Simple to
implement but leads to name collisions and difficulties in grouping files for multiple
users.
○ Two-Level Directory: Each user has their own user file directory (UFD), and there is
a master file directory (MFD) that points to the UFDs . This solves the naming
problem for different users but isolates users from each other.
○ Tree-Structured Directories: A hierarchical structure where directories can contain
files and subdirectories. This allows for logical grouping and easy navigation. Most
modern operating systems use this structure.
○ Acyclic-Graph Directories: Allows shared subdirectories and files among different
directories, introducing links to existing files or directories. This provides flexibility
but can lead to problems with directory deletion and cycles.
○ General Graph Directory: A generalization of the acyclic graph structure, allowing
cycles. This provides maximum flexibility but is complex to manage and can lead to
difficulties in garbage collection.