This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
AW: memory maps, linker control files, etc.
- From: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>
- To: "Gary Thomas" <gary at mlbassoc dot com>, "Andrew Voelkel" <andy at bushtaxi dot com>
- Cc: "eCos Discussion" <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 12 Oct 2005 11:01:16 +0200
- Subject: AW: [ECOS] memory maps, linker control files, etc.
Hi,
> Von: ecos-discuss-owner@ecos.sourceware.org
...
> Not correct. ROMRAM is used for RedBoot (or any monitor) and is
> perfectly suited for loading RAM programs. RAM mode is designed for
> general eCos applications.
>
> The ROMRAM and RAM loader templates (.ldi files) are
> structured so that
> memory used by one does not conflict with the other. In most cases,
> ROMRAM uses a chunk of low memory and RAM version are allowed to use
> everything else.
I think I see a problem there.
In redboot, main.c, there is the following code:
#ifdef CYGMEM_SECTION_heap1
workspace_start = (unsigned char *)CYGMEM_SECTION_heap1;
workspace_end = (unsigned char *)(CYGMEM_SECTION_heap1+CYGMEM_SECTION_heap1_SIZE);
#else
workspace_start = (unsigned char *)CYGMEM_REGION_ram;
workspace_end = (unsigned char *)(CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE);
#endif
Later on, in flash.c, the last part before the end of workspace is used to store the contents of the fis:
workspace_end = (unsigned char *)(workspace_end-fisdir_size);
fis_work_block = workspace_end;
Later on from the application these contents can be accessed via virtual vector calls. So the application should take care not to use this area of the RAM. I'm no ldi-files expert, but AFAICT e.g. hal/arm/xscale/ixdp425/current/include/pkgconf/mlt_arm_xscale_ixdp425_ram.ldi doesn't take this into account:
MEMORY
{
ram : ORIGIN = 0, LENGTH = 0x10000000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
SECTION_rom_vectors (ram, 0x80000, LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
Do I misunderstand something and there is a lock, or is it missing ?
If it is missing, how can it be done ?
Bye
Alex
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss