ICT Operating System Fundamentals 4 — Questions and Answers
Question 1: What distinguishes a microkernel architecture from a monolithic kernel?
- Microkernels run all OS services in kernel space for speed
- Microkernels keep only essential functions in kernel space and run services in user space (Correct answer)
- Monolithic kernels are smaller in code size
- Microkernels do not support multitasking
Correct answer: Microkernels keep only essential functions in kernel space and run services in user space
Microkernels minimize the kernel by running services like file systems and drivers in user space, improving modularity.
Question 2: What happens during a context switch?
- The OS terminates the running process
- The CPU saves the current process state and loads the state of the next scheduled process (Correct answer)
- Memory pages are swapped to disk
- A new thread is created within the current process
Correct answer: The CPU saves the current process state and loads the state of the next scheduled process
A context switch saves the PCB of the running process and restores the PCB of the next process to run.
Question 3: Which page replacement algorithm has the lowest page fault rate theoretically?
- LRU (Least Recently Used)
- FIFO (First In First Out)
- Optimal (OPT) (Correct answer)
- Clock Algorithm
Correct answer: Optimal (OPT)
The Optimal algorithm replaces the page that will not be used for the longest future time, minimizing page faults.
Question 4: In Unix, what does the 'fork()' system call return to the parent process?
- 0
- The PID of the child process (Correct answer)
- -1 on success
- The memory address of the child
Correct answer: The PID of the child process
fork() returns the child's PID to the parent, and 0 to the child — allowing each to identify its role.
Question 5: What is the purpose of a 'mutex' (mutual exclusion lock)?
- To allow multiple threads to read shared data simultaneously
- To ensure only one thread accesses a critical section at a time (Correct answer)
- To schedule threads by priority
- To detect memory leaks in concurrent programs
Correct answer: To ensure only one thread accesses a critical section at a time
A mutex ensures that only one thread can hold the lock and execute within the critical section at any given time.
Question 6: Which of the following is an example of non-preemptive CPU scheduling?
- Round Robin
- Preemptive Priority Scheduling
- First-Come First-Served (FCFS) (Correct answer)
- Shortest Remaining Time First
Correct answer: First-Come First-Served (FCFS)
FCFS is non-preemptive because once a process starts executing, it runs to completion or until it voluntarily yields.
Question 7: What is 'internal fragmentation' in memory management?
- Wasted memory between allocated blocks
- Unused memory within an allocated block due to fixed-size partitions (Correct answer)
- Excessive page swapping
- Memory corruption from pointer errors
Correct answer: Unused memory within an allocated block due to fixed-size partitions
Internal fragmentation is wasted space inside an allocated memory partition when the process doesn't need all of it.
What distinguishes a microkernel architecture from a monolithic kernel?