OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleBootArgs.h
Go to the documentation of this file.
1
13#ifndef APPLE_BOOT_ARGS_H
14#define APPLE_BOOT_ARGS_H
15
20
21/*
22 * Video information...
23 */
24
26 UINT32 v_baseAddr; /* Base address of video memory */
27 UINT32 v_display; /* Display Code (if Applicable */
28 UINT32 v_rowBytes; /* Number of bytes per pixel row */
29 UINT32 v_width; /* Width */
30 UINT32 v_height; /* Height */
31 UINT32 v_depth; /* Pixel Depth */
32};
33
35
36struct Boot_Video {
37 UINT32 v_display; /* Display Code (if Applicable */
38 UINT32 v_rowBytes; /* Number of bytes per pixel row */
39 UINT32 v_width; /* Width */
40 UINT32 v_height; /* Height */
41 UINT32 v_depth; /* Pixel Depth */
42 UINT32 v_resv[7]; /* Reserved */
43 UINT64 v_baseAddr; /* Base address of video memory */
44};
45
46typedef struct Boot_Video Boot_Video;
47
48/* Values for v_display */
49
50#define GRAPHICS_MODE 1
51#define FB_TEXT_MODE 2
52
53/* Boot argument structure - passed into Mach kernel at boot time.
54 * "Revision" can be incremented for compatible changes
55 */
56#define kBootArgsRevision 0
57#define kBootArgsRevision0 kBootArgsRevision
58#define kBootArgsRevision1 1 /* added KC_hdrs_addr */
59#define kBootArgsVersion 2
60
61/* Snapshot constants of previous revisions that are supported */
62#define kBootArgsVersion1 1
63#define kBootArgsRevision1_4 4
64#define kBootArgsRevision1_5 5
65#define kBootArgsRevision1_6 6
66
67#define kBootArgsVersion2 2
68#define kBootArgsRevision2_0 0
69
70#define kBootArgsEfiMode32 32
71#define kBootArgsEfiMode64 64
72
73/* Bitfields for boot_args->flags */
74#define kBootArgsFlagRebootOnPanic (1U << 0U)
75#define kBootArgsFlagHiDPI (1U << 1U)
76#define kBootArgsFlagBlack (1U << 2U)
77#define kBootArgsFlagCSRActiveConfig (1U << 3U)
78#define kBootArgsFlagCSRConfigMode (1U << 4U)
79#define kBootArgsFlagCSRBoot (1U << 5U)
80#define kBootArgsFlagBlackBg (1U << 6U)
81#define kBootArgsFlagLoginUI (1U << 7U)
82#define kBootArgsFlagInstallUI (1U << 8U)
83#define kBootArgsFlagRecoveryBoot (1U << 10U)
84
85#define BOOT_LINE_LENGTH 1024
86
87/* version 1 before Lion */
88typedef struct {
89 UINT16 Revision; /* Revision of boot_args structure */
90 UINT16 Version; /* Version of boot_args structure */
91
92 CHAR8 CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
93
94 UINT32 MemoryMap; /* Physical address of memory map */
98
99 Boot_VideoV1 Video; /* Video Information */
100
101 UINT32 deviceTreeP; /* Physical address of flattened device tree */
102 UINT32 deviceTreeLength; /* Length of flattened tree */
103
104 UINT32 kaddr; /* Physical address of beginning of kernel text */
105 UINT32 ksize; /* Size of combined kernel text+data+efi */
106
107 UINT32 efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
109 UINT32 efiSystemTable; /* physical address of system table in runtime area */
110
111 UINT8 efiMode; /* 32 = 32-bit, 64 = 64-bit */
112 UINT8 __reserved1[3];
113 UINT32 __reserved2[1];
114 UINT32 performanceDataStart; /* physical address of log, 10.6 and up */
116 UINT64 efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages, 10.6 and up */
117 UINT32 __reserved3[2];
118} BootArgs1;
119
120/* version2 as used in Lion, updated with High Sierra fields */
121typedef struct {
122 UINT16 Revision; /* Revision of boot_args structure */
123 UINT16 Version; /* Version of boot_args structure */
124
125 UINT8 efiMode; /* 32 = 32-bit, 64 = 64-bit */
126 UINT8 debugMode; /* Bit field with behavior changes */
127 UINT16 flags;
128
129 CHAR8 CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
130
131 UINT32 MemoryMap; /* Physical address of memory map */
135
136 Boot_VideoV1 VideoV1; /* Video Information */
137
138 UINT32 deviceTreeP; /* Physical address of flattened device tree */
139 UINT32 deviceTreeLength; /* Length of flattened tree */
140
141 UINT32 kaddr; /* Physical address of beginning of kernel text */
142 UINT32 ksize; /* Size of combined kernel text+data+efi */
143
144 UINT32 efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
146 UINT64 efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
147
148 UINT32 efiSystemTable; /* physical address of system table in runtime area */
149 UINT32 kslide;
150
151 UINT32 performanceDataStart; /* physical address of log */
153
154 UINT32 keyStoreDataStart; /* physical address of key store data */
156 UINT64 bootMemStart; /* physical address of interpreter boot memory */
168 Boot_Video Video; /* Video Information */
169
170 UINT32 apfsDataStart; /* Physical address of apfs volume key structure */
172
173 /* Version 2, Revision 1 */
174 UINT64 KC_hdrs_vaddr; /* First kernel virtual address pointing to Mach-O headers */
175
176 UINT64 arvRootHashStart; /* Physical address of root hash file */
178
179 UINT64 arvManifestStart; /* Physical address of manifest file */
181
182 /* Reserved */
183 UINT32 __reserved4[700];
184} BootArgs2;
185
186#endif // APPLE_BOOT_ARGS_H
#define BOOT_LINE_LENGTH
UINT64 v_baseAddr
UINT32 v_resv[7]
UINT32 v_depth
UINT32 v_width
UINT32 v_rowBytes
UINT32 v_display
UINT32 v_height
UINT32 v_rowBytes
UINT32 v_baseAddr
Boot_VideoV1 Video
UINT32 MemoryMap
UINT32 performanceDataStart
UINT16 Version
UINT32 efiSystemTable
UINT32 MemoryMapDescriptorVersion
UINT64 efiRuntimeServicesVirtualPageStart
UINT32 deviceTreeP
UINT16 Revision
UINT32 MemoryMapDescriptorSize
UINT32 deviceTreeLength
UINT32 efiRuntimeServicesPageStart
UINT32 MemoryMapSize
UINT32 performanceDataSize
UINT32 efiRuntimeServicesPageCount
UINT32 efiRuntimeServicesPageCount
UINT32 pciConfigSpaceStartBusNumber
UINT64 pciConfigSpaceBaseAddress
UINT32 csrActiveConfig
UINT32 efiSystemTable
UINT64 arvManifestSize
UINT32 keyStoreDataSize
UINT64 bootMemSize
UINT32 deviceTreeLength
UINT32 MemoryMap
UINT32 MemoryMapSize
UINT32 csrCapabilities
UINT32 boot_SMC_plimit
UINT8 debugMode
UINT16 bootProgressMeterStart
UINT64 bootMemStart
UINT32 apfsDataStart
UINT32 performanceDataStart
UINT32 deviceTreeP
UINT64 efiRuntimeServicesVirtualPageStart
UINT32 performanceDataSize
UINT32 keyStoreDataStart
UINT32 MemoryMapDescriptorSize
UINT32 efiRuntimeServicesPageStart
UINT64 arvRootHashStart
UINT16 Version
UINT16 bootProgressMeterEnd
UINT64 KC_hdrs_vaddr
UINT64 FSBFrequency
UINT64 arvRootHashSize
UINT32 kslide
UINT32 pciConfigSpaceEndBusNumber
UINT64 arvManifestStart
UINT32 MemoryMapDescriptorVersion
UINT16 Revision
UINT64 PhysicalMemorySize
UINT32 apfsDataSize
Boot_Video Video
Boot_VideoV1 VideoV1