Definition
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. It sits between user applications and the bare hardware, giving a convenient programming environment and an efficient runtime.
Goals of an OS
- Convenience — hide hardware complexity, present a clean API.
- Efficiency — maximize CPU, memory, and I/O utilization.
- Ability to evolve — modular design allows new features without breaking existing ones.
- Protection and security — isolate programs and users from each other.
Functions of an OS
- Process management — create, schedule, synchronize, and terminate processes.
- Memory management — allocate and protect memory.
- File system management — organize data on storage.
- Device management — drivers and buffering for I/O.
- Security and access control — users, permissions.
- Networking — TCP/IP stack, sockets.
- User interface — CLI and GUI.
OS Structure
Major architectures:
- Monolithic — all services in the kernel (Linux, classic Unix).
- Layered — clear layers; each only calls the one below.
- Microkernel — minimal kernel, most services in user space (Mach, MINIX, QNX).
- Modular / Hybrid — kernel plus loadable modules (Windows NT, macOS).
Types of Operating Systems
- Batch OS — jobs are collected into batches and processed without interaction.
- Multiprogramming OS — several jobs in memory; CPU switches when one waits for I/O.
- Time-sharing (multitasking) OS — each user/process gets a time slice; responsive.
- Multiprocessor OS — multiple CPUs share memory.
- Distributed OS — many networked machines appear as one system.
- Real-time OS — hard deadlines (avionics, medical devices).
- Embedded OS — tiny footprint (routers, appliances).
- Mobile OS — Android, iOS.
Brief History
- 1940s-50s: no OS, operator loads programs manually.
- 1960s: batch systems (IBM JCL); multiprogramming, time-sharing (MULTICS, CTSS).
- 1970s: UNIX is born at Bell Labs.
- 1980s: personal computers, MS-DOS, Macintosh, Windows 1.0.
- 1990s: GUI everywhere; Linux (1991); Windows 95/NT.
- 2000s: mobile takeoff (Symbian, BlackBerry, iPhone, Android).
- 2010s-now: cloud, containers, unikernels.
System Calls
Applications request OS services through system calls: fork(), exec(), read(), write(), open(), close(). A system call switches the CPU from user mode to kernel mode, runs the requested routine, and returns.
User Mode vs Kernel Mode
The CPU has at least two privilege levels. User mode runs application code and cannot touch hardware directly. Kernel mode can execute any instruction. This separation protects the OS from buggy or malicious programs.
Shell
The shell is the command-line interface that reads user commands and executes programs. Examples: bash, zsh, cmd.exe, PowerShell. GUIs are graphical equivalents.
Summary
An OS manages hardware and provides an abstract machine to applications. Different OS types match different workloads: batch for offline jobs, time-sharing for interactive users, real-time for deadlines, mobile for phones. Modern OS design continues to evolve toward cloud and containerized workloads.
Important Questions
- Define operating system and list its goals.
- List and explain the functions of an OS.
- Differentiate monolithic and microkernel structures.
- List and describe types of OS with examples.
- What is a system call? Give five examples.
- Differentiate user mode and kernel mode.
- Compare batch and time-sharing OS.
- What is a real-time OS? Where is it used?