Page 1 of 1

GRUB2 error: invalid offset in section header

Posted: Thu Oct 24, 2013 1:19 pm
by dkg0414
Hi,

I am new to linux and grub. And thus new to binary formats of ELF.

I am trying to boot NOVA (http://hypervisor.org/) from grub2 (default installation on my xubuntu)
NOVA was meant to be booted from previous grub versions. I dont think author tried with Grub2.
So I created new custom file with following entry, ran the update-grub command to update my grub.

setparams 'Nova Hypervisor'
set root='(hd0,msdos6)'
multiboot /boot/nova/hypervisor keyb

I see that grub.cfg is updated with new entry and I see the boot option 'Nova Hypervisor' on boot up.
However when I select it, I get the error "error: invalid offset in section header"
I suspect problem might be in multiboot header (I saw some posts where people were having problems with that)

Below is the snippet of the code which describes multiboot header in this ELF64 image.
As per the specification of multiboot header, if flags is zero, I can ignore all other stuffs in header.
Is that really the case, Is that something that is causing problems for me?

#include "arch.hpp"
#include "memory.hpp"
#include "selectors.hpp"

/*
* Initialization Code
*/
.section .init

.globl __start_bsp

/*
* Multiboot Header
*/
__boot_header: .long 0x1badb002
.long 0x0
.long -0x1badb002

/*
* Global Descriptor Table (GDT)
*/
.align 8, 0x90
__boot_gdt: .word 0
.word __boot_gdt__ - __boot_gdt - 1
.long __boot_gdt
#ifdef __x86_64__
.quad 0x00a09b0000000000
.quad 0x00a0930000000000
.quad 0x00a0fb0000000000
.quad 0x00a0f30000000000
#else
.quad 0x00cf9b000000ffff
.quad 0x00cf93000000ffff
.quad 0x00cffb000000ffff
.quad 0x00cff3000000ffff
#endif
__boot_gdt__: