Index: trunk/i386/libsaio/bootstruct.c =================================================================== --- trunk/i386/libsaio/bootstruct.c (revision 2560) +++ trunk/i386/libsaio/bootstruct.c (revision 2561) @@ -119,18 +119,20 @@ void reserveKernBootStruct(void) { - if ( TIGER || LEOPARD || SNOW_LEOPARD ) + if ( MacOSVerCurrent >= MacOSVer2Int("10.7") ) // OS X 10.7 and newer { - // for 10.4 10.5 10.6 - void *oldAddr = bootArgsPreLion; - bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion)); - bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion)); - } else { // for 10.7 10.8 10.9 10.10 void *oldAddr = bootArgs; bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args)); bcopy(oldAddr, bootArgs, sizeof(boot_args)); } + else + { + // for 10.4 10.5 10.6 + void *oldAddr = bootArgsPreLion; + bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion)); + bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion)); + } } //============================================================================== Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2560) +++ trunk/i386/libsaio/fake_efi.c (revision 2561) @@ -724,7 +724,7 @@ DT__AddProperty(chosenNode, "machine-signature", sizeof(EFI_UINT32), (EFI_UINT32 *)&MachineSig); - if(YOSEMITE) + if (MacOSVerCurrent >= MacOSVer2Int("10.10")) { // // Pike R. Alpha - 12 October 2014 Index: trunk/i386/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 2560) +++ trunk/i386/boot2/drivers.c (revision 2561) @@ -249,7 +249,7 @@ } else { - if ( MAVERICKS || YOSEMITE ) // issue 352 + if (MacOSVerCurrent >= MacOSVer2Int("10.9")) // issue 352 { strlcpy(gExtensionsSpec, dirSpec, 4087); /* 4096 - sizeof("Library/") */ strcat(gExtensionsSpec, "Library/"); Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2560) +++ trunk/i386/boot2/boot.c (revision 2561) @@ -219,17 +219,9 @@ finalizeBootStruct(); // Jump to kernel's entry point. There's no going back now. - if (TIGER || LEOPARD || SNOW_LEOPARD) + if (MacOSVerCurrent >= MacOSVer2Int("10.7")) { // Notify modules that the kernel is about to be started - execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL); - - startprog( kernelEntry, bootArgsPreLion ); - - } - else - { - // Notify modules that the kernel is about to be started execute_hook("Kernel Start", (void *)kernelEntry, (void *)bootArgs, NULL, NULL); // Masking out so that Lion doesn't doublefault @@ -238,7 +230,14 @@ startprog( kernelEntry, bootArgs ); } + else + { + // Notify modules that the kernel is about to be started + execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL); + startprog( kernelEntry, bootArgsPreLion ); + } + // Not reached return 0; } @@ -269,21 +268,19 @@ } else { - // Leopard prelink kernel cache file - if (TIGER || LEOPARD) + // Lion, Mountain Lion, Mavericks and Yosemite prelink kernel cache file + if (MacOSVerCurrent >= MacOSVer2Int("10.7")) // OSX is Lion (10.7) or newer { - // Reset cache name. - bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64); - snprintf(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64, "%s,%s", gRootDevice, bootInfo->bootFile); - adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler)); - snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s.%08lX", kDefaultCachePathLeo, adler32); - verbose("Reseted kernel cache file path: %s\n", kernelCacheFile);; + snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow); + verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile); } // Snow Leopard prelink kernel cache file - else if ( SNOW_LEOPARD ) + else { - snprintf(kernelCacheFile, sizeof(kernelCacheFile), "kernelcache_%s", - (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64"); + if (MacOSVerCurrent >= MacOSVer2Int("10.6")) // OSX is Snow (10.6) + { + snprintf(kernelCacheFile, sizeof(kernelCacheFile), "kernelcache_%s", + (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64"); int lnam = strlen(kernelCacheFile) + 9; //with adler32 char *name; @@ -309,10 +306,14 @@ } else { - // Lion, Mountain Lion, Mavericks, and Yosemite prelink kernel cache file - // for 10.7 10.8 10.9 10.10 - snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow); - verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile);; + // Leopard prelink kernel cache file + // Reset cache name. + bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64); + snprintf(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64, "%s,%s", gRootDevice, bootInfo->bootFile); + adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler)); + snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s.%08lX", kDefaultCachePathLeo, adler32); + verbose("Reseted kernel cache file path: %s\n", kernelCacheFile); + } } } @@ -744,13 +745,13 @@ // bootFile must start with a / if it not start with a device name if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') { - if ( !YOSEMITE ) + if (MacOSVerCurrent >= MacOSVer2Int("10.10")) // OSX is 10.10 or newer { - snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading / + snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos "%s", bootInfo->bootFile); // Yosemite } else { - snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos"%s", bootInfo->bootFile); // Yosemite + snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading '/' } } else Index: trunk/i386/boot2/boot.h =================================================================== --- trunk/i386/boot2/boot.h (revision 2560) +++ trunk/i386/boot2/boot.h (revision 2561) @@ -30,13 +30,13 @@ #include "libsaio.h" // OS X Versions -#define YOSEMITE checkOSVersion("10.10") // Yosemite -#define MAVERICKS checkOSVersion("10.9") // Mavericks -#define MOUNTAIN_LION checkOSVersion("10.8") // Mountain Lion -#define LION checkOSVersion("10.7") // Lion -#define SNOW_LEOPARD checkOSVersion("10.6") // Snow Leopard -#define LEOPARD checkOSVersion("10.5") // Leopard -#define TIGER checkOSVersion("10.4") // Tiger +//#define YOSEMITE checkOSVersion("10.10") // Yosemite +//#define MAVERICKS checkOSVersion("10.9") // Mavericks +//#define MOUNTAIN_LION checkOSVersion("10.8") // Mountain Lion +//#define LION checkOSVersion("10.7") // Lion +//#define SNOW_LEOPARD checkOSVersion("10.6") // Snow Leopard +//#define LEOPARD checkOSVersion("10.5") // Leopard +//#define TIGER checkOSVersion("10.4") // Tiger /* * Paths used by chameleon Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 2560) +++ trunk/i386/boot2/options.c (revision 2561) @@ -1316,37 +1316,25 @@ } else { - if( YOSEMITE ) // is 10.10 + if (MacOSVerCurrent >= MacOSVer2Int("10.10")) // OS X is 10.10 or newer { strlcpy( bootInfo->bootFile, kOSXKernel, sizeof(bootInfo->bootFile) ); } else - { // OSX is not 10.10 - + { + // or 10.9 and previous strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); } } } - if (!YOSEMITE) // not 10.10 so 10.9 and previus + if ((strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) && (strcmp( bootInfo->bootFile, kOSXKernel ) != 0)) { - if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) - { - //printf(HEADER "org.chameleon.Boot.plist found path for custom '%s' found!\n", bootInfo->bootFile); - gOverrideKernel = true; - } + gOverrideKernel = true; } - else - { // OSX is 10.10 - if (strcmp( bootInfo->bootFile, kOSXKernel ) != 0) - { - //printf(HEADER "org.chameleon.Boot.plist found path for custom '%s' found!\n", bootInfo->bootFile); - gOverrideKernel = true; - } - } // Ermac : Inject "kext-dev-mode=1" if OS X 10.10 is detected - if( YOSEMITE ) // is 10.10 + if (MacOSVerCurrent >= MacOSVer2Int("10.10")) // OS X is 10.10 or newer { addBootArg("kext-dev-mode=1"); }