This is the mail archive of the ecos-discuss@sources.redhat.com 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: memory on linux synthetic target


>>>>> "Tom" == Tom Coremans <tom.coremans@acunia.com> writes:

    Tom> Hi,
    Tom> I`m woriking on the Linux synthetic target and wan`t to
    Tom> increase the size of the heap ecos uses.

    Tom> Is it enough that I change the size of the RAM in the
    Tom> mlt_synth_i386_rom.ldi file where I find:

    Tom> MEMORY
    Tom> {
    Tom>     rom : ORIGIN = 0x1000000, LENGTH = 0x800000
    Tom>     ram : ORIGIN = 0x2000000, LENGTH = 0x800000
    Tom> }

    Tom> and change the size in the mlt_synth_i386_rom.h file where I
    Tom> find:

    Tom> #define CYGMEM_REGION_ram (0x2000000)
    Tom> #define CYGMEM_REGION_ram_SIZE (0x800000)
    Tom> #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R |
    Tom> CYGMEM_REGION_ATTR_W)

    Tom> or is there anything else I should do to make this work?

I believe that changing the RAM size in both these files should be
sufficient. Ideally these sizes should be configuration options, but
when I last worked on this I did not have time to figure out exactly
how to make that work. Eight megabytes is rather more than is
available on a typical embedded target running eCos, so AFAIK the
current fixed size has not been a problem for anybody else so far.

The code which actually allocates space for all the RAM is in
synth_entry.c in hal/synth/arch:

    new_top = (void*) (CYGMEM_REGION_ram + CYGMEM_REGION_ram_SIZE);
    if (new_top != cyg_hal_sys_brk(new_top)) {
        CYG_FAIL("Failed to initialize memory");
        cyg_hal_sys_exit(1);
    }

So if there are problems, that would be a place to start looking.

Bart

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


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