]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Mbr.h
automagically convert ELF to PE/COFF (i386 only)
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Mbr.h
1 /** @file
2 Legacy Master Boot Record Format Definition.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. 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 #define MIN_MBR_DEVICE_SIZE 0x80000
20 #define MBR_ERRATA_PAD 0x40000 // 128 MB
21
22 #define EXTENDED_DOS_PARTITION 0x05
23 #define EXTENDED_WINDOWS_PARTITION 0x0F
24
25 #define MAX_MBR_PARTITIONS 4
26
27 #define PMBR_GPT_PARTITION 0xEE
28 #define EFI_PARTITION 0xEF
29
30 #define MBR_SIZE 512
31
32 #pragma pack(1)
33 //
34 // MBR Partition Entry
35 //
36 typedef struct {
37 UINT8 BootIndicator;
38 UINT8 StartHead;
39 UINT8 StartSector;
40 UINT8 StartTrack;
41 UINT8 OSIndicator;
42 UINT8 EndHead;
43 UINT8 EndSector;
44 UINT8 EndTrack;
45 UINT8 StartingLBA[4];
46 UINT8 SizeInLBA[4];
47 } MBR_PARTITION_RECORD;
48
49 //
50 // MBR Partition table
51 //
52 typedef struct {
53 UINT8 BootStrapCode[440];
54 UINT8 UniqueMbrSignature[4];
55 UINT8 Unknown[2];
56 MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS];
57 UINT16 Signature;
58 } MASTER_BOOT_RECORD;
59
60 #pragma pack()
61
62 #endif