OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleMkext.h
Go to the documentation of this file.
1
13#ifndef APPLE_MKEXT_H
14#define APPLE_MKEXT_H
15
17
18//
19// Based upon XNU libkern/libkern/mkext.h.
20//
21
22//
23// Magic value "MKXT" used to identify an MKEXT file.
24//
25#define MKEXT_MAGIC 0x4D4B5854
26//
27// Magic value "MKXT" used to identify an MKEXT file.
28//
29#define MKEXT_INVERT_MAGIC 0x54584B4D
30//
31// Signature "MOSX" used to identify an MKEXT file.
32//
33#define MKEXT_SIGNATURE 0x4D4F5358
34//
35// Signature "MOSX" used to identify an MKEXT file.
36//
37#define MKEXT_INVERT_SIGNATURE 0x58534F4D
38//
39// Version 1 format.
40//
41#define MKEXT_VERSION_V1 0x01008000
42//
43// Version 2 format.
44//
45#define MKEXT_VERSION_V2 0x02002001
46
47//
48// Common MKEXT header.
49//
50typedef struct {
51 //
52 // MKEXT magic value "MKXT".
53 //
54 UINT32 Magic;
55 //
56 // MKEXT signature "MOSX".
57 //
58 UINT32 Signature;
59 //
60 // File length.
61 //
62 UINT32 Length;
63 //
64 // Adler32 checksum from Version field to end of file.
65 //
66 UINT32 Adler32;
67 //
68 // File version.
69 //
70 UINT32 Version;
71 //
72 // Number of kernel extensions in file.
73 //
74 UINT32 NumKexts;
75 //
76 // The CPU architecture specifier.
77 //
79 //
80 // The CPU sub-architecture specifier.
81 //
84
85//
86//
87// MKEXT v1 format.
88// Version: 0x01008000
89//
90// Kexts stored within an array as plist/binary pairs, with
91// optional lzss compression of each plist and/or binary. V1 allows
92// for fat kexts individually within the mkext or the entire mkext
93// can be contained within a fat binary.
94//
95//
96
97//
98// MKEXT v1 kext file.
99//
100typedef struct {
101 //
102 // Offset into file where data begins.
103 //
104 UINT32 Offset;
105 //
106 // Compressed size. Zero indicates no compression.
107 //
109 //
110 // Uncompressed size.
111 //
112 UINT32 FullSize;
113 //
114 // Last modified time.
115 //
118
119//
120// MKEXT v1 kext entry.
121//
122typedef struct {
123 //
124 // Info.plist entry.
125 //
127 //
128 // Binary entry; optional.
129 //
132
133//
134// MKEXT v1 header.
135//
136typedef struct {
137 //
138 // Common header.
139 //
141 //
142 // Array of kext entries.
143 //
146
147//
148//
149// MKEXT v2 format. Introduced in XNU 10.0.
150// Version: 0x02001000
151//
152// Kext binaries and resources are stored together in sequence
153// followed by a combined plist of all kexts at the end. This plist
154// further contains offset information to respective binaries and resources.
155// Zlib compression can be optionally used, with individual fat kexts
156// diallowed, requiring all to be of the same single arch.
157//
158//
159
160//
161// MKEXT v2 file entry.
162//
163typedef struct {
164 //
165 // Compressed size. Zero indicates no compression.
167 //
168 // Uncompressed size.
169 //
170 UINT32 FullSize;
171 //
172 // Data.
173 //
174 UINT8 Data[];
176
177//
178// MKEXT v2 header.
179//
180typedef struct {
181 //
182 // Common header.
183 //
185 //
186 // Offset of plist in file.
187 //
189 //
190 // Compressed size of plist. Zero indicates no compression.
191 //
193 //
194 // Uncompressed size of plist.
195 //
198
199//
200// Allow selecting correct header based on version.
201//
207
208#endif // APPLE_MKEXT_H
INT32 MACH_CPU_TYPE
INT32 MACH_CPU_SUBTYPE
MACH_CPU_TYPE CpuType
Definition AppleMkext.h:78
MACH_CPU_SUBTYPE CpuSubtype
Definition AppleMkext.h:82
MKEXT_CORE_HEADER Header
Definition AppleMkext.h:140
MKEXT_V1_KEXT_FILE Plist
Definition AppleMkext.h:126
MKEXT_V1_KEXT_FILE Binary
Definition AppleMkext.h:130
UINT32 PlistFullSize
Definition AppleMkext.h:196
MKEXT_CORE_HEADER Header
Definition AppleMkext.h:184
UINT32 PlistCompressedSize
Definition AppleMkext.h:192
MKEXT_V1_HEADER V1
Definition AppleMkext.h:204
MKEXT_CORE_HEADER Common
Definition AppleMkext.h:203
MKEXT_V2_HEADER V2
Definition AppleMkext.h:205