Chameleon

Chameleon Commit Details

Date:2016-05-07 21:58:55 (3 years 3 months ago)
Author:zenith432
Commit:2806
Parents: 2805
Message:Add ability to boot OS X El Capitan
Changes:
M/branches/zenith432/i386/libsaio/bootargs.h
M/branches/zenith432/i386/boot2/boot.c
M/trunk/doc/BootHelp.txt
M/branches/zenith432/i386/libsaio/bootstruct.c
M/trunk/i386/libsaio/bootargs.h
M/trunk/i386/boot2/boot.c
M/branches/zenith432/i386/boot2/boot.h
M/trunk/i386/util/Makefile
M/trunk/i386/util/fdisk/Makefile
M/trunk/i386/libsaio/bootstruct.c
M/branches/zenith432/i386/util/boot1-install/Makefile
M/trunk/i386/boot2/boot.h
M/branches/zenith432/doc/BootHelp.txt
M/trunk/i386/util/boot1-install/Makefile

File differences

trunk/i386/libsaio/bootstruct.c
4040
4141
4242
43
44
4345
4446
4547
......
150152
151153
152154
153
154
155
156
157
158
159
155160
156161
157162
......
209214
210215
211216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
212263
213264
214265
#define DBG(x...)msglog(x)
#endif
#define MEG(1024*1024)
/*==========================================================================
* Initialize the structure of parameters passed to
* the kernel by the booter.
void *addr;
int i;
EfiMemoryRange*memoryMap= NULL;
MemoryRange*range= NULL;
/* Memory size to use for defaults calculations (cparm) */
uint64_tsane_size = 0;
EfiMemoryRange *memoryMap= NULL;
MemoryRange *range= NULL;
int memoryMapCount = bootInfo->memoryMapCount;
if (memoryMapCount == 0)
memoryMap->VirtualStart= range->base;
memoryMap->NumberOfPages= range->length >> I386_PGSHIFT;
memoryMap->Attribute= 0;
switch (memoryMap->Type)
{
case kEfiLoaderCode:
case kEfiLoaderData:
case kEfiBootServicesCode:
case kEfiBootServicesData:
case kEfiConventionalMemory:
/*
* Consolidate usable memory types into one (cparm).
*/
sane_size += (uint64_t)(memoryMap->NumberOfPages << I386_PGSHIFT);
break;
case kEfiRuntimeServicesCode:
case kEfiRuntimeServicesData:
case kEfiACPIReclaimMemory:
case kEfiACPIMemoryNVS:
case kEfiPalCode:
/*
* sane_size should reflect the total amount of physical ram
* in the system, not just the amount that is available for
* the OS to use (cparm)
*/
sane_size += (uint64_t)(memoryMap->NumberOfPages << I386_PGSHIFT);
break;
default:
break;
}
if (sane_size == 0)
{
// I Guess that if sane_size == 0 we've got a big problem here,
// and it means that the memory map was not converted properly (cparm)
stop("Unable to convert memory map into proper format\n");
return;
}
/*
* For user visible memory size, round up to 128 Mb - accounting for the various stolen memory
* not reported by EFI. (cparm)
*/
sane_size = (sane_size + 128 * MEG - 1) & ~((uint64_t)(128 * MEG - 1));
bootArgs->PhysicalMemorySize = sane_size;
}
// copy bootFile into device tree
trunk/i386/libsaio/bootargs.h
132132
133133
134134
135
135
136136
137137
138138
139
139140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
140161
141162
142163
......
181202
182203
183204
184
185
186
187205
206
207
208
209
210
211
212
188213
189214
190215
#define kBootArgsFlagHiDPI(1 << 1)
#define kBootArgsFlagBlack(1 << 2)
#define kBootArgsFlagCSRActiveConfig(1 << 3)
#define kBootArgsFlagCSRPendingConfig(1 << 4)
#define kBootArgsFlagCSRConfigMode(1 << 4)
#define kBootArgsFlagCSRBoot(1 << 5)
#define kBootArgsFlagBlackBg(1 << 6)
#define kBootArgsFlagLoginUI(1 << 7)
#define kBootArgsFlagInstallUI(1 << 8)
/* Rootless configuration flags */
// http://www.idelta.info/archives/kext-to-check-sip-rootless-status-on-el-capitan/
#define CSR_ALLOW_UNTRUSTED_KEXTS(1 << 0) /* Allow untrusted kexts */
#define CSR_ALLOW_UNRESTRICTED_FS(1 << 1) /* Allow unrestricted file system. */
#define CSR_ALLOW_TASK_FOR_PID(1 << 2) /* Allow test_for_pid() */
#define CSR_ALLOW_KERNEL_DEBUGGER(1 << 3)
#define CSR_ALLOW_APPLE_INTERNAL(1 << 4)
#define CSR_ALLOW_UNRESTRICTED_DTRACE(1 << 5) /* Allow unrestricted dtrace */
#define CSR_ALLOW_UNRESTRICTED_NVRAM(1 << 6) /* Allow unrestricted NVRAM */
#define CSR_ALLOW_DEVICE_CONFIGURATION(1 << 7) /* Allow device configuration */
#define CSR_VALID_FLAGS (CSR_ALLOW_UNTRUSTED_KEXTS | \
CSR_ALLOW_UNRESTRICTED_FS | \
CSR_ALLOW_TASK_FOR_PID | \
CSR_ALLOW_KERNEL_DEBUGGER | \
CSR_ALLOW_APPLE_INTERNAL | \
CSR_ALLOW_UNRESTRICTED_DTRACE | \
CSR_ALLOW_UNRESTRICTED_NVRAM | \
CSR_ALLOW_DEVICE_CONFIGURATION)
typedef struct boot_args
{
uint16_t Revision;/* Revision of boot_args structure */
uint64_t pciConfigSpaceBaseAddress;
uint32_t pciConfigSpaceStartBusNumber;
uint32_t pciConfigSpaceEndBusNumber;
uint32_tcsrActiveConfig;
uint32_tcsrPendingConfig;
uint32_t __reserved4[728];
uint32_t csrActiveConfig;
uint32_t csrCapabilities;
uint32_t boot_SMC_plimit;
uint16_tbootProgressMeterStart;
uint16_tbootProgressMeterEnd;
uint32_t __reserved4[726];
} boot_args;
typedef struct boot_args_legacy
trunk/i386/boot2/boot.c
149149
150150
151151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
152226
153227
154228
......
320394
321395
322396
323
397
324398
325
326
399
400
327401
328402
329403
330404
405
406
407
408
409
410
411
331412
332413
333414
......
903984
904985
905986
906
987
907988
908
909
910
989
911990
912991
913992
914
915
993
916994
917995
918996
entry_tkernelEntry;
bootArgs->kaddr = bootArgs->ksize = 0;
// ===============================================================================
// OS X Mountain Lion 10.8
if ( MacOSVerCurrent >= MacOSVer2Int("10.8") ) // Mountain Lion and Up!
{
// cparm
bool KPRebootOption= false;
bool HiDPIOption= false;
getBoolForKey(kRebootOnPanic, &KPRebootOption, &bootInfo->chameleonConfig);
if ( KPRebootOption )
{
bootArgs->flags |= kBootArgsFlagRebootOnPanic;
}
// cparm
getBoolForKey(kEnableHiDPI, &HiDPIOption, &bootInfo->chameleonConfig);
if ( HiDPIOption )
{
bootArgs->flags |= kBootArgsFlagHiDPI;
}
}
// OS X Yosemite 10.10
if ( MacOSVerCurrent >= MacOSVer2Int("10.10") ) // Yosemite and Up!
{
// Pike R. Alpha
bool FlagBlackOption= false;
getBoolForKey(kBlackMode, &FlagBlackOption, &bootInfo->chameleonConfig);
if ( FlagBlackOption )
{
//bootArgs->flags |= kBootArgsFlagBlack;
bootArgs->flags |= kBootArgsFlagBlackBg; // Micky1979
}
}
// OS X El Capitan 10.11
if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Up!
{
// ErmaC
intcrsValue;
#if 0
/*
* A special BootArgs flag "kBootArgsFlagCSRBoot"
* is set in the Recovery or Installation environment.
* This flag is kind of overkill by turning off all the protections
*/
if (isRecoveryHD)
{
// SIP can be controlled with or without FileNVRAM.kext (Pike R. Alpha)
bootArgs->flags|=(kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot);
}
#endif
bootArgs->flags|= kBootArgsFlagCSRActiveConfig;
// Set limit to 7bit
if ( getIntForKey(KCsrActiveConfig, &crsValue, &bootInfo->chameleonConfig) && (crsValue >= 0 && crsValue <= 127) )
{
bootArgs->csrActiveConfig= crsValue;
}
else
{
// zenith432
bootArgs->csrActiveConfig= 0x67;
}
bootArgs->csrCapabilities= CSR_VALID_FLAGS;
bootArgs->boot_SMC_plimit= 0;
}
// ===============================================================================
execute_hook("ExecKernel", (void *)binary, NULL, NULL, NULL);
ret = DecodeKernel(binary,
}
closedir(cacheDir);
}
else
else if ( MacOSVerCurrent >= MacOSVer2Int("10.7") && MacOSVerCurrent < MacOSVer2Int("10.10") )
{
// Lion, Mountain Lion, Mavericks, Yosemite and El Capitan prelink kernel cache file
// for 10.7 10.8 10.9 10.10 10.11
// Lion, Mountain Lion and Mavericks prelink kernel cache file
// for 10.7 10.8 10.9
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow);
verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile);
}
else
{
// Yosemite and El Capitan prelink kernel cache file
// for 10.10 10.11
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%sprelinkedkernel", kDefaultCachePathYosemite);
verbose("Kernel Cache file path (Mac OS X 10.10 and newer): %s\n", kernelCacheFile);
}
}
// Check if the kernel cache file exists
// =========================================================================
bool checkOSVersion(const char *version)
{
if ( (sizeof(version) > 4) && ('.' != version[4]) && ('\0' != version[4]) )
if ( '\0' != version[4] )
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3])
&& (gMacOSVersion[4] == version[4]));
return !memcmp(&gMacOSVersion[0], &version[0], 5);
}
else
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
return !memcmp(&gMacOSVersion[0], &version[0], 4);
}
}
trunk/i386/boot2/boot.h
4646
4747
4848
49
4950
5051
5152
......
170171
171172
172173
174
173175
174176
175177
......
186188
187189
188190
191
189192
190193
191194
// kernel cache
#define kDefaultCachePathLeo"/System/Library/Caches/com.apple.kernelcaches/"
#define kDefaultCachePathSnow"/System/Library/Caches/com.apple.kext.caches/Startup/"
#define kDefaultCachePathYosemite"/System/Library/PrelinkedKernels/"
// Lion installer
#define kLionInstallerDataFolder"/Mac OS X Install Data/"
#define kEnableHDMIAudio"EnableHDMIAudio"/* ati.c && nvidia.c */
/* cparm: added these keys */
#define kRebootOnPanic"RebootOnPanic"
#define kEnableHiDPI"EnableHiDPI"// enable High resolution display (aka Retina)
/* ErmaC: added these keys */
#define kHDAEnabler"HDAEnabler"/* pci_setup.c */
#define kHDEFLayoutID"HDEFLayoutID"/* hda.c */
#define kHDAULayoutID"HDAULayoutID"/* hda.c */
#define KCsrActiveConfig"CsrActiveConfig"/* boot.c */
/* Pike R. Alpha: added this key */
#define kBlackMode"BlackMode"
trunk/i386/util/fdisk/Makefile
1313
1414
1515
16
16
1717
18
1819
1920
2021
include ${SRCROOT}/Make.rules
LDFLAGS := $(LDFALGS) -mmacosx-version-min=10.5
LDFLAGS := $(LDFLAGS) -mmacosx-version-min=10.5
CFLAGS := $(CFLAGS) -mmacosx-version-min=10.5
OBJS = cmd.o32 disk.o32 fdisk.o32 getrawpartition.o32 mbr.o32 misc.o32 opendev.o32 part.o32 user.o32 auto.o32 \
cmd.o64 disk.o64 fdisk.o64 getrawpartition.o64 mbr.o64 misc.o64 opendev.o64 part.o64 user.o64 auto.o64
trunk/i386/util/boot1-install/Makefile
1111
1212
1313
14
14
1515
1616
1717
1818
1919
2020
21
22
21
2322
23
24
2425
2526
2627
include ${SRCROOT}/Make.rules
LDFLAGS := $(LDFALGS) -mmacosx-version-min=10.5 \
LDFLAGS := $(LDFLAGS) -mmacosx-version-min=10.5 \
-framework CoreFoundation \
-framework DiskArbitration \
-Wl,-no_source_version \
-Wl,-no_function_starts \
-Wl,-no_data_in_code_info \
-Wl,-no_version_load_command \
-Wl,-no_uuid \
-Wl,-no_dependent_dr_info
-Wl,-no_uuid
CFLAGS := $(CFLAGS) -mmacosx-version-min=10.5
OBJS = boot1-install.o32 \
boot1-install.o64
trunk/i386/util/Makefile
3535
3636
3737
38
38
3939
40
41
4042
4143
4244
OBJS := $(addprefix $(OBJROOT)/, $(OBJS))
LDFLAGS := $(LDFALGS) -framework IOKit -framework CoreFoundation -mmacosx-version-min=10.5
LDFLAGS := $(LDFLAGS) -framework IOKit -framework CoreFoundation -mmacosx-version-min=10.5
CFLAGS := $(CFLAGS) -mmacosx-version-min=10.5
SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS))
DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
trunk/doc/BootHelp.txt
7777
7878
7979
80
81
8082
8183
8284
BlackMode=Yes|No The new BlackMode loads the white Apple logo,
instead of the gray Apple logo, on a black background (disabled by default).
CsrActiveConfig=<value> Set CsrActiveConfig for OS 10.11.x, range 0..127 (default 0x67)
PciRoot=<value> Use an alternate value for PciRoot (default value 0).
UseKernelCache=Yes|No Yes will load pre-linked kernel and will ignore /E/E
branches/zenith432/i386/libsaio/bootstruct.c
4040
4141
4242
43
44
4345
4446
4547
......
150152
151153
152154
153
154
155
156
157
158
159
155160
156161
157162
......
209214
210215
211216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
212263
213264
214265
#define DBG(x...)msglog(x)
#endif
#define MEG(1024*1024)
/*==========================================================================
* Initialize the structure of parameters passed to
* the kernel by the booter.
void *addr;
int i;
EfiMemoryRange*memoryMap= NULL;
MemoryRange*range= NULL;
/* Memory size to use for defaults calculations (cparm) */
uint64_tsane_size = 0;
EfiMemoryRange *memoryMap= NULL;
MemoryRange *range= NULL;
int memoryMapCount = bootInfo->memoryMapCount;
if (memoryMapCount == 0)
memoryMap->VirtualStart= range->base;
memoryMap->NumberOfPages= range->length >> I386_PGSHIFT;
memoryMap->Attribute= 0;
switch (memoryMap->Type)
{
case kEfiLoaderCode:
case kEfiLoaderData:
case kEfiBootServicesCode:
case kEfiBootServicesData:
case kEfiConventionalMemory:
/*
* Consolidate usable memory types into one (cparm).
*/
sane_size += (uint64_t)(memoryMap->NumberOfPages << I386_PGSHIFT);
break;
case kEfiRuntimeServicesCode:
case kEfiRuntimeServicesData:
case kEfiACPIReclaimMemory:
case kEfiACPIMemoryNVS:
case kEfiPalCode:
/*
* sane_size should reflect the total amount of physical ram
* in the system, not just the amount that is available for
* the OS to use (cparm)
*/
sane_size += (uint64_t)(memoryMap->NumberOfPages << I386_PGSHIFT);
break;
default:
break;
}
if (sane_size == 0)
{
// I Guess that if sane_size == 0 we've got a big problem here,
// and it means that the memory map was not converted properly (cparm)
stop("Unable to convert memory map into proper format\n");
return;
}
/*
* For user visible memory size, round up to 128 Mb - accounting for the various stolen memory
* not reported by EFI. (cparm)
*/
sane_size = (sane_size + 128 * MEG - 1) & ~((uint64_t)(128 * MEG - 1));
bootArgs->PhysicalMemorySize = sane_size;
}
// copy bootFile into device tree
branches/zenith432/i386/libsaio/bootargs.h
132132
133133
134134
135
135
136136
137137
138138
139
139140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
140161
141162
142163
......
181202
182203
183204
184
185
186
187205
206
207
208
209
210
211
212
188213
189214
190215
#define kBootArgsFlagHiDPI(1 << 1)
#define kBootArgsFlagBlack(1 << 2)
#define kBootArgsFlagCSRActiveConfig(1 << 3)
#define kBootArgsFlagCSRPendingConfig(1 << 4)
#define kBootArgsFlagCSRConfigMode(1 << 4)
#define kBootArgsFlagCSRBoot(1 << 5)
#define kBootArgsFlagBlackBg(1 << 6)
#define kBootArgsFlagLoginUI(1 << 7)
#define kBootArgsFlagInstallUI(1 << 8)
/* Rootless configuration flags */
// http://www.idelta.info/archives/kext-to-check-sip-rootless-status-on-el-capitan/
#define CSR_ALLOW_UNTRUSTED_KEXTS(1 << 0) /* Allow untrusted kexts */
#define CSR_ALLOW_UNRESTRICTED_FS(1 << 1) /* Allow unrestricted file system. */
#define CSR_ALLOW_TASK_FOR_PID(1 << 2) /* Allow test_for_pid() */
#define CSR_ALLOW_KERNEL_DEBUGGER(1 << 3)
#define CSR_ALLOW_APPLE_INTERNAL(1 << 4)
#define CSR_ALLOW_UNRESTRICTED_DTRACE(1 << 5) /* Allow unrestricted dtrace */
#define CSR_ALLOW_UNRESTRICTED_NVRAM(1 << 6) /* Allow unrestricted NVRAM */
#define CSR_ALLOW_DEVICE_CONFIGURATION(1 << 7) /* Allow device configuration */
#define CSR_VALID_FLAGS (CSR_ALLOW_UNTRUSTED_KEXTS | \
CSR_ALLOW_UNRESTRICTED_FS | \
CSR_ALLOW_TASK_FOR_PID | \
CSR_ALLOW_KERNEL_DEBUGGER | \
CSR_ALLOW_APPLE_INTERNAL | \
CSR_ALLOW_UNRESTRICTED_DTRACE | \
CSR_ALLOW_UNRESTRICTED_NVRAM | \
CSR_ALLOW_DEVICE_CONFIGURATION)
typedef struct boot_args
{
uint16_t Revision;/* Revision of boot_args structure */
uint64_t pciConfigSpaceBaseAddress;
uint32_t pciConfigSpaceStartBusNumber;
uint32_t pciConfigSpaceEndBusNumber;
uint32_tcsrActiveConfig;
uint32_tcsrPendingConfig;
uint32_t __reserved4[728];
uint32_t csrActiveConfig;
uint32_t csrCapabilities;
uint32_t boot_SMC_plimit;
uint16_tbootProgressMeterStart;
uint16_tbootProgressMeterEnd;
uint32_t __reserved4[726];
} boot_args;
typedef struct boot_args_legacy
branches/zenith432/i386/boot2/boot.c
149149
150150
151151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
152226
153227
154228
......
320394
321395
322396
323
397
324398
325
326
399
400
327401
328402
329403
330404
405
406
407
408
409
410
411
331412
332413
333414
......
903984
904985
905986
906
987
907988
908
909
910
989
911990
912991
913992
914
915
993
916994
917995
918996
entry_tkernelEntry;
bootArgs->kaddr = bootArgs->ksize = 0;
// ===============================================================================
// OS X Mountain Lion 10.8
if ( MacOSVerCurrent >= MacOSVer2Int("10.8") ) // Mountain Lion and Up!
{
// cparm
bool KPRebootOption= false;
bool HiDPIOption= false;
getBoolForKey(kRebootOnPanic, &KPRebootOption, &bootInfo->chameleonConfig);
if ( KPRebootOption )
{
bootArgs->flags |= kBootArgsFlagRebootOnPanic;
}
// cparm
getBoolForKey(kEnableHiDPI, &HiDPIOption, &bootInfo->chameleonConfig);
if ( HiDPIOption )
{
bootArgs->flags |= kBootArgsFlagHiDPI;
}
}
// OS X Yosemite 10.10
if ( MacOSVerCurrent >= MacOSVer2Int("10.10") ) // Yosemite and Up!
{
// Pike R. Alpha
bool FlagBlackOption= false;
getBoolForKey(kBlackMode, &FlagBlackOption, &bootInfo->chameleonConfig);
if ( FlagBlackOption )
{
//bootArgs->flags |= kBootArgsFlagBlack;
bootArgs->flags |= kBootArgsFlagBlackBg; // Micky1979
}
}
// OS X El Capitan 10.11
if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Up!
{
// ErmaC
intcrsValue;
#if 0
/*
* A special BootArgs flag "kBootArgsFlagCSRBoot"
* is set in the Recovery or Installation environment.
* This flag is kind of overkill by turning off all the protections
*/
if (isRecoveryHD)
{
// SIP can be controlled with or without FileNVRAM.kext (Pike R. Alpha)
bootArgs->flags|=(kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot);
}
#endif
bootArgs->flags|= kBootArgsFlagCSRActiveConfig;
// Set limit to 7bit
if ( getIntForKey(KCsrActiveConfig, &crsValue, &bootInfo->chameleonConfig) && (crsValue >= 0 && crsValue <= 127) )
{
bootArgs->csrActiveConfig= crsValue;
}
else
{
// zenith432
bootArgs->csrActiveConfig= 0x67;
}
bootArgs->csrCapabilities= CSR_VALID_FLAGS;
bootArgs->boot_SMC_plimit= 0;
}
// ===============================================================================
execute_hook("ExecKernel", (void *)binary, NULL, NULL, NULL);
ret = DecodeKernel(binary,
}
closedir(cacheDir);
}
else
else if ( MacOSVerCurrent >= MacOSVer2Int("10.7") && MacOSVerCurrent < MacOSVer2Int("10.10") )
{
// Lion, Mountain Lion, Mavericks, Yosemite and El Capitan prelink kernel cache file
// for 10.7 10.8 10.9 10.10 10.11
// Lion, Mountain Lion and Mavericks prelink kernel cache file
// for 10.7 10.8 10.9
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow);
verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile);
}
else
{
// Yosemite and El Capitan prelink kernel cache file
// for 10.10 10.11
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%sprelinkedkernel", kDefaultCachePathYosemite);
verbose("Kernel Cache file path (Mac OS X 10.10 and newer): %s\n", kernelCacheFile);
}
}
// Check if the kernel cache file exists
// =========================================================================
bool checkOSVersion(const char *version)
{
if ( (sizeof(version) > 4) && ('.' != version[4]) && ('\0' != version[4]) )
if ( '\0' != version[4] )
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3])
&& (gMacOSVersion[4] == version[4]));
return !memcmp(&gMacOSVersion[0], &version[0], 5);
}
else
{
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
return !memcmp(&gMacOSVersion[0], &version[0], 4);
}
}
branches/zenith432/i386/boot2/boot.h
4646
4747
4848
49
4950
5051
5152
......
170171
171172
172173
174
173175
174176
175177
......
186188
187189
188190
191
189192
190193
191194
// kernel cache
#define kDefaultCachePathLeo"/System/Library/Caches/com.apple.kernelcaches/"
#define kDefaultCachePathSnow"/System/Library/Caches/com.apple.kext.caches/Startup/"
#define kDefaultCachePathYosemite"/System/Library/PrelinkedKernels/"
// Lion installer
#define kLionInstallerDataFolder"/Mac OS X Install Data/"
#define kEnableHDMIAudio"EnableHDMIAudio"/* ati.c && nvidia.c */
/* cparm: added these keys */
#define kRebootOnPanic"RebootOnPanic"
#define kEnableHiDPI"EnableHiDPI"// enable High resolution display (aka Retina)
/* ErmaC: added these keys */
#define kHDAEnabler"HDAEnabler"/* pci_setup.c */
#define kHDEFLayoutID"HDEFLayoutID"/* hda.c */
#define kHDAULayoutID"HDAULayoutID"/* hda.c */
#define KCsrActiveConfig"CsrActiveConfig"/* boot.c */
/* Pike R. Alpha: added this key */
#define kBlackMode"BlackMode"
branches/zenith432/i386/util/boot1-install/Makefile
1818
1919
2020
21
22
21
2322
2423
2524
-Wl,-no_function_starts \
-Wl,-no_data_in_code_info \
-Wl,-no_version_load_command \
-Wl,-no_uuid \
-Wl,-no_dependent_dr_info
-Wl,-no_uuid
CFLAGS := $(CFLAGS) -mmacosx-version-min=10.5
branches/zenith432/doc/BootHelp.txt
7777
7878
7979
80
81
8082
8183
8284
BlackMode=Yes|No The new BlackMode loads the white Apple logo,
instead of the gray Apple logo, on a black background (disabled by default).
CsrActiveConfig=<value> Set CsrActiveConfig for OS 10.11.x, range 0..127 (default 0x67)
PciRoot=<value> Use an alternate value for PciRoot (default value 0).
UseKernelCache=Yes|No Yes will load pre-linked kernel and will ignore /E/E

Archive Download the corresponding diff file

Revision: 2806