232 iptables: Deep Analysis of Rule Tables and Chains

dean
232 iptables: Deep Analysis of Rule Tables and Chains Preface In the previous article, we gained a deep understanding of Netfilter’s HOOK mechanism — that’s the underlying infrastructure of the entire framework. If we think of Netfilter as the ramp system of a highway, then iptables is the rulebook at the toll booths on those... » read more

356 | System Calls: How User Mode Triggers Kernel Code

dean
356 | System Calls: How User Mode Triggers Kernel Code Key Insight: User programs can never directly read or write hardware. Even just printing a character requires asking the kernel to do it on their behalf. System calls are the only gateway for this “proxy” service. 1. Problem: What If a User-Mode Program Wants to... » read more

Writing an OS Kernel from Scratch | Windows GPT+UEFI Boot: ESP Partition, NVRAM Boot Entries, and Secure Boot — Complete Analysis

dean
Writing an OS Kernel from Scratch | Windows GPT+UEFI Boot: ESP Partition, NVRAM Boot Entries, and Secure Boot — Complete Analysis The previous chapter covered the Windows boot chain in MBR+BIOS mode. The System Reserved partition was the core anchor of the entire chain — BOOTMGR and BCD both resided in that 100MB FAT32 partition,... » read more

358 | Timer: HPET and Clock Interrupts

dean
358 | Timer: HPET and Clock Interrupts Key Insight: The operating system’s sense of time doesn’t come from “watching a clock” — it’s “punched out” by interrupts. Each clock tick tells the kernel that another jiffy has passed — and then it decides who gets to run next. 1. Three Clock Hardware Components The x86... » 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

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

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

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

[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

357 | Memory Management: Buddy System

dean
357 | Memory Management: Buddy System Key Insight: Cut memory into neat power-of-2-sized blocks, merge when freed, merge when freed, merge when freed. This “divide and merge” algorithm is the starting point of Linux physical memory management. 1. What Problem Does the Buddy System Solve? The core problem in physical memory allocation is fragmentation. Assume... » read more