Chapter 23. The Component Repository and Working Directories
Table of Contents
Each of the file trees involved in eCos development has a different role.
23.1. Component Repository
The eCos component repository contains directories for all the packages that are shipped with eCos or provided by third parties.
The component repository should not be modified as part of application development.
Figure 23.1. Component repository
23.1.1. Purpose
The component repository is the master copy of source code for all system and third party components. It also contains some files needed to administer and build the system, such as ecosadmin.tcl.
23.1.2. How is it modified?
You modify it by importing new versions of packages from a distribution or removing existing packages. These activities are undertaken using the eCos Package Administration Tool.
23.1.3. When is it edited manually?
Files in the component repository should only be edited manually as determined by the component maintainer.
23.1.4. User Applications
User application source code should not go into the component repository.
23.1.5. Examples of files in this hierarchy:
-
BASE_DIR
/doc/ref/ecos-ref.html The top level HTML file for the eCos Reference Manual.
-
BASE_DIR
/prebuilt/pid/tests/kernel/<version>
/tests/thread_gdb.exe -
BASE_DIR
/prebuilt/linux/tests/kernel/<version>
/tests/thread_gdb.exe Pre-built tests for the supported platforms, and the synthetic Linux target.
-
BASE_DIR
/examples/twothreads.c One of the example programs.
-
BASE_DIR
/ecosadmin.tcl The Tcl program which is used to import new versions of packages from a distribution or remove existing packages.
-
BASE_DIR
/packages/language/c/libm/<version>
/src/double/portable-api/s_tanh.c Implementation of the hyperbolic tangent function in the standard math library.
-
BASE_DIR
/pkgconf/rules.mak A file with make rules, used by the
makefile
.
23.2. Build Tree
The build tree is the directory
hierarchy in which all generated files
are placed. Generated files consist of the
makefile
, the compiled object files,
and a dependency file (with a .d
extension) for each source file.
23.2.1. Purpose
The build tree is where all intermediate object files are placed.
23.2.2. How is it modified?
Recompiling can modify the object files.
23.2.3. User applications
User application source or binary code should not go in the build tree.
23.2.4. Examples of files in this hierarchy
-
ecos-work/language/c/libc/
<version>
/src The directory in which object files for the C library are built.
23.3. Install Tree
The install tree is the location
for all files needed for application development. The
libtarget.a
library, which contains the
custom-built eCos kernel and other components, is placed
in the install tree, along with all packages‚ public
header files. If you build the tests, the test executable
programs will also be placed in the install
tree.
By default, the install tree is created by
ecosconfig in a subdirectory of the build
tree called install
. This can be
modified with the --prefix
option (see
Chapter 26, Manual Configuration).
23.3.1. Purpose
The install tree is where the custom-built
libtarget.a
library, which contains
the eCos kernel and other components, is located. The
install tree is also the location for all the header files
that are part of a published interface for their
component.
23.3.2. How is it modified?
Recompiling can replace
libtarget.a
and the test
executables.
23.3.3. When is it edited manually?
Where a memory layout requires modification without
use of the eCos
Configuration Tool, the memory layout
files must be edited directly in the install tree. These
files are located at
install/include/pkgconf/mlt_*.*
.
Note that subsequent modification of the install tree
using the Configuration Tool will result in such manual
edits being lost.
23.3.4. User applications
User application source or binary code should not go in the install tree.
23.3.5. Examples of files in this hierarchy
-
install/lib/libtarget.a
The library containing the kernel and other components.
-
install/include/cyg/kernel/kapi.h
The header file for the kernel C language API.
-
install/include/pkgconf/mlt_arm_pid_ram.ldi
The linker script fragment describing the memory layout for linking applications intended for execution on an ARM PID development board using RAM startup.
-
install/include/stdio.h
The C library header file for standard I/O.
23.4. Application Build Tree
This tree is not part of eCos itself: it is the directory in which eCos end users write their own applications.
Example applications and their
Makefile
are located in the component
repository, in the directory
BASE_DIR
/examples
.
There is no imposed format on this directory, but there
are certain compiler and linker flags that must be used to
compile an eCos application. The basic set of flags is shown
in the example Makefile
, and additional
details can be found in Chapter 24, Compiler and Linker Options.
2024-12-10 | Open Publication License |