Lexicon Entry
Systems Programming
Systems programming involves writing system software (like OS kernels, drivers, and compilers) where performance and hardware constraints are critical. It typically requires manual memory management and direct hardware interaction.
Related Knowledge & Cross-References
POSIX Signal Handling: Asynchronous Contexts and Reentrancy
Unpacking asynchronous execution contexts, async-signal-safe functions, and the hidden dangers of reentrancy that make printf and malloc unsafe inside a signal handler.
POSIX Threads and Linux Synchronization: The Magic of Futex
A deep dive into thread creation with pthreads and how Linux avoids system calls in fast path synchronization using futexes.
macOS Execution: Mach Tasks vs. BSD Processes
A deep dive into the Darwin/XNU kernel. We explore the architectural divide between Mach Tasks and Threads, and how standard BSD POSIX APIs like fork() are illusions layered over Mach primitives.
The NT Kernel Approach: Understanding Windows Process Creation
A deep dive into the NT Kernel approach to processes. Learn why Windows lacks fork(), the architecture of Windows subsystems like csrss, and how to use CreateProcess in the Win32 API.
The Anatomy of Execution: Processes, Threads, and Memory Isolation
A conceptual deep dive into what it means for code to execute. We explore the fundamental differences between a process (a resource container) and a thread (an execution unit), and how the OS isolates them.
Linker Explained: How Object Files Become Executables (Static & LTO)
Learn how the linker transforms object files into executables. Explore symbol resolution, relocation records, static vs dynamic linking, and Link-Time Optimization with real readelf and nm examples.
Write a Compiler from Scratch in C: Build a Working Toy Compiler
Learn how to write a compiler from scratch in C. Build a complete toy compiler with a hand-written lexer, recursive descent parser, and code generator targeting x86-64 and ARM64 assembly.
Register Allocation in Compilers: How Variables Fit into CPU Registers
Discover how compilers solve register allocation — mapping thousands of virtual registers to 16 (x86-64) or 31 (ARM64) physical ones. See graph coloring, spilling, and rematerialization with real Godbolt examples.
Compiler Lexer & Parser Demystified: How Compilers Read Your C Code
Learn how a compiler lexer and parser transform C source into tokens and ASTs. Hands-on with Clang's -dump-tokens and -ast-dump across real examples.
How a C Program Becomes Machine Code: The C Compilation Process Explained
Trace the complete C compilation process from source code to executable binary. See each stage — preprocessing, compilation, assembly, and linking — with real GCC and Clang output across x86-64 and ARM64.
Dynamic Linking & Relocations: How the GOT and PLT Work
How does code call functions that aren't there yet? We dive deep into the Global Offset Table (GOT), Procedure Linkage Table (PLT), and the lazy binding dance.
Process Loading & Creation: The Life of a Binary
Curious about process loading? We trace the journey from disk to execution, covering the OS loader, ASLR, and dynamic linking on Linux, macOS, and Windows.