Home | History | Annotate | Download | only in PartitionDxe

Lines Matching defs:Mbr

2   Decode a hard disk partitioned with the legacy MBR found on most PC's

4 MBR - Master Boot Record is in the first sector of a partitioned hard disk.
5 The MBR supports four partitions per disk. The MBR also contains legacy
29 Test to see if the Mbr buffer is a valid MBR.
31 @param Mbr Parent Handle.
34 @retval TRUE Mbr is a Valid MBR.
35 @retval FALSE Mbr is not a Valid MBR.
40 IN MASTER_BOOT_RECORD *Mbr,
51 if (Mbr->Signature != MBR_SIGNATURE) {
59 if (Mbr->Partition[Index1].OSIndicator == 0x00 || UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA) == 0) {
64 StartingLBA = UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA);
65 EndingLBA = StartingLBA + UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA) - 1;
70 // This does not hide space from the OS driver. This means the MBR
71 // that gets created from DOS is smaller than the MBR created from
79 DEBUG((EFI_D_INFO, "PartitionValidMbr: Bad MBR partition size EndingLBA(%1x) > LastLBA(%1x)\n", EndingLBA, LastLba));
85 if (Mbr->Partition[Index2].OSIndicator == 0x00 || UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) == 0) {
89 NewEndingLBA = UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) + UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) - 1;
90 if (NewEndingLBA >= StartingLBA && UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) <= EndingLBA) {
99 // None of the regions overlapped so MBR is O.K.
106 Install child handles if the Handle supports MBR format.
118 @retval Others MBR partition was not found.
133 MASTER_BOOT_RECORD *Mbr;
152 Mbr = AllocatePool (BlockSize);
153 if (Mbr == NULL) {
162 Mbr
168 if (!PartitionValidMbr (Mbr, LastBlock)) {
172 // We have a valid mbr - add each partition
206 // This is a MBR, add each partition
209 if (Mbr->Partition[Index].OSIndicator == 0x00 || UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA) == 0) {
211 // Don't use null MBR entries
216 if (Mbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION) {
218 // This is the guard MBR for the GPT. If you ever see a GPT disk with zero partitions you can get here.
219 // We can not produce an MBR BlockIo for this device as the MBR spans the GPT headers. So formating
227 HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA);
228 HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA);
229 CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (Mbr->UniqueMbrSignature));
243 (BOOLEAN) (Mbr->Partition[Index].OSIndicator == EFI_PARTITION)
264 Mbr
271 if (UNPACK_UINT32 (Mbr->Partition[0].SizeInLBA) == 0) {
275 if ((Mbr->Partition[0].OSIndicator == EXTENDED_DOS_PARTITION) ||
276 (Mbr->Partition[0].OSIndicator == EXTENDED_WINDOWS_PARTITION)) {
277 ExtMbrStartingLba = UNPACK_UINT32 (Mbr->Partition[0].StartingLBA);
281 HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[0].StartingLBA) + ExtMbrStartingLba + ParentHdDev.PartitionStart;
282 HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[0].SizeInLBA);
305 (BOOLEAN) (Mbr->Partition[0].OSIndicator == EFI_PARTITION)
311 if ((Mbr->Partition[1].OSIndicator != EXTENDED_DOS_PARTITION) &&
312 (Mbr->Partition[1].OSIndicator != EXTENDED_WINDOWS_PARTITION)
317 ExtMbrStartingLba = UNPACK_UINT32 (Mbr->Partition[1].StartingLBA);
328 FreePool (Mbr);