Page 1 of 1

make a kernel file I can load

Posted: Tue Jul 02, 2002 1:24 pm
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?

Re:make a kernel file I can load

Posted: Thu Jul 04, 2002 5:20 am
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.