]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/ElTorito.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / ElTorito.h
1 /** @file
2 ElTorito Partitions Format Definition.
3 This file includes some defintions from
4 1. "El Torito" Bootable CD-ROM Format Specification, Version 1.0.
5 2. Volume and File Structure of CDROM for Information Interchange,
6 Standard ECMA-119. (IS0 9660)
7
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11 **/
12
13 #ifndef _ELTORITO_H_
14 #define _ELTORITO_H_
15
16 //
17 // CDROM_VOLUME_DESCRIPTOR.Types, defined in ISO 9660
18 //
19 #define CDVOL_TYPE_STANDARD 0x0
20 #define CDVOL_TYPE_CODED 0x1
21 #define CDVOL_TYPE_END 0xFF
22
23 ///
24 /// CDROM_VOLUME_DESCRIPTOR.Id
25 ///
26 #define CDVOL_ID "CD001"
27
28 ///
29 /// CDROM_VOLUME_DESCRIPTOR.SystemId
30 ///
31 #define CDVOL_ELTORITO_ID "EL TORITO SPECIFICATION"
32
33 //
34 // Indicator types
35 //
36 #define ELTORITO_ID_CATALOG 0x01
37 #define ELTORITO_ID_SECTION_BOOTABLE 0x88
38 #define ELTORITO_ID_SECTION_NOT_BOOTABLE 0x00
39 #define ELTORITO_ID_SECTION_HEADER 0x90
40 #define ELTORITO_ID_SECTION_HEADER_FINAL 0x91
41
42 //
43 // ELTORITO_CATALOG.Boot.MediaTypes
44 //
45 #define ELTORITO_NO_EMULATION 0x00
46 #define ELTORITO_12_DISKETTE 0x01
47 #define ELTORITO_14_DISKETTE 0x02
48 #define ELTORITO_28_DISKETTE 0x03
49 #define ELTORITO_HARD_DISK 0x04
50
51
52 #pragma pack(1)
53
54 ///
55 /// CD-ROM Volume Descriptor
56 ///
57 typedef union {
58 struct {
59 UINT8 Type;
60 CHAR8 Id[5]; ///< "CD001"
61 CHAR8 Reserved[82];
62 } Unknown;
63
64 ///
65 /// Boot Record Volume Descriptor, defined in "El Torito" Specification.
66 ///
67 struct {
68 UINT8 Type; ///< Must be 0
69 CHAR8 Id[5]; ///< "CD001"
70 UINT8 Version; ///< Must be 1
71 CHAR8 SystemId[32]; ///< "EL TORITO SPECIFICATION"
72 CHAR8 Unused[32]; ///< Must be 0
73 UINT8 EltCatalog[4]; ///< Absolute pointer to first sector of Boot Catalog
74 CHAR8 Unused2[13]; ///< Must be 0
75 } BootRecordVolume;
76
77 ///
78 /// Primary Volumn Descriptor, defined in ISO 9660.
79 ///
80 struct {
81 UINT8 Type;
82 CHAR8 Id[5]; ///< "CD001"
83 UINT8 Version;
84 UINT8 Unused; ///< Must be 0
85 CHAR8 SystemId[32];
86 CHAR8 VolumeId[32];
87 UINT8 Unused2[8]; ///< Must be 0
88 UINT32 VolSpaceSize[2]; ///< the number of Logical Blocks
89 } PrimaryVolume;
90
91 } CDROM_VOLUME_DESCRIPTOR;
92
93 ///
94 /// Catalog Entry
95 ///
96 typedef union {
97 struct {
98 CHAR8 Reserved[0x20];
99 } Unknown;
100
101 ///
102 /// Catalog validation entry (Catalog header)
103 ///
104 struct {
105 UINT8 Indicator; ///< Must be 01
106 UINT8 PlatformId;
107 UINT16 Reserved;
108 CHAR8 ManufacId[24];
109 UINT16 Checksum;
110 UINT16 Id55AA;
111 } Catalog;
112
113 ///
114 /// Initial/Default Entry or Section Entry
115 ///
116 struct {
117 UINT8 Indicator; ///< 88 = Bootable, 00 = Not Bootable
118 UINT8 MediaType : 4;
119 UINT8 Reserved1 : 4; ///< Must be 0
120 UINT16 LoadSegment;
121 UINT8 SystemType;
122 UINT8 Reserved2; ///< Must be 0
123 UINT16 SectorCount;
124 UINT32 Lba;
125 } Boot;
126
127 ///
128 /// Section Header Entry
129 ///
130 struct {
131 UINT8 Indicator; ///< 90 - Header, more header follw, 91 - Final Header
132 UINT8 PlatformId;
133 UINT16 SectionEntries; ///< Number of section entries following this header
134 CHAR8 Id[28];
135 } Section;
136
137 } ELTORITO_CATALOG;
138
139 #pragma pack()
140
141 #endif