target elf32-i386 not found

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
Joe

target elf32-i386 not found

Post by Joe »

I am trying to complie my 'os' so that i can boot it from grub, i am using djgpp, nasm etc. The problem is when i try to link the compiled assembly file and the C file. I use the following commands (in dos shell):

nasm -f elf -o start.o start.asm
gcc -c -o main.o main.c
ld -T linker.ld -o myos.bin main.o start.o

The linker script is tryin to output in elf32-i386 format, but ld dosent seem to like this, i have read that you need to get source code to edit for the ld program!!? there must be an easier way!? has no one already done this?

thanks in advance for any help, i would really like to get my os booted, it would be a good start!!
gal

RE:target elf32-i386 not found

Post by gal »

djgpp wont produce elf file. you can use coff -> coff-i386.
Chris Giese

RE:target elf32-i386 not found

Post by Chris Giese »

The DJGPP linker can't make ELF files. Fortunately, GRUB will load non-ELF kernels if you use the "aout kludge". This is fairly simple; just add 5 extra fields to the Multiboot header.
http://www.washingdishes.freeuk.com/grubtut.html
http://my.execpc.com/~geezer/osd/boot/grub-how.txt

Why does everyone thinks GRUB works only with ELF? Is there a website out there with bad information on it?
Joe

RE:target elf32-i386 not found

Post by Joe »

thanks, but i have found an ld-elf tool, that can link elf files.
i have tried with those links before nd had no luck :(
but this works neway, so thank you very much for your help.
Post Reply