Chameleon

Chameleon Commit Details

Date:2011-08-14 13:00:25 (7 years 11 months ago)
Author:Azimutz
Commit:1376
Parents: 1375
Message:One more pass.
Changes:
M/trunk/i386/boot2/boot.c
M/trunk/i386/boot2/boot.h

File differences

trunk/i386/boot2/boot.c
111111
112112
113113
114
114
115
115116
116117
117118
118
119
119120
120121
121122
......
200201
201202
202203
203
204
204205
205
206
206207
207208
208209
......
299300
300301
301302
302
303
303304
304305
305306
......
310311
311312
312313
313
314
315
314316
315317
316318
......
323325
324326
325327
326
328
329
327330
328331
329332
330333
331334
332
335
333336
334
337
335338
336339
337340
......
344347
345348
346349
347
350
348351
349
352
350353
351354
352355
......
509512
510513
511514
512
515
516
513517
514518
515519
static void malloc_error(char *addr, size_t size, const char *file, int line)
{
stop("\nMemory allocation error! Addr=0x%x, Size=0x%x, File=%s, Line=%d\n", (unsigned)addr, (unsigned)size, file, line);
stop("\nMemory allocation error! Addr=0x%x, Size=0x%x, File=%s, Line=%d\n",
(unsigned)addr, (unsigned)size, file, line);
}
//==========================================================================
//Initializes the runtime.Right now this means zeroing the BSS and initializing malloc.
//Initializes the runtime. Right now this means zeroing the BSS and initializing malloc.
//
void initialize_runtime(void)
{
// This will draw the boot graphics unless we are in
// verbose mode.
if (gVerboseMode)
setVideoMode( GRAPHICS_MODE, 0 );
setVideoMode( GRAPHICS_MODE, 0 );
else
drawBootGraphics();
drawBootGraphics();
setupBooterLog();
}
// Override firstRun to get to the boot menu instantly by setting "Instant Menu"=y in system config
if (getBoolForKey(kInsantMenuKey, &instantMenu, &bootInfo->chameleonConfig) && instantMenu) {
if (getBoolForKey(kInstantMenuKey, &instantMenu, &bootInfo->chameleonConfig) && instantMenu) {
firstRun = false;
}
gEnableCDROMRescan = false;
// Enable it with Rescan=y in system config
if (getBoolForKey(kRescanKey, &gEnableCDROMRescan, &bootInfo->chameleonConfig) && gEnableCDROMRescan) {
if (getBoolForKey(kRescanKey, &gEnableCDROMRescan, &bootInfo->chameleonConfig)
&& gEnableCDROMRescan) {
gEnableCDROMRescan = true;
}
}
// Enable touching a single BIOS device only if "Scan Single Drive"=y is set in system config.
if (getBoolForKey(kScanSingleDriveKey, &gScanSingleDrive, &bootInfo->chameleonConfig) && gScanSingleDrive) {
if (getBoolForKey(kScanSingleDriveKey, &gScanSingleDrive, &bootInfo->chameleonConfig)
&& gScanSingleDrive) {
gScanSingleDrive = true;
}
// Create a list of partitions on device(s).
if (gScanSingleDrive) {
scanBootVolumes(gBIOSDev, &bvCount);
scanBootVolumes(gBIOSDev, &bvCount);
} else {
scanDisks(gBIOSDev, &bvCount);
scanDisks(gBIOSDev, &bvCount);
}
// Create a separated bvr chain using the specified filters.
#if DEBUG
printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags);
gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags);
printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags);
gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags);
getchar();
#endif
}
// Snow Leopard
else if (checkOSVersion("10.6")) {
sprintf(gBootKernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64");
sprintf(gBootKernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386)
? "i386" : "x86_64");
int lnam = sizeof(gBootKernelCacheFile) + 9; //with adler32
char* name;
trunk/i386/boot2/boot.h
6868
6969
7070
71
71
7272
7373
7474
#define kRescanPromptKey"Rescan Prompt"
#define kRescanKey "Rescan"
#define kScanSingleDriveKey"Scan Single Drive"
#define kInsantMenuKey"Instant Menu"
#define kInstantMenuKey"Instant Menu"
#define kDefaultKernel"mach_kernel"
#define kGUIKey"GUI"
#define kBootBannerKey"Boot Banner"

Archive Download the corresponding diff file

Revision: 1376