Part 1: Core Concepts (2 Marks)
- Operating System: System software acting as an intermediary between user applications and computer hardware, functioning as an Extended Machine (resource abstraction) and Resource Manager (allocating CPU, memory, devices).
- System Call: The programmatic programmatic interface provided by the OS allowing user-level processes to request privileged services from the kernel (e.g.,
fork(), read(), write(), exec()).
- Kernel Architectures:
- Monolithic Kernel: All OS services (VFS, IPC, drivers, scheduler) execute in a single privileged address space (Linux).
- Microkernel: Only essential primitives (IPC, low-level scheduling, memory mapping) run in kernel space; drivers and file systems run as user-space servers (Minix, QNX).
Part 2: Structural Frameworks (10 Marks)
Dual-Mode Operation Transition
- [User Process Execution] ---- User Mode (Mode bit = 1)
- Executes System Call (e.g. read())
- Software Interrupt (Trap / Syscall Instruction)
- [Kernel System Call Handler] -- Kernel Mode (Mode bit = 0)
- (Validates arguments, executes privileged hardware I/O)
- Returns from Trap
- [User Process Resumes] ---- User Mode (Mode bit = 1)
Part 3: Distinction Tables
Part 4: Worked Problems & Exam Traps
Process Creation with fork() System Call
#include <stdio.h>
#include <unistd.h>
int main() {
pid_t pid = fork();
if (pid < 0) {
printf("Fork failed!\n");
} else if (pid == 0) {
// Child process receives return value 0
printf("Hello from Child! (PID = %d)\n", getpid());
} else {
// Parent process receives Child's PID
printf("Hello from Parent! (Child PID = %d)\n", pid);
}
return 0;
}
fork() duplicates the calling process. If you write fork(); fork(); fork();, total processes created is 23=8 (1 parent + 7 children).