Skip to content

System Calls#

Systems calls are an interesting topic. They're calls you make to the kernel to do something privileged. The kernel operates in a very privileged mode - it can do anything on the system - but when you run software on your system it doesn't execute with the same privleges, it runs in "user land".

The reason for this might not be obvious, but in short if every program executed in privileged mode your entire system would become a security nightmare - processes could do whatever they wanted to whatever they wanted, including other programs. They could access the memory space (allocated RAM) of other processes, allowing them to steal information, manipulate data or just delete it.

That's why the programs you use run in user land. They have highly restricted privileges but when they do need higher privileges they ask the kernel: that's where system calls come in.

In short a system call is a request to do something that requires privileges. You call the system call and the kernel acts on the request. This is the primary interface between your software (user land) and the kernel (kernel space).