Chameleon

Chameleon Commit Details

Date:2010-08-10 08:56:49 (13 years 8 months ago)
Author:Azimutz
Commit:343
Parents: 342
Message:A bit of cleaning...
Changes:
M/branches/azimutz/CleanCut/i386/boot2/drivers.c

File differences

branches/azimutz/CleanCut/i386/boot2/drivers.c
162162
163163
164164
165
165
166166
167167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
188189
189190
190191
......
197198
198199
199200
200
201
201
202
202203
203204
204
205
205206
206207
207208
......
213214
214215
215216
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
232233
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
262263
263264
264265
long LoadDrivers( char * dirSpec )
{
char dirSpecExtra[1024];
char dirSpecExtra[1024];
const char *override_pathfolder = NULL; // path to folder
intfd = 0, len = 0;
if ( InitDriverSupport() != 0 )
return 0;
// Load extra drivers if a hook has been installed.
if (LoadExtraDrivers_p != NULL)
{
(*LoadExtraDrivers_p)(&FileLoadDrivers);
}
if ( gBootFileType == kNetworkDeviceType )
{
if (NetLoadDrivers(dirSpec) != 0) {
error("Could not load drivers from the network\n");
return -1;
}
}
else if ( gBootFileType == kBlockDeviceType )
{
// Take in account user overriding.
if ( InitDriverSupport() != 0 )
return 0;
// Load extra drivers if a hook has been installed.
if (LoadExtraDrivers_p != NULL)
{
(*LoadExtraDrivers_p)(&FileLoadDrivers);
}
if ( gBootFileType == kNetworkDeviceType )
{
if (NetLoadDrivers(dirSpec) != 0)
{
error("Could not load drivers from the network\n");
return -1;
}
}
else if ( gBootFileType == kBlockDeviceType )
{
// Take in account user overriding.
if (getValueForKey(kExtensionsKey, &override_pathfolder, &len, &bootInfo->bootConfig))
{
// Specify a path to a folder, ending with / e.g. /Extra/testkext/
strcpy(dirSpecExtra, "rd(0,0)/"); // check it's "root".
fd = FileLoadDrivers(dirSpecExtra, 0);
if (fd >= 0) goto success_fd;
// No need to specify (gRAMDiskVolume && gRAMDiskBTAliased); checking paths on a
// No need to specify (gRAMDiskVolume && gRAMDiskBTAliased); checking paths on a
// ramdisk aliased as bt(0,0) (rdbt), is the same as checking paths on booter volume.
// In this case the following two apply.
// Check booter volume/rdbt Extra for specific OS files, on specific OS folders.
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
fd = FileLoadDrivers(dirSpecExtra, 0);
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
fd = FileLoadDrivers(dirSpecExtra, 0);
if (fd >= 0) goto success_fd;
// 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);
}
}
}
// 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);
}
}
}
success_fd:
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
{
return 0;
}
MatchPersonalities();
MatchLibraries();
LoadMatchedModules();
return 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
{
return 0;
}
MatchPersonalities();
MatchLibraries();
LoadMatchedModules();
return 0;
}
//==========================================================================

Archive Download the corresponding diff file

Revision: 343