This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Redboot/eCos memory usage


On Sat, 2005-12-03 at 08:55 +0000, R S wrote:
> Hi:
> 
> Thanks a lot for your input.
> 
> The arena size is:
> ARENA SIZE = 133956528 Bytes ~ 127.7 MB which is very close to the 128 that my
> target has.
> Also if ecos application has addresses ranging from 0xc00171e8 up to
> 0xc7fd1000, how can heap be that large. Doesn't this mean ecos app have approx
> 8MB of space.

Sorry, but learn the math:

$ python
Python 2.3.4 (#1, Oct 26 2004, 16:42:40)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0xc7fd1000 - 0xc00171e8
133930520

The other 26008 bytes come from the fact that eCos will willing use
up to 0xC8000000, not just 0xC7FD1000.

> What am I missing here???
> 
> I calculate arena size as follows:
> --------------------
> struct mallinfo minfo;
> minfo = mallinfo();
> diag_printf("ARENA SIZE = %d\n",minfo.arena);
> ----------------------------------------
> 
> heap symbol is defined in my mlt_arm...h file as:
> -------------------------------------
> #define CYGMEM_REGION_ram      (0xC0000000)
> #define CYGMEM_REGION_ram_SIZE (0x08000000)
> #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
> 
> #ifndef __ASSEMBLER__
> extern char CYG_LABEL_NAME (__heap1) [];
> #endif
> 
> #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
> #define CYGMEM_SECTION_heap1_SIZE (0xC8000000 - (size_t) CYG_LABEL_NAME (__heap1))
> -------------------------------------------
> 
> Thanks a ton!
> 
> 
> Gary Thomas <gary@mlbassoc.com> said:
> 
> > On Sat, 2005-12-03 at 08:20 +0000, R S wrote:
> > > Confused with eCos/Redboot memory layout structure.
> > > 
> > > 1. How can I find how much available memory my target has for eCos
> applications.
> > > My target.ld is as below:
> > > 
> > > MEMORY
> > > {
> > >     vrom : ORIGIN = 0x00000000, LENGTH = 0x00001000
> > >     ram  : ORIGIN = 0xC0000000, LENGTH = 0x08000000
> > > }
> > > 
> > > 2. How much of the ram is used by redboot? Below is the message I get on
> > > booting redboot
> > > 
> > > RedBoot(tm) bootstrap and debug environment [ROM]
> > > Non-certified release, version 2.00 - built 11:55:39, May 15 2002
> > > 
> > > Platform: BRH (XScale)
> > > Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
> > > 
> > > RAM: 0xc0000000-0xc8000000, 0xc00171e8-0xc7fd1000 available
> > > FLASH: 0x00000000 - 0x00400000, 32 blocks of 0x00020000 bytes each.
> > > 
> > > How is it that the two address ranges overlap??
> > 
> > They don't - the first range indicates the total amount and the 
> > second range is what's available for user/eCos programs.
> > 
> > > 
> > > primarily, what I intend to do is reduce my heap size and use the available
> > > memory to create another memory section. In my application, I used
> > > mallinfo.arenasize to find initial heap size. It reported over 133MB size??
> > 
> > Are you sure?  I think you are confusing sizes here - 1MB = 1024*1024 
> > bytes = 1048576 bytes, so your board has 128MB = 134217728 bytes total.
> > 
> > eCos programs can safely use any of the memory from 0xc00171e8 up to
> > 0xc7fd1000 (the lower and upper edge regions are used by RedBoot).
> > 
> > > That appears really huge to me. Is this available for use entirely by eCos
> > > application or does Redboot uses it too??
> > > 
> > > Thanks in advance
> > > 
> > > 
> > -- 
> > Gary Thomas <gary@mlbassoc.com>
> > 
> 
> 
> 
> -- 
> 
> 
> 
> 
-- 
Gary Thomas <gary@mlbassoc.com>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]