Step 2 : Compile Ecos
============================

.. tab-set::

   .. tab-item:: Compile Ecos

        * In this program, you are going to learn


        .. panels::
                :container: container pb-4
                :column: col-lg-12 p-2
                :card: shadow

                * How to ?


.. panels::
        :container: container pb-4
        :column: col-lg-12 p-2
        :card: shadow

        Topics in this section,

                * :ref:`Source code download and compilation <ecos_qemu_i386_step2_0>`


.. _ecos_qemu_i386_step2_0:

.. tab-set::

   .. tab-item:: Source code download and compilation

        * Make sure current dir is $HOME
        
        .. code-block:: c

                $ cd $HOME

        * Download the source code using the following command.

        .. code-block:: c

                $ git clone https://github.com/GrantEdwards/eCos-on-qemu.git

        * Set the GNU tools in the environmental variable PATH.

        .. code-block:: c

                $ PATH=$PATH:$HOME/ecos:$HOME/ecos/gnutools/i386-elf/bin
                
                  
        * export the ECOS REPOSITORY path.

        .. code-block:: c

                $ export ECOS_REPOSITORY=$HOME/ecos/ecos-3.0/packages     

        * Go to the eCos-on-qemu directory and run the buildecos script.

        .. code-block:: c

                $ cd $HOME/eCos-on-qemu
                $ ./buildecos.sh
        
        * Run make command to build the applications for ecos.

        .. code-block:: c

                $ make

        * Once the build is done, the final target image will be present in the same directory.

        .. code-block:: c

                test:eCos-on-qemu$ ls -l
                -rwxrwxr-x 1 test test 2157025 Feb  1 12:18 hello.elf
                -rwxrwxr-x 1 test test 2162252 Feb  1 12:18 server.elf
 


.. panels::
        :container: container pb-4
        :column: col-lg-12 p-2
        :card: shadow

        What is /.bashrc file?

        .. dropdown:: See Answer

                * ??