| Directory | Architecture |
|---|---|
arch/x86/ | x86 and x86-64 (IA-32, AMD64) |
arch/arm/ | ARM 32-bit (ARMv6/v7) |
arch/arm64/ | AArch64 (ARMv8/v9, including Apple Silicon) |
arch/powerpc/ | IBM POWER and PowerPC |
arch/s390/ | IBM Z (mainframe) |
arch/mips/ | MIPS32 and MIPS64 |
arch/riscv/ | RISC-V (RV32 and RV64) |
arch/sparc/ | SPARC and SPARC64 |
The source tree lives at
kernel/ for core logic, with subsystem directories such as mm/, net/, fs/, and drivers/ each owned by their respective maintainers.Kernel space vs user space
The processor runs in one of two privilege levels. User space code executes with restricted privileges; it cannot directly access hardware or kernel memory. Kernel space code runs with full hardware access and can execute privileged instructions.SYSCALL/sysenter on x86, svc on ARM64). The kernel performs the requested operation and returns to user mode.
System call interface
System calls are numbered and dispatched through a per-architecture syscall table. On x86-64, theSYSCALL instruction saves the user register state and jumps to entry_SYSCALL_64 in arch/x86/entry/entry_64.S, which routes to the handler via sys_call_table.
Key subsystems
Process Management
Task creation (
fork/clone/exec), scheduling, signals, inter-process communication, and process namespaces. Core code lives in kernel/ and kernel/sched/.Memory Management
Physical page allocation (buddy allocator), slab/SLUB object caches, virtual memory areas (VMAs), page tables, demand paging, swap, and the OOM killer. Source in
mm/.Virtual File System
A filesystem-agnostic abstraction layer exposing a unified
open/read/write/close API to user space. Concrete filesystems (ext4, btrfs, xfs, tmpfs) register with the VFS. Source in fs/.Networking Stack
A layered implementation of L2–L4 protocols. sk_buff (socket buffer) carries packets through the stack. Netfilter hooks allow packet filtering and NAT. Source in
net/.Device Drivers
Character, block, and network device drivers abstract hardware behind uniform kernel interfaces. Most live in
drivers/.IPC
Pipes, FIFOs, UNIX domain sockets, System V and POSIX message queues, semaphores, and shared memory. Source in
ipc/.Supported architectures
Thearch/ directory contains one subdirectory per supported instruction set architecture (ISA). Each architecture port provides platform-specific implementations of context switching, page table management, interrupt handling, and the system call entry path.
Primary architectures
Primary architectures
Additional architectures
Additional architectures
| Directory | Architecture |
|---|---|
arch/alpha/ | DEC Alpha |
arch/arc/ | Synopsys ARC |
arch/csky/ | C-SKY |
arch/hexagon/ | Qualcomm Hexagon DSP |
arch/loongarch/ | LoongArch (Loongson) |
arch/m68k/ | Motorola 68000 |
arch/microblaze/ | Xilinx MicroBlaze |
arch/nios2/ | Altera Nios II |
arch/openrisc/ | OpenRISC 1000 |
arch/parisc/ | HP PA-RISC |
arch/sh/ | SuperH |
arch/um/ | User Mode Linux (UML) |
arch/xtensa/ | Tensilica Xtensa |
Loadable kernel modules
Modules extend the kernel at runtime. A module is an ELF object that the kernel links into its address space on load.Write the module
Declare the entry and exit points with
module_init() and module_exit(), add a MODULE_LICENSE() tag, and build with make M=path/to/module modules.How subsystems interact
Subsystems communicate through well-defined internal kernel APIs rather than system calls. The following shows a typicalread(2) path:
struct bio request to the block layer, which routes it to the appropriate driver.
