Skip to contentSkip to conversation

Multiboot2 header

DISCUSSION Robert Millan 3 participants 4 messages Nov 4, 2008 – Nov 7, 2008

lore
Share & tools
lore
#0 lore raw

The Multiboot2 draft says a Multiboot2 header must be included in the OS image. However, our code assumes (in code itself and in comments) that for MB2 this is optional.

As a consequence, if you feed GRUB's multiboot loader any ELF, it will attempt to load it. I think this is very confusing for those developing a Multiboot _1_ OS. If they happen to make a mistake and put the MB1 header too high or unaligned, GRUB won't tell them about it but instead fail in a very confusing way.

So I assume (I'd like to!) that the correct one is the draft, and it's the code that should be changed to reject executables that don't have either MB1 or MB2 headers?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#1 lore raw

Dne 4 Listopad 2008, 21:36, Robert Millan napsal(a):

Quoted 7 lines

The Multiboot2 draft says a Multiboot2 header must be included in the OS image. However, our code assumes (in code itself and in comments) that for MB2 this is optional.

Quoted 5 lines

As a consequence, if you feed GRUB's multiboot loader any ELF, it will attempt to load it. I think this is very confusing for those developing a Multiboot _1_ OS. If they happen to make a mistake and put the MB1 header too high or unaligned, GRUB won't tell them about it but instead fail in a very confusing way.

Those developers will appretiate if grub will be VERBOSE when loading an OS image. I.e., it should tell what header it found and where. Then the developer will be able to get know that his MBR1 was not found, no matter how much another headers were tried after.

Quoted 3 lines

So I assume (I'd like to!) that the correct one is the draft, and it's the code that should be changed to reject executables that don't have either MB1 or MB2 headers?

But you are true, that the user should have control what headers are tried. There may be some os image (binary, proprietary, thus not repairable by
user) that would need specific way of loading (e.g. the elf-way). Such image may fail in ambiguous way when booted other way (I mean, the image fails, grub's part of bootloading will be okay).

Quoted 2 lines

--
Robert Millan

Signature · 2 lines
.                           Tomas Ebenlendr
.                           http://drak.ucw.cz/~ebik
#2 lore raw
In reply to Robert Millan
Quoted 10 lines · On Tuesday 04 November 2008 21:36:27 Robert Millan wrote:

The Multiboot2 draft says a Multiboot2 header must be included in the OS image. However, our code assumes (in code itself and in comments) that for MB2 this is optional.

As a consequence, if you feed GRUB's multiboot loader any ELF, it will attempt to load it. I think this is very confusing for those developing a Multiboot _1_ OS. If they happen to make a mistake and put the MB1 header too high or unaligned, GRUB won't tell them about it but instead fail in a very confusing way.

Quoted 3 lines

So I assume (I'd like to!) that the correct one is the draft, and it's the code that should be changed to reject executables that don't have either MB1 or MB2 headers?

Yes. The code is wrong.

Regards,
Okuji

#3 lore raw
Quoted 11 lines · Yoshinori K. Okuji
Quoted 10 lines · On Tuesday 04 November 2008 21:36:27 Robert Millan wrote:

The Multiboot2 draft says a Multiboot2 header must be included in the OS image. However, our code assumes (in code itself and in comments) that for MB2 this is optional.

As a consequence, if you feed GRUB's multiboot loader any ELF, it will attempt to load it. I think this is very confusing for those developing a Multiboot _1_ OS. If they happen to make a mistake and put the MB1 header too high or unaligned, GRUB won't tell them about it but instead fail in a very confusing way.

Quoted 5 lines
Quoted 3 lines

So I assume (I'd like to!) that the correct one is the draft, and it's the code that should be changed to reject executables that don't have either MB1 or MB2 headers?

Yes. The code is wrong.

Okay. The fix was fairly simple, I just checked it in.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."