Chameleon

Chameleon Commit Details

Date:2013-12-01 17:40:12 (5 years 6 months ago)
Author:Jief Luce
Commit:2271
Parents: 2270
Message:gBootPartition global variable + some verbose
Changes:
M/branches/Jief/i386/boot2/boot.c
M/branches/Jief/i386/libsaio/saio_internal.h
M/branches/Jief/i386/libsaio/ati.c
M/branches/Jief/i386/boot2/options.c
M/branches/Jief/i386/libsaio/sys.c

File differences

branches/Jief/i386/libsaio/ati.c
21752175
21762176
21772177
2178
2179
21782180
21792181
21802182
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys.vendor_id, pci_dev->subsys_id.subsys.device_id);
return false;
}
verbose("Found ATI card! Device ID:[%04x:%04x] Subsystem ID:[%08x] - Radeon [%04x:%08x] %s\n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id, card->info->device_id, card->info->subsys_id, card->info->model_name);
card->fb= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f);
card->mmio= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f);
branches/Jief/i386/libsaio/sys.c
888888
889889
890890
891
891892
892893
893894
......
907908
908909
909910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
910927
911
928
912929
913930
914
931
915932
916
933
917934
918935
919936
#define LP '('
#define RP ')'
int gBIOSDev;
int gBootPartition;
/*!
This is like boot2's gBootVolume except it is for the internal use of
void setBootGlobals(BVRef chain)
{
gBIOSBootVolume = NULL;
for ( BVRef bvr = chain; bvr; bvr = bvr->next )
{
if (bvr->biosdev == gBIOSDev && bvr->part_no == gBootPartition) {
gBIOSBootVolume = bvr;
}
}
if ( gBIOSBootVolume == NULL ) {
printf("BUG!!! -> gBIOSBootVolume == NULL\n");
getchar();
}
else
{
//printf("gBIOSBootVolume %d %d %d\n", gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no);
}
// Record default boot device.
gBootVolume = selectBootVolume(chain);
//gBootVolume = selectBootVolume(chain);
// turbo - Save the ORIGINAL boot volume too for loading our mkext
if (!gBIOSBootVolume) gBIOSBootVolume = gBootVolume;
//if (!gBIOSBootVolume) gBIOSBootVolume = gBootVolume;
setRootVolume(gBootVolume);
setRootVolume(gBIOSBootVolume);
}
/*!
branches/Jief/i386/libsaio/saio_internal.h
208208
209209
210210
211
211212
212213
213214
extern int getDeviceDescription(BVRef volume, char *str);
extern int gBIOSDev;
extern int gBootPartition;
extern int gBootFileType;
extern BVRef gBootVolume;
extern BVRef gBIOSBootVolume;
branches/Jief/i386/boot2/boot.c
241241
242242
243243
244
244245
245246
246247
......
248249
249250
250251
252
251253
252254
253255
......
269271
270272
271273
274
272275
273276
274277
......
276279
277280
278281
282
279283
280284
281285
......
363367
364368
365369
366
370
367371
368372
369373
......
378382
379383
380384
381
385
386
382387
383388
384389
......
388393
389394
390395
391
392
393
394396
395
396
397
398397
399398
400399
......
458457
459458
460459
461
460
461
462
463
462464
463
465
464466
467
468
469
470
471
472
465473
466474
475
467476
468477
469478
if (cacheFile[0] != 0)
{
strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile));
verbose("Specified kernel cache file path=%s\n", cacheFile);
}
else
{
if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9")))
{
sprintf(kernelCacheFile, "%skernelcache", kDefaultCachePathSnow);
verbose("L & ML kernel cache file path=%s\n", kernelCacheFile);
}
// Snow Leopard prelink kernel cache file
else if (checkOSVersion("10.6")) {
prev_time = time;
}
}
verbose("SnowLeo kernel cache file path=%s\n", kernelCacheFile);
}
else {
// Reset cache name.
sprintf(gCacheNameAdler + 64, "%s,%s", gRootDevice, bootInfo->bootFile);
adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler));
sprintf(kernelCacheFile, "%s.%08lX", kDefaultCachePathLeo, adler32);
verbose("Reseted kernel cache file path=%s\n", kernelCacheFile);
}
}
// If biosdev is kBIOSDevNetwork, then this function will return if
// booting was unsuccessful. This allows the PXE firmware to try the
// next boot device on its list.
void common_boot(int biosdev)
void common_boot(int biosDevAndPart)
{
bool quiet;
bool firstRun = true;
gUnloadPXEOnExit = true;
// Record the device that the booter was loaded from.
gBIOSDev = biosdev & kBIOSDevMask;
gBIOSDev = biosDevAndPart & kBIOSDevMask;
gBootPartition = ((biosDevAndPart & 0xFF00) >> 8);
// Initialize boot info structure.
initKernBootStruct();
// Setup VGA text mode.
// Not sure if it is safe to call setVideoMode() before the
// config table has been loaded. Call video_mode() instead.
#if DEBUG
printf("before video_mode\n");
#endif
video_mode( 2 ); // 80x25 mono text mode.
#if DEBUG
printf("after video_mode\n");
#endif
// Scan and record the system's hardware information.
scan_platform();
init_module_system();
#if DEBUG
printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
printf("gBIOSDev=%d\n", gBIOSDev);
printf("gBootPartition=%d\n", gBootPartition);
printf(" gBootVolume: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags);
printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
printf(" gBIOSBootVolume==bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n",
gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags);
for (BVRef bvr = bvChain; bvr; bvr = bvr->next)
{
printf(" chain: %d, dev: %d, part: %d, flags: %d, ver:%s vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->OSVersion, bvr->visible);
}
getchar();
#endif
useGUI = true;
// Override useGUI default
branches/Jief/i386/boot2/options.c
988988
989989
990990
991
991
992992
993993
994994
}
gBootVolume = menuBVR;
setRootVolume(menuBVR);
gBIOSDev = menuBVR->biosdev;
//????gBIOSDev = menuBVR->biosdev;
break;
case KEY_ESC:

Archive Download the corresponding diff file

Revision: 2271