Skip to contentSkip to conversation

GRUB header magic numbers

DISCUSSION Daniel Weaver 2 participants 2 messages Feb 28, 2007 – Mar 1, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

I have created a proprietary loader that serves much the same function as GRUB. It is used to load a proprietary operating system. One of the things I need in my system is the load length of the operating system. Rather than reinvent the wheel I wish to use a GRUB style header to provide this information. Some day in the future we may decide to change either the loader or the operating system and the use of a standard loader header will make the transition much easier.

My web searches have turned up two very similar multiboot headers. One with a magic number of 0x1BAD002 and another with a magic number of 0xe85250d6.

First off, why are there two numbers?
And which is more likely to be used in the long run?

Thank you,
Dan Weaver

-----------------------------
Dan Weaver, ZNYX Networks
[email protected]

#1 lore raw
Quoted 10 lines · Daniel Weaver

Hello,

I have created a proprietary loader that serves much the same function as GRUB. It is used to load a proprietary operating system. One of the things I need in my system is the load length of the operating system. Rather than reinvent the wheel I wish to use a GRUB style header to provide this information. Some day in the future we may decide to change either the loader or the operating system and the use of a standard loader header will make the transition much easier.

Quoted 5 lines

My web searches have turned up two very similar multiboot headers. One with a magic number of 0x1BAD002 and another with a magic number of 0xe85250d6.

First off, why are there two numbers?

They are from different versions of the Multiboot specification:

http://www.gnu.org/software/grub/manual/multiboot/html_node/Header-magic-fields.html#Header-magic-fields

http://grub.enbug.org/MultibootDraft

It's not just the numbers; the formats are completely different.

Quoted 1 line

And which is more likely to be used in the long run?

The multiboot2 format, though multiboot1 will likely not go away in the near term. multiboot1 was written without any thought for portability, and since it's a large data structure it is very brittle.

The multiboot2 format is portable and much more flexible and extensible, since it is based on a list of small structures. That said, it is not yet in use by any major project (much like grub2 itself). There is no multiboot2 loader for grub 0.9x (which is the version currently in use by all Linux distributions).

If you're looking for a format to support, I would recommend multiboot2, especially since you don't depend on interoperability with the current generation of Linux software.

If you do choose to use multiboot2 and have any comments, questions, or suggestions about the format, we'd love to hear about them here.

-Hollis