[parted-devel] [PATCH] GPT & BIOS Boot partition

H. Peter Anvin hpa at zytor.com
Fri Feb 22 21:35:33 UTC 2008


H. Peter Anvin wrote:
> 
> That's the problem - "it just".  There is another part of the MBR 
> protocol which this doesn't seem to address; the DS:SI structure.
> 
> When an MBR chainloads a boot program, it sets DS:SI to point to the 
> partition entry; to make it work for cases like logical partitions it 
> needs to be synthesized since a logical partition entry has slightly 
> different meaning.
> 
> For < 2 TB, we can simply synthesize a MBR-style partition entry in 
> memory and point to it.  No problem.  For >= 2 TB, there are issues here.
> 
> One possible extension protocol would look like:
> 
> Point DS:SI to an MBR-style partition entry followed by the GPT 
> partition entry.  The MBR partition entry has EE as its type (indicating 
> GPT) and has the offset and length valid if possible, otherwise 
> 0FFFFFFFFh.  This should provide maximum compatibility while providing 
> the program with the flexibility it needs.
> 
> Why bother with this stuff?  Well, for one thing, if partitions can be 
> moved, it is not a very nice thing to stop being able to boot as a result.
> 
> However, using a specific UUID for this doesn't seem to be all that good 
> of an idea; especially with Redmond OSes seemingly going a different way.
> 

Spinning on about protocol design:

The boot flag (not *bootable* flag - the boot flag indicates not just 
bootability, but selection) really should be orthogonal to partition 
type, for obvious reasons.

Given freedom to pick a protocol, I would suggest instead to put the 
UniquePartitionGUID of the chosen boot partition in offset 0x430 of the 
MBR.  Putting a 16-bit magic number at 0x444 would be a nice touch, too; 
to indicate that 0x430 does indeed carry such a UUID and thus can be 
changed.  (0x440-443 is the legacy MBR ID, 0x446-510 the PMBR, and 
0x510-511 the boot signature, obivously.)

This would have the additional benefit that unlike the active flag in 
the MBR, it's simply not possible to have more than one partition 
mistakenly selected.

	-hpa





More information about the parted-devel mailing list