Chameleon

Chameleon Commit Details

Date:2011-06-24 21:31:47 (8 years 3 months ago)
Author:Azimutz
Commit:1052
Parents: 1051
Message:Revert r933/34 & 937; see issue #94
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/boot2/boot.c

File differences

trunk/i386/boot2/drivers.c
182182
183183
184184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
185
227186
228187
229188
230
231
189
190
232191
233
192
234193
235194
236195
237196
238197
239
240
241
242
243
198
199
200
201
202
244203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
245220
246221
247
248
222
249223
250224
251225
252226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
253243
254244
255245
}
}
else if ( gBootFileType == kBlockDeviceType )
{
if (!gHaveKernelCache)
{
// Non-prelinked kernel, load system mkext.
// NOTE: In it's default state, XNU cannot be both prelinked, and load additional drivers
// from the bootloader. There is, however, a patch that changes this and allows
// for both to occure.
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter)
{
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
if (gMKextName[0] != '\0')
{
verbose("LoadDrivers: Loading from [%s]\n", gMKextName);
if ( LoadDriverMKext(gMKextName) != 0 )
{
error("Could not load %s\n", gMKextName);
return -1;
}
}
else
{
strcpy(gExtensionsSpec, dirSpec);
strcat(gExtensionsSpec, "System/Library/");
FileLoadDrivers(gExtensionsSpec, 0);
}
}
//Azi: dependencies still need to be added to E/E.mkext!!
{
// First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0).
if (gRAMDiskVolume && !gRAMDiskBTAliased)
{
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
// Next try to load Extra extensions from the selected root partition.
strcpy(dirSpecExtra, "/Extra/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter)
{
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
if (gMKextName[0] != '\0')
{
verbose("LoadDrivers: Loading from [%s]\n", gMKextName);
if ( LoadDriverMKext(gMKextName) != 0 )
{
error("Could not load %s\n", gMKextName);
return -1;
}
}
else
{
strcpy(gExtensionsSpec, dirSpec);
strcat(gExtensionsSpec, "System/Library/");
FileLoadDrivers(gExtensionsSpec, 0);
}
}
else
{
trunk/i386/boot2/boot.c
155155
156156
157157
158
158
159
159160
160161
161162
......
485486
486487
487488
488
489
489490
490491
491492
execute_hook("DecodedKernel", (void*)binary, NULL, NULL, NULL);
// Load boot drivers from the specifed root path.
LoadDrivers("/");
if (!gHaveKernelCache)
LoadDrivers("/");
clearActivityIndicator();
break;
}
if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig) && usecache) {
if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig)) {
if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) {
strlcpy(gBootKernelCacheFile, val, len+1);
}

Archive Download the corresponding diff file

Revision: 1052