[PATCH] Documentation: Add a source tree map overview

From: William Raezer
Date: Sun Jun 01 2025 - 12:23:14 EST


Hello,

My name is William Raezer, and this is my first contribution to the Linux kernel. I'm submitting a simple but hopefully helpful addition: a high-level map of the Linux kernel source tree as a new document in `Documentation/source-map.rst`.

As someone beginning to explore the internals of the Linux kernel, I noticed that while there is some documentation available that describes the subsystems in principle, there's no centralized overview of the source tree structure itself. This patch adds a basic source map that describes the role of each top-level directory in the kernel source.

The goal is to assist both myself and others in navigating the codebase, especially new contributors who may be overwhelmed by the kernel's size and complexity. As a follow-up, I plan to add subsystem-level maps for key directories such as `kernel/`, `mm/`, and `fs/`.

I hope this addition is seen as a positive and useful step, and I’m open to feedback or suggestions to improve it.

Best regards,  
William Raezer  
wraezer@xxxxxxxxx

Signed-off-by: William Raezer <wraezer@xxxxxxxxx>

--
"If you don't have something nice to say, at least be creative."
--Madilyn Bailey

From: William Raezer <wraezer@xxxxxxxxx>
Subject: [PATCH] Documentation: Add a source tree map overview

This patch introduces a high-level map of the Linux kernel source tree,
describing the purpose of each top-level directory. The goal is to help
new and experienced contributors alike understand the structure of the
kernel source code.

This documentation aims to improve the discoverability and accessibility
of various kernel subsystems and will be extended with subsystem-level
maps in future contributions.

Signed-off-by: William Raezer <wraezer@xxxxxxxxx>

diff --git a/Documentation/source-map.rst b/Documentation/source-map.rst
new file mode 100644
index 000000000000..111111111111
--- /dev/null
+++ b/Documentation/source-map.rst
@@
+.. SPDX-License-Identifier: GPL-2.0
+
+========================
+Linux Kernel Source Map
+========================
+
+This document provides an overview of the Linux kernel source tree, describing the
+purpose of each top-level directory. It serves as a reference for developers
+looking to understand the structure of the kernel source code.
+
+Top-Level Directories
+=====================
+
+- **arch/**: Architecture-specific code for supported CPU platforms (e.g., x86, arm64).
+- **block/**: Generic block layer code for managing block devices.
+- **certs/**: Certificate management used for module signing and kernel verification.
+- **crypto/**: Cryptographic algorithms and the crypto API.
+- **Documentation/**: Kernel documentation, mostly in reStructuredText format.
+- **drivers/**: Device drivers organized by class.
+- **fs/**: Filesystem code and the Virtual Filesystem Switch (VFS).
+- **include/**: Header files shared across kernel components.
+- **init/**: Code for kernel boot and initialization.
+- **io_uring/**: High-performance asynchronous I/O support.
+- **ipc/**: Inter-process communication mechanisms.
+- **kernel/**: Core kernel functionality including scheduling, signals, and system calls.
+- **lib/**: Common utility functions.
+- **LICENSES/**: SPDX license metadata for compliance.
+- **mm/**: Memory management subsystem.
+- **net/**: Networking protocols and infrastructure.
+- **rust/**: Infrastructure for Rust-based kernel components.
+- **samples/**: Sample modules and test code.
+- **scripts/**: Build and configuration scripts.
+- **security/**: Security modules like SELinux and AppArmor.
+- **sound/**: Audio subsystem and drivers.
+- **tools/**: User-space tools related to the kernel.
+- **usr/**: Initramfs image construction code.
+- **virt/**: Virtualization infrastructure (e.g., KVM).
+
+See Also
+========
+
+- `MAINTAINERS <../MAINTAINERS>`_: Maintainer contact information.
+- `kernel.org Documentation <https://www.kernel.org/doc/html/latest/>`_