[ECOS] eCos 1.3.1 to eCos2 problems

Jonathan Larmour jifl@eCosCentric.com
Thu Jan 9 07:11:00 GMT 2003

Andrew Lunn wrote:
> On Thu, Dec 19, 2002 at 11:44:53AM +0100, Fredrik Hederstierna wrote:
>>Thanks for helping us,
>>we sorted the CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO problem out
>>we are defining our own malloc() which seems to override a weak eCos-malloc().
>>When std-streams are constructed it calls malloc it buffered io is selected.
>>Can this be a problem - what other memory is using malloc() when starting up
>>eCos2?? I believe eCos1.3.1 works fine when overriding malloc().
>>Can all mallocs() be disabled? I thought all mem was allocated static.
> All memory for the KERNEL package is statically allocated. Other
> packages do use dynamic memory. 

You could disable malloc in the memalloc package. Then nothing should be 
enabled that uses malloc due to the CDL dependencies. Or you could use 
that to see where the dependencies are.

> You need to ensure that your malloc code is initialized early on. You
> probably need a constructor with highish priority, or make the first
> call to malloc do the initialisation.

You could cheat and hack a call to something to initialize it at the very 
start of your arch HAL's cyg_hal_invoke_constructors().

eCosCentric       http://www.eCosCentric.com/       <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list