GCC and linking

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Thunder

GCC and linking

Post by Thunder »

Hello again i compile code:
gcc -c kernel.c
ld kernel.o -o kernel.sys -oformat binary -Ttext 0x100000

But GRUB doesnt load it, it should be an elf format how i should input eld definition into my code?
Whatever5k

Re:GCC and linking

Post by Whatever5k »

You seem to be linking to binary - if so, you need to use the aout kludge, see [1].
I recommend you use a linker script that links to ELF, see [1] again.

1. http://osdev.berlios.de/grub.html
Post Reply