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