source: rtems-docs/develenv/directory.rst @ 489740f

4.115
Last change on this file since 489740f was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

  • Property mode set to 100644
File size: 24.6 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3Directory Structure
4###################
5
6The RTEMS directory structure is designed to meet
7the following requirements:
8
9- encourage development of modular components.
10
11- isolate processor and target dependent code, while
12  allowing as much common source code as possible to be shared
13  across multiple processors and target boards.
14
15- allow multiple RTEMS users to perform simultaneous
16  compilation of RTEMS and its support facilities for different
17  processors and targets.
18
19The resulting directory structure has processor and
20board dependent source files isolated from generic files.  When
21RTEMS is configured and built, object directories and
22an install point will be automatically created based upon
23the target CPU family and BSP selected.
24
25The placement of object files based upon the selected BSP name
26ensures that object files are not mixed across CPUs or targets.
27This in combination with the makefiles allows the specific
28compilation options to be tailored for a particular target
29board.  For example, the efficiency of the memory subsystem for
30a particular target board may be sensitive to the alignment of
31data structures, while on another target board with the same
32processor memory may be very limited.  For the first target, the
33options could specify very strict alignment requirements, while
34on the second the data structures could be *packed* to conserve
35memory.  It is impossible to achieve this degree of flexibility
36without providing source code.
37
38The RTEMS source tree is organized based on the following variables:
39
40- functionality,
41
42- target processor family,
43
44- target processor model,
45
46- peripherals, and
47
48- target board.
49
50Each of the following sections will describe the
51contents of the directories in the RTEMS source
52tree.  The top of the tree will be referenced
53as ``${RTEMS_ROOT}`` in this discussion.
54
55.. COMMENT: Top Level Tree
56
57.. COMMENT: @ifset use-ascii
58.. code:: c
59
60    rtems-VERSION
61    |
62    +--------+----+----+----+--+-----+---+-------+--------+
63    |        |    |    |       |     |   |       |        |
64    aclocal automake c contrib  cpukit doc make testsuites tools
65
66.. COMMENT: @end ifset
67
68``${RTEMS_ROOT}/aclocal/``
69    This directory contains the custom M4 macros which are available to
70    the various GNU autoconf ``configure.ac`` scripts throughout
71    the RTEMS source tree.  GNU autoconf interprets ``configure.ac``
72    files to produce the ``configure`` files used to tailor
73    RTEMS build for a particular host and target environment.  The
74    contents of this directory will not be discussed further in this
75    document.
76
77``${RTEMS_ROOT}/automake/``
78    This directory contains the custom GNU automake fragments
79    which are used to support the various ``Makefile.am``
80    files throughout the RTEMS source tree.  The
81    contents of this directory will not be discussed
82    further in this document.
83
84``${RTEMS_ROOT}/c/``
85    This directory is the root of the portions of the RTEMS source
86    tree which must be built tailored for a particular CPU model
87    or BSP.  The contents of this directory will be discussed
88    in the `c/ Directory`_ section.
89
90``${RTEMS_ROOT}/contrib/``
91    This directory contains contributed support software.  Currently
92    this directory contains the RPM specifications for cross-compilers
93    hosted on GNU/Linux that target various operating systems
94    including MinGW, Cygwin, FreeBSD, and Solaris.  The
95    cross-compilers produced using these specifications are then
96    used in a Canadian cross build procedure to produce the various
97    RTEMS toolsets on a GNU/Linux host.
98    This directory also contains RPM specifications for the
99    prebuilt cross-compilation toolsets provided by the
100    RTEMS project.  There are separate subdirectories
101    for each of the components in the RTEMS Cross Compilation
102    Environment unde the  ``contrib/crossrpms/`` directory.
103    This directory is configured, built, and installed separately
104    from the RTEMS executive and tests.  This directory will not
105    be discussed further in this document.
106
107``${RTEMS_ROOT}/cpukit/``
108    This directory is the root for all of the "multilib'able"
109    portions of RTEMS.  This is a GNU way of saying the
110    contents of this directory can be compiled like the
111    C Library (``libc.a``) and the functionality is
112    neither CPU model nor BSP specific.  The source code
113    for most RTEMS services reside under this directory.
114    The contents of this directory will be discussed
115    in the `CPU Kit Directory`_ section.
116
117``${RTEMS_ROOT}/doc/``
118    This directory is the root for all RTEMS documentation.
119    The source for RTEMS is written in GNU TeXinfo and
120    used to produce HTML, PDF, and "info" files.
121    The RTEMS documentation is configured, built,
122    and installed separately from the RTEMS executive and tests.
123    The contents of this directory will be discussed
124    in the `Documentation Directory`_ section.
125
126``${RTEMS_ROOT}/make/``
127    This directory contains files which support the
128    RTEMS Makefile's.  From a user's perspective, the
129    most important parts are found in the ``custom/``
130    subdirectory.  Each ".cfg" file in this directory
131    is associated with a specific BSP and describes
132    the CPU model, compiler flags, and procedure to
133    produce an executable for the target board.
134    These files are described in detail in the*RTEMS BSP and Device Driver Development Guide*
135    and will not be discussed further in this document.
136
137``${RTEMS_ROOT}/testsuites/``
138    This directory contains the test suites for the
139    various RTEMS APIs and support libraries.  The
140    contents of this directory are discussed in the `testsuites/ Test Suites`_ section.
141
142``${RTEMS_ROOT}/tools/``
143    This directory contains RTEMS specific support utilities which
144    execute on the development host.  These utilities are divided
145    into subdirectories based upon whether they are used in the process
146    of building RTEMS and applications, are CPU specific, or are
147    used to assist in updating the RTEMS source tree and applications.
148    The support utilities used in the process of building RTEMS are
149    described in `RTEMS Specific Utilities`_.  These are the
150    only components of this subtree that will be discussed in this
151    document.
152
153.. COMMENT: c/ Directions
154
155c/ Directory
156============
157
158The ``${RTEMS_ROOT}/c/`` directory was formerly
159the root directory of all RTEMS source code.  At this time, it contains
160the root directory for only those RTEMS components
161which must be compiled or linked in a way that is specific to a
162particular CPU model or board.  This directory contains the
163following subdirectories:
164
165``${RTEMS_ROOT}/c/src/``
166    This directory is logically the root for the RTEMS components
167    which are CPU model or board dependent.  Thus this directory
168    is the root for the BSPs and the Ada Test Suites as well
169    as CPU model and BSP dependent libraries.  The contents of
170    this directory are discussed in the `c/src/ Directory`_ section.
171
172.. COMMENT: c/src/ Directory
173
174c/src/ Directory
175----------------
176
177As mentioned previously, this directory is logically
178the root for the RTEMS components
179which are CPU model or board dependent.  The
180following is a list of the subdirectories in this
181directory and a description of each.
182
183``${RTEMS_ROOT}/c/src/aclocal/``
184    This directory contains the custom M4 macros which are available to
185    the various GNU autoconf ``configure.ac`` scripts throughout
186    this portion of the RTEMS source tree.  GNU autoconf interprets``configure.ac`` files to produce the ``configure`` files used
187    to tailor RTEMS build for a particular host and target environment.  The
188    contents of this directory will not be discussed further in this
189    document.
190
191``${RTEMS_ROOT}/c/src/ada/``
192    This directory contains the Ada95 language bindings to the
193    RTEMS Classic API.
194
195``${RTEMS_ROOT}/c/src/ada-tests/``
196    This directory contains the test suite for the Ada
197    language bindings to the Classic API.
198
199``${RTEMS_ROOT}/c/src/automake/``
200    This directory contains files which are "Makefile fragments."
201    They are included as required by the various ``Makefile.am``
202    files throughout this portion of the RTEMS source tree.
203
204``${RTEMS_ROOT}/c/src/lib/``
205    This directory contains the directories ``libbsp/``
206    and ``libcpu/`` which contain the source code for
207    the Board Support Packages (BSPs) and CPU Model
208    specific source code for RTEMS.
209    The ``libbsp/`` is organized based upon the CPU
210    family and boards BSPs.  The contents of ``libbsp/``
211    are discussed briefly in `c/src/lib/libbsp BSP Directory`_
212    and presented in detail in the*RTEMS BSP and Device Driver Development Guide*.
213    The ``libcpu/`` directory is also organized by
214    CPU family with further divisions based upon CPU
215    model and features that are shared across CPU models
216    such as caching and DMA.
217
218``${RTEMS_ROOT}/c/src/libchip/``
219    This directory contains device drivers for various
220    peripheral chips which are designed to be CPU and
221    board dependent.  This directory contains a variety
222    of drivers for serial devices, network interface
223    controllers, shared memory and real-time clocks.
224
225``${RTEMS_ROOT}/c/src/librtems++/``
226    This directory contains C++ classes which map to the RTEMS
227    Classic API.
228
229``${RTEMS_ROOT}/c/src/make/``
230    This directory is used to generate the bulk of the supporting
231    rules files which are installed as part of the Application Makefiles.
232    This file contains settings for various Makefile variables to
233    tailor them to the particular CPU model and BSP configured.
234
235``${RTEMS_ROOT}/c/src/nfsclient/``
236    This directory contains a Network File System (NFS) client
237    for RTEMS.  With this file system, a user's application can
238    access files on a remote computer.
239
240``${RTEMS_ROOT}/c/src/optman/``
241    This directory contains stubs for the RTEMS Classic API
242    Managers which are considered optional and whose use
243    may be explicitly forbidden by an application.  All of the
244    directive implementations in this Optional Managers
245    return ``E_NOTCONFIGURED``.
246
247``${RTEMS_ROOT}/c/src/support/``
248    This directory exists solely to generate the RTEMS
249    version string which includes the RTEMS version,
250    CPU architecture, CPU model, and BSP name.
251
252``${RTEMS_ROOT}/c/src/wrapup/``
253    This directory is responsible for taking the individual
254    libraries and objects built in each of the components
255    in the RTEMS source tree and bundling them together to form
256    the single RTEMS library ``librtemsbsp.a``.  This
257    library contains all BSP and CPU model specific software.
258
259.. COMMENT: c/src/lib/libbsp BSP Directory
260
261c/src/lib/libbsp BSP Directory
262~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263
264The "libbsp" directory contains a directory for each CPU family supported
265by RTEMS.  Beneath each CPU directory is a directory for each BSP for that
266processor family.
267
268.. COMMENT: Tree 7 - C BSP Library
269
270The "libbsp" directory provides all the BSPs provided with this
271release of the RTEMS executive.  The subdirectories are
272divided,  as discussed previously, based on specific processor
273family, then further broken down into specific target board
274environments.  The "no_cpu" subdirectory provides a starting point
275template BSP which can be used to develop a specific BSP for an
276unsupported target board.  The files in this subdirectory may aid
277in preliminary testing of the RTEMS development environment that has
278been built for no particular target in mind.
279
280Below each CPU dependent directory is a directory for each target BSP
281supported in this release.
282
283Each BSP provides the modules which comprise an RTEMS BSP.  The
284modules are separated into the subdirectories "clock", "console",
285"include", "shmsupp", "startup", and "timer" as shown in the following
286figure:
287
288.. COMMENT: Tree 8 - Each BSP
289
290.. COMMENT: @ifset use-ascii
291.. code:: c
292
293    Each BSP
294    |
295    +-----------+----------+-----+-----+----------+----------+
296    |           |          |           |          |          |
297    clock      console    include     shmsupp    startup     timer
298
299.. COMMENT: @end ifset
300
301.. COMMENT: CPU Kit Directory
302
303CPU Kit Directory
304=================
305
306.. COMMENT: The @code{cpukit/} directory structure is as follows:
307
308.. COMMENT: CPU Kit Tree
309
310.. COMMENT: @ifset use-ascii
311
312.. COMMENT: @example
313
314.. COMMENT: @group
315
316.. COMMENT: cpukit
317
318.. COMMENT: |
319
320.. COMMENT: +-+-+-+-+
321
322.. COMMENT: |           |          |           |          |
323
324.. COMMENT: posix       rtems       sapi       score     wrapup
325
326.. COMMENT: @end group
327
328.. COMMENT: @end example
329
330.. COMMENT: @end ifset
331
332The ``cpukit/`` directory contains a set of subdirectories which
333contains the source files comprising the executive portion of
334the RTEMS development environment as well as portable support
335libraries such as support for the C Library and filesystems.
336The API specific and "SuperCore" (e.g. ``score/`` directory)
337source code files are separated into distinct directory trees.
338
339The following is a description of each of the subdirectories
340under ``cpukit/``:
341
342``${RTEMS_ROOT}/cpukit/aclocal/``
343    This directory contains the custom M4 macros which are available to
344    the various GNU autoconf ``configure.ac`` scripts throughout
345    the CPU Kit portion of the RTEMS source tree.
346    GNU autoconf interprets ``configure.ac``
347    files to produce the ``configure`` files used to tailor
348    RTEMS build for a particular host and target environment.  The
349    contents of this directory will not be discussed further in this
350    document.
351
352``${RTEMS_ROOT}/cpukit/automake/``
353    This directory contains files which are "Makefile fragments."
354    They are included as required by the various ``Makefile.am``
355    files throughout the CPU Kit portion of the RTEMS source tree.
356
357``${RTEMS_ROOT}/cpukit/ftpd/``
358    This directory contains the RTEMS ftpd server.
359
360``${RTEMS_ROOT}/cpukit/httpd/``
361    This directory contains the port of the GoAhead
362    web server to RTEMS.
363
364``${RTEMS_ROOT}/cpukit/include/``
365    This directory contains header files which are private to
366    RTEMS and not considered to be owned by any other component
367    in the CPU Kit.
368
369``${RTEMS_ROOT}/cpukit/libblock/``
370    This directory contains support code for using
371    Block Devices such as hard drives, floppies, and
372    CD-ROMs.  It includes the generic IO primitives
373    for block device drivers, disk caching support,
374    and a RAM disk block device driver.
375
376``${RTEMS_ROOT}/cpukit/libcsupport/``
377    This directory contains the RTEMS specific support routines
378    for the Newlib C Library.  This includes what are referred
379    to as system calls and found in section 2 of the traditional
380    UNIX manual.   In addition, it contains a thread-safe
381    implementation of the Malloc family of routines as well
382    as BSD and POSIX services not found in Newlib.
383
384``${RTEMS_ROOT}/cpukit/libfs/``
385    This directory contains the various non-networked
386    filesystem implementations for RTEMS.  It includes
387    the In-Memory FileSystem (IMFS), the mini-IMFS,
388    and FAT filesystems.
389
390``${RTEMS_ROOT}/cpukit/libi2c/``
391    This directory contains the RTEMS I2C framework.
392
393``${RTEMS_ROOT}/cpukit/libmd/``
394    This directory contains a port of the standard MD5
395    checksum code.
396
397``${RTEMS_ROOT}/c/src/libmisc/``
398    This directory contains support facilities which
399    are RTEMS specific but otherwise unclassified.  In
400    general, they do not adhere to a standard API.
401    Among the support facilities in this directory are
402    a ``/dev/null`` device driver, the Stack
403    Overflow Checker, a mini-shell, the CPU and
404    rate monotonic period usage monitoring libraries,
405    and a utility to "dump a buffer" in a nicely
406    formatted way similar to many ROM monitors.
407
408``${RTEMS_ROOT}/cpukit/libnetworking/``
409    This directory contains the port of the FreeBSD
410    TCP/IP stack to RTEMS.
411
412``${RTEMS_ROOT}/cpukit/librpc/``
413    This directory contains the port of the FreeBSD
414    RPC/XDR source to RTEMS.
415
416``${RTEMS_ROOT}/cpukit/libpci/``
417    This directory contains RTEMS PCI Library.
418
419``${RTEMS_ROOT}/cpukit/posix/``
420    This directory contains the RTEMS implementation
421    of the threading portions of the POSIX API.
422
423``${RTEMS_ROOT}/cpukit/pppd/``
424    This directory contains a port of the free implementation
425    of the PPPD network protocol.
426
427``${RTEMS_ROOT}/cpukit/rtems/``
428    This directory contains the implementation of the
429    Classic API.
430
431``${RTEMS_ROOT}/cpukit/sapi/``
432    This directory contains the implementation of RTEMS
433    services which are required but beyond the realm
434    of any standardization efforts.  It includes
435    initialization, shutdown, and IO services.
436
437``${RTEMS_ROOT}/cpukit/score/``
438    This directory contains the "SuperCore" of RTEMS.
439    All APIs are implemented in terms of SuperCore services.
440    For example, Classic API tasks and POSIX threads
441    are all implemented in terms of SuperCore threads.
442    This provides a common infrastructure and a high degree
443    of interoperability between the APIs.  For example,
444    services from all APIs may be used by any task/thread
445    independent of the API used to create it.
446    Within the ``score/`` directory the CPU dependent modules are found.
447    The ``score/cpu/`` subdirectory contains a subdirectory for each
448    target CPU supported by this release of the RTEMS
449    executive.  Each processor directory contains the CPU dependent
450    code necessary to host RTEMS.  The ``no_cpu`` directory provides a
451    starting point for developing a new port to an unsupported
452    processor.  The files contained within the ``no_cpu`` directory
453    may also be used as a reference for the other ports to specific
454    processors.
455
456``${RTEMS_ROOT}/cpukit/shttpd/``
457    This directory contains the port of the Simple HTTPD
458    web server to RTEMS.
459
460``${RTEMS_ROOT}/cpukit/telnetd/``
461    This directory contains the RTEMS telnetd server.
462
463``${RTEMS_ROOT}/cpukit/wrapup/``
464    This directory is responsible for taking the individual
465    libraries and objects built in each of the components
466    in the RTEMS CPU Kit source tree and bundling them
467    together to form the single RTEMS library ``librtemscpu.a``.  This
468    library contains all BSP and CPU model specific software.
469
470``${RTEMS_ROOT}/cpukit/zlib/``
471    This directory contains a port of the GNU Zlib compression
472    library to RTEMS.
473
474.. COMMENT: testsuites/ Test Suites
475
476testsuites/ Test Suites
477=======================
478
479This directory provides all of the RTEMS Test Suite
480except those for the Classic API Ada95 binding
481This includes the single processor tests, multiprocessor tests,
482timing tests, library tests, and sample tests.   Additionally,
483subdirectories for support functions and test related header
484files are provided.  The following table lists the test suites
485currently included with the RTEMS and the directory in which
486they may be located:
487
488``${RTEMS_ROOT}/testsuites/libtests/``
489    This directory contains the test suite for the
490    various RTEMS support components.
491
492``${RTEMS_ROOT}/testsuites/mptests/``
493    This directory contains the test suite for the
494    multiprocessor support in the Classic API.
495    The tests provided address two node configurations
496    and provide coverage for the multiprocessor code found
497    in RTEMS.
498
499``${RTEMS_ROOT}/testsuites/psxtests/``
500    This directory contains the test suite for the
501    RTEMS POSIX API.
502
503``${RTEMS_ROOT}/testsuites/samples/``
504    This directory provides sample application tests
505    which aid in the testing a newly built RTEMS environment, a new
506    BSP, or as starting points for the development of an application
507    using the RTEMS executive.  They are discussed in `Sample Applications`_.
508
509``${RTEMS_ROOT}/testsuites/sptests/``
510    This directory contains the test suite for the RTEMS
511    Classic API when executing on a single processor.
512    The tests were originally designed to provide
513    near complete test coverage for the entire
514    executive code.  With the addition of multiple APIs,
515    this is no longer the case as some SuperCore functionality
516    is not available through the Classic API.  Thus
517    some functionality in the SuperCore is only covered
518    by tests in the POSIX API Test Suites.
519
520``${RTEMS_ROOT}/testsuites/support/``
521    This directory contains support software and header files
522    for the various test suites.
523
524``${RTEMS_ROOT}/testsuites/tmtests/``
525    This directory contains the timing test suite for
526    the RTEMS Classic API.  This include tests that
527    benchmark each directive in the Classic API
528    as well as a set of critical SuperCore functions.
529    These tests are important for helping to verify
530    that RTEMS performs as expected on your target hardware.
531    It is not uncommon to discover mistakes in board
532    initialization such as caching being disabled as
533    a side-effect of analyzing the results of these tests.
534
535``${RTEMS_ROOT}/testsuites/tools/``
536    This directory contains tools which execute on
537    the development host and aid in executing and
538    evaluating the results of the test suite.  The
539    tools ``difftest`` compares the output of one
540    or more tests with the expected output.  If you
541    place the output of all the ``tmtests/`` in
542    a single file, then the utility ``sorttimes``
543    will be able to produce a report organizing the
544    execution times by manager.
545
546.. COMMENT: Documentation Directory
547
548Documentation Directory
549=======================
550
551This directory contains the source code for all RTEMS documentation
552in ``TexInfo`` format as well as utilities used in the generation
553of the RTEMS documentation set.  This source code is used to produce
554the RTEMS documentation in various formats including PDF, HTML,
555and PostScript.
556
557``${RTEMS_ROOT}/doc/ada_user/``
558    This directory contains the source code for the *RTEMS
559    Applications Ada User's Guide* which documents the Ada95
560    binding to the Classic API.  This manual is produced from
561    from the same source base as the *RTEMS Application
562    C User's Guide*.
563
564``${RTEMS_ROOT}/doc/bsp_howto/``
565    This directory contains the source code for the*RTEMS BSP and Device Driver Development Guide*.
566
567``${RTEMS_ROOT}/doc/common/``
568    This directory contains the source code for the files which
569    are shared across multiple manuals in the RTEMS Documentation Set.
570    This includes the copyright page as well as the timing
571    tables which can be filled in on a per BSP basis in the
572    CPU supplements.
573
574``${RTEMS_ROOT}/doc/cpu_supplement/``
575    This directory contains the source code for the
576    RTEMS CPU Supplement.
577
578``${RTEMS_ROOT}/doc/develenv/``
579    This directory contains the source code for the*RTEMS Development Environment Guide*.  This is
580    the document you are currently reading.
581
582``${RTEMS_ROOT}/doc/filesystem/``
583    This directory contains the source code for the*RTEMS Filesystem Design Guide*.  This manual
584    is a continuous work in process as it attempts to
585    capture the design of the interface between system
586    calls and filesystem implementations as well as the
587    information required by those implementing filesystems.
588
589``${RTEMS_ROOT}/doc/images/``
590    This directory contains the source code for the graphics
591    used in the HTML version of the RTEMS Documentation.
592
593``${RTEMS_ROOT}/doc/networking/``
594    This directory contains the source code for the*RTEMS Network Supplement*.
595
596``${RTEMS_ROOT}/doc/new_chapters/``
597    This directory contains the source code for the new documentation
598    components which have not yet been collected into a new manual or
599    merged into an existing document.  Currently, this primarily
600    contains draft documentation for some portions of
601    the facilities implemented in ``${RTEMS_ROOT}/c/src/libmisc/``.
602
603``${RTEMS_ROOT}/doc/porting/``
604    This directory contains the source code for the*RTEMS Porting Guide*.
605
606``${RTEMS_ROOT}/doc/posix1003.1/``
607    This directory contains the source code for the*RTEMS POSIX 1003.1 Compliance Guide*.
608
609``${RTEMS_ROOT}/doc/posix_users/``
610    This directory contains the source code for the*RTEMS POSIX API User's Guide*.  It is important to
611    note that RTEMS' support for POSIX is a combination of
612    functionality provided by RTEMS and the Newlib C Library
613    so some functionality is documented by Newlib.
614
615``${RTEMS_ROOT}/doc/relnotes/``
616    This directory contains the source code for a formally
617    release notes document.  This has not been used for
618    recent RTEMS releases.
619
620``${RTEMS_ROOT}/doc/started/``
621    This directory contains the source code for the*Getting Started with RTEMS for C/C++ Users* manual.
622
623``${RTEMS_ROOT}/doc/tools/``
624    This directory contains the source code for the tools
625    used on the development host to assist in producing the
626    RTEMS Documentation.  The most important of these tools
627    is ``bmenu`` which generates the hierarchical node
628    linking commands based upon chapter, section, and
629    subsection organization.
630
631``${RTEMS_ROOT}/doc/user/``
632    This directory contains the source code for the *RTEMS
633    Applications C User's Guide* which documents the Classic API.
634
635.. COMMENT: COPYRIGHT (c) 1989-2007.
636
637.. COMMENT: On-Line Applications Research Corporation (OAR).
638
639.. COMMENT: All rights reserved.
640
641
Note: See TracBrowser for help on using the repository browser.