Hi,
I would like to ask a question on AIS.
The role of linker is to assemble separate .obj output of the assembler into a single .out file, whose contents will then be loaded into various sections in the memory hierarchy (L1, L2, DDR2).
But for a self-booting system without the presence of an emulator, who assumes the role of “carrying” various parts of the .obj file into its designated memory locations?
I know of two possibilities:
1. One could write another loader in assembly language, placing it at the default address in the memory that the bootloader will go to. Upon reset, bootloader goes to that default address on the external memory and starting executing the program. This program will
I. Loading the real code/data into memory (L1, L2, DDR2)
II. Jump to the starting address (c_int00 entry point) upon finish loading
Difficulty:
1) In order to complete the tasks above, the writer of the assembly code must know the structure of the .out file and be able to read its header, so he can correctly extract its parts do the placement.
2) Can this loader code be written in C? It seems to me a chicken-egg dilemma here: where is this assumed C-compiled code going to execute? On the external device, or the memory? Who is going to place parts of itself into the right location?
2. It seems to me likely that the above tasks can be all automated by AIS, which is why it is created. AIS generation tools like DM643x, AISgen, GenAIS or HexAIS would transform .out file (the transformation should chiefly be on the file header, leaving the main code/data intact. Correct?) into .AIS format, encoding all the section placement information in its opcodes. The AIS format commands following the magic number 0x41504954 could then be decoded by bootloader program, which itself is something between an assembler and a compiler that translate each AIS commands into a series of CPU instructions. These translated instructions will perform tasks (I) and (II) assembly loader (see above).
Summary:
In the absence of emulator, its section placement role has to be assumed by other software programs. Two alternatives exist:
1. Writing an assembly code, which could be difficult.
2. Using AIS generation tool and bootloader, which automates everything.
This is my understanding on AIS. Could anyone comment and furnish deeper insights on these points?
Zheng