Digital Garden
Computer Science
C & System Programming
System Programming
Introduction to System Programming

Introduction to System Programming

An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs. Operating systems have kernels which are responsible for scheduling, starting and ending programs but also provide other functionalities like networking or file systems.

The structure and layers of a Unix system.

CPUs run in two modes, kernel and user modes (opens in a new tab) also well explained here (opens in a new tab). Only certain actions can be done in the kernel mode which is why there needs to be a way to interact between these two layers. This is what system calls (opens in a new tab) are for. They allow a program to do things it can't do in the user mode like send information to the hardware etc.

How user programs interact with the kernel which in turn interacts with the hardware through system calls.

POSIX

POSIX stands for Portable Operating System Interface and is an API specification for system calls to maintain compatibility among operating systems. Therefore, any software that conforms to POSIX should be compatible with other operating systems that adhere to the POSIX standards. This is the reason, as to why most of the tools we use on Unix-like operating systems behave almost the same as it is pretty much POSIX compliant.