Tue Jan 21, 2014 4:26 am
elf, exe, coff, hex, srec, etc. Pretty much most of the "binary" formats include the machine code/binary plus other stuff often a header. They work fine on top of operating systems because the operating system wants to see that header or formatting and use it to know how to load and run the program. But the gpu on the raspi doesnt, it wants raw instructions and data and is going to execute starting with those first bytes. (which are "elf" or something like that in an elf file).
the objcopy -O binary pulls the loadable portions out of the elf and at least attempts to create a binary that you can just execute (it is easy to break this for example link with a few things loaded at 0x00000000 and a few bytes loaded at 0xF0000000 and objcopy will have to create a 0xF0000000+a few byte file, that is almost a 4 gig file, technically with as little as 2 real bytes. I always save the objcopy until after I have an elf, have disassembled the elf (objdump -D) and can verify things are where I want them so that it does not create huge files and chew up my hard disk.
I probably should have but hesitated to have the makefile create a kernel.img as the final step some of those directories I wanted to have multiple .bin variations on the build from the same sources (arm, thumb, gcc, llvm, different optimization levels, etc).
Good to see you have it working, enjoy
David (dwelch67)