Page 1 of 1

GRUB Error: Invalid Or Unsupported Executable Format

Posted: Sun Jan 17, 2010 8:49 pm
by Nathan
Hello,
I've followed all the of this tutorial, the only thing that I've changed was before the ld linking, I've used objcopy to correct a PE error when using ld, but I've used objcopy like this:

Code: Select all

objcopy -I pe-i386 -O binary kernel.o kernel.bin
But when all was ok, GRUB booted and shown that menu to choose, as there was only one choice(myOS) I've selected and pressed enter, the I got this:
Image
Why I'm getting this? There is something I can do?

Best Regards,
Nathan Paulino Campos

Re: GRUB Error: Invalid Or Unsupported Executable Format

Posted: Sun Jan 17, 2010 9:09 pm
by thepowersgang
Ok, I would suggest running mbcheck on the binary to validate the multiboot header.
Make sure that the header is within the first 8196 bytes of the kernel. (Usually just linking the file with it first works)

Re: GRUB Error: Invalid Or Unsupported Executable Format

Posted: Mon Jan 18, 2010 1:54 am
by gedd
Nathan wrote: ... the only thing that I've changed was before the ld linking, I've used objcopy to correct a PE error when using ld, ...
You change executable format to PE too.
What was the error ? Can't use LD script with PE format or something like that ?
Even if use objcopy to produce a PE file after having produced a ELF with specific section with LD script, your specific section will not been reproduced in the PE file.
So goodby Multiboot header and welcome unsuported executable format.

Be carefull, most people on this forums are allergic on PE format !

Re: GRUB Error: Invalid Or Unsupported Executable Format

Posted: Mon Jan 18, 2010 2:22 am
by Combuster
I suggest you read properly before complaining. The mere fact that get messages about PE means that you didn't.