summaryrefslogtreecommitdiff
path: root/Board/EM/RapidStartWrapper/Include/Mbr.h
blob: 5a04738742cde80aad9bb9f28700bfe47f70461d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/** @file
  EFI Mbr Partition Generic Driver Header. This header contains Data structures and Definitions
  needed to recognize partitions in a MBR

@copyright
  Copyright (c) 2006 - 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains a 'Sample Driver' and is licensed as such
  under the terms of your license agreement with Intel or your
  vendor.  This file may be modified by the user, subject to
  the additional terms of the license agreement
**/
#ifndef _MBR_H
#define _MBR_H

#define MBR_SIGNATURE       0xAA55
#define NUM_MBR_PARTITIONS  4

///
/// Type definitions for the Hard drive device path
///
#define MBR_TYPE_MASTER_BOOT_RECORD         0x01
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02

///
/// Needed Partition Type definitions for MBR
///
#define NO_PARTITION              0x0
#define EXTENDED_PARTITION        0x05
#define WIN95_EXTENDED_PARTITION  0x0F

//
// Data Structures needed for MBR
//
#pragma pack(1)

///
/// Data Structure definition for each partition in the MBR
///
typedef struct _MBR_PARTITION {
  UINT8   BootIndicator;
  UINT8   StartHead;
  UINT8   StartSector;
  UINT8   StartTrack;
  UINT8   OSType;
  UINT8   EndHead;
  UINT8   EndSector;
  UINT8   EndTrack;
  UINT32  StartingLba;
  UINT32  SizeInLba;
} MBR_PARTITION;

///
/// Data Structure definition of the MBR located in the first block on an MBR drive
///
typedef struct _MASTER_BOOT_RECORD {
  UINT8         BootCode[440];
  UINT32        UniqueMbrSig;
  UINT16        Unknown;
  MBR_PARTITION PartRec[4];
  UINT16        Sig;
} MASTER_BOOT_RECORD;

#pragma pack()
#endif