// series · complete

x86 privilege rings: from Ring 3 to Ring -2

A descent through x86 privilege levels: from user mode to the kernel, the hypervisor and the firmware.

Parts of the series

Low-level · Part 1 · 11 min

From Ring 3 to Ring 0: what happens when your code crosses into the kernel

A journey through x86 privilege rings. What Ring 0 is, how a syscall works, why a kernel bug takes down the whole system, and which defenses guard that border today.

Low-level · Part 2 · 10 min

Ring -1: the hypervisor watching over your kernel

What lives below the kernel: the hypervisor, in VMX root mode (SVM host mode on AMD). How it works with VT-x, AMD-V and EPT, why Windows uses one to protect itself, and how to check it from C++ with CPUID.

Low-level · Part 3 · 12 min

Ring -2: SMI, SMRAM and RSM, how firmware takes over the CPU below the hypervisor

What lives below the hypervisor: System Management Mode, the firmware code that runs hidden from the OS, and how to check from C++ which protections your firmware declares.