0% found this document useful (0 votes)
5 views

Operating_Systems_Answers

Uploaded by

patilanuj49
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Operating_Systems_Answers

Uploaded by

patilanuj49
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Q1 (Attempt any EIGHT):

a) Define I/O bound process:

An I/O-bound process spends more time performing input/output operations than computations,

making its CPU usage minimal.

b) What is the purpose of fork() system call?

The fork() system call creates a new child process, which is a duplicate of the parent process.

c) What is Bootstrap Loader?

The bootstrap loader is a small program stored in ROM that initializes hardware and loads the

operating system into memory during startup.

d) Define context switch.

A context switch is the process of saving the state of a currently running process and loading the

state of another process for execution.

e) "Priority scheduling suffers from starvation," True/False. Justify.

True. Starvation occurs when lower-priority processes are indefinitely delayed because

higher-priority processes keep executing.

f) What is Mutual Exclusion?

Mutual exclusion ensures that only one process can access a critical section at a time to prevent

race conditions.

g) What is race condition?


A race condition occurs when multiple processes access shared resources concurrently, leading to

unpredictable behavior.

h) Define Limit register.

The limit register specifies the size of the addressable memory space for a process, ensuring it

cannot access memory outside its bounds.

i) What is Frame?

A frame is a fixed-size block of physical memory used in paging to store parts of a process.

j) List the advantages of open-source operating systems.

- Free to use and distribute.

- Transparency in code.

- Community-driven development.

- Highly customizable.

Q2 (Attempt any FOUR):

a) What is the critical section problem?

The critical section problem involves ensuring that only one process accesses shared resources at a

time to prevent conflicts.

b) What is the role of the dispatcher?

The dispatcher is responsible for giving control of the CPU to the process selected by the scheduler,

involving context switching, switching to user mode, and jumping to the process's instruction.

c) Write the benefits of virtual memory.


- Allows execution of large programs by using disk space as memory.

- Provides process isolation and security.

- Reduces fragmentation by allowing non-contiguous memory allocation.

d) Explain any two advantages of multithreading.

- Improved responsiveness: Threads can handle tasks concurrently, keeping the application

responsive.

- Efficient resource sharing: Threads share memory and resources of a process, reducing overhead.

e) Write the system calls under the category of process management.

- fork()

- exec()

- wait()

- exit()

- getpid()

Q3 (Attempt any TWO):

a) What is a process? Explain the different types of process states.

A process is a program in execution, consisting of code, data, and resources.

Process states:

1. New: The process is being created.

2. Ready: The process is waiting to be assigned to the CPU.

3. Running: The process is being executed on the CPU.

4. Waiting: The process is waiting for an event (e.g., I/O).

5. Terminated: The process has completed execution.


b) What is fragmentation? Explain the types of fragmentation.

Fragmentation occurs when memory is divided into small, non-contiguous blocks, leading to

inefficient utilization.

Types of Fragmentation:

1. Internal Fragmentation: Unused memory within allocated blocks.

2. External Fragmentation: Free memory is scattered across non-contiguous blocks, making it

unusable for large processes.

c) Round Robin CPU Scheduling (Time Quantum = 3):

Processes:

- P1: Burst time = 4, Arrival time = 2

- P2: Burst time = 6, Arrival time = 0

- P3: Burst time = 2, Arrival time = 1

Gantt Chart:

| P2 | P3 | P1 | P2 | P1 |

0 3 5 8 10 11

Calculation:

- Waiting Time (WT):

- P1: (5 - 2) + 3 = 6 ms

- P2: (11 - 6) = 5 ms

- P3: (3 - 1) = 2 ms
- Average WT: (6 + 5 + 2) / 3 = 4.33 ms

- Turnaround Time (TAT):

- P1: 11 - 2 = 9 ms

- P2: 11 - 0 = 11 ms

- P3: 5 - 1 = 4 ms

- Average TAT: (9 + 11 + 4) / 3 = 8 ms

Q4 (Attempt any TWO):

a) What is semaphore? Explain the dining philosopher's problem.

A semaphore is a synchronization tool used to manage resource sharing among processes. It is a

variable that is modified atomically using operations like wait() and signal().

Dining Philosopher's Problem:

It involves philosophers sitting around a table with limited forks. To prevent deadlock, philosophers

must acquire both forks (resources) or none to eat, and semaphores ensure mutual exclusion and

deadlock avoidance.

b) What are the different types of schedulers? Explain the working of the short-term scheduler.

1. Long-term scheduler: Determines which processes are admitted into the system for processing.

2. Short-term scheduler: Selects processes from the ready queue and allocates the CPU to one.

3. Medium-term scheduler: Suspends and resumes processes for efficient CPU usage.

Short-term Scheduler Working:

- Uses algorithms like Round Robin, FIFO, or Priority Scheduling.

- Selects the highest-priority process for execution and performs context switching.
c) Page Replacement (String: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 3):

Using FIFO (3 Frames):

- Page faults: 9

Using LRU (3 Frames):

- Page faults: 8

Q5 (Attempt any ONE):

a) Write a short note on MMU.

The Memory Management Unit (MMU) is a hardware component responsible for translating logical

addresses generated by the CPU into physical addresses in memory. It supports features like

paging and segmentation to optimize memory usage.

c) Explain the layered structure of the operating system.

The layered structure organizes the operating system into hierarchical layers:

1. Hardware: Lowest layer, managing physical devices.

2. Kernel: Manages system resources and core operations.

3. System Calls: Interface between user and kernel.

4. User Programs: Application layer interacting with system calls.

You might also like