GRUB: Invalid or unsupported executable format
GRUB: Invalid or unsupported executable format
Ok, I think someone somewhere hates me, well i know someone does, but thats not the point. When i try and boot my OS i get GRUB error 13. I'm sure that the multiboot header is in the 1st 4kb and it is the same as the one in the barebones tutorials. Also I'm using "OUTPUT_FORMAT("elf32-i386")" in my linker script so I'm sure that the file format is supported by GRUB. All I've added between this compile and my last working compile is the interrupt support i had in my previous kernel, based on The Bran's kernel tutorial. Thanks for any help and i'm sorry for continually asking for help with errors.
Re:GRUB: Invalid or unsupported executable format
What does mbchk have to say about your kernel binary?
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GRUB: Invalid or unsupported executable format
osfaq:BareBones may contain a few hint. I'd suspect unresolved symbols without other clues.
What does objdump -x says? (mainly anything before "Sections: ..." is useful, rest is only informative)
What does objdump -x says? (mainly anything before "Sections: ..." is useful, rest is only informative)
Re:GRUB: Invalid or unsupported executable format
objdump -x kernel.elf:
mbchk isn't working at the moment so i'll try to fix that then but what mbchk says on here
Code: Select all
kernel.elf: file format elf32-i386
kernel.elf
architecture: i386, flags 0x00000112
EXEC_P, HAS_SYMS, D_PAGED
start address 0xc010002c
Program Header:
LOAD off 0x00001000 vaddr 0x00010000 paddr 0x00010000 align 2**12
filesz 0x0000001e memsz 0x0000001e flags r--
LOAD off 0x00001020 vaddr 0xc0010020 paddr 0x00010020 align 2**12
filesz 0x0000159a memsz 0x0000159a flags r-x
LOAD off 0x00003000 vaddr 0xc0020000 paddr 0x00020000 align 2**12
filesz 0x00000490 memsz 0x0040b908 flags rw-
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GRUB: Invalid or unsupported executable format
if i read it correctly, you're requesting to load at physical addr. 0x10000 -- that's 64K, not 1MB. Grub will not like to load below 1MB barrier.
Re:GRUB: Invalid or unsupported executable format
Sorry that was a typo, it should read:
Code: Select all
kernel.elf: file format elf32-i386
kernel.elf
architecture: i386, flags 0x00000112
EXEC_P, HAS_SYMS, D_PAGED
start address 0xc010002c
Program Header:
LOAD off 0x00001000 vaddr 0x00100000 paddr 0x00100000 align 2**12
filesz 0x0000001e memsz 0x0000001e flags r--
LOAD off 0x00001020 vaddr 0xc0010020 paddr 0x00100020 align 2**12
filesz 0x0000159a memsz 0x0000159a flags r-x
LOAD off 0x00003000 vaddr 0xc0020000 paddr 0x00200000 align 2**12
filesz 0x00000490 memsz 0x0040b908 flags rw-
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GRUB: Invalid or unsupported executable format
sounds equally weird to me. GRUB ignore your virtual-to-physical mapping, so the start address should be a physical one. see this thread.Bob the Avenger wrote: start address 0xc010002c
Re:GRUB: Invalid or unsupported executable format
hmm, my last kernel that grub booted successfully had a start address of 0xC01009DC, which GRUB was fine with. Their (these 2 kernels) are based on Tim Robinson's GDT trick. I'll try placing a jmp in .start and see if that helps.
Re:GRUB: Invalid or unsupported executable format
Thanks, GRUB is loading my OS now. Now to fix the GPF and find out why its trying to do pop ebp when ebp == esp