IT 241

Operating System

TU BIM · Semester 4 · BIM curriculum effective from 2021

Requirement
required
Credits
3
Study Guide
9 units available

Chapter notes

Authoritative study guide across 9 syllabus units

Open a unit to read its study notes.

Unit 1: Operating System Overview· 4 LHs· ~5 marks

Pass path: Learn the 4 primary OS functions, dual-mode operation (User vs Kernel mode), and Monolithic vs Microkernel architecture. Top path: Explain system call traps with CPU interrupt vectors, evaluate OS evolution milestones, and analyze microkernel performance tradeoffs.

Part 1: Core Concepts (2 Marks)

★ Operating System: System software acting as an intermediary between computer hardware and user applications, functioning as an extended virtual machine (abstraction) and a resource allocator (hardware management). ★ Dual-Mode Operation: Hardware architecture using a mode bit (0 = Kernel/Privileged mode, 1 = User mode) to protect operating system code and critical hardware devices from malicious or erroneous user processes. ★ System Call: A controlled programmatic gateway allowing a user-space application to request privileged operating system kernel services (file I/O, process creation, network sockets) via software interrupts (traps).

Part 2: Structural Frameworks (10 Marks)

Operating System Architectural Structures and System Call Mechanism

  • Operating System Structural Models:
    1. Monolithic Kernel: Entire OS (scheduler, file system, memory manager, device drivers) executes as a single massive binary in kernel space. Highly efficient and fast, but a bug in any driver can crash the entire system (e.g. Linux, traditional Unix).
    2. Microkernel: Strips kernel down to absolute essentials (minimal IPC, virtual memory primitives, basic scheduling). All other services (file systems, networking, drivers) run as user-space servers. Highly stable and fault-isolated, but suffers context-switching IPC performance overhead (e.g. Minix, QNX).
    3. Layered Architecture: OS divided into NN modular layers; layer MM can invoke services only of lower layer M−1M-1.
    4. Hybrid: Combines monolithic speed with microkernel modularity (e.g. Windows NT, macOS XNU).
  • Detailed System Call Execution Pipeline:
    1. User program pushes arguments onto stack and invokes wrapper library function (e.g. read()).
    2. Library puts system call number in CPU register and executes software trap instruction (e.g. int 0x80 or syscall).
    3. Hardware switches CPU from User Mode to Kernel Mode (mode bit flips to 0) and jumps to System Call Handler via Interrupt Vector Table.
    4. Kernel inspects call number, validates arguments, and executes requested service routine.
    5. Kernel restores user state, flips mode bit back to 1 (User Mode), and resumes user program execution.

Part 3: Distinction Tables

Criteria Monolithic Kernel Microkernel
Kernel Size Large; includes all drivers, file systems, IPC Minimal; only scheduling, basic IPC, memory primitives
Execution Space of Drivers Executes in privileged Kernel Space Executes in unprivileged User Space
Crash Vulnerability High; driver fault triggers kernel panic / BSOD Low; crashed server can be restarted without OS reboot
Execution Speed Very fast (direct internal function calls) Slower (requires multiple message-passing context switches)
Examples Linux, BSD, MS-DOS Minix, QNX, L4

Part 4: Worked Problems & Exam Traps

  • Easy: What hardware mechanism enables the CPU to transition from user mode to kernel mode during a system call?
    • Answer: A software interrupt instruction (trap) that vectors execution to the kernel interrupt handler.
  • Exam-level: Explain why operating systems forbid user applications from executing raw hardware I/O instructions directly.
    • Answer: Direct hardware access would destroy system security and multi-user isolation; an errant or malicious program could overwrite other processes’ memory, corrupt disk sectors, or bypass file system access permissions.
  • Twist variant: Does a POSIX API function like printf() represent a direct system call?
    • Answer: No. printf() is a C standard library function that formats text in user space and subsequently invokes the underlying write() system call to transfer the buffer to the OS kernel.

Students lose marks here because they describe user mode and kernel mode as purely software concepts, failing to identify that dual-mode operation is enforced by physical CPU hardware mode bits.