15 entries logged

BLOG.

Deep dives, investigations, and things I figured out the hard way.

LINUX

Decoding ELF: How Linux Actually Loads Your Binary

You type ./a.out and a program runs. Behind that: a four-byte magic number, two parallel header tables, mmap-and-fault, and a dynamic linker that bootstraps itself. A guided tour of ELF and what execve actually does.

NETWORKING

Bypassing the Kernel: How DPDK Hits 10 Million Packets per Second

The Linux network stack tops out at ~2 Mpps per core. DPDK reaches 20 Mpps. The difference isn't speed — it's removing work: no syscalls, no allocations, no demux, no locks. Why kernel-bypass exists and when it earns its complexity.

EBPF

eBPF Maps: The Data Structures That Power Kernel Programs

eBPF programs are stateless — maps are how they remember. A walk through the five map types that cover most real programs: hash, array, per-CPU, ring buffer, and LRU, with concrete code for each.

NETWORKING

The Journey of a Received Packet: From NIC Interrupt to recv()

When recv() returns, dozens of layers ran behind your back — DMA, NAPI, sk_buff, protocol demux, the socket queue. A trace of the entire receive path with the cost of each hop and where the latency actually lives.

SYSTEMS

Memory Barriers Demystified: Acquire, Release, and Why They Matter

Compilers reorder. CPUs reorder. Single-threaded code never notices — multi-threaded code crashes mysteriously. A clear walk through acquire and release semantics, what the hardware actually does, and the spinlock that ties it all together.

NETWORKING

How epoll Actually Works: Inside the Kernel's Event Loop

select and poll were O(n). epoll is O(1). The reason isn't smarter scanning — it's that the kernel pushes ready events into a list as they happen. A walk through the data structures that make it work.

EMBEDDED

ESP32 Wake-on-LAN over MQTT with ESP-IDF

Using an ESP32 and ESP-IDF to build a network-aware Wake-on-LAN trigger — power on machines remotely over MQTT without an always-on server in between.

ASSEMBLY

Writing a 16-bit Real Mode Bootloader in x86 Assembly

The first 512 bytes that run when your machine powers on. A walkthrough of x86 real mode, the BIOS interrupt interface, segment:offset addressing, and what it takes to load a second stage.

NETWORKING

Building a Software TCP/IP Stack from Scratch in C

A deep dive into implementing a functional TCP/IP stack entirely in software — covering Ethernet framing, ARP, IP routing, TCP state machines, and the painful lessons learned along the way.