What changes during an x86 context switch
This figure documents the historical i386 source baseline. Current native x86-64/AArch64 qualification is recorded separately; this is not an ELF64 or native SMP implementation diagram.
Task metadata, TSS and CR3 change before the assembly stack exchange.
Text equivalent and source references
- The scheduler selects next, updates its state, quantum and the ring-0 TSS stack, then changes page directories if needed.
- Assembly saves flags and callee-saved registers on the outgoing stack, stores its ESP, loads the incoming ESP, restores registers and returns on that stack. The incoming path releases the scheduler guard.
Low-level control flow. Source paths refer to the atlas baseline; the kernel checkout is private.
kernel/core/task.c · schedulearch/x86/context.asm · context_switch