1 /* $NetBSD: efipart.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $ */ 2 3 #ifndef _EFI_PART_H 4 #define _EFI_PART_H 5 6 /*++ 7 8 Copyright (c) 1998 Intel Corporation 9 10 Module Name: 11 12 efipart.h 13 14 Abstract: 15 Info about disk partitions and Master Boot Records 16 17 18 19 20 Revision History 21 22 --*/ 23 24 // 25 // 26 // 27 28 #define EFI_PARTITION 0xef 29 #define MBR_SIZE 512 30 31 #pragma pack(1) 32 33 typedef struct { 34 UINT8 BootIndicator; 35 UINT8 StartHead; 36 UINT8 StartSector; 37 UINT8 StartTrack; 38 UINT8 OSIndicator; 39 UINT8 EndHead; 40 UINT8 EndSector; 41 UINT8 EndTrack; 42 UINT8 StartingLBA[4]; 43 UINT8 SizeInLBA[4]; 44 } MBR_PARTITION_RECORD; 45 46 #define EXTRACT_UINT32(D) (UINT32)(D[0] | (D[1] << 8) | (D[2] << 16) | (D[3] << 24)) 47 48 #define MBR_SIGNATURE 0xaa55 49 #define MIN_MBR_DEVICE_SIZE 0x80000 50 #define MBR_ERRATA_PAD 0x40000 // 128 MB 51 52 #define MAX_MBR_PARTITIONS 4 53 typedef struct { 54 UINT8 BootStrapCode[440]; 55 UINT8 UniqueMbrSignature[4]; 56 UINT8 Unknown[2]; 57 MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS]; 58 UINT16 Signature; 59 } MASTER_BOOT_RECORD; 60 #pragma pack() 61 62 63 #endif 64