BCS Operating Systems 2 — Questions and Answers
Question 1: What is the purpose of the page table in virtual memory management?
- To store the process code
- To map virtual addresses to physical memory addresses (Correct answer)
- To manage I/O device registers
- To schedule processes
Correct answer: To map virtual addresses to physical memory addresses
A page table maintains the mapping between a process's virtual page numbers and the corresponding physical frame numbers in RAM.
Question 2: What is the difference between a process and a thread?
- Processes share memory; threads do not
- Threads are heavyweight; processes are lightweight
- A thread is a unit of execution within a process; processes have separate memory spaces (Correct answer)
- They are identical in all modern operating systems
Correct answer: A thread is a unit of execution within a process; processes have separate memory spaces
A process has its own separate memory space and resources, while threads within the same process share memory and resources but have separate execution contexts.
Question 3: Which page replacement algorithm suffers from Belady's Anomaly?
- Optimal (OPT)
- Least Recently Used (LRU)
- First-In First-Out (FIFO) (Correct answer)
- Clock algorithm
Correct answer: First-In First-Out (FIFO)
FIFO can suffer from Belady's Anomaly, where increasing the number of page frames counterintuitively increases the number of page faults.
Question 4: What is a critical section in concurrent programming?
- The most computationally expensive part of the code
- A segment of code that accesses shared resources and must not be executed by more than one process simultaneously (Correct answer)
- A section of memory reserved for the OS
- Code that handles hardware interrupts
Correct answer: A segment of code that accesses shared resources and must not be executed by more than one process simultaneously
A critical section is a code segment that accesses shared data and must execute atomically to prevent race conditions in concurrent systems.
Question 5: In Round Robin scheduling, what parameter determines how long each process runs before being preempted?
- Priority value
- Burst time
- Time quantum (Correct answer)
- Arrival time
Correct answer: Time quantum
The time quantum (or time slice) defines the fixed time interval each process is allowed to run before the CPU is given to the next process in the ready queue.
Question 6: What is the role of the OS kernel?
- Manage user applications only
- Provide a graphical interface
- Manage hardware resources and provide services to user-space programs (Correct answer)
- Handle network communication exclusively
Correct answer: Manage hardware resources and provide services to user-space programs
The OS kernel is the core component that manages CPU scheduling, memory, device drivers, file systems, and provides system call interfaces to user-space programs.
What is the purpose of the page table in virtual memory management?