This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bootloader + AIS = placement ?

Anonymous
Anonymous

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

  • Hi there

    Writing a boot routine in assebly is actually easier than one would imagine. We wanted full control of the boot process (we have a selection of programs we can boot to, etc.) and so we were forced to go this route.

    Writing the assebly boot routine as part of the main firmware can be done following the examples in spra999a. (The rest of that document isn't up to date, but since most people use AIS to boot I don't know of a newer version). hex6x.exe makes it easy to convert this file for writing to flash.

    You'd only do this if you really wanted that level of control though, otherwise AIS should work fine. I've only used AIS in conjuction with the Flashburn untility, in which case I found their documentation that came with the Flashburn example code best.

    Let me know if you wish to pursue booting without AIS.

    Regards

    Leon de Wit

     

    PS: Thanks again to Bernie Thompson and Tim Harron who originally helped me to get this working here.

  • Anonymous
    0 Anonymous in reply to Leon de Wit

    Leon,

    Thanks for the explanation,

    I am still attempting with both approaches (AIS and assembly). I will update the post when I get results.

     

    Zheng