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?
make a kernel file I can load
- Pype.Clicker
- 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
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.
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.