A.3 hybrid mbr boot code – Western Digital T13/2132-D User Manual

Page 84

Advertising
background image

T13/2132-D Revision 3

June 23, 2010

72

Working Draft Enhanced Disk Drive - 4 (EDD-4)

Figure A.2 shows an example of a GPT disk layout with hybrid MBR boot code on a disk with an ending LBA
greater than FFFF_FFFFh. The MBR partition record is not able to describe the LBAs above FFFF_FFFFh.

Figure A.2 — GPT disk layout with hybrid MBR boot code truncation example

A.3 Hybrid MBR boot code

Hybrid MBR boot code performs the following steps:

1) use the Extended Read function (i.e., INT 13h FN 42h) (see 8.15) to load the Primary GPT Header. The

Device Address Packet (see table 9) includes:
A) the LBA field set to 00000000 00000001h; and
B) the Number of Blocks field set to 01h;

2) calculate the CRC32 of the GPT Header and verify that it equals the Header CRC32 field;
3) if the Header CRC32 field is incorrect, use the Extended Read function to load the backup GPT Header.

The Device Address Packet includes:
A) the LBA field set to the last LBA of the disk; and
B) the Number of Blocks field set to 01h;

NOTE 3 — Due to the limited size (i.e., 440 bytes) of the MBR boot code, the hybrid MBR boot code
may not perform all the checks that EFI system firmware would perform.

4) use the Extended Read function to load the GPT Partition Entry Array pointed to by the selected GPT

Header. The Device Address Packet includes:
A) the LBA field set to the value specified in the Partition Entry LBA field; and
B) the Number of Blocks field set to (Number Of Partition Entries * Size Of Partition Entry) / Logical

Block Size;

5) calculate the CRC32 of the GPT Partition Entry Array and verify that it equals the Partition Entry Array

CRC32 field in the GPT Header;

6) if the Partition Entry Array CRC32 field is incorrect and the Primary GPT Partition Entry Array was

selected, use the Extended Read function to load the backup GPT Header from the last LBA of the disk
(see step 3), load the backup GPT Partition Entry Array (see step 4), and calculate the CRC32
(see step 5). If the CRC32 is incorrect again, report an error and stop;

7) search the GPT Partition Entry Array for a partition with the Legacy BIOS Bootable bit set to one in the

Attributes field. The code may also check for a special value in the Partition Type GUID field when
selecting the partition;

8) use the Extended Read function to load the first logical block of the selected partition into memory

address 7C00h; and

Protective

MBR with

hybrid

MBR boot

code

Primary

GPT

UEFI

system

partition

Partition

Partition

Backup

GPT

Partition

GPT Protective partition

LBA 0

LBA FFFFFFFFh

LBA 1

End of disk

LBAs not covered by

MBR data structures

Advertising