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.

Questions on initialization model

Anonymous
Anonymous

Hi,

I would like to ask a question about initialization.

The following is from page 227 of SPRU186S, TMS320C6000 Assembly Language Tools v 7.0 User's Guide.

My questions are:

  1. The initialization routine is within the C run-time library? I have never written it, so it must be.
  2. Regardless of ram_model or rom_model choice, the initialization routine (in boot.obj) is always linked into the .out file?
  3. So the difference between load-time initialization and auto- initialization, is only that for load-time initialization cinit -1 is told to the initialization routine, and emulator does its job instead.

So that’s all the difference?

And it is also clear from here that this C run-time initialization routine has nothing to do with bootloader, which is for moving sections into memory, rather than initializing its variables. Correct?

Zheng

  • Zheng Zhao said:
    The initialization routine is within the C run-time library? I have never written it, so it must be.

    Yes.

    Zheng Zhao said:
    Regardless of ram_model or rom_model choice, the initialization routine (in boot.obj) is always linked into the .out file?

    Use of either --rom_model or --ram_model causes the linker to follow several conventions for linking C code, one of which is that boot.obj being is included in the link.

    Zheng Zhao said:
    So the difference between load-time initialization and auto- initialization, is only that for load-time initialization cinit -1 is told to the initialization routine, and emulator does its job instead.

    Change "emulator" to "loader".  Otherwise, that is correct.

    Zheng Zhao said:
    And it is also clear from here that this C run-time initialization routine has nothing to do with bootloader, which is for moving sections into memory, rather than initializing its variables. Correct?

    Yes.

    Thanks and regards,

    -George

     

     

  • Anonymous
    0 Anonymous in reply to George Mock

    George,

    George said:

    Use of either --rom_model or --ram_model causes the linker to follow several conventions for linking C code, one of which is that boot.obj being is included in the link.

    For --rom_model, I think the inclusion of boot.obj is imperative, or nothing would do the initialization.

    For --ram_model, I think the inclusion boot.obj is optional, and in fact redundant.

    What's your opinion?

     

    George said:

    Change "emulator" to "loader".  Otherwise, that is correct.

    Do you mean "loader" is a more general concept of which "emulator" is an instance? Are you referring (implicitly) to PC programming, for example, MS Visual Studio could also do the initialization work instead of auto-initialization (boot.obj's MS VC++ equivalent)?

     

     

    Zheng

  • Zheng Zhao said:

    For --ram_model, I think the inclusion boot.obj is optional, and in fact redundant.

    boot.obj does more than this, so it is necessary.

     

    Zheng Zhao said:

    Do you mean "loader" is a more general concept of which "emulator" is an instance? Are you referring (implicitly) to PC programming, for example, MS Visual Studio could also do the initialization work instead of auto-initialization (boot.obj's MS VC++ equivalent)?

    Emulator is a piece of hardware that only knows how to read/write bytes. Loader is PC software that uses emulator and understands out file format.

    MS VS (as all compilers do) adds some code that runs before main() starts, but it's not the same code as TI's compiler adds.

  • Anonymous
    0 Anonymous in reply to Bartosz Bosowiec

    Bartosz Bosowiec said:

    Emulator is a piece of hardware that only knows how to read/write bytes. Loader is PC software that uses emulator and understands out file format.


    For object file format parsing/reading, I tend to believe it is mostly done by software on PC.
    Hardware logic and equate software. There are intro-class emulators and high-end emulators, so how much logic has been integrated into the emulator, for example, XDS560?

    Bartosz Bosowiec said:

    boot.obj does more than this, so it is necessary.

    What are these? Could you provide some more information?
     
       
     
    Zheng

  • Zheng Zhao said:

    There are intro-class emulators and high-end emulators, so how much logic has been integrated into the emulator, for example, XDS560?

    Don't know.

    Zheng Zhao said:

    What are these? Could you provide some more information?
     

    C stack setup, marpsing argument. See in TI compiler's directory for include/rts.zip and in there for boot.c file

     

  • Anonymous
    0 Anonymous in reply to Bartosz Bosowiec

    Bartosz,

    Thanks, I appreciate your answers on these questions.

     

    Zheng