]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.h
ac692dbdd9dbe2954fb18db3f09ddc914dd9312c
[mirror_edk2.git] / EdkModulePkg / Universal / Disk / Partition / Dxe / Mbr.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Mbr.h
15
16 Abstract:
17
18 Data Structures required for detecting MBR Partitions
19
20 Revision History
21
22 --*/
23
24 #ifndef _MBR_H_
25 #define _MBR_H_
26
27 #pragma pack(1)
28
29 #define MBR_SIGNATURE 0xaa55
30 #define MIN_MBR_DEVICE_SIZE 0x80000
31 #define MBR_ERRATA_PAD 0x40000 // 128 MB
32 #define EXTENDED_DOS_PARTITION 0x05
33 #define EXTENDED_WINDOWS_PARTITION 0x0F
34 #define MAX_MBR_PARTITIONS 4
35
36 #define PMBR_GPT_PARTITION 0xEE
37 #define EFI_PARTITION 0xEF
38 #define MBR_SIZE 512
39
40 //
41 // MBR Partition Entry
42 //
43 typedef struct {
44 UINT8 BootIndicator;
45 UINT8 StartHead;
46 UINT8 StartSector;
47 UINT8 StartTrack;
48 UINT8 OSIndicator;
49 UINT8 EndHead;
50 UINT8 EndSector;
51 UINT8 EndTrack;
52 UINT8 StartingLBA[4];
53 UINT8 SizeInLBA[4];
54 } MBR_PARTITION_RECORD;
55
56 //
57 // MBR Partition table
58 //
59 typedef struct {
60 UINT8 BootStrapCode[440];
61 UINT8 UniqueMbrSignature[4];
62 UINT8 Unknown[2];
63 MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS];
64 UINT16 Signature;
65 } MASTER_BOOT_RECORD;
66
67 #pragma pack()
68
69 #endif