Skip to main content

Articles · page 2 of 5

Technical articles archive

Explore structured guides on computer architecture, operating systems, systems programming, Python data science, Rust and quantitative finance.

Articles
49
Series
7
Topics
16

Articles, page 2

Diagram of a C kernel calling a Rust no_std allocator crate across the extern C FFI boundary, linked into a single kernel.elf

Chapter 11 · Operating Systems

Rust no_std Kernel Allocator: Bringing Rust Into a C Kernel

Carve the C heap allocator out of PurgatoryOS and replace it with a no_std Rust implementation wired in via extern C FFI. Set up aarch64-unknown-none-softfloat, build-std core + alloc, the GlobalAlloc trait, a spin-locked free list, and a Makefile that links libpurgatory_rs.a into the existing kernel.elf, without rewriting a single line of C above the allocator.

37 min Intermediate

Diagram of an EL0 user task issuing svc to cross the privilege boundary into the EL1 kernel, dispatching through a syscall table and returning with eret

Chapter 10 · Operating Systems

How System Calls Work: Drawing the Line Between User and Kernel

Drop your AArch64 tasks into EL0, trap into EL1 with the svc instruction, decode ESR_EL1 EC=0x15, dispatch through a syscall table, and return cleanly with eret. Four real syscalls (write, exit, getpid and yield) and the hardware-enforced privilege boundary that makes them possible.

37 min Intermediate

Diagram of two process control blocks exchanging CPU state through context_switch, with tasks A and B interleaving on a round-robin timeline

Chapter 9 · Operating Systems

Context Switching & Process Scheduling: Teaching the Kernel to Multitask

Build a round-robin task scheduler from scratch for your AArch64 bare-metal kernel. Implement the PCB, understand why only callee-saved registers need saving, write the context_switch assembly, and watch two tasks interleave on the UART, the moment your kernel becomes an actual operating system.

22 min Intermediate

Diagram of a kernel heap divided into used and free blocks with headers, linked into a free list traversed by kmalloc and kfree

Chapter 8 · Operating Systems

Kernel Heap Allocator in C: Teaching the Kernel to Manage Its Own Memory

Write a bump allocator and then a free-list allocator from scratch in C for your AArch64 bare-metal kernel. Learn block headers, first-fit search, coalescing, alignment, and why Rust's no_std offers a safer alternative. Visualize every allocation interactively.

25 min Intermediate

Diagram of an AArch64 exception vector table with a timer interrupt routed through the GICv2 to the CPU and the kernel's IRQ handler

Chapter 7 · Operating Systems

AArch64 Exceptions & Interrupts: Teaching Your Kernel to Listen

Build an AArch64 exception vector table from scratch, set up the GICv2 Generic Interrupt Controller on QEMU, and write a working ARM Generic Timer interrupt handler. Your kernel finally responds to the hardware.

29 min Intermediate

Diagram of an AArch64 virtual address walked through L0, L1 and L2 page tables to a physical 2 MB block of RAM

Chapter 6 · Operating Systems

AArch64 Virtual Memory & the MMU: Teaching the CPU to Lie

Master the AArch64 MMU on bare metal ARM. A deep dive into page table structures, translation levels (L0-L3), and configuring SCTLR_EL1, TCR_EL1, and MAIR_EL1 for kernel memory protection.

36 min Intermediate

Diagram of a CPU storing a character to the PL011 UART data register at 0x09000000 over MMIO, with the text appearing on a terminal

Chapter 4 · Operating Systems

PL011 UART Driver on QEMU: Your First Bare-Metal Kernel Output

Learn how to write a bare-metal C driver for the PL011 UART on AArch64. Master Memory-Mapped I/O (MMIO), the volatile keyword in C, and building a kprint function for QEMU virt without a standard library.

15 min Intermediate

Diagram of the ARM64 boot flow from the reset vector through exception levels EL2 to EL1, with the boot checklist ending at kernel_main

Chapter 3 · Operating Systems

The ARM64 Boot Process: From Reset Vector to kernel_main

Learn how to write an ARM64 bootloader stub in assembly. We cover AArch64 exception levels (EL2 to EL1), zeroing BSS, stack setup, and jumping to a C kernel_main on bare metal.

21 min Intermediate

Diagram of the computing stack from applications and libc down through the operating system to firmware and AArch64 silicon, with the descent highlighted

Chapter 1 · Operating Systems

Why Build an OS from Scratch? The Case for Going All the Way Down

Stop treating the OS as a black box. Discover why building an AArch64 kernel from scratch on ARM is the ultimate systems programming challenge for 2026. From silicon to shell, we go all the way down.

11 min Beginner

Visualizing Itô's Lemma and Stochastic Differential Equations

Chapter 10 · Quantitative Finance

Itô's Lemma Explained: Stochastic Calculus for Finance

Why the ordinary chain rule breaks for random processes, and how Ito's Lemma fixes it. Derive geometric Brownian motion with a live simulator.

16 min Advanced