[ECOS] Redboot/eCos RAM division

Gary Thomas gary@mlbassoc.com
Thu Dec 7 10:53:00 GMT 2006


Paul D. DeRocco wrote:
>>> Paul D. DeRocco wrote:
>>>
>>> I'm baffled by how the RAM in my system gets divided between
>>> Redboot and my
>>> eCos app. The Redboot signon seems to indicate that it consumes
>>> memory from
>>> zero upwards. Yet I'm under the impression that an eCos app is normally
>>> linked with the code first. Since this isn't
>>> position-independent code, and
>>> there's no memory remapping taking place, What ensures that the eCos app
>>> doesn't try to use the same RAM as Redboot? (I'm using an EB40A
>>> ARM7 eval
>>> board.) Is there simply some accepted start address for the
>>> eCos app that's
>>> high enough that Redboot never bumps into it?
>> From: Gary Thomas [mailto:gary@mlbassoc.com]
>>
>> The layout depends on the startup type.  RedBoot typically runs using
>> either ROM or ROMRAM startup, which is designed to use different pieces
>> of RAM for the workspace/variables.  The RAM startup is adjusted [per
>> platform or architecture] so that its use of RAM is unique from what
>> RedBoot uses.
>>
>> Look at the mlt* files for your platform for the details.
> 
> Okay, the .ldi files seem to indicate that for my EB40A board, which has
> 256K of on-chip RAM, the ROM model starts its ram area at 0x4000 (except of
> course for the fixed vectors), while the RAM model starts its ram area at
> 0xC000. It appears, then, that these boundaries are merely a matter of
> historical agreement, based on the observation that 32K is more than enough
> space for any conceivable version of Redboot.
> 
> However, the ROM .h file still defines SYGMEM_SECTION_heap1_SIZE as being
> the distance from the top of the used portion of RAM all the way up to the
> top of the physical RAM. So what keeps Redboot from eating into the area
> above 0xC000? Does it not use the heap at all? That wouldn't surprise me for
> my serial port base GDB stubs, but what about a board that has a network
> stack built into Redboot? Does its version of Redboot use only statically
> allocated memory? That's the only explanation I can think of.

RedBoot uses only static data (except for FLASH workspaces which are
allocated at the top of memory and considered volatile by RedBoot).

The reason that ROM or ROMRAM memory layouts allow use of all of
the RAM is that other programs besides RedBoot may use those startup
types.  After all, eCos was designed for embedded systems and many
of those only have a single embedded (ROM or ROMRAM) application and
no RedBoot at all.  This way, they can be built using the identical
layout template.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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



More information about the Ecos-discuss mailing list