This page provides a high-level orientation to the Linux kernel source tree. The Linux kernel is a large-scale, monolithic kernel with a modular design, supporting a vast array of hardware architectures and devices. It manages system resources including CPU time, memory, and peripheral access while providing a stable User Application Binary Interface (UAPI) for userspace.
The source tree is organized by functional area rather than by hardware alone. The top-level directories categorize code into architecture-specific logic, core kernel services, device drivers, and supporting infrastructure.
arch/: Contains all architecture-specific code (e.g., x86, arm64). Each architecture implements the low-level hooks required by the generic kernel arch/arm64/Kconfig.platforms1-10kernel/: The core of the operating system, containing the scheduler, signal handling, and core process management logic.mm/: The Memory Management subsystem, implementing the page allocator, slab allocators, and virtual memory logic rust/bindings/bindings_helper.h72drivers/: The largest directory by file count, containing subdirectories for every class of hardware (gpu, net, usb, pci, etc.) MAINTAINERS35-36 drivers/gpu/drm/panel/Kconfig1-8fs/: The Virtual File System (VFS) layer and individual filesystem implementations (ext4, xfs, btrfs, smb, 9p) MAINTAINERS152-164 rust/bindings/bindings_helper.h63net/: Networking protocols (TCP/IP, Bluetooth, 6LOWPAN) and core socket logic MAINTAINERS103-111 MAINTAINERS130-131rust/: Support for writing kernel modules in Rust, including the kernel crate and generated bindings rust/kernel/lib.rs3-12 rust/bindings/bindings_helper.h1-7init/: Contains the main kernel entry point and logic for parsing boot-time configuration.include/: Global header files defining the kernel's internal and external APIs rust/bindings/bindings_helper.h29-31For a detailed breakdown of every top-level directory and how code ownership is tracked, see Repository Map & Major Directories.
Subsystems interact through well-defined internal APIs. While the kernel is monolithic, it uses an object-oriented pattern in C, where structures contain function pointers (ops) that are implemented by specific drivers or filesystem types. For example, struct drm_panel_funcs defines how the DRM subsystem interacts with specific display panels drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c174-180
The MAINTAINERS file is the source of truth for subsystem boundaries. It maps file patterns to specific people and mailing lists MAINTAINERS33-39
For details on how changes flow from a developer's machine into the mainline tree, see Subsystem Boundaries, Ownership, and Patch Flow.
The following diagram illustrates how a graphics driver interacts with the kernel's DRM subsystem and underlying hardware interfaces.
DRM Panel Initialization Path
Sources: drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c96-135 drivers/gpu/drm/panel/Kconfig11-14 rust/bindings/bindings_helper.h85
Several technologies are "cross-cutting," meaning they are used across almost all subsystems to ensure performance, safety, or observability.
kernel crate provides safe wrappers for C APIs, such as DMA, PCI, and Operating Performance Points (OPP) rust/kernel/lib.rs63-67 rust/kernel/opp.rs1-10For a technical introduction to these primitives, see Key Cross-Cutting Concepts (RCU, Maple Tree, BPF, tracefs).
The kernel uses the Kbuild system. Configuration is handled via Kconfig, which defines symbols (e.g., CONFIG_DRM_PANEL) that control conditional compilation in Makefiles drivers/gpu/drm/panel/Kconfig2-3 drivers/gpu/drm/panel/Makefile2-10
Build and Rust Integration
Sources: drivers/gpu/drm/panel/Makefile1-15 rust/kernel/lib.rs141-143 rust/bindings/bindings_helper.h1-96 rust/helpers/helpers.c1-10
drivers/ and look at existing drivers in the same class (e.g., drivers/gpu/drm/panel/ drivers/gpu/drm/panel/Kconfig8-10).kernel/ for process management or mm/ for memory allocation rust/bindings/bindings_helper.h72-88rust/kernel/ for existing API abstractions like Device, Dma, or Pci rust/kernel/lib.rs63-106scripts/get_maintainer.pl which parses the MAINTAINERS file MAINTAINERS50-54For detailed guides on specific subsystems, refer to the child pages listed in the sidebar.
Sources: MAINTAINERS1-131 rust/kernel/lib.rs1-144 drivers/gpu/drm/panel/Kconfig1-215 drivers/gpu/drm/panel/Makefile1-110 rust/bindings/bindings_helper.h1-107 arch/arm64/Kconfig.platforms1-190 drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c1-180
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.