nuttx/Documentation/quickstart/organization.rst

250 lines
7.1 KiB
ReStructuredText
Raw Normal View History

.. include:: /substitutions.rst
.. todo::
This is mostly untouched from the original documentation. It does
not really belong to "quickstart". Also, this needs cleanup.
.. _organization:
2020-07-21 00:18:26 +02:00
===================
Directory Structure
===================
This is included for reference, and it's not necessary to know
all the details at first.
The general directory layout for NuttX is
2020-07-21 00:18:26 +02:00
very similar to the directory structure of the Linux kernel -- at
least at the most superficial layers. At the top level is the main
makefile and a series of sub-directories identified below and
discussed in the following paragraphs:
**Configuration Files**. The NuttX configuration consists of logic
in processor architecture directories, *chip/SoC* directories, and
board configuration directories. The complete configuration is
specified by several settings in the NuttX configuration file.
- *Processor architecture specific files*. These are the files
2023-10-29 16:37:00 +01:00
contained in the ``arch/<arch-name>/`` directory and
2020-07-21 00:18:26 +02:00
are discussed in a paragraph
`below <#arch-subdirectory-structure>`__. As an example, all ARM
2020-07-21 00:18:26 +02:00
processor architectures are provided under the ``arch/arm/``
directory which is selected with the ``CONFIG_ARCH="arm"``
configuration option.
Variants of the processor architecture may be provided in
sub-directories of the Extending this example, the ARMv7-M ARM
family is supported by logic in ``arch/arm/include/armv7-m``
and ``arch/arm/src/armv7-m`` directories which are selected by
the ``CONFIG_ARCH_CORTEXM3=y``, ``CONFIG_ARCH_CORTEXM4=y``, or
``CONFIG_ARCH_CORTEXM7=y`` configuration options
- *Chip/SoC specific files*. Each processor architecture is
embedded in a *System-on-a-Chip* (SoC) architecture. The full
SoC architecture includes the processor architecture plus
chip-specific interrupt logic, clocking logic, general purpose
I/O (GPIO) logic, and specialized, internal peripherals (such
as UARTs, USB, etc.).
These chip-specific files are contained within chip-specific
2023-10-29 16:37:00 +01:00
sub-directories also under the ``arch/<arch-name>/``
2020-07-21 00:18:26 +02:00
directory and are selected via the ``CONFIG_ARCH_CHIP``
selection.
As an example, the STMicro STM32 SoC architecture is based on
the ARMv7-M processor and is supported by logic in the
``arch/arm/include/stm32`` and ``arch/arm/src/stm32``
directories which are selected with the
``CONFIG_ARCH_CHIP="stm32"`` configuration setting.
- *Board specific configurations*. In order to be usable, the
chip must be contained in a board environment. The board
configuration defines additional properties of the board
including such things as peripheral LEDs, external peripherals
(such as networks, USB, etc.).
These board-specific configuration files can be found in the
2023-10-29 16:37:00 +01:00
``boards/<arch-name>/<chip-name>/<board-name>/``
2020-07-21 00:18:26 +02:00
sub-directories and are discussed in a paragraph
`below <#boards-subdirectory-structure>`__.
2020-07-21 00:18:26 +02:00
The directory ``boards/arm/stm32/stm32f4disovery/``, as an
example, holds board-specific logic for the STM32F4 Discovery
board and is selected via the
``CONFIG_ARCH_BOARD="stm32f4discovery"`` configuration setting.
``nuttx/Documentation``
=======================
2020-07-21 00:18:26 +02:00
This directory holds the NuttX documentation. It's made with
the `Sphinx documentation system <https://www.sphinx-doc.org>`_. See the
README.md file for information on how to build it.
2020-07-21 00:18:26 +02:00
``nuttx/arch``
==============
2023-10-29 16:37:00 +01:00
This sub-directory holds the NuttX supported architectures.
For details see :doc:`/components/arch/index`.
2020-07-21 00:18:26 +02:00
``nuttx/binfmt``
================
2020-07-21 00:18:26 +02:00
The ``binfmt/`` subdirectory contains logic for loading binaries
in the file system into memory in a form that can be used to
execute them.
``nuttx/audio``
===============
The ``audio/`` subdirectory contains the NuttX audio sub-system.
.. _nuttx_boards:
2020-07-21 00:18:26 +02:00
``nuttx/boards``
================
The ``boards/`` subdirectory contains custom logic and board
configuration data for each board. These board-specific
configurations plus the architecture-specific configurations in
the ``arch/`` subdirectory complete define a customized port of
NuttX.
Boards Subdirectory Structure
-----------------------------
2020-07-21 00:18:26 +02:00
The ``boards/`` directory contains board specific configuration
files. Each board must provide a sub-directory <board-name> under
2023-10-29 16:37:00 +01:00
``boards/<arch-name>/<chip-name>/``.
See :doc:`/components/boards` for details.
2020-07-21 00:18:26 +02:00
2023-10-29 16:37:00 +01:00
``nuttx/cmake``
===============
2020-07-21 00:18:26 +02:00
2023-10-29 16:37:00 +01:00
This sub-directory holds the NuttX CMake functions.
2020-07-21 00:18:26 +02:00
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/cmake`.
2020-07-21 00:18:26 +02:00
``nuttx/crypto``
================
This sub-directory holds the NuttX cryptographic sub-system.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/crypto`.
2020-07-21 00:18:26 +02:00
``nuttx/drivers``
=================
This directory holds architecture-independent device drivers.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/drivers/index`.
2020-07-21 00:18:26 +02:00
``nuttx/fs``
============
This directory contains the NuttX file system. This file system is
described `below <#NxFileSystem>`__.
``nuttx/graphics``
==================
This directory contains files for graphics/video support under
NuttX.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/nxgraphics/index`.
2020-07-21 00:18:26 +02:00
``nuttx/include``
=================
This directory holds NuttX header files. Standard header files
file retained in can be included in the *normal* fashion:
``nuttx/libs/libc``
===================
This directory holds a collection of standard libc-like functions
with custom interfaces into NuttX.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/libs/index`.
2020-07-21 00:18:26 +02:00
``nuttx/mm``
============
This is the NuttX memory manager.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/mm/index`.
2020-07-21 00:18:26 +02:00
``nuttx/net``
=============
This directory contains the implementation of the NuttX networking
layer including internal socket APIs.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/net/index`.
``nuttx/openamp``
=================
This directory contains OpenAMP support for NuttX.
For details see :doc:`/components/openamp`.
``nuttx/pass1``
===============
TODO
2020-07-21 00:18:26 +02:00
``nuttx/sched``
===============
The files forming core of the NuttX RTOS reside here.
``nuttx/syscall``
=================
If NuttX is built as a separately compiled kernel (with
``CONFIG_BUILD_PROTECTED=y`` or ``CONFIG_BUILD_KERNEL=y``), then
the contents of this directory are built. This directory holds a
syscall interface that can be used for communication between
user-mode applications and the kernel-mode RTOS.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/syscall`.
2020-07-21 00:18:26 +02:00
``nuttx/tools``
===============
This directory holds a collection of tools and scripts to simplify
configuring, building and maintaining NuttX.
Refer to the :doc:`/components/tools/index` page for more
2020-07-21 00:18:26 +02:00
information about the individual files. Some of these tools are
discussed below as well in the discussion of `configuring and
building <#configandbuild>`__ NuttX.
2023-10-29 16:37:00 +01:00
``nuttx/video``
===============
This directory holds support for video sub-system.
For details see :doc:`/components/video`.
2020-07-21 00:18:26 +02:00
``nuttx/wireless``
==================
This directory holds support for hardware-independent wireless
support.
2023-10-29 16:37:00 +01:00
For details see :doc:`/components/wireless`.
``nuttx/CMakeList.txt``
=======================
The top-level ``CMakeList.txt`` file.
2020-07-21 00:18:26 +02:00
``nuttx/Makefile``
==================
The top-level ``Makefile`` in the ``$(TOPDIR)`` directory contains
all of the top-level control logic to build NuttX.