Introduction to Operating Systems
The Software Layer Between Hardware and Applications
Wikimedia Commons
OS placement between hardware and user applications
Introduction to Operating Systems — Educational
What Is an Operating System?
An Operating System (OS) is system software that manages computer hardware, software resources, and provides common services for application programs. It acts as an intermediary between users and computer hardware. Without an OS, every application would need its own device drivers, memory allocator, and hardware communication protocols, making software development nearly impossible. The OS abstracts hardware complexity, presenting programs with a clean, consistent interface. Major examples include Linux, Windows, macOS, Android, and iOS. The first OS concepts emerged in the 1950s with batch processing systems at IBM, evolving continuously to the cloud-native and microkernel designs of today.
Goals and Core Functions
An OS has two primary goals: convenience (making the computer easy to use) and efficiency (optimal use of hardware resources). Core functions include: Process Management (creating, scheduling, and terminating processes and threads), Memory Management (allocating, deallocating, and virtualizing memory), File System Management (organizing, storing, retrieving files and directories), I/O Management (abstracting and controlling input/output devices), Security and Protection (isolating processes, enforcing access control, preventing unauthorized operations), Networking (managing TCP/IP stack, socket interfaces, protocol implementations), and User Interface (Command-Line Interface via shell, or Graphical User Interface via desktop environment). Modern OSes balance all responsibilities while maintaining stability, security, and performance.
OS Architecture Styles
Operating systems are structured in fundamentally different ways. Monolithic kernels place all OS services (scheduling, memory management, file systems, device drivers) in a single large program running in privileged kernel space — fast due to no inter-process communication overhead, but less modular (Linux, original Unix). Microkernels move most services to user space, keeping only IPC, basic scheduling, and memory in the kernel — better fault isolation and formal verification potential (seL4, QNX, Minix). Hybrid kernels blend both approaches for practicality (Windows NT, macOS XNU uses a Mach microkernel wrapped in BSD Unix). Exokernels expose raw hardware directly, letting applications implement their own abstractions. Each architecture involves fundamental tradeoffs between performance, modularity, and fault tolerance.
System Calls: The OS Interface
System calls are the programmatic interface through which user programs request services from the OS kernel — the fundamental boundary between user space (Ring 3) and kernel space (Ring 0). Categories include: Process control (fork, exec, wait, exit, kill), File management (open, read, write, close, unlink, stat), Device management (ioctl, mmap), Information maintenance (getpid, gettimeofday), and Communication (pipe, socket, send, recv). When a system call is made, the CPU atomically switches from user mode to kernel mode via a software interrupt (int 0x80 on legacy x86, syscall instruction on x86-64), executes the kernel handler, then returns to user mode restoring the mode bit. System call overhead is approximately 100-300 nanoseconds — minimizing kernel crossings is critical for performance-sensitive applications.
History and Evolution
Generation 1 (1945-55): No OS at all — machines programmed by physically rewiring circuits, then in machine code, operated entirely manually by human operators. Generation 2 (1955-65): Batch processing systems — jobs submitted on punch cards, processed sequentially without user interaction, IBM 701 with FMS. Generation 3 (1965-80): Multiprogramming and time-sharing emerged — IBM OS/360 (one OS for all IBM hardware), CTSS, Multics, and crucially Unix (Thompson and Ritchie, Bell Labs, 1969 — written in C for portability). Generation 4 (1980-present): Personal computers — CP/M, MS-DOS, Macintosh GUI (1984), Windows, and Linux (Linus Torvalds, 1991 — still the dominant server OS today). Generation 5 (present): Mobile OS (iOS 2007, Android 2008), cloud-native OS, containers (Docker 2013), orchestration (Kubernetes 2014), serverless, and unikernels.