OS section organization

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Thu May 8 18:11:45 UTC 2003


Brett Swimley writes:
 > 
 > Hello all,
 > 
 > Is there a preferred way to modify source code section information or modify my
 > linker script to allow me to move more frequently executed sections of the OS
 > (such as context switching) into faster memory?
 > 
 > I'm using the 5272 Coldfire and would like to place more frequently executed
 > pieces of code into internal SRAM, which has a much faster access time than
 > external SDRAM.
 > 
 > Ideally, the change would be transparent to existing processors and BSPs, but
 > would allow those BSPs that desire this functionality to be able to pick it up
 > and utilize it.
 > 

Its an entirely reasonable approach, provided there are no code
generation implications for using it (page select bits or different
instructions, etc...).

Generally, the approach is to cook up your own link script, then tell
your linker to use instead of the default bsp script.

That said, you may have to be clever with your bootstrap to arrange
your image at runtime.  If you have a romm'ed/flashed/whatevered image
that copies itself to RAM to run, then you'll need to be a bit smarter
about location the sections.  What you'll end up doing is creating
symbols in the linker script to mark where sections are located, then
referencing those symbols in your relocation code.  We do a lot of
this kind of thing, so I'd be glad to offer suggestions & examples.

Gregm




More information about the users mailing list