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

Writing an OS Kernel from Scratch – Part 17: Scheduler — Making Multitasking Truly Concurrent!

dean
# Writing an OS Kernel from Scratch – Part 17: Scheduler — Making Multitasking Truly Concurrent! “Cooperative multitasking relies on programs voluntarily yielding the CPU; once there’s an infinite loop, the system freezes. Today, we introduce timer interrupts and implement a preemptive scheduler, making multitasking truly fair!” In Part 6, we implemented cooperative multitasking, where... » read more

231 Netfilter: Deep Dive into Linux Network Filtering Core Architecture and HOOK Mechanism

dean
231 Netfilter: Deep Dive into Linux Network Filtering Core Architecture and HOOK Mechanism Preface Deep within the Linux kernel network subsystem lies a core framework hailed as the “backbone of network firewalls” — Netfilter. Whether it’s iptables, nftables, Docker networking, or Kubernetes Service implementations, they all rely on Netfilter’s HOOK mechanism for their fundamental capabilities.... » read more

H02 — Why Memory Should Be Installed in Pairs: How Dual Channel Works

dean
H02 — Why Memory Should Be Installed in Pairs: How Dual Channel Works Key Insight: A single tree does not make a forest. Neither does a single channel for bandwidth. Single Channel vs Dual Channel: Numerical Comparison What is the performance difference between one 16 GB DDR4-3200 stick and two 8 GB DDR4-3200 sticks? 理论带宽对比:... » read more

[Writing an OS Kernel from Scratch] 334 – SystemServer: Service Management Mechanism Startup

dean
title: [Writing an OS Kernel from Scratch] 334 – SystemServer: Service Management Mechanism Startup category: os tag: [android, systemserver, zygote, binder] source: https://github.com/golang12306/os-kernel-from-scratch [Writing an OS Kernel from Scratch] 334 – SystemServer: Service Management Mechanism Startup 1. What Is SystemServer? In Android’s Java world, all system services do not live inside application processes. They run... » read more