• Programs run in user mode because they can’t be trusted with full access to the computer
  • User mode does its job, preventing access to most of the computer - but programs need to be able to access I/O, allocate memory, and interact with the operating system somehow!
  • To do so, software running in user mode has to ask the OS’s kernel for help. The OS can then implement its own security protections to prevent programs from doing anything malicious.
  • This request to the OS is what we call a system call

A system call is a special procedure that lets a program start a transition from user space to kernel space, jumping from the program’s code into OS code

  • User space to kernel space control transfers are accomplished using a processor feature called software interrupts

Note

Functions like openreadfork, and exit are all abstracted system calls


Refs

  1. https://cpu.land/the-basics