make a kernel file I can load

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
neos

make a kernel file I can load

Post by neos »

I wrote a micro kernel to test, and I compiled it with
gcc -c kernel.c
then I linked it using the instructions on the OS-FAQ http://www.mega-tokyo.com/os/os-faq-kernel.html

ld -o kernel --oformat binary -Ttext 0x100000 kernel.o

But I get this error
ld: PE operation on non PE file.

I cant find what the problem is. Anyone know? Also, will this give me an elf kernel?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:make a kernel file I can load

Post by Pype.Clicker »

what binutils package are you using ?
Your problem is likely to be due to a bad executable format (for instance, you have compiled under linux that uses ELF and try to link your file as a windows PE .exe file ...). Or you have used legacy coff-go32 (djgpp) and uses informations for coff-pe ...

You can check your format using objdump on the system that compiled the executable.
Post Reply