Index: branches/Chimera/i386/libsaio/console.c =================================================================== --- branches/Chimera/i386/libsaio/console.c (revision 2402) +++ branches/Chimera/i386/libsaio/console.c (revision 2403) @@ -91,7 +91,8 @@ msgbuf = malloc(BOOTER_LOG_SIZE); bzero(msgbuf, BOOTER_LOG_SIZE); cursor = msgbuf; - msglog("%s\n", "Chimera 3.0.1 Branch of " "Chameleon " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]"); +// msglog("%s\n", "Chimera 4.0.0 Branch of " "Chameleon " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]"); + msglog("%s\n", "Chimera 4.0.0 Branch of Chameleon" " [" I386BOOT_BUILDDATE "]"); } void msglog(const char * fmt, ...) @@ -246,6 +247,25 @@ } else { vprf(fmt, ap); } + + { + // Kabyl: BooterLog + struct putc_info pi; + + if (!msgbuf) { + return 0; + } + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) { + return 0; + } + + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + cursor += strlen((char *)cursor); + } + va_end(ap); return(0); } Index: branches/Chimera/i386/libsaio/bootstruct.c =================================================================== --- branches/Chimera/i386/libsaio/bootstruct.c (revision 2402) +++ branches/Chimera/i386/libsaio/bootstruct.c (revision 2403) @@ -27,6 +27,7 @@ */ #include "libsaio.h" +#include "boot.h" #include "bootstruct.h" /*========================================================================== @@ -109,9 +110,8 @@ 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)); bcopy(oldAddr, bootArgs, sizeof(boot_args)); Index: branches/Chimera/i386/libsaio/hfs.c =================================================================== --- branches/Chimera/i386/libsaio/hfs.c (revision 2402) +++ branches/Chimera/i386/libsaio/hfs.c (revision 2403) @@ -304,7 +304,7 @@ } dirID = kHFSRootFolderID; - // Skip a lead '\'. Start in the system folder if there are two. + // Skip a lead '/'. Start in the system folder if there are two. if (filePath[0] == '/') { if (filePath[1] == '/') @@ -370,7 +370,7 @@ if (*dirIndex == -1) return -1; dirID = kHFSRootFolderID; - // Skip a lead '\'. Start in the system folder if there are two. + // Skip a lead '/'. Start in the system folder if there are two. if (dirPath[0] == '/') { if (dirPath[1] == '/') { if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); @@ -435,7 +435,7 @@ if (HFSInitPartition(ih) == -1) return -1; dirID = kHFSRootFolderID; - // Skip a lead '\'. Start in the system folder if there are two. + // Skip a lead '/'. Start in the system folder if there are two. if (filePath[0] == '/') { if (filePath[1] == '/') { if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); Index: branches/Chimera/i386/libsaio/spd.h =================================================================== --- branches/Chimera/i386/libsaio/spd.h (revision 2402) +++ branches/Chimera/i386/libsaio/spd.h (revision 2403) @@ -118,6 +118,8 @@ #define SPD_MEMORY_TYPE_SGRAM_DDR 6 #define SPD_MEMORY_TYPE_SDRAM_DDR 7 #define SPD_MEMORY_TYPE_SDRAM_DDR2 8 +#define SPD_MEMORY_TYPE_SDRAM_FB_DDR2 9 +#define SPD_MEMORY_TYPE_SDRAM_FBP_DDR2 0xa #define SPD_MEMORY_TYPE_SDRAM_DDR3 0xb /* SPD_MODULE_VOLTAGE values. */ Index: branches/Chimera/i386/libsaio/hda.c =================================================================== --- branches/Chimera/i386/libsaio/hda.c (revision 2402) +++ branches/Chimera/i386/libsaio/hda.c (revision 2403) @@ -92,105 +92,107 @@ static hda_controller_devices know_hda_controller[] = { //8086 Intel Corporation - { HDA_INTEL_HASWELL, "Haswell" }, - { HDA_INTEL_CRYSTAL, "Crystal Well" }, - { HDA_INTEL_CPT, "6 Series/C200 Series Chipset Family" }, - { HDA_INTEL_PATSBURG,"C600/X79 series chipset" }, - { HDA_INTEL_PPT1, "7 Series/C210 Series Chipset Family" }, - { HDA_INTEL_82801F, "82801FB/FBM/FR/FW/FRW (ICH6 Family)" }, - { HDA_INTEL_63XXESB, "631x/631xESB/632xESB" }, - { HDA_INTEL_82801G, "NM10/ICH7 Family" }, - { HDA_INTEL_82801H, "82801H (ICH8 Family)" }, - { HDA_INTEL_82801I, "82801I (ICH9 Family)" }, - { HDA_INTEL_82801JI, "82801JI (ICH10 Family)" }, - { HDA_INTEL_82801JD, "82801JD/DO (ICH10 Family) " }, - { HDA_INTEL_PCH, "5 Series/3400 Series" }, - { HDA_INTEL_PCH2, "5 Series/3400 Series" }, - { HDA_INTEL_SCH, "System Controller Hub (SCH Poulsbo)" }, - { HDA_INTEL_LPT1, "Lynx Point" }, - { HDA_INTEL_LPT2, "Lynx Point" }, - { HDA_INTEL_LYNX, "Lynx Point-LP" }, - { HDA_INTEL_LYNX2, "Lynx Point-LP" }, + { HDA_INTEL_HASWELL, "Haswell-ULT" }, + { HDA_INTEL_HASWELL2, "Haswell" }, + { HDA_INTEL_CRYSTAL, "Crystal Well" }, + { HDA_INTEL_CPT, "6 Series/C200 Series Chipset Family" }, + { HDA_INTEL_PATSBURG, "C600/X79 series chipset" }, + { HDA_INTEL_PPT1, "7 Series/C210 Series Chipset Family" }, + { HDA_INTEL_82801F, "82801FB/FBM/FR/FW/FRW (ICH6 Family)" }, + { HDA_INTEL_63XXESB, "631x/631xESB/632xESB" }, + { HDA_INTEL_82801G, "NM10/ICH7 Family" }, + { HDA_INTEL_82801H, "82801H (ICH8 Family)" }, + { HDA_INTEL_82801I, "82801I (ICH9 Family)" }, + { HDA_INTEL_82801JI, "82801JI (ICH10 Family)" }, + { HDA_INTEL_82801JD, "82801JD/DO (ICH10 Family) " }, + { HDA_INTEL_PCH, "5 Series/3400 Series" }, + { HDA_INTEL_PCH2, "5 Series/3400 Series" }, + { HDA_INTEL_SCH, "System Controller Hub (SCH Poulsbo)" }, + { HDA_INTEL_SCH2, "9 Series" }, + { HDA_INTEL_LPT1, "Lynx Point" }, + { HDA_INTEL_LPT2, "Lynx Point" }, + { HDA_INTEL_LYNX, "Lynx Point-LP" }, + { HDA_INTEL_LYNX2, "Lynx Point-LP" }, //10de NVIDIA Corporation - { HDA_NVIDIA_MCP51, "MCP51" }, - { HDA_NVIDIA_MCP55, "MCP55" }, - { HDA_NVIDIA_MCP61_1, "MCP61" }, - { HDA_NVIDIA_MCP61_2, "MCP61" }, - { HDA_NVIDIA_MCP65_1, "MCP65" }, - { HDA_NVIDIA_MCP65_2, "MCP65" }, - { HDA_NVIDIA_MCP67_1, "MCP67" }, - { HDA_NVIDIA_MCP67_2, "MCP67" }, - { HDA_NVIDIA_MCP73_1, "MCP73" }, - { HDA_NVIDIA_MCP73_2, "MCP73" }, - { HDA_NVIDIA_MCP78_1, "MCP78" }, - { HDA_NVIDIA_MCP78_2, "MCP78" }, - { HDA_NVIDIA_MCP78_3, "MCP78" }, - { HDA_NVIDIA_MCP78_4, "MCP78" }, - { HDA_NVIDIA_MCP79_1, "MCP79" }, - { HDA_NVIDIA_MCP79_2, "MCP79" }, - { HDA_NVIDIA_MCP79_3, "MCP79" }, - { HDA_NVIDIA_MCP79_4, "MCP79" }, - { HDA_NVIDIA_MCP89_1, "MCP89" }, - { HDA_NVIDIA_MCP89_2, "MCP89" }, - { HDA_NVIDIA_MCP89_3, "MCP89" }, - { HDA_NVIDIA_MCP89_4, "MCP89" }, - { HDA_NVIDIA_0BE2, "(0x0be2)" }, - { HDA_NVIDIA_0BE3, "(0x0be3)" }, - { HDA_NVIDIA_0BE4, "(0x0be4)" }, - { HDA_NVIDIA_GT100, "GT100" }, - { HDA_NVIDIA_GT104, "GT104" }, - { HDA_NVIDIA_GT106, "GT106" }, - { HDA_NVIDIA_GT108, "GT108" }, - { HDA_NVIDIA_GT116, "GT116" }, - { HDA_NVIDIA_GF119, "GF119" }, - { HDA_NVIDIA_GF110, "GF110" }, - { HDA_NVIDIA_GF114, "GF114" }, // HDMi - { HDA_NVIDIA_GK110, "GK110" }, - { HDA_NVIDIA_GK106, "GK106" }, - { HDA_NVIDIA_GK107, "GK107" }, - { HDA_NVIDIA_GK104, "GK104" }, + { HDA_NVIDIA_MCP51, "MCP51" }, + { HDA_NVIDIA_MCP55, "MCP55" }, + { HDA_NVIDIA_MCP61_1, "MCP61" }, + { HDA_NVIDIA_MCP61_2, "MCP61" }, + { HDA_NVIDIA_MCP65_1, "MCP65" }, + { HDA_NVIDIA_MCP65_2, "MCP65" }, + { HDA_NVIDIA_MCP67_1, "MCP67" }, + { HDA_NVIDIA_MCP67_2, "MCP67" }, + { HDA_NVIDIA_MCP73_1, "MCP73" }, + { HDA_NVIDIA_MCP73_2, "MCP73" }, + { HDA_NVIDIA_MCP78_1, "MCP78" }, + { HDA_NVIDIA_MCP78_2, "MCP78" }, + { HDA_NVIDIA_MCP78_3, "MCP78" }, + { HDA_NVIDIA_MCP78_4, "MCP78" }, + { HDA_NVIDIA_MCP79_1, "MCP79" }, + { HDA_NVIDIA_MCP79_2, "MCP79" }, + { HDA_NVIDIA_MCP79_3, "MCP79" }, + { HDA_NVIDIA_MCP79_4, "MCP79" }, + { HDA_NVIDIA_MCP89_1, "MCP89" }, + { HDA_NVIDIA_MCP89_2, "MCP89" }, + { HDA_NVIDIA_MCP89_3, "MCP89" }, + { HDA_NVIDIA_MCP89_4, "MCP89" }, + { HDA_NVIDIA_0BE2, "(0x0be2)" }, + { HDA_NVIDIA_0BE3, "(0x0be3)" }, + { HDA_NVIDIA_0BE4, "(0x0be4)" }, + { HDA_NVIDIA_GT100, "GT100" }, + { HDA_NVIDIA_GT104, "GT104" }, + { HDA_NVIDIA_GT106, "GT106" }, + { HDA_NVIDIA_GT108, "GT108" }, + { HDA_NVIDIA_GT116, "GT116" }, + { HDA_NVIDIA_GF119, "GF119" }, + { HDA_NVIDIA_GF110, "GF110" }, + { HDA_NVIDIA_GF114, "GF114" }, // HDMi + { HDA_NVIDIA_GK110, "GK110" }, + { HDA_NVIDIA_GK106, "GK106" }, + { HDA_NVIDIA_GK107, "GK107" }, + { HDA_NVIDIA_GK104, "GK104" }, //1002 Advanced Micro Devices [AMD] nee ATI Technologies Inc - { HDA_ATI_SB450, "IXP SB4x0" }, - { HDA_ATI_SB600, "SB600" }, - { HDA_ATI_RS600, "RS600" }, - { HDA_ATI_RS690, "RS690" }, - { HDA_ATI_RS780, "RS780" }, - { HDA_ATI_RS880, "RS880" }, - { HDA_ATI_TRINITY, "Trinity" }, - { HDA_ATI_R600, "R600" }, - { HDA_ATI_RV610, "RV610" }, - { HDA_ATI_RV620, "RV620" }, - { HDA_ATI_RV630, "RV630" }, - { HDA_ATI_RV635, "RV635" }, - { HDA_ATI_RV710, "RV710" }, - { HDA_ATI_RV730, "RV730" }, - { HDA_ATI_RV740, "RV740" }, - { HDA_ATI_RV770, "RV770" }, - { HDA_ATI_RV810, "RV810" }, - { HDA_ATI_RV830, "RV830" }, - { HDA_ATI_RV840, "RV840" }, - { HDA_ATI_RV870, "RV870" }, - { HDA_ATI_RV910, "Caicos" }, - { HDA_ATI_RV930, "RV930" }, - { HDA_ATI_RV940, "RV940" }, - { HDA_ATI_RV970, "RV970" }, - { HDA_ATI_R1000, "Tahiti XT" }, // HDMi - { HDA_ATI_VERDE, "Cape Verde" }, // HDMi + { HDA_ATI_SB450, "IXP SB4x0" }, + { HDA_ATI_SB600, "SB600" }, + { HDA_ATI_RS600, "RS600" }, + { HDA_ATI_RS690, "RS690" }, + { HDA_ATI_RS780, "RS780" }, + { HDA_ATI_RS880, "RS880" }, + { HDA_ATI_TRINITY, "Trinity" }, + { HDA_ATI_R600, "R600" }, + { HDA_ATI_RV610, "RV610" }, + { HDA_ATI_RV620, "RV620" }, + { HDA_ATI_RV630, "RV630" }, + { HDA_ATI_RV635, "RV635" }, + { HDA_ATI_RV710, "RV710" }, + { HDA_ATI_RV730, "RV730" }, + { HDA_ATI_RV740, "RV740" }, + { HDA_ATI_RV770, "RV770" }, + { HDA_ATI_RV810, "RV810" }, + { HDA_ATI_RV830, "RV830" }, + { HDA_ATI_RV840, "RV840" }, + { HDA_ATI_RV870, "RV870" }, + { HDA_ATI_RV910, "Caicos" }, + { HDA_ATI_RV930, "RV930" }, + { HDA_ATI_RV940, "RV940" }, + { HDA_ATI_RV970, "RV970" }, + { HDA_ATI_R1000, "Tahiti XT" }, // HDMi + { HDA_ATI_VERDE, "Cape Verde" }, // HDMi //17f3 RDC Semiconductor, Inc. - { HDA_RDC_M3010, "M3010" }, + { HDA_RDC_M3010, "M3010" }, //1106 VIA Technologies, Inc. - { HDA_VIA_VT82XX, "VT8251/8237A" }, + { HDA_VIA_VT82XX, "VT8251/8237A" }, //1039 Silicon Integrated Systems [SiS] - { HDA_SIS_966, "966" }, + { HDA_SIS_966, "966" }, //10b9 ULi Electronics Inc.(Split off ALi Corporation in 2003) - { HDA_ULI_M5461, "M5461" }, + { HDA_ULI_M5461, "M5461" }, /* Unknown */ - { HDA_INTEL_ALL, "Unknown Intel device" }, - { HDA_NVIDIA_ALL, "Unknown NVIDIA device" }, - { HDA_ATI_ALL, "Unknown ATI device" }, - { HDA_VIA_ALL, "Unknown VIA device" }, - { HDA_SIS_ALL, "Unknown SiS device" }, - { HDA_ULI_ALL, "Unknown ULI device" }, + { HDA_INTEL_ALL, "Unknown Intel device" }, + { HDA_NVIDIA_ALL, "Unknown NVIDIA device" }, + { HDA_ATI_ALL, "Unknown ATI device" }, + { HDA_VIA_ALL, "Unknown VIA device" }, + { HDA_SIS_ALL, "Unknown SiS device" }, + { HDA_ULI_ALL, "Unknown ULI device" }, }; #define HDAC_DEVICES_LEN (sizeof(know_hda_controller) / sizeof(know_hda_controller[0])) @@ -581,6 +583,7 @@ * The above case are intended as for HDEF device at address 0x001B0000 ***********************************************************************/ case HDA_INTEL_HASWELL: + case HDA_INTEL_HASWELL2: case HDA_INTEL_CRYSTAL: case HDA_INTEL_CPT: case HDA_INTEL_PATSBURG: @@ -595,6 +598,7 @@ case HDA_INTEL_PCH: case HDA_INTEL_PCH2: case HDA_INTEL_SCH: + case HDA_INTEL_SCH2: case HDA_INTEL_LPT1: case HDA_INTEL_LPT2: case HDA_INTEL_LYNX: @@ -614,9 +618,13 @@ verbose("Using default HDEF layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", default_HDEF_layout_id[0], default_HDEF_layout_id[1], default_HDEF_layout_id[2], default_HDEF_layout_id[3]); } - devprop_add_value(device, "layout-id", default_HDEF_layout_id, HDEF_LEN); - devprop_add_value(device, "built-in", &BuiltIn, 1); - devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "layout-id", default_HDEF_layout_id, HDEF_LEN); + devprop_add_value(device, "AAPL,slot-name", (uint8_t *)"Built-in", 9); // 0x09 + devprop_add_value(device, "name", (uint8_t *)"audio", 6); // 0x06 + devprop_add_value(device, "device_type", (uint8_t *)"High Definition Audio", 22); // 0x16 + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); // 0x0a + // "AFGLowPowerState" = <03000000> break; /**************************************************************************************************************** Index: branches/Chimera/i386/libsaio/hda.h =================================================================== --- branches/Chimera/i386/libsaio/hda.h (revision 2402) +++ branches/Chimera/i386/libsaio/hda.h (revision 2403) @@ -90,7 +90,8 @@ /* Intel */ #define INTEL_VENDORID 0x8086 -#define HDA_INTEL_HASWELL HDA_MODEL_CONSTRUCT(INTEL, 0x0c0c) +#define HDA_INTEL_HASWELL HDA_MODEL_CONSTRUCT(INTEL, 0x0a0c) +#define HDA_INTEL_HASWELL2 HDA_MODEL_CONSTRUCT(INTEL, 0x0c0c) #define HDA_INTEL_CRYSTAL HDA_MODEL_CONSTRUCT(INTEL, 0x0d0c) #define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_PATSBURG HDA_MODEL_CONSTRUCT(INTEL, 0x1d20) @@ -105,6 +106,7 @@ #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) +#define HDA_INTEL_SCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x8ca0) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8d20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) #define HDA_INTEL_LYNX HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) Index: branches/Chimera/i386/libsaio/disk.c =================================================================== --- branches/Chimera/i386/libsaio/disk.c (revision 2402) +++ branches/Chimera/i386/libsaio/disk.c (revision 2403) @@ -1576,7 +1576,8 @@ // getValueForKey uses const char for val // so copy it and trim *str = '\0'; - strncat(str, val, MIN(len, 4)); +// strncat(str, val, MIN(len, 4)); // removed since it breaks any OS X version greater than 10.9 i.e. Yosemite 10.10 + strncat(str, val, len); // just copy the whole version number instead } else { valid = false; } Index: branches/Chimera/i386/libsaio/smbios.c =================================================================== --- branches/Chimera/i386/libsaio/smbios.c (revision 2402) +++ branches/Chimera/i386/libsaio/smbios.c (revision 2403) @@ -694,6 +694,7 @@ case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) case CPU_MODEL_IVYBRIDGE_XEON: // Intel Core i7, Xeon E5 v2 LGA2011 (22nm) MacMan moved to proper location + case CPU_MODEL_HASWELL_SVR: // Intel Core i7, Xeon E5 v3 LGA2011v3 (22nm) defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion; defaultBIOSInfo.releaseDate = kDefaultMacProWestmereBIOSReleaseDate; defaultSystemInfo.productName = kDefaultMacProWestmere; Index: branches/Chimera/i386/libsaio/stringTable.c =================================================================== --- branches/Chimera/i386/libsaio/stringTable.c (revision 2402) +++ branches/Chimera/i386/libsaio/stringTable.c (revision 2403) @@ -60,7 +60,7 @@ break; } } else if (c == '\"') { - /* Premature end of key */ + // Premature end of key return 1; } if (c != *str++) { @@ -647,43 +647,70 @@ * Returns 0 - successful. * -1 - unsuccesful. */ -int loadChameleonConfig(config_file_t *config) +int loadChameleonConfig(config_file_t *config, BVRef chain) { char *dirspec[] = { - "rd(0,0)/Extra/org.chameleon.Boot.plist", "/Extra/org.chameleon.Boot.plist", - "bt(0,0)/Extra/org.chameleon.Boot.plist", - - "rd(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ "/Extra/com.apple.Boot.plist", /* DEPRECIATED */ - "bt(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ }; - int i, fd, count, ret=-1; + int i; for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) { - if ((fd = open(dirspec[i], 0)) >= 0) { - // Check for depreciated file names and annoy the user about it. - if(strstr(dirspec[i], "com.apple.Boot.plist")) { - printf("%s is depreciated.\n", dirspec[i]); - dirspec[i][strlen(dirspec[i]) - strlen("com.apple.Boot.plist")] = 0; - printf("Please use the file %sorg.chameleon.Boot.plist instead.\n", dirspec[i]); - pause(); + if ( loadChameleonConfigForDevice(config, "rd(0,0)", dirspec[i]) == 0 ) { + return 0; + } + if ( loadChameleonConfigForDevice(config, "", dirspec[i]) == 0 ) { + return 0; + } + if ( loadChameleonConfigForDevice(config, "bt(0,0)", dirspec[i]) == 0 ) { + return 0; + } + BVRef bvr; + for ( bvr = chain; bvr; bvr = bvr->next ) { /* C99 Error */ + char device[256]; + getDeviceDescription(bvr, device); + + if ( loadChameleonConfigForDevice(config, device, dirspec[i]) == 0 ) { + return 0; } - // read file - count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); - close(fd); - - // build xml dictionary - ParseXMLFile(config->plist, &config->dictionary); - sysConfigValid = true; - ret=0; - break; } } - return ret; + return -1; } +/* loadChameleonConfigForDevice + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadChameleonConfigForDevice(config_file_t *config, const char *device, const char *path) +{ + char full_path[1024]; + int fd; + + snprintf(full_path, sizeof(full_path), "%s%s", device, path); + + if ((fd = open(full_path, 0)) >= 0) { + // Check for depreciated file names and annoy the user about it. + if(strstr(full_path, "com.apple.Boot.plist")) { + printf("%s is depreciated.\n", full_path); + full_path[strlen(full_path) - strlen("com.apple.Boot.plist")] = 0; + printf("Please use the file %sorg.chameleon.Boot.plist instead.\n", full_path); + pause(); + } + // read file + read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + return 0; + } + return -1; +} + /* loadHelperConfig * * Returns 0 - successful. Index: branches/Chimera/i386/libsaio/saio_types.h =================================================================== --- branches/Chimera/i386/libsaio/saio_types.h (revision 2402) +++ branches/Chimera/i386/libsaio/saio_types.h (revision 2403) @@ -70,7 +70,7 @@ typedef struct { char plist[IO_CONFIG_DATA_SIZE]; // buffer for plist - TagPtr dictionary; // buffer for xml dictionary + TagPtr dictionary; // buffer for xml dictionary bool canOverride; // flag to mark a dictionary can be overriden } config_file_t; @@ -151,10 +151,10 @@ typedef void (*BVFree)(CICell ih); struct iob { - unsigned int i_flgs; /* see F_* below */ - unsigned int i_offset; /* seek byte offset in file */ - int i_filesize; /* size of file */ - char * i_buf; /* file load address */ + char * i_buf; /* file load address */ + unsigned int i_flgs; /* see F_* below */ + unsigned int i_offset; /* seek byte offset in file */ + int i_filesize; /* size of file */ }; #define BPS 512 /* sector size of the device */ @@ -212,7 +212,8 @@ kBVFlagBootable = 0x08, kBVFlagEFISystem = 0x10, kBVFlagBooter = 0x20, - kBVFlagSystemVolume = 0x40 + kBVFlagSystemVolume = 0x40, + kBVFlagInstallVolume = 0x80 }; enum { @@ -225,14 +226,21 @@ }; enum { - kPartitionTypeHFS = 0xAF, - kPartitionTypeHPFS = 0x07, - kPartitionTypeFAT16 = 0x06, - kPartitionTypeFAT32 = 0x0c, - kPartitionTypeEXT3 = 0x83, - kPartitionTypeBEFS = 0xEB, - kPartitionTypeFreeBSD = 0xa5, - kPartitionTypeOpenBSD = 0xa6 + //KPartitionTypeFAT12 = 0x01, // FAT12 + kPartitionTypeHPFS = 0x07, // Mac OS X + kPartitionTypeFAT16 = 0x06, // FAT16 + kPartitionTypeFAT32 = 0x0C, // FAT32 + kPartitionTypeEXT3 = 0x83, // Linux + kPartitionTypeOSXBoot = 0xAB, // Mac OS X Boot partition + kPartitionTypeFreeBSD = 0xA5, // FreeBSD + kPartitionTypeOpenBSD = 0xA6, // OpenBSD + //kPartitionTypeNeXTSTEP = 0xA7 // NeXTSTEP + //kPartitionTypeNetBSD = 0xA9 // NetBSD + kPartitionTypeHFS = 0xAF, // Mac OS X + //kPartitionTypeSolaris = 0xBE, // Solaris + kPartitionTypeBEFS = 0xEB, // BeOS BFS + //kPartitionTypeBeOS = 0xEB, // BeOS BFS + //kPartitionTypeSkyOS = 0xEC, // SkyOS }; //#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) Index: branches/Chimera/i386/libsaio/fake_efi.c =================================================================== --- branches/Chimera/i386/libsaio/fake_efi.c (revision 2402) +++ branches/Chimera/i386/libsaio/fake_efi.c (revision 2403) @@ -74,9 +74,10 @@ /* Identify ourselves as the EFI firmware vendor */ static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','2', 0}; -static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ - // Bungo +//static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ +static EFI_UINT32 const FIRMWARE_REVISION = 0x0001000a; // got from real MBP6,1 +// Bungo /* Default platform system_id (fix by IntVar) static EFI_CHAR8 const SYSTEM_ID[] = "0123456789ABCDEF"; //random value gen by uuidgen */ @@ -436,15 +437,17 @@ static const char FIRMWARE_REVISION_PROP[] = "firmware-revision"; static const char FIRMWARE_ABI_PROP[] = "firmware-abi"; static const char FIRMWARE_VENDOR_PROP[] = "firmware-vendor"; -static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; +//static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; static const char FIRMWARE_ABI_64_PROP_VALUE[] = "EFI64"; +static const char EFI_MODE_PROP[] = "efi-mode"; //Bungo static const char SYSTEM_ID_PROP[] = "system-id"; static const char SYSTEM_SERIAL_PROP[] = "SystemSerialNumber"; static const char SYSTEM_TYPE_PROP[] = "system-type"; static const char MODEL_PROP[] = "Model"; static const char BOARDID_PROP[] = "board-id"; static const char DEV_PATH_SUP[] = "DevicePathsSupported"; -static uint32_t DevPathSup = 1; +static EFI_UINT32 DevPathSup = 1; +static EFI_UINT32 MachineSig = 0; //Bungo /* * Get an smbios option string option to convert to EFI_CHAR16 string */ @@ -567,13 +570,15 @@ // But I think eventually we want to fill stuff in the efi node // too so we might as well create it so we have a pointer for it too. node = DT__AddChild(node, "efi"); - - if (archCpuType == CPU_TYPE_I386) { - DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE); - } else { - DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char*)FIRMWARE_ABI_64_PROP_VALUE); - } - + /* Bungo + if (archCpuType == CPU_TYPE_I386) { + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE); + } else { */ + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char *)FIRMWARE_ABI_64_PROP_VALUE); + // } + + DT__AddProperty(node, EFI_MODE_PROP, sizeof(EFI_UINT8), (EFI_UINT8 *)&bootArgs->efiMode); + DT__AddProperty(node, FIRMWARE_REVISION_PROP, sizeof(FIRMWARE_REVISION), (EFI_UINT32*)&FIRMWARE_REVISION); DT__AddProperty(node, FIRMWARE_VENDOR_PROP, sizeof(FIRMWARE_VENDOR), (EFI_CHAR16*)FIRMWARE_VENDOR); @@ -598,6 +603,11 @@ // all of the configuration tables needed by various kernel extensions. gEfiConfigurationTableNode = DT__AddChild(node, "configuration-table"); + // New node: /efi/kernel-compatibility + Node *efiKernelComNode = DT__AddChild(node, "kernel-compatibility"); + len = 1; + DT__AddProperty(efiKernelComNode, "x86_64", sizeof(uint32_t), (EFI_UINT32 *)&len); + // Now fill in the /efi/platform Node Node *efiPlatformNode = DT__AddChild(node, "platform"); @@ -618,7 +628,7 @@ DT__AddProperty(efiPlatformNode, CPU_Frequency_prop, sizeof(uint64_t), &Platform.CPU.CPUFrequency); } - DT__AddProperty(efiPlatformNode,DEV_PATH_SUP, sizeof(uint32_t), &DevPathSup); + DT__AddProperty(efiPlatformNode,DEV_PATH_SUP, sizeof(EFI_UINT32), &DevPathSup); // Bungo /* Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist @@ -669,16 +679,34 @@ { Node *chosenNode; chosenNode = DT__FindNode("/chosen", false); + static EFI_UINT8 const RANDOM_SEED[] = + { + 0x40, 0x00, 0x50, 0x00, 0x5c, 0x00, 0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, + 0x6d, 0x00, 0x5c, 0x00, 0x4c, 0x00, 0x69, 0x00, 0x62, 0x00, 0x72, 0x00, 0x61, 0x00, 0x72, 0x00, + 0x79, 0x00, 0x5c, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, 0x53, 0x00, 0x65, 0x00, + 0x72, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00, 0x65, 0x00, 0x73, 0x00, 0x5c, 0x00, 0x62, 0x00 + }; + + DT__AddProperty(chosenNode, "random-seed", sizeof(RANDOM_SEED), (EFI_UINT8*) &RANDOM_SEED); + if (chosenNode == 0) { stop("Couldn't get chosen node"); } - int bootUUIDLength = strlen(gBootUUIDString); - if (bootUUIDLength) + int length = strlen(gBootUUIDString); + if (length) { - DT__AddProperty(chosenNode, "boot-uuid", bootUUIDLength + 1, gBootUUIDString); + DT__AddProperty(chosenNode, "boot-uuid", length + 1, gBootUUIDString); } + + length = strlen(bootArgs->CommandLine); + DT__AddProperty(chosenNode, "boot-args", length + 1, bootArgs->CommandLine); + + length = strlen(bootInfo->bootFile); + DT__AddProperty(chosenNode, "boot-file", length + 1, bootInfo->bootFile); + + DT__AddProperty(chosenNode, "machine-signature", sizeof(EFI_UINT32), (EFI_UINT32 *)&MachineSig); } /* Index: branches/Chimera/i386/libsaio/smbios_getters.c =================================================================== --- branches/Chimera/i386/libsaio/smbios_getters.c (revision 2402) +++ branches/Chimera/i386/libsaio/smbios_getters.c (revision 2403) @@ -125,6 +125,7 @@ // MacMan the following CPUs have fixed DMI2 speeds case CPU_MODEL_IVYBRIDGE_XEON: // Intel Core i7, Xeon E5 v2 LGA2011 (22nm) case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL_SVR: // Intel Core i7, Xeon E5 LGA2011v3 { unsigned long dmi2speed; dmi2speed = 5000; @@ -162,7 +163,7 @@ if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) { // Intel if (!done) { - verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, (uint32_t)Platform.CPU.Family, (uint32_t)Platform.CPU.Model); +/* verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, (uint32_t)Platform.CPU.Family, (uint32_t)Platform.CPU.Model); */ done = true; } // Bungo: fixes Oem Processor Type - better matching IMHO Index: branches/Chimera/i386/libsaio/saio_internal.h =================================================================== --- branches/Chimera/i386/libsaio/saio_internal.h (revision 2402) +++ branches/Chimera/i386/libsaio/saio_internal.h (revision 2403) @@ -162,7 +162,8 @@ extern int loadConfigFile(const char *configFile, config_file_t *configBuff); extern int loadSystemConfig(config_file_t *configBuff); extern int loadHelperConfig(config_file_t *configBuff); -extern int loadChameleonConfig(config_file_t *configBuff); +extern int loadChameleonConfig(config_file_t *configBuff, BVRef chain); +extern int loadChameleonConfigForDevice(config_file_t *configBuff, const char *device, const char *path); extern char * newString(const char *oldString); extern char * getNextArg(char ** ptr, char * val); extern int ParseXMLFile( char * buffer, TagPtr * dict ); Index: branches/Chimera/i386/boot1/boot1h.s =================================================================== --- branches/Chimera/i386/boot1/boot1h.s (revision 2402) +++ branches/Chimera/i386/boot1/boot1h.s (revision 2403) @@ -74,7 +74,7 @@ kBoot1Sector1Addr EQU kBoot1RelocAddr + kSectorBytes ; boot1 load address for sector 1 kHFSPlusBuffer EQU kBoot1Sector1Addr + kSectorBytes ; HFS+ Volume Header address -kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Sectors EQU (480 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors kBoot2Segment EQU 0x2000 ; boot2 load segment kBoot2Address EQU kSectorBytes ; boot2 load address Index: branches/Chimera/i386/boot2/drivers.c =================================================================== --- branches/Chimera/i386/boot2/drivers.c (revision 2402) +++ branches/Chimera/i386/boot2/drivers.c (revision 2403) @@ -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); @@ -523,6 +523,7 @@ if (ret != 0) { break; } + // Allocate memory for the driver path and the plist. module->executablePath = tmpExecutablePath; @@ -837,14 +838,15 @@ static char gPlatformName[64]; #endif -long -DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize) +char *gDarwinBuildVerStr = "Darwin Kernel Version"; // Bungo + +long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize) { - long ret; - compressed_kernel_header * kernel_header = (compressed_kernel_header *) binary; - u_int32_t uncompressed_size, size; - void *buffer; - unsigned long len; + long ret = 0; + compressed_kernel_header * kernel_header = (compressed_kernel_header *) binary; + u_int32_t uncompressed_size = 0, size = 0, adler32 = 0; + void *buffer = NULL; + unsigned long len = 0; #if 0 printf("kernel header:\n"); @@ -858,11 +860,18 @@ if (kernel_header->signature == OSSwapBigToHostConstInt32('comp')) { - if (kernel_header->compress_type != OSSwapBigToHostConstInt32('lzss')) + if ((kernel_header->compress_type != OSSwapBigToHostConstInt32('lzss')) && + (kernel_header->compress_type != OSSwapBigToHostConstInt32('lzvn'))) { - error("kernel compression is bad\n"); + verbose ("Decompressing Kernel\n"); + error("ERROR: Invalid kernel compression\n"); return -1; } + if (kernel_header->compress_type == OSSwapBigToHostConstInt32('lzss')) + verbose ("Decompressing Kernel Using lzss\n"); + else + if (kernel_header->compress_type == OSSwapBigToHostConstInt32('lzvn')) + verbose ("Decompressing Kernel Using lzvn\n"); #if NOTDEF if (kernel_header->platform_name[0] && strcmp(gPlatformName, kernel_header->platform_name)) { @@ -873,24 +882,38 @@ return -1; } #endif - uncompressed_size = OSSwapBigToHostInt32(kernel_header->uncompressed_size); binary = buffer = malloc(uncompressed_size); - size = decompress_lzss((u_int8_t *) binary, &kernel_header->data[0], - OSSwapBigToHostInt32(kernel_header->compressed_size)); - if (uncompressed_size != size) { - error("size mismatch from lzss: %x\n", size); - return -1; - } - - if (OSSwapBigToHostInt32(kernel_header->adler32) != - Adler32(binary, uncompressed_size)) - { - printf("adler mismatch\n"); - return -1; - } - } + // MinusZwei + size = 0; + switch (kernel_header->compress_type) + { + case OSSwapBigToHostConstInt32('lzvn'): + size = decompress_lzvn( binary, uncompressed_size, &kernel_header->data[0], OSSwapBigToHostInt32(kernel_header->compressed_size)); + break; + + case OSSwapBigToHostConstInt32('lzss'): + size = decompress_lzss( (u_int8_t *)binary, uncompressed_size, &kernel_header->data[0], OSSwapBigToHostInt32(kernel_header->compressed_size)); + break; + + default: + break; + } + // MinusZwei + + if (uncompressed_size != size) { + error("ERROR: size mismatch from lzss (found: %x, expected: %x).\n", size, uncompressed_size); + return -1; + } + + adler32 = Adler32(binary, uncompressed_size); + if (OSSwapBigToHostInt32(kernel_header->adler32) != adler32) + { + error("ERROR: adler mismatch (found: %x, expected: %x).\n", adler32, OSSwapBigToHostInt32(kernel_header->adler32)); + return -1; + } + } ret = ThinFatFile(&binary, &len); if (ret == 0 && len == 0 && archCpuType==CPU_TYPE_X86_64) @@ -899,6 +922,13 @@ ret = ThinFatFile(&binary, &len); } + // Bungo: no range checking, sorry + size = 0; + while (memcmp((uint8_t *)binary + size, (uint8_t *)gDarwinBuildVerStr, 21)) { + size++; + } + gDarwinBuildVerStr = (char *)binary + size; + // Notify modules that the kernel has been decompressed, thinned and is about to be decoded execute_hook("DecodeKernel", (void*)binary, NULL, NULL, NULL); Index: branches/Chimera/i386/boot2/prompt.c =================================================================== --- branches/Chimera/i386/boot2/prompt.c (revision 2402) +++ branches/Chimera/i386/boot2/prompt.c (revision 2403) @@ -28,7 +28,7 @@ #include -char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chameleon v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n" + char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chameleon v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n" "Build date: " I386BOOT_BUILDDATE "\n" "%dMB memory\n"; Index: branches/Chimera/i386/boot2/Makefile =================================================================== --- branches/Chimera/i386/boot2/Makefile (revision 2402) +++ branches/Chimera/i386/boot2/Makefile (revision 2403) @@ -42,7 +42,7 @@ # The ordering is important; # boot2.o must be first. -OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ +OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o lzvn.o mboot.o \ ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o \ modules_support.o boot_modules.o # button.o browser.o scrollbar.o == NOTYET Index: branches/Chimera/i386/boot2/boot.c =================================================================== --- branches/Chimera/i386/boot2/boot.c (revision 2402) +++ branches/Chimera/i386/boot2/boot.c (revision 2403) @@ -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,9 +195,8 @@ 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 execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgs, NULL, NULL); @@ -239,13 +236,13 @@ if (cacheFile[0] != 0) { strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); - } - else - { + verbose("Specified kernel cache file path = %s\n", cacheFile); + } 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); + verbose("Kernel cache file path = %s\n", kernelCacheFile); } // Snow Leopard prelink kernel cache file else if (checkOSVersion("10.6")) { @@ -266,6 +263,7 @@ prev_time = time; } } + verbose("Snow Leopard Kernel cache file path = %s\n", kernelCacheFile); } closedir(cacheDir); } else { @@ -309,7 +307,7 @@ // Exit if kernel cache file wasn't found if (ret == -1) { - verbose("No Kernel Cache File '%s' found\n", kernelCacheFile); + verbose("Kernel Cache File '%s' not found\n", kernelCacheFile); return -1; } @@ -328,7 +326,7 @@ // Check if the S/L/E directory time is more recent than the cache file if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) && (exttime > cachetime)) { - verbose("/System/Library/Extensions is more recent than KernelCache (%s), ignoring KernelCache\n", + verbose("Contents of /System/Library/Extensions is more recent than KernelCache (%s), ignoring KernelCache\n", kernelCacheFile); return -1; } @@ -379,12 +377,13 @@ // Record the device that the booter was loaded from. gBIOSDev = biosdev & kBIOSDevMask; + + // Initialize boot-log + initBooterLog(); // Initialize boot info structure. initKernBootStruct(); - initBooterLog(); - // Setup VGA text mode. // Not sure if it is safe to call setVideoMode() before the // config table has been loaded. Call video_mode() instead. @@ -405,7 +404,7 @@ setBootGlobals(bvChain); // Load boot.plist config file - status = loadChameleonConfig(&bootInfo->chameleonConfig); + status = loadChameleonConfig(&bootInfo->chameleonConfig, bvChain); if (getBoolForKey(kQuietBootKey, &quiet, &bootInfo->chameleonConfig) && quiet) { gBootMode |= kBootModeQuiet; @@ -533,9 +532,6 @@ updateVRAM(); } - // Find out which version mac os we're booting. - getOSVersion(); - if (platformCPUFeature(CPU_FEATURE_EM64T)) { archCpuType = CPU_TYPE_X86_64; } else { @@ -603,7 +599,7 @@ HibernateBoot((char *)val); break; } - + verbose("Loading Darwin %s\n", gMacOSVersion); getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig); @@ -623,14 +619,12 @@ } if (gOverrideKernel && kernelCacheFile[0] == 0) { - verbose("Using a non default kernel (%s) without specifying 'Kernel Cache' path, KernelCache will not be used\n", - bootInfo->bootFile); + verbose("Using a non default kernel (%s) without specifying 'Kernel Cache' path, KernelCache will not be used\n", bootInfo->bootFile); useKernelCache = false; break; } if (gMKextName[0] != 0) { - verbose("Using a specific MKext Cache (%s), KernelCache will not be used\n", - gMKextName); + verbose("Using a specific MKext Cache (%s), KernelCache will not be used\n", gMKextName); useKernelCache = false; break; } @@ -655,9 +649,15 @@ // 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 / - else + { + if (checkOSVersion("10.10")) { + snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathYosemite"%s", bootInfo->bootFile); // for Yosemite + } else { + snprintf(bootFile, sizeof(bootFile), kDefaultKernelPath"%s", bootInfo->bootFile); // append a leading / + } + } else { strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile)); + } // Try to load kernel image from alternate locations on boot helper partitions. ret = -1; @@ -675,7 +675,8 @@ } } } - if (ret == -1) { + if (ret == -1) + { // No alternate location found, using the original kernel image path. strlcpy(bootFilePath, bootFile, sizeof(bootFilePath)); } @@ -749,15 +750,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])) { + 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: branches/Chimera/i386/boot2/boot.h =================================================================== --- branches/Chimera/i386/boot2/boot.h (revision 2402) +++ branches/Chimera/i386/boot2/boot.h (revision 2403) @@ -32,44 +32,53 @@ * Paths used by chameleon */ +//kernel path +#define kDefaultKernelPath "/" +#define kDefaultKernelPathYosemite "/System/Library/Kernels/" + //kernel cache -#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/" -#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/" +#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/" +#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/" // Lion installer -#define kLionInstallerDataFolder "/Mac OS X Install Data/" -#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist" +#define kLionInstallerDataFolder "/Mac OS X Install Data/" +#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist" +// Mountain Lion installer +#define kMLionInstallerDataFolder "/OS X Install Data/" +#define kMLionInstallerPlist kMLionInstallerDataFolder "com.apple.Boot.plist" + /* * Keys used in system Boot.plist */ -#define kGraphicsModeKey "Graphics Mode" -#define kTextModeKey "Text Mode" -#define kQuietBootKey "Quiet Boot" -#define kKernelFlagsKey "Kernel Flags" -#define kKernelArchKey "Kernel Architecture" -#define kMKextCacheKey "MKext Cache" -#define kKernelNameKey "Kernel" -#define kKernelCacheKey "Kernel Cache" -#define kUseKernelCache "UseKernelCache" /* boot.c */ -#define kBootDeviceKey "Boot Device" -#define kTimeoutKey "Timeout" -#define kRootDeviceKey "rd" -#define kBootUUIDKey "boot-uuid" -#define kHelperRootUUIDKey "Root UUID" -#define kPlatformKey "platform" -#define kACPIKey "acpi" -#define kCDROMPromptKey "CD-ROM Prompt" -#define kCDROMOptionKey "CD-ROM Option Key" -#define kRescanPromptKey "Rescan Prompt" -#define kRescanKey "Rescan" -#define kScanSingleDriveKey "Scan Single Drive" -#define kInstantMenuKey "Instant Menu" -#define kDefaultKernel "mach_kernel" -#define kGUIKey "GUI" -#define kBootBannerKey "Boot Banner" -#define kShowInfoKey "ShowInfo" /* gui.c */ -#define kWaitForKeypressKey "Wait" +#define kGraphicsModeKey "Graphics Mode" +#define kTextModeKey "Text Mode" +#define kQuietBootKey "Quiet Boot" +#define kKernelFlagsKey "Kernel Flags" +#define kKernelArchKey "Kernel Architecture" +#define kMKextCacheKey "MKext Cache" +#define kKernelNameKey "Kernel" +#define kKernelCacheKey "Kernel Cache" +#define kUseKernelCache "UseKernelCache" /* boot.c */ +#define kBootDeviceKey "Boot Device" +#define kTimeoutKey "Timeout" +#define kRootDeviceKey "rd" +#define kBootUUIDKey "boot-uuid" +#define kHelperRootUUIDKey "Root UUID" +#define kPlatformKey "platform" +#define kACPIKey "acpi" +#define kCDROMPromptKey "CD-ROM Prompt" +#define kCDROMOptionKey "CD-ROM Option Key" +#define kRescanPromptKey "Rescan Prompt" +#define kRescanKey "Rescan" +#define kScanSingleDriveKey "Scan Single Drive" +#define kInstantMenuKey "Instant Menu" +#define kDefaultKernel "mach_kernel" +#define kDefaultKernelYosemite "kernel" +#define kGUIKey "GUI" +#define kBootBannerKey "Boot Banner" +#define kShowInfoKey "ShowInfo" /* gui.c */ +#define kWaitForKeypressKey "Wait" /* AsereBLN: added these keys */ #define kUseAtiROM "UseAtiROM" /* ati.c */ @@ -253,6 +262,7 @@ /* * drivers.c */ +extern char *gDarwinBuildVerStr; // Bungo extern long LoadExtraDrivers(char * dirSpec); extern long LoadDrivers(char * dirSpec); extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize); @@ -286,8 +296,15 @@ /* * lzss.c */ -extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen); +extern int decompress_lzss(u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen); +extern u_int8_t *compress_lzss(u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srcLen); +/* + * lzvn.c + */ +extern size_t decompress_lzvn(void * _dest, size_t _dest_size, void * _src, size_t _src_size); +// extern u_int8_t *compress_lzvn(u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srcLen); + struct compressed_kernel_header { u_int32_t signature; u_int32_t compress_type; @@ -307,4 +324,6 @@ /* bmdecompress.c */ void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel); +bool checkOSVersion(const char * version); + #endif /* !__BOOT2_BOOT_H */ Index: branches/Chimera/i386/boot2/gui.c =================================================================== --- branches/Chimera/i386/boot2/gui.c (revision 2402) +++ branches/Chimera/i386/boot2/gui.c (revision 2403) @@ -43,7 +43,9 @@ iDeviceGeneric_o, iDeviceHFS, iDeviceHFS_o, - iDeviceHFS_mav, + iDeviceHFS_yos, + iDeviceHFS_yos_o, + iDeviceHFS_mav, iDeviceHFS_mav_o, iDeviceHFS_ML, iDeviceHFS_ML_o, @@ -58,6 +60,8 @@ iDeviceHFSRAID, iDeviceHFSRAID_o, + iDeviceHFSRAID_yos, + iDeviceHFSRAID_yos_o, iDeviceHFSRAID_mav, iDeviceHFSRAID_mav_o, iDeviceHFSRAID_ML, @@ -70,6 +74,7 @@ iDeviceHFSRAID_Leo_o, iDeviceHFSRAID_Tiger, iDeviceHFSRAID_Tiger_o, + iDeviceEXT3, iDeviceEXT3_o, iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ @@ -123,7 +128,9 @@ {.name = "device_generic_o", .image = NULL}, {.name = "device_hfsplus", .image = NULL}, {.name = "device_hfsplus_o", .image = NULL}, - {.name = "device_hfsplus_mav", .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}, {.name = "device_hfsplus_ml_o", .image = NULL}, @@ -138,6 +145,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}, @@ -150,6 +159,7 @@ {.name = "device_hfsraid_leo_o", .image = NULL}, {.name = "device_hfsraid_tiger", .image = NULL}, {.name = "device_hfsraid_tiger_o", .image = NULL}, + {.name = "device_ext3", .image = NULL}, {.name = "device_ext3_o", .image = NULL}, {.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ @@ -351,6 +361,8 @@ LOADPNG(device_generic_o, iDeviceGeneric); LOADPNG(device_hfsplus, iDeviceGeneric); LOADPNG(device_hfsplus_o, iDeviceHFS); + LOADPNG(device_hfsplus_yos, iDeviceHFS); + LOADPNG(device_hfsplus_yos_o, iDeviceHFS_yos); LOADPNG(device_hfsplus_mav, iDeviceHFS); LOADPNG(device_hfsplus_mav_o, iDeviceHFS_mav); LOADPNG(device_hfsplus_ml, iDeviceHFS); @@ -366,6 +378,8 @@ LOADPNG(device_hfsraid, iDeviceHFS); LOADPNG(device_hfsraid_o, iDeviceHFSRAID); + LOADPNG(device_hfsraid_yos, iDeviceHFSRAID); + LOADPNG(device_hfsraid_yos_o, iDeviceHFSRAID_yos); LOADPNG(device_hfsraid_mav, iDeviceHFSRAID); LOADPNG(device_hfsraid_mav_o, iDeviceHFSRAID_mav); LOADPNG(device_hfsraid_ml, iDeviceHFSRAID); @@ -933,6 +947,11 @@ { // Use HFS or HFSRAID icon depending on bvr flags. Fallbacks are handled by alt_image above. switch (device->OSVersion[3]) { + case '1': + if ((device->OSVersion[4]) == '0') { + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_yos : iDeviceHFS_yos); + break; + } case '9': devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_mav : iDeviceHFS_mav); break; Index: branches/Chimera/i386/boot2/lzss.c =================================================================== --- branches/Chimera/i386/boot2/lzss.c (revision 2402) +++ branches/Chimera/i386/boot2/lzss.c (revision 2403) @@ -64,12 +64,12 @@ int match_position, match_length; }; -int -decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen) +int decompress_lzss( u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen ) { /* ring buffer of size N, with extra F-1 bytes to aid string comparison */ u_int8_t text_buf[N + F - 1]; u_int8_t *dststart = dst; + u_int8_t *dstend = dst + dstlen; u_int8_t *srcend = src + srclen; int i, j, k, r, c; unsigned int flags; @@ -88,6 +88,9 @@ if (flags & 1) { if (src < srcend) c = *src++; else break; *dst++ = c; + if (dst >= dstend) { + goto finish; + } text_buf[r++] = c; r &= (N - 1); } else { @@ -98,12 +101,15 @@ for (k = 0; k <= j; k++) { c = text_buf[(i + k) & (N - 1)]; *dst++ = c; + if (dst >= dstend) { + goto finish; + } text_buf[r++] = c; r &= (N - 1); } } } - +finish: return dst - dststart; } @@ -221,23 +227,20 @@ sp->parent[p] = NIL; } -u_int8_t *compress_lzss( - u_int8_t * dst, - u_int32_t dstlen, - u_int8_t * src, - u_int32_t srclen) +u_int8_t *compress_lzss( u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen ) { - u_int8_t * result = NULL; /* Encoding state, mostly tree but some current match stuff */ struct encode_state *sp; + int i, c, len, r, s, last_match_length, code_buf_ptr; u_int8_t code_buf[17], mask; - u_int8_t * srcend = src + srclen; + u_int8_t *srcend = src + srclen; u_int8_t *dstend = dst + dstlen; + /* initialize trees */ sp = (struct encode_state *) malloc(sizeof(*sp)); - if (!sp) goto finish; init_state(sp); + /* * code_buf[1..16] saves eight units of code, and code_buf[0] works * as eight flags, "1" representing that the unit is an unencoded @@ -246,13 +249,16 @@ */ code_buf[0] = 0; code_buf_ptr = mask = 1; + /* Clear the buffer with any character that will appear often. */ s = 0; r = N - F; + /* Read F bytes into the last F bytes of the buffer */ for (len = 0; len < F && src < srcend; len++) sp->text_buf[r + len] = *src++; if (!len) - goto finish; + return (void *) 0; /* text of size zero */ + /* * Insert the F strings, each of which begins with one or more * 'space' characters. Note the order in which these strings are @@ -260,6 +266,7 @@ */ for (i = 1; i <= F; i++) insert_node(sp, r - i); + /* * Finally, insert the whole string just read. * The global variables match_length and match_position are set. @@ -286,7 +293,7 @@ if (dst < dstend) *dst++ = code_buf[i]; else - goto finish; + return (void *) 0; code_buf[0] = 0; code_buf_ptr = mask = 1; } @@ -295,20 +302,24 @@ delete_node(sp, s); /* Delete old strings and */ c = *src++; sp->text_buf[s] = c; /* read new bytes */ + /* * If the position is near the end of buffer, extend the buffer * to make string comparison easier. */ if (s < F - 1) sp->text_buf[s + N] = c; + /* Since this is a ring buffer, increment the position modulo N. */ s = (s + 1) & (N - 1); r = (r + 1) & (N - 1); + /* Register the string in text_buf[r..r+F-1] */ insert_node(sp, r); } while (i++ < last_match_length) { delete_node(sp, s); + /* After the end of text, no need to read, */ s = (s + 1) & (N - 1); r = (r + 1) & (N - 1); @@ -317,15 +328,13 @@ insert_node(sp, r); } } while (len > 0); /* until length of string to be processed is zero */ + if (code_buf_ptr > 1) { /* Send remaining code. */ for (i = 0; i < code_buf_ptr; i++) if (dst < dstend) *dst++ = code_buf[i]; else - goto finish; + return (void *) 0; } - result = dst; -finish: - if (sp) free(sp); - return result; + return dst; } Index: branches/Chimera/i386/boot2/options.c =================================================================== --- branches/Chimera/i386/boot2/options.c (revision 2402) +++ branches/Chimera/i386/boot2/options.c (revision 2403) @@ -32,6 +32,12 @@ #include "pci.h" #include "modules.h" +#if DEBUG +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + bool showBootBanner = true; //Azi:showinfo static bool shouldboot = false; @@ -1093,7 +1099,9 @@ int len = argLen + cnt + 1; // +1 to account for space if (argName) + { len++; // +1 to account for '=' + } if (len > *cntRemainingP) { error("Warning: boot arguments too long, truncating\n"); @@ -1193,7 +1201,11 @@ else { return -1; } - + + // Find out which version mac os we're booting. + strlcpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion)); +// printf("OS Version Booted %s\n", gBootVolume->OSVersion); + // Load config table specified by the user, or use the default. if (!getValueForBootKey(cp, "config", &val, &cnt)) { @@ -1205,7 +1217,7 @@ // and use its contents to override default bootConfig. loadSystemConfig(&bootInfo->bootConfig); - loadChameleonConfig(&bootInfo->chameleonConfig); + loadChameleonConfig(&bootInfo->chameleonConfig, NULL); // Use the kernel name specified by the user, or fetch the name // in the config table, or use the default if not specified. @@ -1215,16 +1227,23 @@ // to be used. gOverrideKernel = false; - if (( kernel = extractKernelName((char **)&cp) )) { + if (( kernel = extractKernelName((char **)&cp) )) + { strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) ); } else { - if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) { + 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, kDefaultKernelYosemite, 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, kDefaultKernelYosemite ) != 0)) + { gOverrideKernel = true; } @@ -1233,7 +1252,8 @@ // Get config kernel flags, if not ignored. if (getValueForBootKey(cp, kIgnoreBootFileFlag, &val, &cnt) || - !getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig )) { + !getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig )) + { val = ""; cnt = 0; } @@ -1242,51 +1262,68 @@ // boot-uuid can be set either on the command-line or in the config file if (!processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config, - &argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) { + &argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) + { // // Try an alternate method for getting the root UUID on boot helper partitions. // - if (gBootVolume->flags & kBVFlagBooter) { + if (gBootVolume->flags & kBVFlagBooter) + { // Load the configuration store in the boot helper partition - if (loadHelperConfig(&bootInfo->helperConfig) == 0) { + if (loadHelperConfig(&bootInfo->helperConfig) == 0) + { val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig); - if (val != NULL) { + if (val != NULL) + { strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString)); } } } - +/* // Try to get the volume uuid string - if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) { + if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) + { gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString); } - +*/ // If we have the volume uuid add it to the commandline arguments - if (strlen(gBootUUIDString)) { + if (strlen(gBootUUIDString)) + { copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining); } + // Try to get the volume uuid string + if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) + { + gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString); + DBG("boot-uuid: %s\n", gBootUUIDString); + } } if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, - &argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) { + &argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) + { cnt = 0; - if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) { + if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) + { valueBuffer[0] = '*'; cnt++; strlcpy(valueBuffer + 1, val, cnt); val = valueBuffer; - } else { - if (strlen(gBootUUIDString)) { + } else { /* + if (strlen(gBootUUIDString)) + { val = "*uuid"; cnt = 5; - } else { + } else { */ // Don't set "rd=.." if there is no boot device key // and no UUID. val = ""; cnt = 0; - } - } - if (cnt > 0) { + /* } */ + } + + if (cnt > 0) + { copyArgument( kRootDeviceKey, val, cnt, &argP, &cntRemaining); } strlcpy( gRootDevice, val, (cnt + 1)); @@ -1296,15 +1333,18 @@ * Removed. We don't need this anymore. * if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, - &argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) { + &argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) + { getPlatformName(gPlatformName); copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining); } */ if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) && - !getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) { - if (gBootMode & kBootModeSafe) { + !getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) + { + if (gBootMode & kBootModeSafe) + { copyArgument(0, kSafeModeFlag, strlen(kSafeModeFlag), &argP, &cntRemaining); } } @@ -1312,8 +1352,10 @@ // Store the merged kernel flags and boot args. cnt = strlen(configKernelFlags); - if (cnt) { - if (cnt > cntRemaining) { + if (cnt) + { + if (cnt > cntRemaining) + { error("Warning: boot arguments too long, truncating\n"); cnt = cntRemaining; } @@ -1322,26 +1364,30 @@ cntRemaining -= cnt; } userCnt = strlen(cp); - if (userCnt > cntRemaining) { + if (userCnt > cntRemaining) + { error("Warning: boot arguments too long, truncating\n"); userCnt = cntRemaining; } strncpy(&argP[cnt], cp, userCnt); argP[cnt+userCnt] = '\0'; - if(!shouldboot) { + if(!shouldboot) + { gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) || getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->chameleonConfig ); gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) ? kBootModeSafe : kBootModeNormal; - if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) { + if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) + { gBootMode = kBootModeSafe; } } - if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) { + if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) + { strlcpy(gMKextName, val, cnt + 1); } else { gMKextName[0]=0; Index: branches/Chimera/Make.rules =================================================================== --- branches/Chimera/Make.rules (revision 2402) +++ branches/Chimera/Make.rules (revision 2403) @@ -17,7 +17,7 @@ NASM = $(shell which nasm) -p $(SRCROOT)/autoconf.inc -CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror -Wno-unused-function +CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror -Wno-unused-function -Wno-int-conversion CPPFLAGS = $(MORECPP) -g -Wmost -Werror -fno-exceptions -fno-rtti -ffreestanding DEFINES=