Index: trunk/i386/libsaio/xml.c =================================================================== --- trunk/i386/libsaio/xml.c (revision 2886) +++ trunk/i386/libsaio/xml.c (revision 2887) @@ -592,25 +592,6 @@ } } - - /***** false ****/ - else if (!strncmp(tagName, kXMLTagFalse, sizeof(kXMLTagFalse))) - { - length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse); - } - - /***** true ****/ - else if (!strncmp(tagName, kXMLTagTrue, sizeof(kXMLTagTrue))) - { - length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue); - } - - /***** plist ****/ - - - /***** dict ****/ - - /***** data ****/ else if (!strncmp(tagName, kXMLTagData, sizeof(kXMLTagData))) { @@ -631,6 +612,19 @@ { length = ParseTagDate(buffer + pos, tag); } + + /***** false ****/ + else if (!strncmp(tagName, kXMLTagFalse, sizeof(kXMLTagFalse))) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse); + } + + /***** true ****/ + else if (!strncmp(tagName, kXMLTagTrue, sizeof(kXMLTagTrue))) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue); + } + /***** array ****/ else if (!strncmp(tagName, kXMLTagArray, sizeof(kXMLTagArray) )) { @@ -911,10 +905,11 @@ // ParseTagData static long ParseTagData( char *buffer, TagPtr *tag) { - int actuallen = 0; - long length = 0; + //int actuallen = 0; + int len = 0; + long length = 0; TagPtr tmpTag; - char *string; + char *tmpString; length = FixDataMatchingTag(buffer, kXMLTagData); if (length == -1) @@ -927,18 +922,14 @@ { return -1; } - - //printf("ParseTagData unimplimented\n"); - //printf("Data: %s\n", buffer); - // getchar(); - - string = BASE64Decode(buffer, strlen(buffer), &actuallen); + tmpString = NewSymbol(buffer); tmpTag->type = kTagTypeData; - tmpTag->string = string; + tmpTag->string = tmpString; + tmpTag->data = (UInt8 *)BASE64Decode(buffer, strlen(buffer), &len); + tmpTag->dataLen = len; tmpTag->tag = NULL; - tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0; - + tmpTag->offset = /* actuallen; */ buffer_start ? buffer - buffer_start: 0; tmpTag->tagNext = NULL; *tag = tmpTag; @@ -1106,6 +1097,8 @@ { tag[cnt].type = kTagTypeNone; tag[cnt].string = 0; + tag[cnt].data = 0; + tag[cnt].dataLen = 0; tag[cnt].tag = 0; tag[cnt].tagNext = tag + cnt + 1; } @@ -1141,6 +1134,8 @@ // Clear and free the tag. tag->type = kTagTypeNone; tag->string = NULL; + tag->data = NULL; + tag->dataLen = 0; tag->tag = NULL; tag->offset = 0; tag->tagNext = gTagsFree; @@ -1182,6 +1177,7 @@ if (symbol == NULL) { stop("NULL symbol!"); + return NULL; } // Set the symbol's data. Index: trunk/i386/libsaio/xml.h =================================================================== --- trunk/i386/libsaio/xml.h (revision 2886) +++ trunk/i386/libsaio/xml.h (revision 2887) @@ -62,6 +62,8 @@ #define kXMLTagReference "reference" #define kXMLStringID "ID=" #define kXMLStringIDRef "IDREF=" +#define kXMLStringIDRefs "IDREFS=" +#define kXMLTagSIZE "size=" #define kPropCFBundleIdentifier ("CFBundleIdentifier") #define kPropCFBundleExecutable ("CFBundleExecutable") Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 2886) +++ trunk/i386/libsaio/nvidia.c (revision 2887) @@ -1252,7 +1252,7 @@ // { 0x10DE11E7, "GeForce " }, // GK106M // 11F0 - 11FF { 0x10DE11FA, "Quadro K4000" }, - { 0x10DE11FC, "Quadro 2100M" }, + { 0x10DE11FC, "Quadro K2100M" }, { 0x10DE11FF, "NB1Q" }, // // 1200 - 120F { 0x10DE1200, "GeForce GTX 560 Ti" }, @@ -1323,6 +1323,7 @@ { 0x10DE134E, "GeForce 930MX" }, // GM108M { 0x10DE134F, "GeForce 920MX" }, // GM108M { 0x10DE137A, "Quadro K620M/M500M" }, // GM108GLM + { 0x10DE137B, "Quadro M520" }, { 0x10DE137D, "GeForce 940A" }, // GM108M { 0x10DE1380, "GeForce GTX 750 Ti" }, { 0x10DE1381, "GeForce GTX 750" }, @@ -1345,6 +1346,8 @@ { 0x10DE13B1, "Quadro M1000M" }, // GM107GLM { 0x10DE13B2, "Quadro M600M" }, // GM107GLM { 0x10DE13B3, "Quadro K2200M" }, // GM107GLM + { 0x10DE13B4, "Quadro M620" }, + { 0x10DE13B6, "Quadro M1200" }, { 0x10DE13B9, "NVS 810" }, // GM107GL { 0x10DE13BA, "Quadro K2200" }, { 0x10DE13BB, "Quadro K620" }, @@ -1376,6 +1379,7 @@ { 0x10DE1427, "GeForce GTX 965M" }, // GM206M { 0x10DE1430, "Quadro M2000" }, // { 0x10DE1431, "Tesla M4" }, // GM206GL + { 0x10DE1436, "Quadro M2200" }, // { 0x10DE143F, "Graphics Device" }, // // { 0x10DE1600, "Graphics Device" }, // // { 0x10DE1601, "Graphics Device" }, // @@ -1425,12 +1429,16 @@ { 0x10DE1BB0, "Quadro P5000" }, // GP104GL // { 0x10DE1BB1, "Graphics Device" }, // GP104GL // { 0x10DE1BB4, "Graphics Device" }, // GP104GL + { 0x10DE1BB6, "Quadro P5000" }, + { 0x10DE1BB7, "Quadro P4000" }, + { 0x10DE1BB8, "Quadro P3000" }, { 0x10DE1BE0, "GeForce GTX 1080" }, //GP104M { 0x10DE1BE1, "GeForce GTX 1070" }, //GP104M // { 0x10DE1C00, "Graphics Device" }, // GP106 // { 0x10DE1C01, "Graphics Device" }, // GP106 { 0x10DE1C02, "GeForce GTX 1060"}, // GP106 { 0x10DE1C03, "GeForce GTX 1060"}, // GP106 +// { 0x10DE1C07, "NVIDIA CMP6-1"}, // { 0x10DE1c20, "GeForce GTX 1060" }, //GP106M // { 0x10DE1C30, "Graphics Device" }, // GP106GL { 0x10DE1C60, "GeForce GTX 1060" }, // GP106M @@ -1438,6 +1446,9 @@ // { 0x10DE1C80, "Graphics Device" }, // GP107 // { 0x10DE1C81, "Graphics Device" }, // GP107 { 0x10DE1C82, "GeForce GTX 1050 Ti"}, // GP107 + // 1D00 - 1EFFF + { 0x10DE1D10, "GeForce MX150"}, + }; static nvidia_card_info_t nvidia_card_exceptions[] = { @@ -1610,6 +1621,8 @@ { 0x10DE1140, 0x10280565, "Dell GeForce GT 630M" }, { 0x10DE1140, 0x10280568, "Dell GeForce GT 630M" }, { 0x10DE1140, 0x144DC0D5, "Samsung GeForce GT 630M" }, + { 0x10DE1140, 0x17AA2200, "nVidia NVS 5200M" }, + { 0x10DE1140, 0x17AA2213, "nVidia GeForce GT 720M" }, { 0x10DE1140, 0x17AA500D, "Lenovo GeForce GT 620M" }, { 0x10DE1140, 0x1B0A20DD, "Pegatron GeForce GT 620M" }, { 0x10DE1140, 0x1B0A20FD, "Pegatron GeForce GT 620M" }, Index: trunk/i386/libsaio/ati.c =================================================================== --- trunk/i386/libsaio/ati.c (revision 2886) +++ trunk/i386/libsaio/ati.c (revision 2887) @@ -103,9 +103,9 @@ {"Maguro", 1}, {"MaguroS", 6}, /* AMD8000Controller */ + {"Exmoor", 6}, {"Baladi", 6}, /* AMD9000Controller */ - {"Exmoor", 6}, {"MalteseS", 1}, {"Lagotto", 4}, {"GreyhoundS", 1}, @@ -113,14 +113,23 @@ {"Basset", 4}, {"Greyhound", 6}, {"Labrador", 6}, + /* AMD9300Controller */ + {"FlueveSWIP", 4}, /* AMD9500Controller */ - {"Elqui", 5}, {"Acre", 3}, + {"Dayman", 6}, + {"Guariba", 6}, + {"Huallaga", 3}, + {"Orinoco", 5}, + /* AMD9510Controller */ {"Berbice", 5}, + /* AMD9515Controller */ + {"Mazaruni", 5}, + {"Longavi", 5}, + /* AMD9520Controller */ + {"Elqui", 5}, {"Caroni", 5}, - {"Florin", 6}, - {"Dayman", 6}, - {"Guariba", 6} + {"Florin", 6} }; static radeon_card_info_t radeon_cards[] = { @@ -1185,15 +1194,16 @@ { 0x6763, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon E6460 Series", kHydrilla }, { 0x6768, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400M Series", kHydrilla }, { 0x6770, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400 Series", kBulrushes }, + { 0x6771, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8490", kBulrushes }, { 0x6772, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400A Series", kBulrushes }, - { 0x6778, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7000 Series", kBulrushes }, + { 0x6778, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470", kBulrushes }, { 0x6779, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450/7450/8450/R5 230", kBulrushes }, { 0x677B, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400 Series", kBulrushes }, // TAHITI //Framebuffers: Aji - 4 Desktop, Buri - 4 Mobile, Chutoro - 5 Mobile, Dashimaki - 4, IkuraS - HMDI // Ebi - 5 Mobile, Gari - 5 M, Futomaki - 4 D, Hamachi - 4 D, OPM - 6 Server, Ikura - 6 - { 0x6780, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kIkuraS }, + { 0x6780, 0x00000000, CHIP_FAMILY_TAHITI, "AMD FirePro W9000", kIkuraS }, { 0x6784, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, { 0x6788, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, { 0x678A, 0x00000000, CHIP_FAMILY_TAHITI, "AMD FirePro W8000", kFutomaki }, @@ -1215,7 +1225,7 @@ // { 0x67A9, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon", kFutomaki }, // { 0x67AA, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon", kFutomaki }, { 0x67B0, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon R9 290X", kBaladi }, - { 0x67B1, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon R9 290", kBaladi }, + { 0x67B1, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon R9 290/390", kBaladi }, // { 0x67B8, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon", kFutomaki }, { 0x67B9, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon R9 200", kFutomaki }, // { 0x67BA, 0x00000000, CHIP_FAMILY_HAWAII, "AMD Radeon", kFutomaki }, @@ -1243,7 +1253,7 @@ { 0x67E9, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67EB, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67EF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon RX460", kAcre }, - { 0x67FF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, + { 0x67FF, 0x00000000, CHIP_FAMILY_BAFFIN, "AMD Radeon RX560", kNull }, // Polaris 12 { 0x6980, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, @@ -1251,8 +1261,20 @@ { 0x6985, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, { 0x6986, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, { 0x6987, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, - { 0x699F, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, + { 0x6995, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull }, + { 0x699F, 0x00000000, CHIP_FAMILY_GREENLAND, "AMD Radeon RX550", kNull }, + // Vega 10 + { 0x6860, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6861, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6862, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6863, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6864, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6867, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x6868, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x686C, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + { 0x687F, 0x00000000, CHIP_FAMILY_VEGA10, "AMD Radeon Vega 10", kNull }, + // PITCAIRN { 0x6800, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD 7970M", kBuri }, // Mobile { 0x6801, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD 8970M Series", kFutomaki }, // Mobile @@ -1415,7 +1437,7 @@ { 0x7181, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, { 0x7183, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, { 0x7186, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, - { 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD1900 ", kCaretta }, { 0x7188, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD2300 Mobile ", kCaretta }, { 0x718A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, { 0x718B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, @@ -1540,7 +1562,7 @@ { 0x9452, 0x00000000, CHIP_FAMILY_RV770, "AMD FireStream 9250", kMotmot }, { 0x9456, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8700 (FireGL)", kMotmot }, { 0x945A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4870", kMotmot }, - { 0x9460, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, + { 0x9460, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, { 0x9462, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, // { 0x946A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon", kMotmot }, // { 0x946B, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon", kMotmot }, @@ -1842,6 +1864,9 @@ "Ellesmere", "Baffin", "Greenland", + "Vega10", +// "Vega11", +// "Navi", "" }; Index: trunk/i386/libsaio/load.c =================================================================== --- trunk/i386/libsaio/load.c (revision 2886) +++ trunk/i386/libsaio/load.c (revision 2887) @@ -256,9 +256,9 @@ if (((long *)cmdBase)[0] == LC_SEGMENT_64) { struct segment_command_64 *segCmd; - segCmd = (struct segment_command_64 *)cmdBase; - vmaddr = (segCmd->vmaddr & 0x3fffffff); - vmsize = segCmd->vmsize; + segCmd = (struct segment_command_64 *)cmdBase; + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; fileaddr = (gBinaryAddress + segCmd->fileoff); filesize = segCmd->filesize; segname = segCmd->segname; @@ -274,10 +274,10 @@ { struct segment_command *segCmd; - segCmd = (struct segment_command *)cmdBase; + segCmd = (struct segment_command *)cmdBase; - vmaddr = (segCmd->vmaddr & 0x3fffffff); - vmsize = segCmd->vmsize; + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; fileaddr = (gBinaryAddress + segCmd->fileoff); filesize = segCmd->filesize; segname = segCmd->segname; Index: trunk/i386/libsaio/ati.h =================================================================== --- trunk/i386/libsaio/ati.h (revision 2886) +++ trunk/i386/libsaio/ati.h (revision 2887) @@ -92,13 +92,14 @@ CHIP_FAMILY_PITCAIRN, CHIP_FAMILY_VERDE, CHIP_FAMILY_OLAND, + /* Sea Islands */ CHIP_FAMILY_HAINAN, CHIP_FAMILY_BONAIRE, CHIP_FAMILY_KAVERI, CHIP_FAMILY_KABINI, CHIP_FAMILY_HAWAII, - /* ... */ CHIP_FAMILY_MULLINS, + /* Volcanic Islands */ CHIP_FAMILY_TOPAZ, CHIP_FAMILY_AMETHYST, CHIP_FAMILY_TONGA, @@ -108,6 +109,7 @@ CHIP_FAMILY_ELLESMERE, /* Polaris 10 */ CHIP_FAMILY_BAFFIN, /* Polaris 11 */ CHIP_FAMILY_GREENLAND, /* Polaris 12 */ + CHIP_FAMILY_VEGA10, /* Vega 10 */ CHIP_FAMILY_LAST } ati_chip_family_t; @@ -199,9 +201,9 @@ kMaguro, kMaguroS, /* AMD8000Controller */ + kExmoor, kBaladi, /* AMD9000Controller */ - kExmoor, kMalteseS, kLagotto, kGreyhoundS, @@ -209,14 +211,23 @@ kBasset, kGreyhound, kLabrador, + /* AMD9300Controller */ + kFleuveSWIP, /* AMD9500Controller */ - kElqui, kAcre, + kDayman, + kGuariba, + kHuallaga, + kOrinoco, + /* AMD9510Controller*/ kBerbice, + /* AMD9515Controller */ + kMazaruni, + kLongavi, + /* AMD9520Controller */ + kElqui, kCaroni, kFlorin, - kDayman, - kGuariba, kCfgEnd } config_name_t; Index: trunk/i386/libsaio/smbios_decode.c =================================================================== --- trunk/i386/libsaio/smbios_decode.c (revision 2886) +++ trunk/i386/libsaio/smbios_decode.c (revision 2887) @@ -655,9 +655,9 @@ // break; /* Skip all Apple Specific Structures */ - // case kSMBTypeFirmwareVolume: // Type 128 + case kSMBTypeFirmwareVolume: // Type 128 // case kSMBTypeMemorySPD: // Type 130 - // break; + break; case kSMBTypeOemProcessorType: // Type 131 decodeOemProcessorType(structHeader); Index: trunk/i386/libsaio/saio_types.h =================================================================== --- trunk/i386/libsaio/saio_types.h (revision 2886) +++ trunk/i386/libsaio/saio_types.h (revision 2887) @@ -61,6 +61,8 @@ { long type; char *string; + uint8_t *data; + long dataLen; long offset; struct Tag *tag; struct Tag *tagNext; Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2886) +++ trunk/i386/libsaio/fake_efi.c (revision 2887) @@ -829,6 +829,7 @@ // booter-build-time (Fri Apr 14 16:21:16 PDT 2017) 10.12.5 DT__AddProperty(chosenNode, "booter-build-time", sizeof(I386BOOT_BUILDDATE), I386BOOT_BUILDDATE); + // booter-name DT__AddProperty(chosenNode, "booter-name", sizeof("Chameleon"), "Chameleon"); Index: trunk/i386/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 2886) +++ trunk/i386/boot2/drivers.c (revision 2887) @@ -652,12 +652,12 @@ // LoadMatchedModules long LoadMatchedModules( void ) { - TagPtr prop; - ModulePtr module; - char *fileName, segName[32]; - DriverInfoPtr driver; - long length, driverAddr, driverLength; - void *executableAddr = 0; + TagPtr prop; + ModulePtr module; + char *fileName, segName[32]; + DriverInfoPtr driver; + long length, driverAddr, driverLength; + void *executableAddr = 0; module = gModuleHead; @@ -678,7 +678,7 @@ length = LoadFile(gFileSpec); executableAddr = (void *)kLoadAddr; } -// printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar(); +// printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar(); } else { @@ -1252,10 +1252,6 @@ /* ================================================================ */ - // Entry point - -/* ================================================================ */ - ret = DecodeMachO(binary, rentry, raddr, rsize); if (ret < 0 && archCpuType == CPU_TYPE_X86_64) { Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2886) +++ trunk/i386/boot2/boot.c (revision 2887) @@ -1079,11 +1079,25 @@ // void setupBooterArgs() { - bool KPRebootOption = false; - bool HiDPIOption = false; - bool FlagBlackOption = false; + bool KPRebootOption = false; // I don't want this by default ( It makes me angry because I do not see the reason for the panic)+ +// bool HiDPIOption = false; // (Disabled by default) 10.8+ +// bool FlagBlackOption = false; // (Disabled by default) 10.10+ + // OS X Lion 10.7 + if ( MacOSVerCurrent >= MacOSVer2Int("10.7") ) // Lion and Up! + { + // Pike R. Alpha: Adding a 16 KB log space. + bootArgs->performanceDataSize = 0; + bootArgs->performanceDataStart = 0; + // Pike R. Alpha: AppleKeyStore.kext + bootArgs->keyStoreDataSize = 0; + bootArgs->keyStoreDataStart = 0; + + bootArgs->bootMemSize = 0; + bootArgs->bootMemStart = 0; + } + // OS X Mountain Lion 10.8 if ( MacOSVerCurrent >= MacOSVer2Int("10.8") ) // Mountain Lion and Up! { @@ -1116,7 +1130,7 @@ } // OS X El Capitan 10.11 - if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan and Sierra! + if ( MacOSVerCurrent >= MacOSVer2Int("10.11") ) // El Capitan, Sierra and High Sierra! { // ErmaC verbose("\n"); @@ -1131,7 +1145,7 @@ if (isRecoveryHD || isInstaller || isOSXUpgrade || isMacOSXUpgrade) { // SIP can be controlled with or without FileNVRAM.kext (Pike R. Alpha) - bootArgs->flags |= (kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot); + bootArgs->flags |= (kBootArgsFlagCSRActiveConfig + kBootArgsFlagCSRConfigMode + kBootArgsFlagCSRBoot + kBootArgsFlagInstallUI); } else { @@ -1187,6 +1201,7 @@ verbose("DTrace Restrictions: %s\n", ((csrValue & 0x20) == 0) ? "enabled":"disabled"); /* (1 << 5) Allow unrestricted dtrace */ verbose("NVRAM Protections: %s\n", ((csrValue & 0x40) == 0) ? "enabled":"disabled"); /* (1 << 6) Allow unrestricted NVRAM */ // verbose("DEVICE configuration: %s\n", ((csrValue & 0x80) == 0) ? "enabled":"disabled"); /* (1 << 7) Allow device configuration */ +// verbose("Disable BaseSystem Verification: %s\n", ((csrValue & 0x100) == 0) ? "enabled":"disabled"); /* (1 << 8) Disable BaseSystem Verification */ } verbose("\n"); } Index: trunk/i386/libsa/prf.c =================================================================== --- trunk/i386/libsa/prf.c (revision 2886) +++ trunk/i386/libsa/prf.c (revision 2887) @@ -38,11 +38,12 @@ * @(#)prf.c 7.1 (Berkeley) 6/5/86 */ -#include +#include #define SPACE 1 #define ZERO 2 -#define UCASE 16 +#define UCASE 16 +#define SIGNED 32 /* * Scaled down version of C Library printf. @@ -52,57 +53,144 @@ * */ +#define DIVIDEND_LOW *(unsigned int*) dividend +#define DIVIDEND_HIGH ((unsigned int*) dividend)[1] + /* + * Divides 64-bit dividend by 32-bit divisor. + * Quotient stored in dividend, remainder returned. + * Assumes little-endian byte order. + * Assumes divisor is non-zero. + */ +unsigned int i386_unsigned_div( + unsigned long long* dividend, + unsigned int divisor + ) +{ + unsigned int high = DIVIDEND_HIGH; + + if (high >= divisor) + { + __asm__ volatile ("xorl %%edx, %%edx; divl %2" : "=a"(DIVIDEND_HIGH), "=d"(high) : "r"(divisor), "a"(high)); + } + else + { + DIVIDEND_HIGH = 0; + } + __asm__ volatile("divl %2" : "+a"(DIVIDEND_LOW), "+d"(high) : "r"(divisor)); + return high; +} + +#undef DIVIDEND_HIGH +#undef DIVIDEND_LOW + +/* * Printn prints a number n in base b. * We don't use recursion to avoid deep kernel stacks. */ -static void printn(n, b, flag, minwidth, putfn_p, putfn_arg) - u_long n; - int b, flag, minwidth; - void (*putfn_p)(); - void *putfn_arg; +static int printn( + unsigned long long n, + int b, + int flag, + int minwidth, + int (*putfn_p)(), + void* putfn_arg + ) { - char prbuf[11]; + char prbuf[22]; register char *cp; int width = 0, neg = 0; + static const char hexdig[] = "0123456789abcdef0123456789ABCDEF"; - if (b == 10 && (int)n < 0) { + if ((flag & SIGNED) && (long long)n < 0) + { neg = 1; - n = (unsigned)(-(int)n); + n = (unsigned long long)(-(long long)n); } cp = prbuf; - do { - *cp++ = "0123456789abcdef0123456789ABCDEF"[(flag & UCASE) + n%b]; - n /= b; + if ((b & -b) == b) // b is a power of 2 + { + unsigned int log2b = (unsigned int) (__builtin_ctz((unsigned int) b) & 31); + unsigned int mask = (unsigned int) (b - 1); + do + { + *cp++ = hexdig[(flag & UCASE) + (int) (n & mask)]; + n >>= log2b; + width++; + } + while (n); + } + else // b is not a power of 2 + { + do + { + *cp++ = hexdig[(flag & UCASE) + (int) i386_unsigned_div(&n, (unsigned int) b)]; + width++; + } + while (n); + } + + if (neg) + { + if (putfn_p) + { + (void)(*putfn_p)('-', putfn_arg); + } width++; - } while (n); - - if (neg) { - (*putfn_p)('-', putfn_arg); - width++; } - while (width++ < minwidth) - (*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg); - + if (!putfn_p) + { + return (width < minwidth) ? minwidth : width; + } + for (;width < minwidth; width++) + (void)(*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg); + do - (*putfn_p)(*--cp, putfn_arg); + (void)(*putfn_p)(*--cp, putfn_arg); while (cp > prbuf); + return width; } +/* + * Printp prints a pointer. + */ +static int printp( + const void* p, + int minwidth, + int (*putfn_p)(), + void* putfn_arg + ) +{ + int width = 0; + + if (p) + { + if (putfn_p) + { + (void)(*putfn_p)('0', putfn_arg); + (void)(*putfn_p)('x', putfn_arg); + } + width = 2; + minwidth = ((minwidth >= 2) ? (minwidth - 2) : 0); + } + return width + printn((unsigned long long) p, 16, ZERO, minwidth, putfn_p, putfn_arg); +} + int prf( - char *fmt, - unsigned int *adx, - void (*putfn_p)(), + const char *fmt, + va_list ap, + int (*putfn_p)(), void *putfn_arg -) + ) { - int b, c, len =0; - char *s; - int flag = 0, width = 0; + int b, c, len = 0; + const char *s; + int flag, width, ells; int minwidth; loop: - while ((c = *fmt++) != '%') { + while ((c = *fmt++) != '%') + { if(c == '\0') { return len; @@ -110,15 +198,22 @@ if (putfn_p) { - (*putfn_p)(c, putfn_arg); + (void)(*putfn_p)(c, putfn_arg); } len++; } minwidth = 0; + flag = 0; + ells = 0; again: c = *fmt++; - switch (c) { + switch (c) + { case 'l': + if (ells < 2) + { + ++ells; + } goto again; case ' ': flag |= SPACE; @@ -149,46 +244,82 @@ b = 16; goto number; case 'd': + case 'i': + flag |= SIGNED; + /* fall through */ + case 'u': b = 10; goto number; case 'o': case 'O': b = 8; number: - if (putfn_p) + switch (ells) { - printn((u_long)*adx, b, flag, minwidth, putfn_p, putfn_arg); + case 2: + len += printn(va_arg(ap, unsigned long long), b, flag, minwidth, putfn_p, putfn_arg); + break; + case 1: + len += printn(va_arg(ap, unsigned long), b, flag, minwidth, putfn_p, putfn_arg); + break; + default: + len += printn(va_arg(ap, unsigned int), b, flag, minwidth, putfn_p, putfn_arg); + break; } - len++; break; case 's': - s = (char *)*adx; - while ((c = *s++)) { - if (putfn_p) + s = va_arg(ap, const char*); + if (!s) + { + s = "(null)"; + } + width = 0; + if (!putfn_p) + { + while ((c = *s++)) { - (*putfn_p)(c, putfn_arg); + width++; } + len += ((width < minwidth) ? minwidth : width); + break; + } + while ((c = *s++)) + { + (void)(*putfn_p)(c, putfn_arg); len++; width++; } while (width++ < minwidth) { - if (putfn_p) - { - (*putfn_p)(' ', putfn_arg); - } + (void)(*putfn_p)(' ', putfn_arg); len++; } break; case 'c': if (putfn_p) { - (*putfn_p)((char)*adx, putfn_arg); + (void)(*putfn_p)((char) va_arg(ap, int), putfn_arg); } len++; break; + case '%': + if (putfn_p) + { + (void)(*putfn_p)('%', putfn_arg); + } + len++; + break; + case 'p': + len += printp(va_arg(ap, const void*), minwidth, putfn_p, putfn_arg); + break; + case 'n': + s = va_arg(ap, const char*); + if (s) + { + *(int*) s = len; + } + break; default: break; } - adx++; goto loop; } Index: trunk/i386/libsa/strtol.c =================================================================== --- trunk/i386/libsa/strtol.c (revision 2886) +++ trunk/i386/libsa/strtol.c (revision 2887) @@ -324,8 +324,9 @@ register const char *s = nptr; register unsigned long long acc; register int c; - register unsigned long long qbase, cutoff; + /* register */ unsigned long long qbase, cutoff; register int neg, any, cutlim; + extern unsigned int i386_unsigned_div(unsigned long long*, unsigned int); /* * See strtoq for comments as to the logic used. @@ -365,8 +366,8 @@ } qbase = (unsigned)base; - cutoff = (unsigned long long)UQUAD_MAX / qbase; - cutlim = (unsigned long long)UQUAD_MAX % qbase; + cutoff = (unsigned long long)UQUAD_MAX; + cutlim = (int) i386_unsigned_div(&cutoff, (unsigned int) base); for (acc = 0, any = 0;; c = *s++) { Index: trunk/package/OptionalSettings/Control.txt =================================================================== --- trunk/package/OptionalSettings/Control.txt (revision 2886) +++ trunk/package/OptionalSettings/Control.txt (revision 2887) @@ -28,7 +28,7 @@ Bool@BootBanner:Boot Banner=No Bool@GUI:GUI=No Bool@LegacyLogo:Legacy Logo=Yes -#Bool@RebootOnPanic:RebootOnPanic=No +Bool@RebootOnPanic:RebootOnPanic=No #Bool@EnableHiDPI:EnableHiDPI=Yes Bool@BlackMode:BlackMode=Yes Bool@InstantMenu:Instant Menu=Yes