Introduction
Each major operating system represents different design philosophies and trade-offs. Comparing them reveals the diversity of approaches to common OS challenges.
Compare Linux, Windows, and macOS to understand how different operating systems solve common challenges.
Each major operating system represents different design philosophies and trade-offs. Comparing them reveals the diversity of approaches to common OS challenges.
Linux is a free, open-source kernel powering everything from phones (Android) to supercomputers.
Linux Timeline:
══════════════════════════════════════════════════════════════
1991 Linus Torvalds releases Linux 0.01
1994 Linux 1.0 (TCP/IP, X Window)
1996 Linux 2.0 (SMP support)
2003 Linux 2.6 (O(1) scheduler)
2011 Linux 3.0 (cgroups mature)
2020 Linux 5.x (io_uring, eBPF)
Design Philosophy:
• "Everything is a file"
• Small tools that do one thing well
• Open development, GPLv2 license
• Performance and flexibility over ease of use
Windows NT is Microsoft's kernel since Windows NT 3.1 (1993), designed for compatibility and enterprise features.
Windows NT Architecture:
══════════════════════════════════════════════════════════════
User Mode
┌───────────────────────────────────────┐
│ Win32 Apps | UWP Apps | Subsystems │
├───────────────────────────────────────┤
│ NTDLL.DLL (NT API) │
└───────────────────────────────────────┘
│
Kernel Mode ▼
┌───────────────────────────────────────┐
│ Executive (NT Kernel Services) │
│ • Process Mgr • Memory Mgr │
│ • I/O Mgr • Object Mgr │
├───────────────────────────────────────┤
│ HAL (Hardware Abstraction Layer) │
└───────────────────────────────────────┘
Key Features:
• Object-based design (everything is an object)
• Strong backward compatibility
• Registry for configuration
• Hybrid kernel (microkernel-like structure, monolithic performance)
XNU ("X is Not Unix") is Apple's hybrid kernel combining Mach microkernel with BSD Unix.
XNU Kernel Structure:
══════════════════════════════════════════════════════════════
┌───────────────────────────────────────┐
│ BSD Layer (FreeBSD) │
│ POSIX APIs, VFS, Networking Stack │
├───────────────────────────────────────┤
│ Mach Microkernel │
│ IPC, Memory, Thread scheduling │
├───────────────────────────────────────┤
│ I/O Kit │
│ C++ driver framework │
└───────────────────────────────────────┘
Unique Features:
• Grand Central Dispatch (GCD) for concurrency
• Mach ports for secure IPC
• Apple Silicon (ARM) unified memory architecture
Kernel Architecture Comparison:
══════════════════════════════════════════════════════════════
Aspect Linux Windows NT macOS (XNU)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Type Monolithic Hybrid Hybrid
Source Open (GPL) Closed Partial open
LOC ~30M ~50M (est.) ~8M
Syscall syscall inst sysenter/int2e mach_msg/BSD
IPC Pipes, sockets Named pipes, Mach ports
signals, SysV LPC/ALPC BSD sockets
CPU Scheduling Approaches:
══════════════════════════════════════════════════════════════
LINUX (CFS - Completely Fair Scheduler):
• Red-black tree of tasks, sorted by virtual runtime
• Tasks that run less get scheduled more
• Per-CPU runqueues, periodic load balancing
• Priority: nice values (-20 to +19)
WINDOWS (Multilevel Feedback Queue):
• 32 priority levels (0-31)
• Higher priority always preempts lower
• Priority boost for I/O-bound tasks
• Foreground window priority boost
macOS (Mach-based):
• Thread-centric scheduling (not process)
• Quality of Service (QoS) classes
• Grand Central Dispatch integrates with scheduler
• Priority: kernel manages based on QoS
Virtual Memory Implementation:
══════════════════════════════════════════════════════════════
LINUX:
• 4-level page tables (x86-64)
• Demand paging with copy-on-write
• Slab allocator for kernel objects
• OOM killer when memory exhausted
WINDOWS:
• Paged and non-paged pools
• Working Set management (per-process)
• Standby list for quick reclaim
• SuperFetch (predictive loading)
macOS:
• Compressed memory (in-RAM compression)
• Memory pressure notifications to apps
• Unified memory on Apple Silicon (CPU+GPU share)
Default File Systems:
══════════════════════════════════════════════════════════════
Linux: ext4 (default), btrfs, XFS, ZFS
• Journaling, extents, delayed allocation
• Case-sensitive by default
• POSIX permissions + ACLs
Windows: NTFS (default), ReFS
• MFT (Master File Table)
• Case-insensitive (preserving)
• ACLs with inheritance
• Alternate data streams
macOS: APFS (Apple File System)
• Copy-on-write, snapshots
• Space sharing between volumes
• Native encryption
• Case-insensitive by default (macOS)
Max File Size:
ext4: 16 TiB NTFS: 16 EiB APFS: 8 EiB
Each OS represents different trade-offs:
In Part 24: Capstone Projects, we'll apply everything we've learned by building real OS components from scratch.