Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Benefits of Running without Windows Benefits of Running with Windows Preparing a Program for RTTarget-32 Locating a Program Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
Locating a ProgramLocating an application is accomplished using program RTLoc. It requires two sources of input: An .EXE file (and possibly one or more DLLs) produced by a 32-bit compiler/linker and a configuration file. The output is an absolute binary file (extension .RTB, RTTarget-32 Binary) and a listing file (extension .LOC) which contains information similar to a linker map file. The configuration file specifies how to map the program onto the given hardware. Here is a short example configuration file for a simple program compiled with Borland C++: Region MyRAM 0h 256k RAM Region MyROM F0000h 64k ROM Locate Header Header MyROM Locate NTSection CODE MyROM Locate NTSection DATA MyRAM Locate Stack Stack MyRAM 16k Locate Heap Heap MyRAM First, two regions of memory are defined using Region commands. The first is named MyRAM at address 0, size 256k. The second section MyROM is located at address F0000h, and is 64k bytes long. Its type is ROM. The Locate commands instruct RTLoc which parts of the program to map to which regions. The Header is required by the boot code. It contains information about where the application is located, its entrypoint, etc. NTSections are data read from the .EXE file. RTLoc will determine their sizes from information in the .EXE file. The stack and heap are only allocated; initially, there is no data associated with them. The stack size is fixed at 16k in this example. Since we did not specify a size for the heap, RTLoc will assign all remaining space in region MyRAM to the heap. After running RTLoc, the .LOC file will contain the following Relocation Report (and several other reports): [Relocation Report] Name Address Size Image Access ----------------------------------------------- MyRAM 00000000 00040000 00040000 DATA 00000000 00002000 00001200 ReadWrite Stack 00002000 00004000 00000000 ReadWrite Heap 00006000 0003A000 00000000 NoAccess MyROM 000F0000 00010000 00006000 Header 000F0000 00000096 00000096 ReadOnly CODE 000F1000 00005000 00004A00 ReadOnly All regions are listed with their respective locations, sizes, and space used. Indented below each region, all entities allocated to the region are listed with their locations, sizes, and data image sizes. This example may seem trivial; real configurations can be more complex. For example, you could have several disjoint RAM and ROM regions as well as DEVICE regions, virtual regions, DLLs, etc. Section RTLoc: Locating a Program covers configuration files in detail. Running Win32 Programs without Win32 Preparing a Program for RTTarget-32
|