MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / StartLoader

Method StartLoader

rEFIt_UEFI/refit/main.cpp:565–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565VOID LOADER_ENTRY::StartLoader()
566{
567 EFI_STATUS Status;
568 EFI_TEXT_STRING ConOutOutputString = 0;
569 EFI_HANDLE ImageHandle = NULL;
570 EFI_LOADED_IMAGE *LoadedImage = NULL;
571 CONST CHAR8 *InstallerVersion;
572 TagDict* dict = NULL;
573 UINTN i;
574 NSVGfont *font; // , *nextFont;
575
576// DBG("StartLoader() start\n");
577 DbgHeader("StartLoader");
578 if (Settings.notEmpty()) {
579 DBG(" Settings: %ls\n", Settings.wc_str());
580 Status = LoadUserSettings(SelfRootDir, Settings, &dict);
581 if (!EFI_ERROR(Status)) {
582 DBG(" - found custom settings for this entry: %ls\n", Settings.wc_str());
583 gBootChanged = TRUE;
584 Status = GetUserSettings(dict);
585 if (EFI_ERROR(Status)) {
586 DBG(" - ... but: %s\n", efiStrError(Status));
587 } else {
588 if ((gSettings.CpuFreqMHz > 100) && (gSettings.CpuFreqMHz < 20000)) {
589 gCPUStructure.MaxSpeed = gSettings.CpuFreqMHz;
590 }
591 //CopyMem(KernelAndKextPatches,
592 // &gSettings.KernelAndKextPatches,
593 // sizeof(KERNEL_AND_KEXT_PATCHES));
594 //DBG("Custom KernelAndKextPatches copyed to started entry\n");
595 }
596 } else {
597 DBG(" - [!] LoadUserSettings failed: %s\n", efiStrError(Status));
598 }
599 }
600
601 DBG("Finally: ExternalClock=%lluMHz BusSpeed=%llukHz CPUFreq=%uMHz",
602 DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo),
603 DivU64x32(gCPUStructure.FSBFrequency + kilo - 1, kilo),
604 gCPUStructure.MaxSpeed);
605 if (gSettings.QPI) {
606 DBG(" QPI: hw.busfrequency=%lluHz\n", MultU64x32(gSettings.QPI, Mega));
607 } else {
608 // to match the value of hw.busfrequency in the terminal
609 DBG(" PIS: hw.busfrequency=%lluHz\n", MultU64x32(LShiftU64(DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), 2), Mega));
610 }
611
612 //Free memory
613 for (i = 0; i < ConfigsNum; i++) {
614 if (ConfigsList[i]) {
615 FreePool(ConfigsList[i]);
616 ConfigsList[i] = NULL;
617 }
618 }
619 for (i = 0; i < DsdtsNum; i++) {
620 if (DsdtsList[i]) {
621 FreePool(DsdtsList[i]);
622 DsdtsList[i] = NULL;

Callers 1

RefitMainFunction · 0.80

Calls 15

DbgHeaderFunction · 0.85
LoadUserSettingsFunction · 0.85
GetUserSettingsFunction · 0.85
DivU64x32Function · 0.85
MultU64x32Function · 0.85
LShiftU64Function · 0.85
nsvg__deleteFontFunction · 0.85
LoadEFIImageFunction · 0.85
egClearScreenFunction · 0.85
egSetGraphicsModeEnabledFunction · 0.85
strncmpFunction · 0.85
CheckEmptyFBFunction · 0.85

Tested by

no test coverage detected