[haiku-bugs] Re: [Haiku] #4028: Hybrid GPT/MBR Initial Program Loader

  • From: "meianoite" <trac@xxxxxxxxxxxx>
  • Date: Tue, 09 Apr 2013 17:21:44 -0000

#4028: Hybrid GPT/MBR Initial Program Loader
----------------------------+---------------------------
   Reporter:  meianoite     |      Owner:  axeld
       Type:  enhancement   |     Status:  new
   Priority:  normal        |  Milestone:  R1
  Component:  File Systems  |    Version:  R1/pre-alpha1
 Resolution:                |   Keywords:  GPT, EFI, MBR
 Blocked By:                |   Blocking:
Has a Patch:  1             |   Platform:  All
----------------------------+---------------------------

Comment (by meianoite):

 Hoy. Almost two years. Brings some memories of the time when Real Life was
 quite tame, in hindsight.


 Replying to [comment:26 phoudoin]:
 > I'm with modeenf here (both novice and interested ;-):
 > is this could unlock us poor GPT partitions guys?


 This is for legacy BIOS. In theory what this IPL enables is that one could
 take a GPT-partitioned disk from a EFI system and plug it into a BIOS
 system, or vice versa, and things would Just Work(tm).


 > AFAIK, our current boot loader don't support yet GPT, which needs
 > - to map/sync the MBR table with the GPT one,
 > - Haiku bootable partition(s) to live in the first 4 partitions
 > What this universal MBR will offer? No more MBR / GPT tables sync and no
 first 4 partitions limit?


 Kind of; what it does is:
 - Test the BIOS for the availability of LBA Packet mode; proceed to GPT
 boot if available; else proceed to MBR boot.
 - Look up the GPT for the partition signature written at byte offset 416;
  - Load up to 576kb or the entire contents of that partition, whichever is
 smaller, into RAM starting from address 0x7c00 (flat addressing), and jump
 to that address. Hopefully either the boot loader or the code from the
 first several sectors in the partition boot loader would fit that much
 memory. For those old enough to remember, this lies within the bounds of
 the old DOS conventional memory limits.
 - If none found, proceed to MBR boot;
  - MBR boot sequence happens as usual, potentially falling back to CHS
 mode for royally legacy BIOSes (pre-Pentium II).

 This is mostly code taken straight from FreeBSD, only modified to work
 with both MBR and GPT schemes, so it should be pretty compatible. However
 a bunch of stuff was moved around, so: caveat emptor, YMMV, THIS SOFTWARE
 IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED,
 etc.

--
Ticket URL: <http://dev.haiku-os.org/ticket/4028#comment:31>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: