]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/IndustryStandard/ElTorito.h
re-defined CDROM_VOLUME_DESCRIPTOR to be a union including Boot Record Volume Descrip...
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / ElTorito.h
... / ...
CommitLineData
1/** @file\r
2 ElTorito Partitions Format Definition. \r
3 This file includes some defintions from \r
4 1. "El Torito" Bootable CD-ROM Format Specification, Version 1.0.\r
5 2. Volume and File Structure of CDROM for Information Interchange, \r
6 Standard ECMA-119. (IS0 9660)\r
7\r
8Copyright (c) 2006 - 2008, Intel Corporation \r
9All rights reserved. This program and the accompanying materials \r
10are licensed and made available under the terms and conditions of the BSD License \r
11which accompanies this distribution. The full text of the license may be found at \r
12http://opensource.org/licenses/bsd-license.php \r
13 \r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
16\r
17**/\r
18\r
19#ifndef _ELTORITO_H_\r
20#define _ELTORITO_H_\r
21\r
22///\r
23/// CDROM_VOLUME_DESCRIPTOR.Types, defined in ISO 9660\r
24///\r
25#define CDVOL_TYPE_STANDARD 0x0\r
26#define CDVOL_TYPE_CODED 0x1\r
27#define CDVOL_TYPE_END 0xFF\r
28\r
29///\r
30/// CDROM_VOLUME_DESCRIPTOR.Id\r
31///\r
32#define CDVOL_ID "CD001"\r
33\r
34///\r
35/// CDROM_VOLUME_DESCRIPTOR.SystemId\r
36///\r
37#define CDVOL_ELTORITO_ID "EL TORITO SPECIFICATION"\r
38\r
39//\r
40// Indicator types\r
41//\r
42#define ELTORITO_ID_CATALOG 0x01\r
43#define ELTORITO_ID_SECTION_BOOTABLE 0x88\r
44#define ELTORITO_ID_SECTION_NOT_BOOTABLE 0x00\r
45#define ELTORITO_ID_SECTION_HEADER 0x90\r
46#define ELTORITO_ID_SECTION_HEADER_FINAL 0x91\r
47\r
48//\r
49// ELTORITO_CATALOG.Boot.MediaTypes\r
50//\r
51#define ELTORITO_NO_EMULATION 0x00\r
52#define ELTORITO_12_DISKETTE 0x01\r
53#define ELTORITO_14_DISKETTE 0x02\r
54#define ELTORITO_28_DISKETTE 0x03\r
55#define ELTORITO_HARD_DISK 0x04\r
56\r
57\r
58#pragma pack(1)\r
59\r
60/// \r
61/// El Torito Volume Descriptor\r
62/// Note that the CDROM_VOLUME_DESCRIPTOR does not match the ISO-9660\r
63/// descriptor. For some reason descriptor used by El Torito is\r
64/// different, but they start the same. The El Torito descriptor\r
65/// is left shifted 1 byte starting with the SystemId. (Note this\r
66/// causes the field to get unaligned)\r
67/// \r
68typedef union { \r
69 struct {\r
70 UINT8 Type; \r
71 CHAR8 Id[5]; ///< "CD001" \r
72 CHAR8 Reserved[82];\r
73 } Unknown;\r
74\r
75 struct {\r
76 UINT8 Type; ///< Must be 0\r
77 CHAR8 Id[5]; ///< "CD001" \r
78 UINT8 Version; ///< Must be 1 \r
79 CHAR8 SystemId[32]; ///< "EL TORITO SPECIFICATION" \r
80 CHAR8 Unused[32]; ///< Must be 0 \r
81 UINT8 EltCatalog[4]; ///< Absolute pointer to first sector of Boot Catalog\r
82 CHAR8 Unused2[13]; ///< Must be 0\r
83 } BootRecordVolume;\r
84\r
85 struct {\r
86 UINT8 Type; \r
87 CHAR8 Id[5]; ///< "CD001"\r
88 UINT8 Version; \r
89 UINT8 Unused; ///< Must be 0\r
90 CHAR8 SystemId[32]; \r
91 CHAR8 VolumeId[32]; \r
92 UINT8 Unused2[8]; ///< Must be 0 \r
93 UINT32 VolSpaceSize[2]; ///< the number of Logical Blocks\r
94 } PrimaryVolume;\r
95\r
96} CDROM_VOLUME_DESCRIPTOR; \r
97\r
98///\r
99/// Catalog Entry\r
100///\r
101typedef union {\r
102 struct {\r
103 CHAR8 Reserved[0x20];\r
104 } Unknown;\r
105\r
106 ///\r
107 /// Catalog validation entry (Catalog header)\r
108 ///\r
109 struct {\r
110 UINT8 Indicator;\r
111 UINT8 PlatformId;\r
112 UINT16 Reserved;\r
113 CHAR8 ManufacId[24];\r
114 UINT16 Checksum;\r
115 UINT16 Id55AA;\r
116 } Catalog;\r
117\r
118 ///\r
119 /// Initial/Default Entry or Section Entry\r
120 ///\r
121 struct {\r
122 UINT8 Indicator;\r
123 UINT8 MediaType : 4;\r
124 UINT8 Reserved1 : 4;\r
125 UINT16 LoadSegment;\r
126 UINT8 SystemType;\r
127 UINT8 Reserved2;\r
128 UINT16 SectorCount;\r
129 UINT32 Lba;\r
130 } Boot;\r
131\r
132 ///\r
133 /// Section Header Entry\r
134 ///\r
135 struct {\r
136 UINT8 Indicator;\r
137 UINT8 PlatformId;\r
138 UINT16 SectionEntries;\r
139 CHAR8 Id[28];\r
140 } Section;\r
141\r
142} ELTORITO_CATALOG;\r
143\r
144#pragma pack()\r
145\r
146#endif\r