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

Function RefitMain

rEFIt_UEFI/refit/main.cpp:1772–2710  ·  view source on GitHub ↗

main entry point

Source from the content-addressed store, hash-verified

1770// main entry point
1771//
1772EFI_STATUS
1773EFIAPI
1774RefitMain (IN EFI_HANDLE ImageHandle,
1775 IN EFI_SYSTEM_TABLE *SystemTable)
1776{
1777 EFI_STATUS Status;
1778 BOOLEAN MainLoopRunning = TRUE;
1779 BOOLEAN ReinitDesktop = TRUE;
1780 BOOLEAN AfterTool = FALSE;
1781 REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL;
1782 REFIT_ABSTRACT_MENU_ENTRY *DefaultEntry = NULL;
1783 REFIT_ABSTRACT_MENU_ENTRY *OptionEntry = NULL;
1784 INTN DefaultIndex;
1785 UINTN MenuExit;
1786 UINTN i;
1787 //UINT64 TscDiv;
1788 //UINT64 TscRemainder = 0;
1789// LOADER_ENTRY *LoaderEntry;
1790 XStringW ConfName;
1791 TagDict* smbiosTags = NULL;
1792 BOOLEAN UniteConfigs = FALSE;
1793 EFI_TIME Now;
1794 BOOLEAN HaveDefaultVolume;
1795 REFIT_MENU_SCREEN BootScreen;
1796 BootScreen.isBootScreen = true; //other screens will be constructed as false
1797 // CHAR16 *InputBuffer; //, *Y;
1798 // EFI_INPUT_KEY Key;
1799
1800 // Init assets dir: misc
1801 /*Status = */ //egMkDir(SelfRootDir, L"EFI\\CLOVER\\misc");
1802 //Should apply to: "ACPI/origin/" too
1803
1804 // get TSC freq and init MemLog if needed
1805 gCPUStructure.TSCCalibr = GetMemLogTscTicksPerSecond(); //ticks for 1second
1806 //GlobalConfig.TextOnly = TRUE;
1807
1808 // bootstrap
1809 gST = SystemTable;
1810 gImageHandle = ImageHandle;
1811 gBS = SystemTable->BootServices;
1812 gRT = SystemTable->RuntimeServices;
1813 /*Status = */EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
1814
1815 ConsoleInHandle = SystemTable->ConsoleInHandle;
1816
1817 {
1818 EFI_LOADED_IMAGE* LoadedImage;
1819 Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage);
1820
1821// if ( !EFI_ERROR(Status) ) {
1822// XString8 msg = S8Printf("Clover : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
1823// SerialPortWrite((UINT8*)msg.c_str(), msg.length());
1824// }
1825 if ( !EFI_ERROR(Status) ) DBG("Clover : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
1826
1827#ifdef JIEF_DEBUG
1828 gBS->Stall(1500000); // to give time to gdb to connect
1829// gBS->Stall(0500000); // to give time to gdb to connect

Callers

nothing calls this directly

Calls 15

InitializeConsoleSimFunction · 0.85
InitBooterLogFunction · 0.85
InitRefitLibFunction · 0.85
PrepatchSmbiosFunction · 0.85
GetCPUPropertiesFunction · 0.85
GetDevicesFunction · 0.85
GetDefaultSettingsFunction · 0.85
GetBootFromOptionFunction · 0.85
ParseLoadOptionsFunction · 0.85

Tested by

no test coverage detected