Operating Systems
Processes, memory, scheduling, and the Linux kernel
IT & Tech Reports | Class IM24A | 2026
1. What Does an OS Do?
An operating system is software that manages hardware resources and provides services to
applications. It acts as an intermediary between user programs and the physical hardware. Core
responsibilities: process management, memory management, file systems, I/O management, and
security.
2. Processes vs Threads
Process Thread
Definition Running program instance Execution unit within a process
Memory Own private address space Shares process address space
Communication IPC (pipes, sockets, shared mem) Shared memory directly
Creation cost Expensive (fork, exec) Cheap (pthread_create)
Failure isolation Crash doesn't affect others Crash can kill entire process
Python note multiprocessing module threading module (limited by GIL)
3. CPU Scheduling Algorithms
Algorithm How it works Pros / Cons
FCFS First-Come-First-Served — queue order
Simple; convoy effect on short jobs
SJF Shortest Job First — run quickest next
Optimal avg wait; starvation risk
Round Robin Each process gets a time quantum (e.g.
Fair; 10ms)
context-switch overhead
Priority Highest priority runs first Flexible; starvation of low-priority
CFS (Linux) Completely Fair Scheduler — virtualUsed
runtime
in real Linux kernel
4. Memory Management
Virtual Memory & Paging
Each process sees a contiguous virtual address space independent of physical RAM. The OS and MMU
(Memory Management Unit) translate virtual addresses to physical addresses via page tables. A page is
typically 4 KB.
• Page fault — accessing a page not currently in RAM; OS loads it from swap
• TLB (Translation Lookaside Buffer) — cache for page table entries (speeds translation)
• Swap space — disk area used when RAM is full; much slower than RAM
• Memory-mapped files — map file contents directly into a process's address space
Memory Allocation
The heap is used for dynamic allocation (malloc/new). Fragmentation occurs over time as objects of
varying sizes are allocated and freed. Garbage collectors (Java, Python, Go) automate memory
reclamation.
5. File Systems
File System OS Features
ext4 Linux Journaling, widely supported, default on most distros
Btrfs Linux Copy-on-write, snapshots, built-in RAID, checksums
XFS Linux High-performance, large files, parallel I/O
APFS macOS/iOS Copy-on-write, encryption, snapshots, optimised for SSD
NTFS Windows Journaling, permissions, compression, encryption (EFS)
ZFS BSD/Linux Data integrity, deduplication, snapshots, RAID-Z
FAT32/exFAT Universal Cross-platform compatibility, USB drives
6. Interprocess Communication (IPC)
• Pipes — unidirectional byte stream between related processes (shell: cmd1 | cmd2)
• Named pipes (FIFOs) — like pipes but accessible via filesystem path
• Unix domain sockets — bidirectional, high-performance local communication
• Shared memory — fastest IPC; processes map same physical memory; requires synchronisation
• Signals — asynchronous notifications (SIGTERM, SIGKILL, SIGUSR1, SIGCHLD)
• Message queues — kernel-managed message buffer (POSIX mq_open)
7. Linux Kernel Subsystems
Subsystem Responsibility
Process scheduler CPU time allocation across processes and threads (CFS)
Memory manager Virtual memory, paging, page cache, OOM killer
VFS Virtual File System — unified interface over all file system types
Network stack TCP/IP implementation, socket API, netfilter (firewall)
Subsystem Responsibility
Device drivers Kernel modules that abstract hardware (block, char, network devices)
cgroups Resource limits per process group (CPU, memory, I/O) — used by Docker
namespaces Isolation of processes, network, mounts, UIDs — foundation of containers