Execute In Place

The previous two sections talk about how TFS transfers sections of a formatted file (i.e., an ELF format file) from the flash space in which it resides to the DRAM space from which it was configured to run. No code actually executes out of the flash space allocated to TFS. A memory copy (and possibly a decompression ) is always involved. The previously mentioned disadvantage of this approach is that the .text space used by the application is copied to RAM when it really doesnt need to be (since .text space is not considered writable). An alternative to this loading process is execute-in-place (XIP), meaning that the .text section of the program resides in flash and the CPU executes it out of flash directly, with no memory copy required.

The attractiveness of namespace (rather than address space) is the very reason why TFS does not support XIP. XIP (without address translation) requires that the program reside at a fixed location in memory, and TFS cannot guarantee that any file in the file system will be at a fixed location. TFS does, however, allow you to leave the program in flash memory and execute directly out of flash memory. Actually, TFS isnt even aware of the program, but, because of TFSs ability to reside in some portion of a flash device, MicroMonitor can still execute a program in XIP mode.

The standard way to design the monitor/application flash memory map is shown in the No XIP Support map (see Figure 7.12). The monitor is at the base of the flash space with all remaining space dedicated to TFS. If a program is to run in XIP mode, the base of TFS can be shifted up (as in the XIP Support side of Figure 7.12), and some fixed number of sectors can be dedicated to the XIP program. Note that MicroMonitor and the program still has access to TFS for data storage, but the program itself is not in TFS.

image from book
Figure 7.12: XIP vs. Non-XIP Flash Support.

The monitor supports XIP simply because the starting point of TFS can be adjusted so that a fixed number of flash sectors are dedicated to the storage of the XIP program.



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net