[haiku-development] Re: [PATCH 1/1] Add Multiboot Support to the Stage2 loader.

  • From: "Dustin Howett" <alaricx@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 9 Sep 2008 08:08:26 -0400

A stylistic concern:
If you'd like, remove the addl $15, %ebx line and change the next line
with 15(%ebx) instead of just (%ebx). I was preparing another patch
with multiboot commandline support (to, say, always boot haiku in
debug mode, or always display the menu; the only two things that can
really be done from platform/), but realized it wasn't very useful-
the aforementioned stylistic fix started to nag at me though.

On Tue, Sep 9, 2008 at 7:02 AM, Dustin Howett <alaricx@xxxxxxxxx> wrote:
> I was having trouble booting Haiku from a partition on my Acer Aspire
> One, so I added multiboot support to zbeos.
> It uses the a.out kludge to load at 0x100000 (1mb) and then relocates
> itself down to 0x10000, its expected location.
> Loading boot_loader_bios_ia32 as ELF also works, but grub refuses to
> load it below 1MB, despite what the multiboot header says (ELF header
> has priority).
>
> There is one downside to loading zbeos directly with GRUB: It won't
> find its boot volume, so the menu needs to be used to select it -
> I worked around this with a small shell script (meant to be run from a
> trunk checkout post build, passed the BIOS Drive ID in hex (80, 81,
> etc.) and the partition offset in sectors (the one makebootable
> outputs)) that manually patches zbeos.
> The reason it needs to be run from a checkout/built copy is that it
> runs objdump on the built bootloader to find the address to write
> gBootDriveID and gBootPartitionOffset.
>
> I tried adding a partition ID field, based on the multiboot info struct, but-
>  1) GRUB passes the ID/Drive of the partition the multiboot image was
> loaded from, so this would only be feasible with a GRUB bfs driver.
>  2) The bootloader's partition IDs are not equivalent to grub partition 
> numbers.
>
> Note that GRUB2 will not load a.out kludge multiboot files, only GRUB
> Legacy will. This appears to be a defect or limitation.
>
> Attached: Patch and Script.
> Script comes with no error/bounds checking. Script requires bc, tr,
> dd, and bash (probably >=3.0)
>
> This would all be more useful if:
> GRUB could read bfs partitions and makebootable touched zbeos so this
> script didn't need to exist.
> Currently, zbeos needs to be copied to a grub-bootable partition, obviously.
>
> Report: Success on the Aspire One and in QEMU.
>



-- 

- DH

Other related posts: