# eCos ## Setting up and running EcMasterDemo 1. Build the eCos kernel with the parameters associated to the application : As a starting point there is an eCos configuration file (`.ecc`) file located at `SDK/LIB/eCos/x86/`.
eCos is unable to get command line parameters for main(). The parameters for the application are built in the kernel via the configuration tool ( Arguments to main ). ![eCos configuration tool showing the Arguments to main setting used to pass parameters to the EcMasterDemo application](../../OsLayer/Media/eCos_demo.png)
To use another example with different parameters, the kernel has to be rebuilt.
For the EcMasterDemo example the following line has to be passed to the application via the configuration tool: ```c { (char *)"name",(char *)"-f",(char *)"perf.xml", (char *)" -intelgbe",(char *)"1",(char *)"1",(char *)"-v", (char *)"3",(char *)"-t",(char *)"60000",(char *)"-perf",(char *)NULL } ``` 2. Compile EcMasterDemo : As a starting point there is the Eclipse project for EcMasterDemo for eCos located at `Workspace/eCos/EcMasterDemo`. The following macro in `Sources/OsLayer/eCos/EcOs.cpp` loads the ENI file from disk: ```c "MTAB_ENTRY(fat, "/", "fatfs", "/dev/idedisk1/1", 0)" ``` 3. Copy the ENI file to target : eCos supports only the 8.3 file format. Adjust the ENI file name and the command line in the configuration tool accordingly. 4. Configure Grub to load the application : Adjust the Grub menu file: ```default title eCos EcMasterDemo kernel (hd0,0)/EcMasterDemo boot ``` 5. Load and start the EcMasterDemo with Grub 6. Verify that the EcMasterDemo is running successfully : The EcMasterDemo takes some seconds to start. The following message is sent to the serial port on startup finished: ```console $ [ 3593.654951] MainDevice state changed from to ``` #### SEE ALSO [Running EcMasterDemo](gettingstarted_running-demo.html.md#running-ecmasterdemo) ## OS Compiler settings Besides the general settings from [Compiling the EcMasterDemo](gettingstarted_compiling.html.md#compiling-the-ecmasterdemo) the following settings are necessary to build the example application for eCos. Extra include paths : ```default /SDK/INC/eCos /Examples/Common/eCos ``` Extra source paths : ```default /Examples/Common/eCos /Sources/OsLayer/eCos/EcOs.cpp ``` Extra library paths to the main EtherCAT® components : ```default /SDK/LIB/eCos ``` Extra libraries : ```default libEcMaster.a libemllIntelGbe.a libtarget.a ```