Author

S01 — DRAM: How One Capacitor and One Transistor Store One Bit

dean
S01 — DRAM: How One Capacitor and One Transistor Store One Bit Key Insight: Behind complex systems, there are often just a few simple physical principles at work. Understanding DRAM starts with the most fundamental Cell. 1. Physical Structure of a DRAM Cell 1.1 What Is DRAM DRAM (Dynamic Random Access Memory) is the main... » read more

B09 — What Happens When Memory Runs Low: kswapd and Page Frame Reclaim

dean
B09 — What Happens When Memory Runs Low: kswapd and Page Frame Reclaim Key Insight: When memory runs tight, the system quietly moves infrequently used data to disk. This is swapping. Sources of Memory Pressure Linux always starts tidying up when memory approaches full. It swaps out infrequently used pages to disk, making room for... » read more

333 – Android Zygote: The Incubator for All App Processes

dean
333 – Android Zygote: The Incubator for All App Processes Series Navigation: 330-Boot Overview | 331-Bootloader | 332-init Process In the previous article, we covered the init process — the first userspace process, responsible for parsing configuration, mounting filesystems, managing properties, and starting key services. The most important of these services is Zygote. Zygote is... » read more

K08 — Inter-Process Shared Memory: shm and mmap(MAP_SHARED)

dean
K08 — Inter-Process Shared Memory: shm and mmap(MAP_SHARED) Key Insight: The fastest inter-process communication is no communication at all — directly share the same block of memory. Three Ways to Share Memory Between Processes Linux supports three mechanisms for inter-process shared memory: 1. System V Shared Memory (shmget/shmat) - Long history, pre-POSIX API - Managed... » read more

B06 — The Manager of Physical Memory: The Buddy System

dean
B06 — The Manager of Physical Memory: The Buddy System Key Insight: Grouping memory into “buddies” makes both allocation and reclamation efficient. Why Do We Need the Buddy System The OS needs to manage physical memory allocation and reclamation. The simplest approach is bitmap management, but it is inefficient for allocating large blocks. 位图管理的问题: 假设用... » read more

A11 — The Memory Boundary Between User and Kernel: Zero-Copy Technology

dean
A11 — The Memory Boundary Between User and Kernel: Zero-Copy Technology Key Insight: The fastest path from disk to network is to not copy at all. Memory Boundary Between User Mode and Kernel Mode User programs and the kernel have separate address spaces. Interaction requires system calls or specific mechanisms. 用户态和内核态的隔离: 用户地址空间(0x00000000 ~ 0x7FFFFFFFFFFF): -... » read more

B05 — How the MMU Translates Virtual Addresses to Physical Addresses

dean
B05 — How the MMU Translates Virtual Addresses to Physical Addresses Key Insight: Behind every virtual address is a complex translation process. And you never perceive it. What is an MMU The MMU is a hardware unit on the CPU chip. It translates Virtual Addresses (VA) to Physical Addresses (PA). MMU 在系统中的位置: CPU Core Memory... » read more

Understanding Low-Level Principles – Memory Series | S05 | Bank, Row, Column — How a Memory Address is Step-by-Step Mapped to a Specific Cell

dean
Understanding Low-Level Principles – Memory Series | S05 | Bank, Row, Column — How a Memory Address is Step-by-Step Mapped to a Specific Cell Key Insight: Translating an address into a physical access requires many layers of abstraction. Understanding Bank internal structure is the key to understanding DDR performance. 1. DRAM Chip Internal Structure: The... » read more

Writing an OS Kernel from Scratch | 351: NIC — From PHY to Socket

dean
Writing an OS Kernel from Scratch | 351: NIC — From PHY to Socket Abstract: The network card is the gateway for a computer to connect to the network. Data travels from the application socket all the way through the protocol stack, driver, bus, and reaches the PHY, finally becoming optical/electrical signals transmitted over the... » read more

A03 — Multi-threaded malloc: Arena Contention and Per-thread Arena

dean
A03 — Multi-threaded malloc: Arena Contention and Per-thread Arena Key Insight: In multi-threaded scenarios, every malloc is a potential contention point. ptmalloc uses arenas to solve this problem. The Problem with Multi-threaded malloc In single-threaded programs, malloc contention is rare (only one heap). But in multi-threaded programs, all threads share the same heap. Without special... » read more

Writing an OS Kernel from Scratch | Synchronization Primitives — spinlock and semaphore, How the OS Coordinates Concurrent Access

dean
Writing an OS Kernel from Scratch | Synchronization Primitives — spinlock and semaphore, How the OS Coordinates Concurrent Access Two processes write data to the same file simultaneously — process A writes the first 100 bytes, process B writes the next 100 bytes. If no coordination is done, what happens? Process A just read the... » read more

H06 — How Memory Module Gold Fingers Are Connected: PCB Traces, Impedance Control, and DQ Signal Integrity

dean
H06 — How Memory Module Gold Fingers Are Connected: PCB Traces, Impedance Control, and DQ Signal Integrity Key Insight: Invisible trace lengths determine visible system stability. Memory PCB Structure A memory module (DDR DIMM) is an independent PCB filled with signal traces and power planes. DDR4 UDIMM PCB 结构(6 层或 8 层): Layers: Layer 1(Top):信号层,元器件和... » read more