Index: Make.rules
===================================================================
--- Make.rules	(revision 2378)
+++ Make.rules	(working copy)
@@ -17,7 +17,8 @@
 NASM = $(shell which nasm) -p $(SRCROOT)/autoconf.inc
 
 
-CFLAGS	= $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror
+#CFLAGS	= $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror
+CFLAGS	= $(CONFIG_OPTIMIZATION_LEVEL) -g -Werror
 CPPFLAGS = $(MORECPP) -g -Wmost -Werror -fno-exceptions -fno-rtti
 DEFINES=
 
Index: i386/boot2/Makefile
===================================================================
--- i386/boot2/Makefile	(revision 2378)
+++ i386/boot2/Makefile	(working copy)
@@ -20,7 +20,7 @@
 include ${SRCROOT}/Make.rules
 
 OPTIM = -Os -Oz
-CFLAGS	= $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \
+CFLAGS	= $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Werror \
 		-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \
 		-march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
 
Index: i386/boot2/boot.c
===================================================================
--- i386/boot2/boot.c	(revision 2378)
+++ i386/boot2/boot.c	(working copy)
@@ -80,8 +80,6 @@
 long		gBootMode; /* defaults to 0 == kBootModeNormal */
 BVRef		bvr, menuBVR, bvChain;
 
-static bool				checkOSVersion(const char * version);
-static void				getOSVersion();
 static unsigned long	Adler32(unsigned char *buffer, long length);
 //static void			selectBiosDevice(void);
 
@@ -197,7 +195,7 @@
 	finalizeBootStruct();
 
 	// Jump to kernel's entry point. There's no going back now.
-	if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")))
+	if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")) || (checkOSVersion("10.10")))
 	{
 
 		// Notify modules that the kernel is about to be started
@@ -243,7 +241,7 @@
 	else
 	{
 		// Lion, Mountain Lion and Mavericks prelink kernel cache file
-		if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")))
+		if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")) || (checkOSVersion("10.10")))
 		{
 			snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow);
 		}
@@ -533,9 +531,6 @@
 			updateVRAM();
 		}
 
-		// Find out which version mac os we're booting.
-		getOSVersion();
-
 		if (platformCPUFeature(CPU_FEATURE_EM64T)) {
 			archCpuType = CPU_TYPE_X86_64;
 		} else {
@@ -655,7 +650,11 @@
 
 			// 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 (checkOSVersion("10.10")) {
+                    snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos"%s", bootInfo->bootFile); // for Yosemite
+                } else {
+                    snprintf(bootFile, sizeof(bootFile), kDefaultKernelPath"%s", bootInfo->bootFile); // append a leading /
+                }
 			else
 				strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile));
 
@@ -749,15 +748,16 @@
 
 bool checkOSVersion(const char * version) 
 {
-	return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
-			&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
+    if ( (sizeof(version) > 4) && ('.' != version[4]) && ('\0' != version[4])) {  //10.10\0
+        return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
+                && (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]))
+                && (gMacOSVersion[4] == version[4]);
+    } else {
+        return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
+                && (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
+    }
 }
 
-static void getOSVersion()
-{
-	strncpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion));
-}
-
 #define BASE 65521L /* largest prime smaller than 65536 */
 #define NMAX 5000
 // NMAX (was 5521) the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1
Index: i386/boot2/boot.h
===================================================================
--- i386/boot2/boot.h	(revision 2378)
+++ i386/boot2/boot.h	(working copy)
@@ -40,6 +40,10 @@
 #define kLionInstallerDataFolder      "/Mac OS X Install Data/"
 #define kLionInstallerPlist           kLionInstallerDataFolder "com.apple.Boot.plist"
 
+//kernel path
+#define kDefaultKernelPath          "/"
+#define kDefaultKernelPathForYos    "/System/Library/Kernels/"  //for Yosemite
+
 /*
  * Keys used in system Boot.plist
  */
@@ -66,6 +70,7 @@
 #define kScanSingleDriveKey	"Scan Single Drive"
 #define kInstantMenuKey		"Instant Menu"
 #define kDefaultKernel		"mach_kernel"
+#define kDefaultKernelForYos    "kernel"  //Yosemite
 #define kGUIKey			"GUI"
 #define kBootBannerKey		"Boot Banner"
 #define kShowInfoKey		"ShowInfo"		// gui.c
@@ -302,4 +307,6 @@
 /* bmdecompress.c */
 void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
 
+bool checkOSVersion(const char * version);
+
 #endif /* !__BOOT2_BOOT_H */
Index: i386/boot2/drivers.c
===================================================================
--- i386/boot2/drivers.c	(revision 2378)
+++ i386/boot2/drivers.c	(working copy)
@@ -235,7 +235,7 @@
 					return -1;
 				}
 			} else {
-				if (gMacOSVersion[3] == '9') {
+				if ((checkOSVersion("10.9")) || (checkOSVersion("10.10"))) {
 					strlcpy(gExtensionsSpec, dirSpec, 4087); /* 4096 - sizeof("Library/") */
 					strcat(gExtensionsSpec, "Library/");
 					FileLoadDrivers(gExtensionsSpec, 0);
Index: i386/boot2/gui.c
===================================================================
--- i386/boot2/gui.c	(revision 2378)
+++ i386/boot2/gui.c	(working copy)
@@ -43,6 +43,8 @@
 	iDeviceGeneric_o,
 	iDeviceHFS,
 	iDeviceHFS_o,
+    iDeviceHFS_yos,
+    iDeviceHFS_yos_o,
 	iDeviceHFS_mav,
 	iDeviceHFS_mav_o,
 	iDeviceHFS_ML,
@@ -58,6 +60,8 @@
 
 	iDeviceHFSRAID,
 	iDeviceHFSRAID_o,
+    iDeviceHFSRAID_yos,
+    iDeviceHFSRAID_yos_o,
 	iDeviceHFSRAID_mav,
 	iDeviceHFSRAID_mav_o,
 	iDeviceHFSRAID_ML,
@@ -123,6 +127,8 @@
 	{.name = "device_generic_o",            .image = NULL},
 	{.name = "device_hfsplus",              .image = NULL},
 	{.name = "device_hfsplus_o",            .image = NULL},
+    {.name = "device_hfsplus_yos",          .image = NULL},
+    {.name = "device_hfsplus_yos_o",        .image = NULL},
 	{.name = "device_hfsplus_mav",          .image = NULL},
 	{.name = "device_hfsplus_mav_o",        .image = NULL},
 	{.name = "device_hfsplus_ml",           .image = NULL},
@@ -138,6 +144,8 @@
 
 	{.name = "device_hfsraid",              .image = NULL},
 	{.name = "device_hfsraid_o",            .image = NULL},
+	{.name = "device_hfsraid_yos",          .image = NULL},
+	{.name = "device_hfsraid_yos_o",        .image = NULL},
 	{.name = "device_hfsraid_mav",          .image = NULL},
 	{.name = "device_hfsraid_mav_o",        .image = NULL},
 	{.name = "device_hfsraid_ml",           .image = NULL},
Index: i386/boot2/options.c
===================================================================
--- i386/boot2/options.c	(revision 2378)
+++ i386/boot2/options.c	(working copy)
@@ -1193,6 +1193,9 @@
 		return -1;
 	}
 
+    // Find out which version mac os we're booting.
+    strncpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion));
+    
 	// Load config table specified by the user, or use the default.
 
 	if (!getValueForBootKey(cp, "config", &val, &cnt)) {
@@ -1220,10 +1223,14 @@
 		if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) {
 			strlcpy( bootInfo->bootFile, val, cnt+1 );
 		} else {
-			strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
+            if ((checkOSVersion("10.10"))) {
+                strlcpy( bootInfo->bootFile, kDefaultKernelForYos, sizeof(bootInfo->bootFile) );
+            } else {
+                strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) );
+            }
 		}
 	}
-	if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) {
+	if ((strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) && (strcmp( bootInfo->bootFile, kDefaultKernelForYos ) != 0)) {
 		gOverrideKernel = true;
 	}
 
Index: i386/libsaio/bootstruct.c
===================================================================
--- i386/libsaio/bootstruct.c	(revision 2378)
+++ i386/libsaio/bootstruct.c	(working copy)
@@ -27,6 +27,7 @@
  */
 
 #include "libsaio.h"
+#include "boot.h"
 #include "bootstruct.h"
 
 /*==========================================================================
@@ -109,8 +110,7 @@
 void
 reserveKernBootStruct(void)
 {
-	if ((gMacOSVersion[0] == '1') && (gMacOSVersion[1] == '0')
-		&& (gMacOSVersion[2] == '.') && (gMacOSVersion[3] == '7' || gMacOSVersion[3] == '8' || gMacOSVersion[3] == '9'))
+	if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")) || (checkOSVersion("10.10")))
 	{
 		void *oldAddr = bootArgs;
 		bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args));
