New source layout.

Amar Takhar amar at rtems.org
Sat Mar 7 01:20:46 UTC 2015


The following is a proposal for a new source layout that will be included in the 
new 'waf' build system.  The current layout is a product of years of laying and 
requirements for the auto* build system.  Since we are no longer restricted by 
this it makes sense to take the time and give RTEMS a more sensible source 
layout.

rtems/bsp/* exists to carry common bsp files.  I don't know why it makes sense 
to have score/* then cpu/* with separate architectures.  Even if the purpose is 
different does it make sense to have two completely separate areas with 
architecture hierarchies?  There may have been a reason to do this before is 
there one now?

There are some interdependencies between the common BSP files (bsp.h).  I can 
hack around this for now using waf until we can break this interdependency by 
moving to public APIs.

Note: the reason for rtems/bsp/* existing is to unhook rtems/ and bsp/ 100%.  
This means you can develop a BSP with only librtems installed on your system and 
nothing else.  We will also support a build that does not build any BSP code.  
It will also allow us to split our tests correctly as well.

I will propose a 1:1 mapping of all source and header files from current -> new 
location for approval once we have the general layout completed.  I would like 
to avoid renaming the source files themselves until after we have moved and 
verified everything builds OK.  Renaming the files in-dir is a trivial 
operation and can be verified using a hash of the resulting libraries.


include locations
~~~~~~~~~~~~~~~~~
include/rtems/include/             - Private API
include/rtems/include/rtems/       - Public API
include/rtems/bsp/include/         - Common BSP files
include/rtems/bsp/include/<arch>   - Architecture specific


rtems
~~~~
rtems/lib/ada/          [c/src/ada]
rtems/lib/block
rtems/lib/csupport
rtems/lib/fs
rtems/lib/misc
rtems/lib/networking
rtems/lib/rpc
rtems/lib/z
rtems/lib/qos
rtems/lib/md
rtems/lib/gnat
rtems/lib/i2c
rtems/lib/rtems++       [c/src/librtems++]
rtems/classic           [cpukit/rtems]
rtems/posix
rtems/sapi
rtems/server/ftpd
rtems/server/mghttpd
rtems/server/pppd
rtems/score

The following need to be discussed in detail as they will end up split into multiple locations:
rtems/bsp/chip/         [c/src/libchip]
rtems/bsp/shared/<arch> [c/src/lib/libcpu]

Note: c/src/support has been killed.


bsp (contents of c/src/lib/libbsp, actual BSP source)
~~~
bsp/<arch>/
bsp/<arch>/<bsp>/
bsp/<arch>/<bsp>/include <-installable BSP headers.


installed locations
~~~~~~~~~~~~~~~~~~
include/rtems/                  - Public API
include/rtems/bsp/              - Common BSP files
include/rtems/bsp/<arch>/       - Architecture specific
include/rtems/bsp/<arch/<bsp>/  - BSP specific


changes to source
~~~~~~~~~~~~~~~~
- All RTEMS source will use #include <rtems/header.h> for public API
- Private API will use #include "header.h"
- Local header will use #include "header.h"
- Only -Iinclude will be provided all paths must be full and start with 'rtems/' 
  to avoid name clashing and for clarity.


Please feel free to comment on any of the above.  It is meant as a guideline for 
us to talk about the larger 'chunks' of source.  Eventually this will move to a 
spreadsheet that contains 1:1 mapping of old_dir -> new_dir locations.


Amar.


More information about the devel mailing list