eCosTM Reference Manual
Prev | Chapter 4. System start-up | Next

# System startup — cyg_package_start()

The `cyg_package_start()` allows individual packages to do their initialization before the main user program is invoked.

Two of the packages shipped with this release of eCos have code in the default `cyg_package_start()`: the µITRON and the ISO standard C library compatibility packages (see Chapter 6 and Part IV in eCosTM Reference Manual).

The infrastructure package has configuration options `CYGSEM_START_UITRON_COMPATIBILITY` and `CYGSEM_START_ISO_C_COMPATIBILITY` which control specialized initialization.

You can override the default `cyg_package_start()` routine by providing your own function by the same name with the following prototype:

`void cyg_package_start`(void);

but you should be careful to initialize the default packages (if you are using them). An example user-supplied function might look like:

    	void cyg_package_start(void)
    	{
     #ifdef CYGSEM_START_UITRON_COMPATABILITY
    	cyg_uitron_start(); /* keep the µITRON initialization */
     #endif
    	my_package_start(); /* make sure I initialize my package */
    	}

> Note: If you are supplying your own definition of this function from a C++ file, make sure it has “C” linkage.

Prev | Home | Next
System startup — cyg_prestart() | Up | System startup — cyg_user_start()