Multiboot woes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Bob the Avenger

Multiboot woes

Post 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
Midas
Member
Member
Posts: 140
Joined: Sat Jun 24, 2006 4:40 pm
Location: Falkirk, Scotland
Contact:

Re:Multiboot woes

Post 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
Regards,
Angus [Óengus] 'Midas' Lepper
Bob the Avenger

Re:Multiboot woes

Post 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
Bob the Avenger

Re:Multiboot woes

Post 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.
Post Reply