Index: trunk/i386/libsaio/bootstruct.c =================================================================== --- trunk/i386/libsaio/bootstruct.c (revision 2432) +++ trunk/i386/libsaio/bootstruct.c (revision 2433) @@ -118,15 +118,17 @@ void reserveKernBootStruct(void) { - if ( LION || MOUNTAIN_LION || MAVERICKS ) + if ( TIGER || LEOPARD || SNOW_LEOPARD ) { + // 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 { - 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/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 2432) +++ trunk/i386/boot2/drivers.c (revision 2433) @@ -915,7 +915,16 @@ if (uncompressed_size != size) { - error("ERROR: size mismatch from lzss (found: %x, expected: %x).\n", size, uncompressed_size); + if ( kernel_header->compress_type == OSSwapBigToHostConstInt32('lzvn')) + { + error("ERROR: size mismatch from lzvn (found: %x, expected: %x).\n", size, uncompressed_size); + } + + if ( kernel_header->compress_type == OSSwapBigToHostConstInt32('lzss')) + { + error("ERROR: size mismatch from lzss (found: %x, expected: %x).\n", size, uncompressed_size); + } + return -1; } Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2432) +++ trunk/i386/boot2/boot.c (revision 2433) @@ -207,9 +207,14 @@ finalizeBootStruct(); // Jump to kernel's entry point. There's no going back now. - if ( LION || MOUNTAIN_LION || MAVERICKS ) + if (TIGER || LEOPARD || SNOW_LEOPARD) { + // 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); @@ -218,11 +223,6 @@ outb(0xa1, 0xff); /* Maskout all interrupts Pic2 */ 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 @@ -251,11 +251,16 @@ strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); verbose("Specified kernel cache file path = %s\n", cacheFile); } else { - // Lion, Mountain Lion and Mavericks prelink kernel cache file - if ( LION || MOUNTAIN_LION || MAVERICKS ) + // Leopard prelink kernel cache file + if (TIGER || LEOPARD) { - snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow); - verbose("10.7, 10.8 & 10.9 kernel cache file path = %s\n", kernelCacheFile); } + // 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); + } // Snow Leopard prelink kernel cache file else if ( SNOW_LEOPARD ) { snprintf(kernelCacheFile, sizeof(kernelCacheFile), "kernelcache_%s", @@ -280,14 +285,10 @@ } closedir(cacheDir); } else { - // 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); + // 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("10.7, 10.8, 10.9 & 10.10 kernel cache file path = %s\n", kernelCacheFile); } } @@ -329,24 +330,41 @@ // than the kernel file or the S/L/E directory ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime); - // Check if the kernel file is more recent than the cache file - if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat) - && (kerneltime > cachetime)) + if (!YOSEMITE) { - DBG("Kernel file (%s) is more recent than Kernel Cache (%s)! Ignoring Kernel Cache.\n", + // Check if the kernel file is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat) && (kerneltime > cachetime)) + { + DBG("Kernel file (%s) is more recent than Kernel Cache (%s)! Ignoring Kernel Cache.\n", bootInfo->bootFile, kernelCacheFile); + return -1; + } + + ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime); + // Check if the S/L/E directory time is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) && (exttime > cachetime)) + { + DBG("Folder: '/System/Library/Extensions' is more recent than Kernel Cache file (%s)! Ignoring Kernel Cache.\n", kernelCacheFile); + return -1; + } + } else { + // for 10.10 + // Check if the kernel file is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat) && (kerneltime > cachetime)) + { + DBG("Kernel file (%s) is more recent than Kernel Cache (%s), still loading KernelCache\n", bootInfo->bootFile, kernelCacheFile); - return -1; - } + return -1; + } - ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime); - // Check if the S/L/E directory time is more recent than the cache file - if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) && (exttime > cachetime)) - { - DBG("Folder: '/System/Library/Extensions' is more recent than Kernel Cache file (%s)! Ignoring Kernel Cache.\n", + ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime); + // Check if the S/L/E directory time is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) && (exttime > cachetime)) + { + DBG("Folder: '/System/Library/Extensions' is more recent than Kernel Cache (%s), still loading KernelCache\n", kernelCacheFile); - return -1; + return -1; + } } - // Since the kernel cache file exists and is the most recent try to load it DBG("Loading kernel cache: '%s'\n", kernelCachePath); @@ -665,7 +683,17 @@ // bootFile must start with a / if it not start with a device name if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') { - snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading / + if (!YOSEMITE) + { + //printf(HEADER " (%s).\n", bootInfo->bootFile); + snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading / + //sleep(1); + } else { + + //printf(HEADER " (%s).\n", bootInfo->bootFile); + snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos"%s", bootInfo->bootFile); // Yosemite + //sleep(1); + } } else { strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile)); } Index: trunk/i386/boot2/boot.h =================================================================== --- trunk/i386/boot2/boot.h (revision 2432) +++ trunk/i386/boot2/boot.h (revision 2433) @@ -54,6 +54,10 @@ #define kMLionInstallerDataFolder "/OS X Install Data/" #define kMLionInstallerPlist kMLionInstallerDataFolder "com.apple.Boot.plist" +//kernel path +#define kDefaultKernelPathPreYos "/" +#define kDefaultKernelPathForYos "/System/Library/Kernels/" //for Yosemite + /* * Keys used in system Boot.plist */ @@ -80,6 +84,7 @@ #define kScanSingleDriveKey "Scan Single Drive" #define kInstantMenuKey "Instant Menu" #define kDefaultKernel "mach_kernel" +#define kOSXKernel "kernel" // Yosemite #define kGUIKey "GUI" #define kBootBannerKey "Boot Banner" #define kShowInfoKey "ShowInfo" /* gui.c */ Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 2432) +++ trunk/i386/boot2/options.c (revision 2433) @@ -1238,13 +1238,37 @@ } else { - strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); + if( YOSEMITE ) // is 10.10 + { + + strlcpy( bootInfo->bootFile, kOSXKernel, sizeof(bootInfo->bootFile) ); + //printf(HEADER "/System/Library/Kernels/%s\n", bootInfo->bootFile); + } + else + { // OSX is not 10.10 + + strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); + //printf(HEADER "/%s\n", bootInfo->bootFile); + } } } - if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) + + if (!YOSEMITE) // not 10.10 so 10.9 and previus { - gOverrideKernel = true; + if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) + { + //printf(HEADER "org.chameleon.Boot.plist found path for custom '%s' found!\n", bootInfo->bootFile); + 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; + } + } cntRemaining = BOOT_STRING_LEN - 2; // save 1 for NULL, 1 for space argP = bootArgs->CommandLine; Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 2432) +++ trunk/CHANGES (revision 2433) @@ -1,3 +1,7 @@ +- ErmaC : Merge Yosemite patch (ready from June 2014) Thanks all involved in the test and develop; + Special thanks: Alex J, viv xix, zenith432 from http://forge.voodooprojects.org/p/chameleon/issues/375/ + Testing and improvements: Pike R. Alpha, ErmaC, Bungo, blackosx, Micky1979, crazybirdy, oldnapalm, janek202, MinusZwei and Andy Vandijck. + - Pike R. Alpha : dinamic "random-seed" implementation ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ ) - ErmaC : getCPUTick() helper function ( http://www.insanelymac.com/forum/topic/301350-lets-make-random-seed-really-random/ ) - ErmaC : Add Yosemite Icons detection for chameleon UI