2.9. The Boot PROM

You may build your program to run on the simulator, or as a program that executes directly from PROM or as a program that is loaded from PROM and executes from RAM. These choices are known as linker emulations and are a new feature in ERC32 Ada Version 1.7.

We have added three emulations to the linker: erc_ram, erc_xgcmon, and erc_rom.

The emulation erc_ram, which is the default, builds a program exactly as ERC32 Ada Version 1.6 does. All sections are located in RAM starting at address 0x02000000. The program's warm start entry point is 0x02000000.

The emulation erc_rom builds a memory image that has an entry point at address 0x00000000, and in which the program sections that contain instructions or data reside in the boot PROM. The start file includes additional code that copies these program sections into their proper locations before branching to the entry point (at address 0x02000000.

This emulation is intended to replace the program mkprom. Unlike the output of mkprom, the memory image contains full debug information for the application program, which may be debugged on the simulator in the usual way.

The emulation erc_xgcmon builds a program that is suitable for downloading to the target computer and running with the XGC monitor. This means linking with the linker script file xgcmon.ld and using the start file art1.S in place of art0.S.

Programs built with this emulation rely on the trap handlers in the monitor and all system calls are handled by the monitor.

To specifiy an emulation on the command line, use the linker option -m as follows:

$ erc-coff-gnatmake hello.adb -largs -Wl,-merc_rom

This command will build an executable image that contains instructions starting at address zero that copy the main part of the image (i.e. the sections .text, .rodata and .idata) from an area of PROM into the main RAM starting at address 16#02000000#.