For the complete documentation index, see llms.txt. This page is also available as Markdown.

40.1 FreeBSD Source Code Directory Structure

If the source code has not been installed yet, please refer to the earlier chapter on obtaining the source code using Git.

The FreeBSD system source code is organized by function into directories such as bin, lib, share, usr.bin, and so on. The overall structure is shown as a tree diagram.

FreeBSD src Directory Structure

Understanding the directory structure of the FreeBSD source code helps in comprehending how the system is organized.

FreeBSD Source Code Directory Structure

Image generated by treesize_free.

The contrib directory contains third-party software integrated into the FreeBSD project. The following figure shows the contents of this directory:

contrib Directory Structure

The following is a detailed description of the /usr/src/ directory structure:

FreeBSD Kernel Source Code Directory Structure

The kernel source code is the core of the FreeBSD system. Understanding its directory structure helps in comprehending the system architecture. The following figure shows the overall organization of the kernel source code:

FreeBSD Kernel Source Code Directory Structure

The contrib directory within the kernel source code also contains important third-party components. The following figure shows the contents of this directory:

FreeBSD Kernel contrib Directory Structure

The following is a detailed description of the /usr/src/sys kernel source code directory structure:

Last updated