question about rtems compiler

Chris Johns chrisj at
Thu May 10 07:25:14 UTC 2012

On 9/05/12 10:10 PM, Luca Cinquepalmi wrote:
> I have no error... I'd just like to know the difference bewtween a
> simple C source code (with main function)
> and rtems structured one... thanks.

Traditionally most embedded systems did not support 'main', RTEMS 
included. The boot monitor passes control to the BSP entry point and 
this initialises various resources then starts RTEMS running. The C API 
provides support for initialisation tasks that can be started. This 
approach makes 'main' difficult.

These days RTEMS does provide support for 'main' if the BSP supports it. 
There is code in the BSP shared area that provides a default 'Init' 
symbol as weak. This ties in with confdefs.h support and the runtime 
configuration of RTEMS which assumes the entry point is a single 
initialisation task called 'Init'. If the weak Init support is built by 
your BSP you can just provide 'main' and it will be called.


More information about the users mailing list