I think I have figured out most of the problems, but I'd like to know if
I did something wrong since I'm quite new to all those tools.
So basically, for the bios to work in elf, (after fixing all the compile
and link problems, mostly due to missing includes and too many "_" in
some names like string.S stuffs), I made the following .lds file :
/* ld script to make ARM Bios
*/
OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")
OUTPUT_ARCH(arm)
ENTRY(_entry)
SECTIONS
{
_text = .; /* Text and read-only data */
.text : {
*(.text)
*(.fixup)
*(.gnu.warning)
*(.rodata)
}
_etext = .; /* End of text section */
_data = 0x1000;
.data 0x1000 : { /* Data */
*(.data)
}
_edata = .; /* End of data section */
__bss_start = .; /* BSS */
.bss : {
*(.bss)
}
_end = . ;
}
This creates an elf containing 2 sections, one with the text and rodata,
and one with the datas. The linker-generated values for _etext (used when
copying data to RAM from crt0.S) seems to be ok (according to objdump
output). The main reason why I made an lds file is that I wanted _etext
to include the rodata section, in order for the data copy code from
crt0.S to work.
Then, I changed (Hummm, let's say I'm changing, It's not finished yet)
mkaif to parse the elf file, and build an AIF file consisting of the AIF
header, the text section, immediately followed by the data section. (If
I'm understanding things correctly, the code in crt0.S for copying the
datas to RAM 0x1000 begins copying from _etext).
I differenciate the 2 sections in the elf file base on the execute bit of
the section flags (the generated elf contains 2 PHdrs's).
Does it look ok ? (I won't be able to test that until next week, or maybe
later this week). Just a question: Instead of having code that looks for
the data size in the AIF header (in crt0.S), could we just use the lds
script to have it built-in like _etext, __bss_start, etc... ?
--
E-Mail: <mailto:[EMAIL PROTECTED]>
BenH. Web : <http://calvaweb.calvacom.fr/bh40/>
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]