› Module 1: Introduction to Operating Systems › 1.3 Operating System Structures
M O D U L E

Module 1: Introduction to Operating Systems

Core concepts, architecture, and system software fundamentals

1.1 What is an OS & Its Functions

An Operating System (OS) is the fundamental system software that manages a computer's hardware, software resources, and provides common services for computer programs. It acts as an intermediary between the computer user/application software and the raw physical hardware, making the system convenient to use while ensuring hardware resources are utilized efficiently, fairly, and securely.

Figure 1.1: The Operating System as an Intermediary Between Users and Hardware USERS / APPLICATION PROGRAMS requests / system calls OPERATING SYSTEM controls / allocates HARDWARE (CPU, Memory, I/O Devices, Storage)

Figure 1.1: The OS sits between the user/applications and the raw hardware, translating abstract high-level requests into physical hardware operations.

Core Functions of an Operating System

  • Process Management: Creating, scheduling, dispatching, and terminating processes; synchronizing cooperating processes and allocating CPU cores equitably.
  • Memory Management: Dynamically allocating and deallocating primary memory (RAM) segments; keeping track of allocated regions and isolating process address spaces.
  • File System Management: Organizing unstructured secondary storage blocks into logical files and hierarchical directories; enforcing access permissions and persistence.
  • Device & I/O Management: Abstracting hardware device quirks behind standard device drivers, managing I/O request queues, buffering, caching, and handling asynchronous hardware interrupts.
  • Protection & Security: Enforcing authentication, authorization access matrices, and CPU dual-mode execution (User mode vs. Kernel mode) to prevent unauthorized resource tampering.
  • User Interface: Exposing intuitive command line interfaces (CLI / shells) or graphical user interfaces (GUI) for interactive computer control.
  • Networking & Distributed Services: Mediating packet routing, socket endpoints, and distributed resource sharing across network interfaces.
  • Error Detection & Fault Recovery: Continually monitoring CPU traps, memory parity errors, disk failures, and software panics to preserve system stability.

Dual-Mode Operation & System Calls

To protect the computer system from errant user programs or malicious manipulation, modern CPUs implement hardware-enforced Dual-Mode Operation:

  1. User Mode (Mode bit = 1): User applications execute in this restricted environment. Privileged instructions (direct I/O instructions, CPU halt, timer configuration, memory base/limit changes) cannot be executed.
  2. Kernel Mode / Supervisor Mode (Mode bit = 0): The OS kernel executes with unrestricted access to all machine instructions, hardware registers, and physical memory.

When an application requires hardware services (such as reading a file or creating a socket), it executes a System Call (e.g. read(), fork()). The CPU raises a software interrupt (trap), switches the mode bit from 1 to 0, vectors through the Interrupt Descriptor Table (IDT) into the kernel's handler, executes the requested service safely, and returns to user mode with mode bit = 1.

1.2 Types of Operating Systems

Operating systems have evolved through distinct technological generations to overcome efficiency, utilization, and interactivity limitations. Understanding these categories is essential for evaluating performance trade-offs in modern computing environments.

Figure 1.2: Major Categories of Operating Systems and Their Defining Characteristics Batch OS Jobs grouped in batches; no user interaction during execution Multiprogramming OS Multiple jobs kept in memory; CPU switches when one waits for I/O Time-Sharing OS CPU rapidly switches between users → gives illusion of simultaneous access Distributed OS Manages a group of independent networked computers as one system Real-Time OS (RTOS) Guarantees response within a strict, predictable time bound (hard/soft) Network OS Provides services to computers connected on a network (files, print, etc.)

Figure 1.2: Six major operating system archetypes, showing how design priorities shifted from batch throughput to interactive multi-access and deterministic real-time timing.

In-Depth Category Breakdown

  • Batch Operating Systems: Grouped similar punch-card jobs into batches and processed them sequentially without operator intervention. Solved the problem of manual setup overhead, but offered zero interactivity and suffered from severe CPU idle time during slow tape/card reader I/O.
  • Multiprogrammed Operating Systems: Keep multiple active jobs in main memory simultaneously. Whenever the currently executing job initiates I/O, the OS context-switches the CPU to another ready job. Greatly maximized CPU utilization, but lacked interactive user response.
  • Time-Sharing (Multitasking) Systems: Introduced time-slicing via hardware timer interrupts. The CPU rapidly context-switches across active user processes every few milliseconds (time quantum), giving each user the illusion of a dedicated personal machine. Formed the foundation for modern UNIX, Linux, and Windows desktop/server OSs.
  • Distributed Operating Systems: Manage a cluster of physically distinct, autonomous computational nodes interconnected via high-speed networks, presenting a single system image to users. Features transparent resource access and fault-tolerant computation.
  • Real-Time Operating Systems (RTOS): Engineered for deterministic environments where task completion within a deadline is the primary correctness criterion:
    • Hard Real-Time: Deadlines are absolute. Missing a single deadline causes catastrophic failure (e.g., automobile airbag triggers, cardiac pacemakers, anti-lock braking systems). Secondary storage and virtual memory swapping are typically omitted to prevent nondeterministic latency.
    • Soft Real-Time: Missing a deadline causes service quality degradation without catastrophic damage (e.g., video streaming buffers, live voice calls, online multiplayer games).

1.3 Operating System Structures

The internal architecture of an operating system dictates its performance, reliability, security boundaries, and maintainability. Three primary kernel architectures have emerged over decades of system design: Monolithic, Microkernel, and Layered structures.

Figure 1.3: Monolithic, Microkernel, and Layered Kernel Architectures Monolithic Kernel Kernel Space (Privileged) Process Mgmt • Memory Mgmt File Systems • Device Drivers Network Stack • Virtual Memory (Fast Direct Function Calls) User Applications Microkernel File Server Device Drv Net Server Minimal Kernel Mode IPC • Basic Scheduling • Memory (Crash Isolation via User Servers) User Applications Layered Architecture Layer 5: User Interface Layer 4: I/O Management Layer 3: Memory Management Layer 2: Process Management Layer 1: Raw Hardware

Figure 1.3: Monolithic kernels run all subsystems in one address space; microkernels move services to user processes; layered models enforce strict hierarchical service calls.

Architectural Trade-Off Analysis

Architecture Key Advantages Disadvantages & Trade-offs Examples
Monolithic Maximum raw performance; zero IPC overhead; fast direct in-memory function calls. A bug in any driver or module can crash the entire operating system kernel. Linux, traditional UNIX, FreeBSD
Microkernel High reliability and fault isolation. A crashed device driver restarts without rebooting. Performance penalty due to frequent context switches and user-kernel message passing. QNX, Minix, seL4
Hybrid Blends monolithic speed for graphics/file I/O with modular driver isolation. Complex design and larger overall codebase footprint. Windows NT, macOS (XNU)
MODULE COMPREHENSIVE QUIZ

Module 1 Final Quiz

Test your understanding across all 3 topics of this module with interview-grade questions, tricky edge cases, and code output predictions.

Take Module 1 Final Quiz →
Yukti Mascot