# Syscalls and kernel mode

Week 2 · Kernel · Operating Systems
The page also has an interactive playground: https://alfonsocampodonico.com/classes/operating-systems/syscalls?lang=en
Code: https://github.com/AlfonsoCampodonico/os-playground/tree/main/src/sim (`gh repo clone AlfonsoCampodonico/os-playground`)

> Follow a write() from your program, through the trap, into the kernel and back.

A process cannot touch hardware directly: it asks the kernel through a syscall. Watch the CPU mode change, which stack is in use, and who runs each instruction.

**OSTEP:** chapter 6.

The playground above keeps its whole setup in the URL, so a link to this page reproduces the exact example. Change the inputs, step through it, and share the link.
