In partnership with

Your program has no access to hardware resources. For example, it cannot read a file, send a network request, or even print a message on the screen.

You might think “that can't be right.” You've written code that has done these things before.

That's because your programming language is using system calls (syscall) under the hood.

The operating system (OS) has two modes:

  1. user mode: no access to the hardware

  2. kernel mode: access to everything

Your program runs in user mode.

When we need to access the hardware, we switch to kernel mode by using a system call and ask the OS to perform the actions on our behalf.

Quick Example:

Let's say you want to create a variable and print it.

#include <stdio.h>

int main() {
    char *message = "Hello, World!";
    
    // syscall
    printf("%s\n", message);
    
    return 0;
}

First, it creates the variable, no problem.

But printing a message requires access to the terminal, which our program doesn't have.

This is where it needs to use a syscall to tell the OS to print the message.

Each OS provides a set of APIs for syscalls.

For printing a message to the Linux terminal, there's an API called write().

The flow goes like this:

  1. printf() calls the write() syscall

  2. write() loads a number to a specific CPU register (eg rax)

  3. The number depends on the OS's syscall table (architecture-specific). x86 is different from ARM-based

  4. OS activates kernel mode, executes sys_write, and controls the terminal to print that message.

A system call is the middleman between your program and hardware. It’s used in all kinds of actions, including reading files, sending network requests, and managing processes.

Fee from Anime Coders

If you want to add a competitive skill to your resume, try Gacha Coders, a Gacha game that teaches you Docker.

How owning AI deployment expands your career

Across product, ops, and CX teams, a new kind of role is taking shape: the person responsible for making AI actually work, day to day.

On July 16, three people living this shift join a live roundtable: Simone Santiago Broad (Yoco), Yelva Espinoza (Zumba Fitness), and Fin's Dave Lynch. You'll hear what the job really looks like across industries, how they carved out these roles, the skills they'd hire for, and the challenges they're tackling now. Bring your questions, since the best moments happen live.

Register for the roundtable to save your spot.

Keep Reading