• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Legacy Master Boot Record Format Definition.
3 
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef _MBR_H_
16 #define _MBR_H_
17 
18 #define MBR_SIGNATURE               0xaa55
19 
20 #define EXTENDED_DOS_PARTITION      0x05
21 #define EXTENDED_WINDOWS_PARTITION  0x0F
22 
23 #define MAX_MBR_PARTITIONS          4
24 
25 #define PMBR_GPT_PARTITION          0xEE
26 #define EFI_PARTITION               0xEF
27 
28 #define MBR_SIZE                    512
29 
30 #pragma pack(1)
31 ///
32 /// MBR Partition Entry
33 ///
34 typedef struct {
35   UINT8 BootIndicator;
36   UINT8 StartHead;
37   UINT8 StartSector;
38   UINT8 StartTrack;
39   UINT8 OSIndicator;
40   UINT8 EndHead;
41   UINT8 EndSector;
42   UINT8 EndTrack;
43   UINT8 StartingLBA[4];
44   UINT8 SizeInLBA[4];
45 } MBR_PARTITION_RECORD;
46 
47 ///
48 /// MBR Partition Table
49 ///
50 typedef struct {
51   UINT8                 BootStrapCode[440];
52   UINT8                 UniqueMbrSignature[4];
53   UINT8                 Unknown[2];
54   MBR_PARTITION_RECORD  Partition[MAX_MBR_PARTITIONS];
55   UINT16                Signature;
56 } MASTER_BOOT_RECORD;
57 
58 #pragma pack()
59 
60 #endif
61