|
Hello all,
I have a very general question regarding the correct way to compile a C program using the arm-linux-gcc toolchain... in case its important, I am writing and comiling the programs on a machine running RedHat Linux 9.0. I am aware that in addition to the code the user writes, there must be the often-discussed c-startup sequence to initialize stacks and variables, etc. However, perhaps I am simply slow at picking this up, but I do not clearly understand it and was hoping someone could describe in an example how one would go about correctly linking and placing the program in RAM. I am aware of the various c-startup sequences that are available for reference, but I am having trouble using them for my own purposes. Ultimately, I want to have a basic application template in which I can simply edit the C source files to create different applications for my board. I do have the necessary set of header/source filers and makefile, yet my applications won't run from U-Boot and I am sure it has to do with the startup sequence.
Say for the example application I have two source files, util.c and main.c. I would like to be able to load via serial DEBUG and launch the application from U-Boot. Taking the AT91RM9200DK as the example target, what additional files need to be included, and where in RAM should it be placed (I imagine it is user-definable, if so where can this be defined)? Is a single assembler file (e.g. entry.s) sufficient?
I appreciate any help that can be offered, even if it is pointers to somewhere else to look for tutorials or discussions on this.
Conger
|