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

  • From: "phoudoin" <trac@xxxxxxxxxxxx>
  • Date: Tue, 09 Apr 2013 09:20:10 -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 phoudoin):

 Replying to [comment:23 bonefish]:
 > Replying to [comment:21 axeld]:
 > > Replying to [comment:20 meianoite]:
 > > > I'm not trying to avoid a problem, I'm instead willing to providing
 a more general solution.
 > >
 > > FWIW, you managed to convince me. Not so much in the anyboot case, but
 in the more general solution thing.
 > I'm still not convinced. There really is no reason for `anyboot` to
 require a complete MBR (*). It only needs the boot code and AFAI can see
 save for signature it writes all the other stuff itself, anyway. Writing
 the signature is like five additional lines of code. This makes a more
 general solution superfluous. And there's no reason to implement something
 that is not needed.

 AFAICT, anyboot currently don't mind to check MBR file's actual size, as
 it simply copy all its content at offset 0. Then, it write its built-in
 anyboot partition table over it..

 What's matter is:
 * anyboot assumes the MBR file is a complete 512 bytes-long, as it doesn't
 write itself the 0x55AA Boot Signature at end.
 * anyboot don't overwrite the (optional) disk signature part - no big deal

 Semantically, a MBR is a disk record of 512 bytes long. Period.
 It's the job of tools handling MBR to know how to skip, copy or overwrite
 bootstrap code and/or partitions table within.

 I see no point to truncate hybrid_mbr.bin.
 So, either anyboot is changed to have the boot code compiled-in or it
 remains MBR agnostic like today, and then patching the partitions table of
 an external 512 bytes long data file make perfect sense.

 I'm for keeping anyboot runtime MBR agnostic.

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

Other related posts: