Operating_Systems_Answers
Operating_Systems_Answers
An I/O-bound process spends more time performing input/output operations than computations,
The fork() system call creates a new child process, which is a duplicate of the parent process.
The bootstrap loader is a small program stored in ROM that initializes hardware and loads the
A context switch is the process of saving the state of a currently running process and loading the
True. Starvation occurs when lower-priority processes are indefinitely delayed because
Mutual exclusion ensures that only one process can access a critical section at a time to prevent
race conditions.
unpredictable behavior.
The limit register specifies the size of the addressable memory space for a process, ensuring it
i) What is Frame?
A frame is a fixed-size block of physical memory used in paging to store parts of a process.
- Transparency in code.
- Community-driven development.
- Highly customizable.
The critical section problem involves ensuring that only one process accesses shared resources at a
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.
- Improved responsiveness: Threads can handle tasks concurrently, keeping the application
responsive.
- Efficient resource sharing: Threads share memory and resources of a process, reducing overhead.
- fork()
- exec()
- wait()
- exit()
- getpid()
Process states:
Fragmentation occurs when memory is divided into small, non-contiguous blocks, leading to
inefficient utilization.
Types of Fragmentation:
Processes:
Gantt Chart:
| P2 | P3 | P1 | P2 | P1 |
0 3 5 8 10 11
Calculation:
- 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
- P1: 11 - 2 = 9 ms
- P2: 11 - 0 = 11 ms
- P3: 5 - 1 = 4 ms
- Average TAT: (9 + 11 + 4) / 3 = 8 ms
variable that is modified atomically using operations like wait() and signal().
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.
- 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):
- Page faults: 9
- Page faults: 8
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
The layered structure organizes the operating system into hierarchical layers: