Operating Systems (Module 1)
1. Introduction to Operating Systems
The Software Landscape
Every computer runs two broad categories of software:
System Software Application Software
Manages hardware & supports every other
Built for end users to perform specific tasks
program
Runs closest to the hardware, mostly in the
Runs on top of the operating system
background
Examples: Operating System, Device Drivers, Examples: Browsers, Office Tools, Games,
Firmware, Utilities Media Players
The Operating System is the most critical piece of system software — the bridge that makes
every application possible.
What is an Operating System?
An Operating System (OS) is software that manages a computer's hardware and software
resources, and provides common services for programs. It:
Manages resources such as CPU, memory, and files
Acts as an interface between the user and hardware
Performs process, memory, and file management
Organizes resources much like departments in a government
Think of the OS as a resource manager and a control program:
As a resource manager, it allocates CPU time, memory, storage, and I/O devices
among competing programs.
As a control program, it manages the execution of user programs to prevent errors
and improper use of the computer.
Basic Components of a Computer System
1. Hardware – CPU, memory, I/O devices (provides basic computing resources)
2. Operating System – controls and coordinates hardware use among applications
3. Application Programs – define how resources are used to solve user problems
(compilers, browsers, games, etc.)
4. Users – people, machines, or other computers interacting with the system
Each layer talks only to the one below it — the OS is the translator in the middle.
Why the OS Matters
Bridges Hardware & Software: translates program requests into hardware actions
Coordinates Every Resource: shares CPU, memory, and devices fairly across
programs
Keeps Systems Secure & Stable: controls access and prevents processes from
colliding
Operating systems you'll encounter: Windows 11, Linux, macOS, Unix, Android, iOS,
MS-DOS
Goals of an Operating System
Primary goals (what the OS must deliver directly to the user):
User convenience — a friendly, easy-to-use interface
Program execution — providing the environment and services programs need to run
Resource management — fairly allocating CPU, memory, disk, and I/O devices
Security — protecting the system and user data from unauthorized access
Secondary goals (what keeps the system healthy over time):
Efficient resource utilization — maximizing throughput of CPU, memory, and I/O
Reliability — handling errors gracefully, staying modular and easy to debug
Basic Elements of an Operating System
1. Kernel — the core component managing system resources and providing essential
services; interacts directly with hardware.
2. User Interface — enables interaction between users and the OS, either graphical
(GUI) or command-line (CLI).
3. Device Drivers — software modules that let the OS communicate with hardware,
abstracting away device complexity.
4. File System — organizes storage into files and directories; handles creation, deletion,
reading, and writing.
Types of Operating Systems
Operating systems are classified based on how they handle jobs, users, and time constraints:
Batch OS: Groups similar jobs together and runs them without user interaction; no
direct communication between the user and the running job.
Multiprogramming OS: Keeps multiple jobs in memory at once so the CPU always
has something to execute, maximizing CPU utilization.
Multitasking / Time-Sharing OS: Rapidly switches the CPU between multiple jobs
so each user feels they have exclusive access to the system (e.g., Windows, Linux).
Multiprocessing OS: Uses two or more CPUs within a single system to execute
multiple processes simultaneously, improving throughput and reliability.
Distributed OS: Manages a group of independent, networked computers so they
appear to users as a single coherent system.
Network OS: Runs on a server and provides facilities such as file sharing, printer
access, and user authentication across a network (e.g., Windows Server, Novell
NetWare).
Real-Time OS (RTOS): Guarantees processing within strict time constraints — hard
real-time (missed deadlines unacceptable) or soft real-time (occasional missed
deadlines tolerable). Used in pacemakers, industrial control, automotive systems.
Mobile OS: Designed specifically for smartphones and tablets, optimized for touch
input, battery efficiency, and app-based usage (e.g., Android, iOS).
What Is a System Call?
A system call is the interface between a user program and the OS that allows applications to
request OS services. Applications cannot directly access hardware — they request services
through system calls.
How a system call works:
1. User program requests a service.
2. The CPU switches from User Mode to Kernel Mode.
3. The system call transfers control to the kernel.
4. The kernel performs the requested operation.
5. Control returns to the application.
Categories of system calls, with real examples:
Category Purpose Example Calls Real-Life Example
Manage execution of fork(), exec(), Opening Google Chrome
Process Control
processes exit(), wait() creates a new process
open(), read(),
Perform operations Saving a Word document uses
File Management write(), close(),
on files unlink()
file system calls
Printing a document sends
Device Control hardware read(), write(),
requests via device system
Management devices ioctl()
calls
Opening a game allocates
Memory Allocate and free
mmap(), brk() RAM via memory system
Management memory
calls
Task Manager displays
Information Retrieve/update getpid(), time(),
process IDs obtained via
Maintenance system information uname()
system calls
WhatsApp or a browser
Exchange data pipe(), socket(),
Communication communicates over the
between processes send(), recv()
internet using sockets
Booting Process (Brief Overview)
1. Power-on: Hardware initializes and the CPU starts executing firmware.
2. POST (Power-On Self Test): Firmware (BIOS/UEFI) checks essential hardware
(RAM, keyboard, storage).
3. Bootloader: Firmware locates and loads a small bootloader program from storage.
4. Kernel load: The bootloader loads the OS kernel into memory and transfers control
to it.
5. Initialization: The kernel initializes drivers and system services, then starts the
shell/GUI.
2. Functions of an Operating System
The OS performs nine core functions to manage the computer system:
2.1 Process Management
Allocates CPU and memory to running processes
Schedules execution by priority, fairness, or other algorithms
Tracks process states and enables inter-process communication (IPC)
Handles process creation, deletion, suspension, and resumption
Example: When you open five browser tabs, the OS treats each as (or spawns threads within)
separate processes, scheduling CPU time so all of them stay responsive.
2.2 Memory Management
Allocates and deallocates memory dynamically
Manages virtual memory beyond what's physically available
Uses paging and segmentation to protect and optimize memory
Keeps track of which parts of memory are in use and by whom
Example: Virtual memory lets you run applications whose combined size exceeds your
physical RAM, by temporarily swapping inactive data to disk.
2.3 File System Management
Organizes and maintains files and directories on storage
Handles creation, deletion, reading, and writing of files
Provides permissions, access control, and journaling for integrity
Maps files onto secondary storage
Example: When you save a Word document, the OS's file system decides where on disk to
physically store it and updates the directory structure so it can be found again.
2.4 Device Management
Manages I/O devices such as keyboards, monitors, and printers
Handles device initialization, allocation, and deallocation
Uses drivers to standardize how devices are accessed
Manages buffering, caching, and spooling
Example: Printing several documents queues them via spooling, so applications don't have to
wait for the (slow) printer directly.
2.5 Security & Access Control
Enforces policies that protect system resources and data
Authenticates users and controls their access rights
Uses authentication, encryption, and firewalling against threats
Protection controls access of processes/users to resources; Security defends against
external/internal attacks
Example: File permissions (read/write/execute) on Linux/Unix are a protection mechanism; a
firewall or antivirus is a security mechanism.
2.6 Networking
Enables communication between computers and devices
Implements protocols such as TCP/IP and manages configurations
Supports file sharing, remote access, and distributed computing
2.7 User Interface Management
CLI lets users type commands directly
GUI offers graphical, intuitive interaction
Batch interfaces automate scripted execution
2.8 Job Accounting
Keeps track of the time and resources used by various jobs and users — useful for billing or
usage statistics.
2.9 Software Coordination
Coordinates and assigns compilers, interpreters, assemblers, and other software tools to the
various users of the computer system.
3. Evolution of Operating Systems
Four Generations, from ENIAC to today's networked systems (1945 → Present). Each
generation solved the previous one's biggest limitation — from wasted machine time to
isolated, single-user computing.
Why Did Operating Systems Evolve?
Problems in Early Computers Need for Evolution
Manual operation Better CPU utilization
One program at a time Faster execution
No user interface Multi-user support
Long processing time Security
Poor hardware utilization User-friendly computing
Generation 1 (1945–1955): The Start of Computing — No OS
No operating system existed. Computers were programmed directly with physical switches
and wires.
Electronic computing replaced mechanical computing, which was slow and error-
prone.
Programs were written directly in machine language.
Each user took complete control of the machine for a dedicated time slot.
Programs were loaded by hand using punched cards or paper tape.
ENIAC (1945) — Electronic Numerical Integrator And Computer; one of the first
electronic general-purpose computers.
UNIVAC I (1951) — Universal Automatic Computer I; the first commercially
produced computer in the US.
"One user. One program. Everything done manually." The user gave instructions directly to
the CPU, memory, and printer — everyone "spoke at once," creating confusion.
Generation 2 (1955–1965): Batch Processing
Jobs were grouped into batches and run one after another.
Users submitted a stack of punched cards, one job per card set.
The system processed cards sequentially — results took hours.
Introduced automatic job loading, basic file management, and error handling.
Limitations: no real-time interaction (users waited hours/days for results); poor
resource utilization (CPU sat idle during slow mechanical I/O).
Examples: IBM 704's FMS (Fortran Monitor System) and IBM 7094's IBSYS
handled the job queue.
Generation 3 (1965–1980): Multiprogramming & Time-Sharing
Multiprogramming: Multiple jobs are held in memory simultaneously — the CPU
switches to another job whenever one is waiting on I/O. Key projects: IBM OS/360
(1964), CDC SCOPE, Burroughs MCP.
Time-Sharing: Interactive users connect through online terminals, letting many
people use the same computer at once. Key projects: CTSS (1961), MULTICS
(1965–69), UNIX (1969).
Generation 4 (1980–Now): Networks, GUIs & Distributed Computing
Computers became networked and personal. Users grew aware of machines connected to one
another, and the Graphical User Interface made computing accessible to everyone.
Distributed Computing: networked machines share work and resources across
locations.
Graphical User Interface: point-and-click replaces memorized command-line
syntax.
Wearable & Smart Devices: smartwatches, glasses, and VR gear extend where an
OS runs.
Also includes the rise of mobile OS (iOS, Android) and cloud computing.
Summary Table
Generation Period Key Feature Example Systems
1st 1945–1955 No OS — fully manual ENIAC (1945), UNIVAC I (1951)
2nd 1955–1965 Batch processing IBM 704 FMS, IBM 7094 IBSYS
Multiprogramming, time- IBM OS/360, CTSS, MULTICS,
3rd 1965–1980
sharing UNIX (1969)
1980– Networked, GUI & Windows, Linux, macOS, Android,
4th
Present distributed iOS
Advantages and Disadvantages of Having an OS
Advantages Disadvantages
Manages devices (printers, scanners, etc.)
Data may be hard to recover if the OS itself
and provides drivers for hardware
errors — regular backups matter
communication
Lets multiple applications run
Vulnerable to viruses and other security threats
simultaneously
Keeps the system responsive by managing Learning a new OS (e.g., switching from
process execution Windows to Linux) can be time-consuming
Organizes and manages files on storage Keeping the OS updated requires ongoing
devices maintenance
The OS itself consumes CPU, memory, and
Allocates resources efficiently across
storage, which can affect other applications'
applications
performance
4. Operating System Structures
OS structure is a blueprint for how components are organized and integrated into the kernel
— breaking a complex system into manageable parts. There are eight commonly studied
structures:
4.1 Simple Structure
No well-defined architecture — a small, limited system where interfaces and functionality
aren't clearly separated.
Interfaces and functional levels are not clearly separated
Applications can reach basic I/O routines directly
One failing user program can crash the entire system
Example: MS-DOS
4.2 Monolithic Structure
The entire operating system is built as a single large kernel, with every major service
compiled into one code base.
Process, memory, and file system management all live in one kernel
Device drivers also run inside that same kernel
A single unified code base handles every core function
All services run in kernel mode with fast communication between them, but the kernel
is large — if one service crashes, it can affect the entire system
Examples: Linux, UNIX, MS-DOS
4.3 Layered Structure
Hardware sits at the bottom, the user interface at the top. The OS is divided into levels, and
each layer only uses the services of the layer directly below it.
Each layer relies only on the layer below it
Debugging is easier — errors stay isolated to one layer
Passing data through many layers adds overhead
Every layer needs careful upfront planning
Example: UNIX
4.4 Micro-Kernel Structure
Only the essentials stay in the kernel. Non-essential services move out to user space, leaving
a small core microkernel behind (handling things like CPU scheduling and IPC).
New services can be added without ever touching the kernel
A failure in a user-space service doesn't take down the whole OS
Slightly slower, since services communicate through message passing
Example: macOS's hybrid XNU kernel builds on microkernel ideas
4.5 Modular Structure
A lean core, extended by modules. The kernel holds only essential components, while
additional services load dynamically at boot or runtime.
Kernel contains only core components
Extra services are added as loadable modules
More flexible than a layered design — modules can call each other freely
Uses defined, protected interfaces like a layered structure
Example: Solaris
4.6 Hybrid-Kernel Structure
The best of both worlds — blends monolithic and microkernel design, combining raw speed
with modular stability.
Combines monolithic and microkernel design principles
Delivers monolithic-level speed and performance
Keeps the modularity and stability microkernels are known for
Example: macOS (hybrid XNU kernel), Windows
4.7 Virtual Machines
Hardware, split into isolated worlds. CPU, memory, disk, and network are abstracted into
several environments, each behaving like an independent system.
Each virtual machine behaves like its own separate computer
CPU scheduling and virtual memory simulate dedicated resources
Physical disks are the main limiting factor — a hypervisor creates virtual disks to
support more VMs than the machine has physical drives
Example: VirtualBox
Analogy: Imagine a large apartment building 🏢 — the building is the physical computer, each
apartment 🏠 is a virtual machine, and the families 👨👩👧👦 living in them are different operating
systems (Windows, Linux, Ubuntu).
4.8 Exo-Kernel Structure
Hardware control, handed to applications. Developed at MIT, it separates resource protection
from resource management instead of imposing OS-level abstractions.
Gives applications direct control over hardware resources
Separates resource protection from resource management
Skips standard OS abstractions so apps can customize freely
Its minimal design gives developers greater flexibility, at the cost of much more
complex application development
Example: MIT research architecture
Analogy: Imagine a hotel 🏨 — the Exokernel is the hotel manager (only assigns rooms and
ensures rules are followed), a Library OS is your personal assistant (arranges the room the
way you want), and the Guest is the application. The manager doesn't decide how you
arrange your room; they only make sure you have a room and follow the hotel's rules.
Comparison Summary
Structure Kernel Design Performance Extensibility Example
Simple No defined architecture High Very Low MS-DOS
Monolithic Single large program High Low Linux, UNIX
Layered Hierarchical layers Medium Medium UNIX
Minimal kernel + user Lower (IPC
Micro-Kernel High macOS XNU
servers overhead)
Core + loadable
Modular High High Solaris
modules
macOS,
Hybrid-Kernel Mixed approach High Medium-High
Windows
Virtual High
Abstraction of hardware Varies VirtualBox
Machine (isolation)
Minimal resource
Exo-Kernel High (app-tuned) Very High MIT Exokernel
multiplexer
5. System Programs
System programs are software utilities that provide a convenient environment for users to
interact with the operating system. They are built on top of the OS and help users perform
everyday tasks.
Type Purpose Examples Real-Life Example
File Explorer
Create, copy, rename, (Windows), Finder Creating a new folder
File Management
delete, and search files (macOS), cp, mv, rm, for your assignments
mkdir (Linux)
Displays information Task Manager, System Checking available
Status Information about the computer and Information, top, df,
RAM or CPU usage
OS free
Used to edit the contents Notepad, WordPad, Editing a C program
File Modification
of files Vim, Nano in a text editor
GCC (C Compiler), Compiling a C
Programming Tools to write, compile,
Java Compiler (javac), program before
Language Support and debug programs
Python Interpreter running it
Loads programs into Program Loader, Double-clicking
Program Loading &
memory and executes Linker, Dynamic Microsoft Word loads
Execution
them Loader it into memory
Supports Email applications,
Sending an email or
Communications communication between Web browsers, SSH,
browsing the internet
users and computers FTP
Print service, Network
Run continuously in the Your antivirus scans
Background Services service, Windows
background to provide files automatically
(System Daemons) Update, Antivirus
system services while you work
service
Unlike programs you open yourself, daemons start automatically — often at boot — and
keep running silently, without a visible window, until they're needed or the system shuts
down. This is why your antivirus, printer service, and update checker all seem to "just work."