Module Review: Advanced Internals

[!NOTE] This module explores the core principles of Module Review: Advanced Internals, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. Key Takeaways

  1. Virtualization: Type 1 Hypervisors run on bare metal for performance. Type 2 run on a Host OS. Modern CPUs use Hardware Assist (VT-x) to avoid slow binary translation.
  2. Memory Virtualization: EPT (Extended Page Tables) allows the hardware to walk two layers of page tables (Guest → Host), removing the need for software Shadow Page Tables.
  3. Containers: Are not VMs. They are isolated processes sharing the Host Kernel, created using Namespaces (Visibility) and Cgroups (Resource Limits).
  4. Distributed OS: Uses Logical Clocks (Lamport) to order events because physical clocks drift. The CAP Theorem dictates you can only have two of Consistency, Availability, and Partition Tolerance.
  5. RTOS: Prioritizes Determinism over Throughput. RMS is optimal for fixed-priority; EDF is optimal for dynamic-priority.
  6. Mobile OS: Constrained by Power and Memory. Android uses Zygote for fast startup and Binder for IPC. iOS enforces strict Sandboxing via Entitlements.

2. Interactive Flashcards

What is a Type 1 Hypervisor?

(Click to flip)

Bare Metal

Runs directly on the hardware without a Host OS (e.g., VMware ESXi, Xen).

What does `CLONE_NEWPID` do?

PID Isolation

Creates a new Process ID Namespace. The process inside sees itself as PID 1.

Define Priority Inversion.

Blocking Bug

When a Low Priority task holds a lock needed by a High Priority task, and is preempted by a Medium task.

What is the Zygote?

Android Warm Start

A process with preloaded Java classes that forks to create new apps instantly.

Lamport Clock Rule?

C = max(local, recv) + 1

Ensures causality ordering. If A → B, then C(A) < C(B).


3. Cheat Sheet

Concept Definition Key Tech
Hypervisor VMM that manages VMs. Intel VT-x, AMD-V
EPT Hardware paging for VMs (GVA->GPA->HPA). SLAT
Namespace Isolates what a process sees. CLONE_NEWPID, CLONE_NEWNET
Cgroup Limits what a process uses. cpu.max, memory.max
OverlayFS Union filesystem for containers (CoW). LowerDir, UpperDir
RPC Remote Procedure Call. Stub, Marshalling
CAP Theorem Pick 2: Consistency, Availability, Partition Tol. CP vs AP
RMS Rate Monotonic Scheduling (Static). Period determines Prio
Priority Inheritance Fixes Priority Inversion. Low inherits High Prio
Binder Android IPC mechanism. mmap, ioctl, Zero-Copy

4. Glossary

For a full list of terms, visit the OS Glossary.


5. Course Complete!

You have reached the end of the Operating Systems course. You now possess a deep understanding of how the software that runs the world actually works.

Where to go next?

  • System Design: Apply these concepts to build scalable distributed systems.
  • Kubernetes: See how containers are orchestrated at scale.