Opened 3 years ago

Last modified 7 months ago

#12644 assigned bug

MBR & stage1 do not handle boot partition passing for chainloading (makebootable should not be required)

Reported by: mmu_man Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: System/Boot Loader Version: R1/Development
Keywords: chainload, partition, GRUB, MBR, stage1 Cc:
Blocked By: Blocking: #11345
Has a Patch: no Platform: All

Description

Unlike GRUB, GRUB2, LILO, and most other MBR loaders, our own MBR sector does not pass the selected partition info properly, and our stage1 loader does not attempt to use it, which is why we require running makebootable on install. But it should not be necessary.

Most MBR pass the selected boot partition entry in a register (ds:si) with a flag set to let the chainloaded OS know about it. There is no reason not to do it as well, as it would eliminate the need for makebootable.

This is not about BIOSes, buggy or not, since it's only the MBR which does this, and except if the user does not install our own MBR or GRUB or GRUB2 or the many other MBRs which support this convention, it would just work without makebootable.

We can still ship with makebootable just in case, but it shouldn't be required anymore once this is fixed.

cf. http://www.gnu.org/software/grub/manual/legacy/root.html#root http://f.osdev.org/viewtopic.php?f=1&t=26015 http://forum.osdev.org/viewtopic.php?f=1&t=22470 http://forum.osdev.org/viewtopic.php?f=1&t=27371 http://forum.osdev.org/viewtopic.php?f=2&t=23227 http://stackoverflow.com/questions/17517813/grub2-chainloading-how-does-it-pass-drive-number-and-partition-entry-point

Change History (9)

comment:1 Changed 3 years ago by mmu_man

Related to #3545 although I don't understand the wording.

Version 0, edited 3 years ago by mmu_man (next)

comment:2 Changed 3 years ago by starsseed

Our booting process does not handle the "drive number" passed in the DL register, either, stopping us to boot Haiku from "BootManager" when it's not installed on the boot drive.

Both issues should be adressed simultaneously.

comment:4 in reply to:  2 Changed 3 years ago by mmu_man

Replying to starsseed:

Our booting process does not handle the "drive number" passed in the DL register, either, stopping us to boot Haiku from "BootManager" when it's not installed on the boot drive.

I'm quite sure I've seen DL being passed around in several places as boot drive, at least the MBR code and stage1, didn't check bootman though.

comment:5 Changed 3 years ago by mmu_man

Actually, we would still need makebootable though, since it writes all of the stage1 loader, not only the partition offset...

comment:6 Changed 3 years ago by mmu_man

But the raw image could now be dd-ed onto a partition without any need for makebootable.

comment:7 Changed 3 years ago by axeld

Milestone: R1/beta1R1
Owner: changed from axeld to nobody
Priority: highnormal
Status: newassigned

It's more of a "nice to have" thing than a requirement in any case.

comment:8 Changed 10 months ago by waddlesplash

Blocking: 11345 added

comment:9 Changed 7 months ago by pulkomandy

Milestone: R1R1/beta2
Note: See TracTickets for help on using tickets.