Operating System Slides 📂 Introduction · 1 of 22 63 min read

Introduction to Operating Systems: Structure, Operations & Core Components

Understand what an operating system really is — the intermediary between users and hardware. This visual guide covers the three OS views, four-layer architecture, kernel structures, dual-mode operation, system calls, interrupts, and the six core components, with animated diagrams throughout.

🖥️

Introduction to Operating Systems

What an OS really is, how it is structured, how it operates in dual mode, and the six core components that turn raw hardware into a machine you can actually use.
Structure Operations Core Components System Calls

Press Next → or use ← → arrow keys

Section 01

What Is an Operating System?

The Air-Traffic Control Tower
Dozens of planes want to land and take off at once, but there is only one runway, limited fuel and limited gates. Nobody lets the pilots negotiate directly — a control tower decides who goes when, keeps everyone safe, and makes a chaotic scramble look effortless.

An operating system is that control tower for your computer. Programs constantly demand the CPU, memory, disk and network. The OS sits between them and the hardware, granting access fairly, safely and efficiently.
🌉
The One-Line Definition

An operating system is the software layer that acts as an intermediary between the user and the hardware — making programs convenient to run while managing every resource behind the scenes.

1Runway, many planes = 1 CPU, many programs
3Roles it plays at once
6Core components inside
24/7Always running, always arbitrating
Section 01 · Perspectives

Three Ways to See the Same OS

OS one system 🙂 User View ease & convenience ⚙️ System View resource allocator 🛡️ Control View prevents errors
🙂
User View
convenience first
To a person, the OS is the friendly interface that makes the machine easy and pleasant to use — performance matters less than usability.
⚙️
System View
resource allocator
To the hardware, the OS is a manager that fairly shares CPU time, memory, storage and I/O among competing programs.
🛡️
Control View
a control program
It supervises execution to stop errant programs from crashing the machine or interfering with each other.
Section 02

The Four-Layer Computer Architecture

Every request travels down the stack toward the hardware and every result travels back up to the user. The OS kernel is the gatekeeper in the middle.

L4 👤 Users people, developers, administrators L3 🧩 Applications browsers, compilers, editors, games L2 🧠 OS Kernel scheduler · memory · file system · I/O · protection L1 🔌 Hardware CPU, RAM, disk, GPU, peripherals req res
🔑
Why the Layering Matters

Applications never touch hardware directly. They ask the kernel, which checks permissions and translates the request into safe hardware operations. This indirection is exactly what keeps one crashing app from taking down the whole machine.

Section 03

Four Ways to Build a Kernel

Monolithic MS-DOS · UNIX Layered THE · Multics μK Microkernel QNX · MINIX core .ko .ko .ko Modular Linux · NT
🧱
Monolithic
everything in one space
All services — scheduling, memory, drivers, file system — run together in kernel space. Fast, but one faulty driver can crash everything. MS-DOS, classic UNIX.
📚
Layered
strict hierarchy
Each layer only talks to the one below it. Clean and easy to debug, but the extra hops make it slower. THE system, early Multics.
🪶
Microkernel
minimal core
Only the bare essentials run in the kernel; drivers and file systems run as user-space servers. Robust & secure, with messaging overhead. QNX, MINIX, Mach.
StructureIdeaTrade-offExamples
MonolithicAll services in kernel spaceFast · fragileMS-DOS, early Linux
LayeredStrict layer hierarchyClean · slowerTHE, early Multics
MicrokernelMinimal core, servers outsideRobust · messaging costQNX, MINIX, Mach
Modular / HybridMonolithic core + loadable modulesBest of bothLinux, Windows NT, macOS
🧬
What Modern Systems Actually Do

Today's mainstream OSes are hybrid: a fast monolithic-style core with the extensibility of loadable modules. Linux loads drivers on demand; Windows NT and macOS blend a microkernel heritage with kernel-mode modules for speed.

Section 04 · Operations

Dual-Mode Operation — The Mode Bit

🧩 USER MODE mode bit = 1 no direct hardware access 🚪 syscall / trap 🧠 KERNEL MODE mode bit = 0 full privileged access
🔐
Hardware-Enforced Protection

A single mode bit in the CPU decides what code is allowed to do. In user mode a program cannot touch hardware directly — it must knock on the door with a system call, which flips the CPU into kernel mode just long enough to serve the request. A buggy app literally cannot execute privileged instructions.

Section 04 · Sharing the CPU

Multiprogramming · Multitasking · Time-Sharing

All three keep the CPU busy by switching between jobs — they differ only in when the switch happens.

CPU busy over time → Multiprog. switch on I/O A C B A Multitask. ~100 ms P1 P2 P3 P1 P2 P3 Time-share 10 ms quantum
⏱️ How the CPU Is Kept Busy
Model 1
Multiprogramming — when a job pauses to wait for I/O, the CPU immediately switches to another job. Goal: never sit idle.
Model 2
Multitasking — the CPU switches every few hundred milliseconds so several programs appear to run at once.
Model 3
Time-sharing — each user/process gets a tiny quantum (~10 ms). Switching is so fast it creates the illusion of a dedicated machine per user.
🎞️
The Flip-Book Illusion

Like a flip-book that turns still frames into motion, rapid context switching turns a single CPU into what feels like many. Nothing is truly simultaneous on one core — it is just switched faster than you can perceive.

Section 04 · Events

Interrupts vs Traps — How the OS Wakes Up

⌨️ Device keyboard / disk / timer 🧮 CPU pauses current work 🧠 Handler (ISR) services the event ↩️ Resume back to the program
FeatureInterruptTrap (Exception)
TriggerHardware eventSoftware event
TimingAsynchronous — any timeSynchronous — exact instruction
SourceDevice: keyboard, disk, timerUser code: syscall, divide-by-zero
ResponseInterrupt Service Routine runsTrap handler runs
Section 04 · The Gateway

System Calls — The Only Legal Door

A system call is the single, guarded entry point from user space into the kernel. Every file you open, every byte you send over the network, goes through one.

📄
Process Control
fork · exec · exit · wait
Create, run, and end programs; wait for children to finish.
🗂️
File & Device
open · read · write · close
Move data to and from files, disks, and devices through one uniform interface.
📡
Info & Comms
getpid · pipe · socket
Query system state and let processes talk to each other locally or across a network.
🔎
See It Yourself — strace

Run strace ls and watch a simple directory listing fire off ~140 system callsopenat, getdents64, write, close. Every interaction with the outside world is a documented trip through the kernel door.

Section 05

The Six Core Components

KERNEL the hub 🔄 Process 🧠 Memory 🗂️ File Sys 💽 Storage 🔌 I/O 🛡️ Security
🧩
Each Manager Owns One Resource

Around the kernel sit six specialists: Process, Memory, File System, Secondary Storage, I/O, and Protection & Security. Together they mirror every physical resource — and every risk of sharing it.

Section 05 · Details

What Each Component Actually Does

ComponentResponsibilityKey Techniques
🔄 Process ManagementCreate, schedule & terminate processesScheduling, IPC, deadlock handling
🧠 Memory ManagementAllocate & reclaim RAMPaging, segmentation, virtual memory
🗂️ File-System MgmtAbstract disk blocks as files/foldersDirectories, permissions, metadata
💽 Secondary StorageManage the disk beneath the filesDisk scheduling, free-space tracking
🔌 I/O SystemTalk to every device uniformlyBuffering, caching, spooling, drivers
🛡️ Protection & SecurityKeep users/processes isolatedAccess control, authentication, audit
🧮
Observe Them Live

These are not abstractions — you can watch them: top shows process scheduling, free shows memory management, df/ls -l show the file system, and lsof shows open I/O handles.

Section 05 · Process Life

The Life of a Process — Five States

admit dispatch I/O wait I/O done ready exit NEW READY RUNNING WAITING END
🔄
Reading the Cycle

A process is admitted (NEW → READY), dispatched to the CPU (READY → RUNNING), and may pause for I/O (RUNNING → WAITING) before returning to the queue (WAITING → READY). When its work is done it exits (RUNNING → END). The scheduler drives every transition.

Section 05 · Memory

Virtual Memory — The Grand Illusion

Virtual Pages what the process sees Page 0 Page 1 Page 2 MMU + Page Table translates addresses 🧭 virtual → physical Physical Frames actual RAM Frame 7 Frame 2 Frame 9
💡
Every Process Thinks It Owns the Machine

Each program gets its own private, contiguous virtual address space. The MMU and page table quietly map those virtual pages to scattered physical frames. When a page is not in RAM, a page fault fetches it from disk — letting you run programs larger than physical memory.

Section 05 · Protection

Files, Permissions & Security

- r w - r - - r - - type file owner read + write group read only others read only
🔤 Decoding -rw-r--r--
char 1
- → file type. A dash is a regular file; d is a directory, l a symbolic link.
2–4
rw-owner can read and write, but not execute.
5–7
r--group can only read.
8–10
r--everyone else can only read.
Security ConceptQuestion It AnswersExample
AuthenticationWho are you?Password, fingerprint, key
AuthorizationWhat may you do?Read-only vs read-write access
AuditWhat happened?Login & access logs
IsolationAre you contained?Separate process memory spaces
Section 06

The Major Types of Operating Systems

TypeDefining TraitExamplesWhere You'll Find It
🗃️ BatchJobs queued, no interactionIBM OS/360Payroll, billing runs
👥 Time-SharingMany users at onceUNIXShared servers
🌐 DistributedCoordinates many machinesAmoeba, Plan 9Data centres
⏰ Real-TimeHard deadlines guaranteedQNX, VxWorksAvionics, robotics
📟 EmbeddedTiny footprint, one jobContiki, FreeRTOSSmart devices, sensors
📱 MobileTouch UI, power-efficientAndroid, iOSPhones, tablets
🎯
One Idea, Many Shapes

The same core job — manage resources, protect the system, present an interface — is tuned very differently for a data centre versus a pacemaker versus a phone. The constraints (deadlines, power, scale) decide the design.

Section 07 · Putting It Together

One Command, All Six Components — ls

01
Keystroke → Interrupt
You type ls and press Enter. The keyboard raises a hardware interrupt; the I/O system reads it via the driver.
02
Shell forks a child
The shell calls fork(). Process management creates a new child process to run the command.
03
Load the binary
The child calls execve(). Memory management maps the ls program into a fresh virtual address space.
04
Read the directory
getdents() asks the file system for directory entries, which the storage layer fetches from disk.
05
Write & exit
write() sends the names to your terminal via the I/O system; _exit() lets process management reclaim the resources. Protection checked permissions the whole way.
🧠
The Takeaway

A command that feels instant quietly engages all six components and dozens of system calls. That orchestration — invisible and reliable — is the operating system doing its job.

Section 08

Seven Ideas Worth Remembering

🖥️ OPERATING SYSTEMS · THE ESSENTIALS
1
The OS plays three roles at once — resource manager, control program, and the interface between people and hardware.
2
Dual-mode operation (user vs kernel) is hardware-enforced protection — a buggy program simply cannot run privileged instructions.
3
System calls are the only gateway from applications into the kernel — every file, socket, and process passes through one.
4
Interrupts and traps make the OS responsive — hardware and software events both hand control back to the kernel at the right moment.
5
The six core components mirror the physical resources — and every risk that comes with sharing them.
6
Modern kernels are hybrid — monolithic speed plus modular, loadable extensibility. Pure designs are rare in production.
7
It is all observablestrace, top, free, and lsof let you watch the theory run live.
FINAL

The Foundation Beneath Every Program

3Views: user, system, control
4Kernel structures
2CPU modes: user & kernel
6Core components
5Process states
6Types of OS
🎯
You Now Speak OS

Everything ahead — process scheduling, memory allocation algorithms, file systems, concurrency, and security — builds on what you just learned. The structure, the dual-mode protection, and the six components are the vocabulary of the entire subject.

📚
Where To Go Next

Dive into CPU scheduling and process synchronization, then memory management and deadlocks. Experiment on any Linux shell with strace, top, and ps to see each concept in action.

🖥️ End of tutorial · Press to review, or click Restart