␊ |
␉lowHalf %= 65521L;␊ |
␉highHalf %= 65521L;␊ |
␊ |
␊ |
␉result = (highHalf << 16) | lowHalf;␊ |
␊ |
␊ |
␉return result;␊ |
}␊ |
␊ |
|
}␊ |
else␊ |
{␊ |
␉␉␉␉if (gMacOSVersion[3] == '9') {␊ |
␉␉␉␉␉strcpy(gExtensionsSpec, dirSpec);␊ |
␉␉␉␉␉strcat(gExtensionsSpec, "Library/");␊ |
␉␉␉␉␉FileLoadDrivers(gExtensionsSpec, 0);␊ |
␉␉␉␉}␊ |
strcpy(gExtensionsSpec, dirSpec);␊ |
strcat(gExtensionsSpec, "System/Library/");␊ |
FileLoadDrivers(gExtensionsSpec, 0);␊ |
|
␉␊ |
␉sprintf (altDirSpec, "%s%s", dirSpec, extDirSpec);␊ |
␉ret = GetFileInfo(altDirSpec, "Extensions.mkext", &flags, &time);␊ |
␉␊ |
␊ |
␉if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat))␊ |
␉{␊ |
␉␉ret = GetFileInfo(dirSpec, "Extensions", &flags, &time2);␊ |
␉␉␊ |
␊ |
␉␉if ((ret != 0)␊ |
␉␉␉|| ((flags & kFileTypeMask) != kFileTypeDirectory)␊ |
␉␉␉|| (((gBootMode & kBootModeSafe) == 0) && (time == (time2 + 1))))␊ |
␉␉{␊ |
␉␉␉sprintf(gDriverSpec, "%sExtensions.mkext", altDirSpec);␊ |
␉␉␉verbose("LoadDrivers: Loading from [%s]\n", gDriverSpec);␊ |
␉␉␉␊ |
␊ |
␉␉␉if (LoadDriverMKext(gDriverSpec) == 0)␊ |
␉␉␉␉return 0;␊ |
␉␉}␊ |
|
}␊ |
if (tries == -1) return -1;␊ |
␊ |
return 0;␊ |
␉return 0;␊ |
}␊ |
␊ |
//==========================================================================␊ |
|
␉long␉␉ length, driverAddr, driverLength;␊ |
␉void␉␉ *executableAddr = 0;␊ |
␊ |
␊ |
␉module = gModuleHead;␊ |
␊ |
␉while (module != 0)␊ |
|
␊ |
␉required = XMLGetProperty(moduleDict, kPropOSBundleRequired);␊ |
␊ |
␉//if ( (required != NULL) && (required->type == kTagTypeString) && !strcmp(required->string, "Safe Boot"))␊ |
␉if ( (required != NULL) && ((required->type != kTagTypeString) || (!strcmp(required->string, "Safe Boot"))) )␊ |
␉if ( (required == 0) || (required->type != kTagTypeString) || !strcmp(required->string, "Safe Boot"))␊ |
␉{␊ |
␉␉XMLFreeTag(moduleDict);␊ |
␉␉return -2;␊ |
|
␉printf("compressed_size: 0x%x\n", kernel_header->compressed_size);␊ |
␉getchar();␊ |
#endif␊ |
␉␊ |
␊ |
␉if (kernel_header->signature == OSSwapBigToHostConstInt32('comp'))␊ |
␉{␊ |
␉␉if (kernel_header->compress_type != OSSwapBigToHostConstInt32('lzss'))␊ |
|
␉␉}␊ |
#if NOTDEF␊ |
␉␉if (kernel_header->platform_name[0] && strcmp(gPlatformName, kernel_header->platform_name))␊ |
␉␉{␊ |
␉␉␉return -1;␊ |
␉␉}␊ |
␉␉if (kernel_header->root_path[0] && strcmp(gBootFile, kernel_header->root_path))␊ |
␉␉{␊ |
␉␉␉return -1;␊ |
␉␉}␊ |
#endif␊ |
␊ |
␉␉uncompressed_size = OSSwapBigToHostInt32(kernel_header->uncompressed_size);␊ |
␉␉binary = buffer = malloc(uncompressed_size);␊ |
␉␉␊ |