question on linker script setting for a case

Chan Kim ckim at etri.re.kr
Tue Nov 17 08:41:58 UTC 2015


Dear rtems users and developers,

I have three demo programs 
1. sieve, a simple caculation, supposed to be loaded and run at 0x20000000, length 0x8b28 (small)
2. linux, supposed to be loaded and run at 0x27000000, length 0x37b988  (over 3MB)
3. rtems+gui demo, supposed to be loaded and run at 0x20000000, length 0x1993e08 (less than 2MB)
                but this program has to run with another disk image which is 8MB, loaded to 0x26000000.
These three programs whether it's bare-metal or OS, I don't want to change the load address.
(Our system has DDR ram from 0x20000000 ~ 0x5fffffff)
My demo program which itself is an rtems application reads the SD card and displays the demo program names.
It receives demo name using scanf from the console and loads the executable (with disk image when necessary) and runs the program by jumping to the loaded location. 
I used to have it ok for some time, but today with slightly revisioned FPGA, when I run the program, this program loading and execution runs ok for sieve and rtems+gui  programs but not for linux. The linux run only to certain location for some reason I don't know. I tried loading the linux image to 0x27000000 and running and it runs ok.

Here's my current linkcmds file. I intended the rtems image to be placed after 0x21a00000 because the "rtems+gui" demo program will be loaded to 0x20000000 to 0x21993e08. I know linux image will be loaded to 0x27000000 to 0x2737b988. The real problem is that I don't know the exact meaning of _RAM_START and LENGTH in be linkcmds below.  Do I have to include the area above 0x27000000 in the MEMROY ram area below or not? Do I have to include that area with _RAM_SIZE too? What's the difference of _RAM_SIZE and LENGTH? Some explanation will be deeply appreciated.

Best regards,
Chan Kim

/*  linkcmds
 */
/* Default values, can be overridden */
_PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 2M;
_PROM_START = DEFINED (_PROM_START) ? _PROM_START : 0x00000000;
_RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 91M;
_RAM_START = DEFINED (_RAM_START) ? _RAM_START : 0x21a00000;
/*_RAM_START = DEFINED (_RAM_START) ? _RAM_START : 0x20000000;*/
/*
 *  Base address of the on-CPU peripherals
 */

/* these are the maximum values */
MEMORY
{
  rom     : ORIGIN = 0x00000000, LENGTH = 2M
  ram     : ORIGIN = 0x21a00000, LENGTH = 127M
/*  ram     : ORIGIN = 0x20000000, LENGTH = 127M */
}
INCLUDE linkcmds.base


More information about the users mailing list