Skip to content
systemcoding.dev

Library

Everything you need to level up your coding skills.

Flat illustration of two options weighed side by side, with the macOS, Linux and Apple logos.
Kernels

Mach Traps vs BSD System Calls on macOS

Learn how macOS routes one trap instruction to either a Mach trap or a BSD system call, how the number sign and class decide, and why you should call libSystem.

8 min read
Flat illustration of a hardware register drawn as bit fields with one field highlighted, with the C, GNU and STMicroelectronics logos.
Systems Programming

Register Exit Handlers with atexit and on_exit

atexit registers cleanup functions that run in reverse order when a program ends normally. on_exit also passes the status. Neither runs after _exit or abort.

7 min read
Flat illustration of a magnifier over lines of a log, with the C, Linux and GNU logos.
Systems Programming

Read the Auxiliary Vector with getauxval

getauxval reads the kernel's auxiliary vector: page size, CPU features, secure-mode flag, random bytes and the executable name, without parsing /proc.

7 min read
Flat illustration of user space above the system call boundary, the kernel and the hardware, with the Linux, Rust and FreeBSD logos.
Kernels

Ship Out-of-Tree Kernel Modules With DKMS

Package an out-of-tree kernel module with DKMS: write dkms.conf, add, build and install, rebuild on kernel upgrades automatically and sign for Secure Boot.

6 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.