From 78aea38e5786ab074a5d604544485cd07fd33bdb Mon Sep 17 00:00:00 2001 From: Michael Gielda Date: Mon, 7 Apr 2014 11:26:24 +0200 Subject: Minor update --- doc/source/introduction.rst | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/doc/source/introduction.rst b/doc/source/introduction.rst index 9c47a2a..2afeb9b 100644 --- a/doc/source/introduction.rst +++ b/doc/source/introduction.rst @@ -130,46 +130,54 @@ Preparing an :abbr:`.ecc` file The actual configuration of the eCos system is maintained and modified through :program:`ecosconfig`. The following commands will prepare a sample :abbr:`.ecc` file for a kernel with default settings. -.. topic:: Generating the kernel ecc file from scratch. +.. topic:: Generating the kernel ecc file from scratch .. code-block:: bash - export ECOS_REPOSITORY="{path/to/ecos-vybrid/ecos}/packages" # modify this - # Create ecos.ecc file based on Colibri VF61 default template - ecosconfig new col_vf61 default + export ECOS_REPOSITORY="{path/to/ecos-colibri-vf61/ecos}/packages" # modify this + # Create ecos.ecc file based on Colibri VF61 default template + ecosconfig new col_vf61 default You now have a ``ecos.ecc`` file that holds the default eCos configuration for Colibri VF61. -The file can be further edited manually with a text editor and/or :program:`ecosconfig` or graphically using :program:`configtool` (see :ref:`custom-config`), but at this moment it is already enough to compile a sample eCos kernel. +The file can be further edited manually with a text editor and/or :program:`ecosconfig` or graphically using :program:`configtool` (see :ref:`custom-config`), but at this moment it is already enough to compile a sample eCos kernel. .. _build-kernel: Building the kernel ------------------- +The eCos kernel is built in two stages: + +* first, a so-called *build tree* is generated from the eCos sources by :program:`ecosconfig`. + The build tree is customized for your build as configured in the :abbr:`.ecc` file used. + It is best to generate the build tree in a separate directory (here ``build-tree``). +* then, the source files are compiled + A short shell script is proposed to make the compilation process easier: -.. topic:: Making the eCos kernel script +.. topic:: Building the eCos kernel .. code-block:: bash - export ECOS_REPOSITORY="{path/to/ecos-vybrid/ecos}/packages" # modify this - export PATH="{path/to/toolchain}/bin:$PATH" # modify this + export ECOS_REPOSITORY="{path/to/ecos-colibri-vf61/ecos}/packages" # modify this + export PATH="{path/to/toolchain}/bin:$PATH" # modify this - mkdir -p ecos-kernel - rm -rf ecos-kernel/* - cd ecos-kernel + mkdir -p build-tree + rm -rf build-tree/* + cd build-tree - ecosconfig --config={path/to}/ecos.ecc tree # modify this + ecosconfig --config={path/to}/ecos.ecc tree # modify this make + cd .. -The resulting kernel files can be found in :file:`ecos-kernel/install/lib`. +The resulting kernel files can be found in :file:`build-tree/install/lib`. Application ----------- -With a compiled kernel files in the :file:`ecos-kernel/install/lib` directory (see :ref:`build-kernel`), a user space eCos application can be compiled and linked to it. +With a compiled kernel files in the :file:`build-tree/install/lib` directory (see :ref:`build-kernel`), a user space eCos application can be compiled and linked to it. -A listing for a short sample application (taken from :file:`ecos/examples/hello.c`) is given below. +A listing for a short sample application (taken from :file:`ecos-colibri-vf61/ecos/examples/hello.c`) is given below. .. topic:: hello.c - sample application @@ -198,11 +206,11 @@ You can compile an eCos program with a procedure similar to the following listin -mcpu=cortex-m4" # Set path to eCos kernel - KPATH="{path/to/kernel}" # modify this + BTPATH="{path/to/ecos/build-tree}" # modify this # Do compilation and link your application with kernel - arm-eabi-gcc -g -I./ -g -I${KPATH}/install/include hello.c \ - -L${KPATH}/install/lib -Ttarget.ld ${OPT} + arm-eabi-gcc -g -I./ -g -I${BTPATH}/install/include hello.c \ + -L${BTPATH}/install/lib -Ttarget.ld ${OPT} # Use objcopy to generate a binary arm-eabi-objcopy -O binary a.out hello.bin -- cgit v1.2.3