Page 1 of 1

Multiboot woes

Posted: Fri Jun 23, 2006 2:08 pm
by Bob the Avenger
GRUB and multiboot are causing me yet more trouble. Ok, firstly the multiboot header is somehow invalid, and mbchk is being evil and refusing to work. This means, not only is an invalid magic value being passed to the kernel (0x2BAD0010), but also the flags value in the multitboot data structure is set to 0xFFFFFFFF. Finally make is throwing errors about multitboot.h, which contains the definitions for the structures.

Code: Select all

error: redefinition of 'struct multiboot_header'
error: redefinition of typedef 'multiboot_header_t'
error: previous declaration of 'multiboot_header_t' was here
I get that series of errors for: aout_symbol_table, elf_section_header_table, multiboot_info, module and memory_map structures.
Thanks for any help in advance

Re:Multiboot woes

Posted: Fri Jun 23, 2006 2:45 pm
by Midas
First thing that occurs with the redefinition errors is that if you have them in a header file, and that header file is included more than once in the entire set of object files, then you'll have more than one definition. You should wrap your headers as follows to make sure things are only defined once:

Code: Select all

#ifndef MULTIBOOT_H
#define MULTIBOOT_H

// Header content here...

#endif

Re:Multiboot woes

Posted: Fri Jun 23, 2006 2:51 pm
by Bob the Avenger
Thanks Midas, I wish you much toffee! I think I've just managed to prove how stupid I am:-[, that (well similar) wrapper is in every other header file and i didnt notice it was missing there at all.
Thanks for that, it would've taken me days to get that

Re:Multiboot woes

Posted: Sat Jun 24, 2006 10:57 am
by Bob the Avenger
Ok, I've got mbchk to work:

Code: Select all

kernel.elf: The Multiboot header is found at offset 4144.
kernel.elf: Page alignment is turned on.
kernel.elf: Memory information is turned on.
kernel.elf: Address fields is turned off.
kernel.elf: All checks passed.