Apex › Systems & OS

How a syscall enters the kernel

The wall every program lives behind. A narrated walk across the user/kernel boundary: your ring-3 program loads a syscall number and arguments into registers, traps in with one instruction, the CPU switches to ring 0 and jumps to a fixed entry point, the kernel validates and does the privileged work, then returns you to ring 3 with the result. Step one read() across and back — and see why the mode switch is the cost futex and io_uring work to avoid.

More in Systems & OS