LEARNING IN PUBLIC

Disk Bytes to DRAM Frames

How bytes move from spinning platters through kernel buffers into your program's address space. Every post shows real offsets, real hex dumps, real register values.

5
Posts
12
Topics
0x1000
Bytes/Page

The Disk Is Just a Numbered Array of 512-Byte Slots

Every spinning platter and every SSD cell exposes the same interface to the silicon: read slot N, write slot N. Each slot is 512 bytes. That's the entire contract.

The First 1024 Bytes Tell You Everything About the Disk Layout

At byte offset 1024 from the start of the partition sits a 1024-byte record. It holds total block count, block size exponent, blocks-per-group, and free counts.

From "/home/r/file.txt" to the Actual Bytes on Disk

Split the path into ["home", "r", "file.txt"]. Start at metadata-record #2 (the root). Walk each name-to-number table. Each step costs one disk read minimum.

Tracing Stack Crash with Real Data (GPF vs. Page Fault)

When a corrupted stack pointer is dereferenced, the OS acts completely differently depending on the virtual address. A non-canonical address triggers a GPF, bypassing the Page Fault handler entirely.

How the Linux Kernel Maps Inode Numbers to Disk Sectors (V6 vs. System V)

Locating dynamic inode blocks on disk. Comparing division/modulo calculations in Unix V6 simulator against direct bitwise shifts and AND masks inside the 6.8.0 Linux kernel's sysv_raw_inode.

Coming Next

06 How ext4 Maps File Byte Offsets to Disk Blocks (Extent Records) DRAFTING
06 What fsync() Actually Guarantees (and What It Doesn't) PLANNED
07 Journal Replay: How the Disk Recovers After Power Loss PLANNED
08 The Name-to-Number Dispatch Table (How the Kernel Supports Many Disk Formats) PLANNED
09 open() Walks 7 Kernel Functions Before Returning a Small Integer PLANNED
10 read() Copies 4096 Bytes From DRAM to Your Buffer (or Fetches From Disk First) PLANNED
11 Unix V6: A Filesystem in 32-Byte Records and 512-Byte Blocks PLANNED
12 Comparing Disk Formats: V6 vs ext2 vs ext4 — Same Ideas, Different Byte Counts PLANNED