Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeySlice committed Sep 2, 2021
2 parents 070037a + f7add07 commit 2e38740
Show file tree
Hide file tree
Showing 13 changed files with 177 additions and 182 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# CloverBootloader
Bootloader for macOS, Windows and Linux in UEFI and in legacy mode
# Features

- Boot macOS, Windows, and Linux in UEFI or legacy mode on Mac or PC with UEFI or BIOS firmware
- Boot using UEFI firmware directly or CloverEFI UEFI firmware emulation
- Customizable GUI including themes, icons, fonts, background images, animations, and mouse pointers.
- Theme manager and theme repository at http://sourceforge.net/p/cloverefiboot/themes/
- Native screen resolution in GUI
- Press Page Up or Page Down to change GUI resolution
- Press **F1** for multilingual help, depending on language setting in configuration
- Press **F2** to save `preboot.log` from GUI
- Press **F4** to save original (OEM) ACPI tables into `/EFI/CLOVER/ACPI/origin`
- Press **F5** to test DSDT patching
- Press **F6** to save graphics firmware into `/EFI/CLOVER/misc`
- Press **F10** to save screenshots from GUI
- Press **F11** to reset NVRAM
- Press **F12** to eject CD/DVD
- GUI refreshes after CD/DVD insertion
- Ability to boot previously selected boot entry after default timeout
- Boot entries menu scrolls if screen resolution is too low for menu
- Create custom boot entries for personalizing boot entries and add support for other operating systems
- Create Clover boot entry in NVRAM with tool from GUI
- Launch EFI command shell from GUI
- Startup sound controlled by **F8** and checked by **F7**
42 changes: 1 addition & 41 deletions buildme
Original file line number Diff line number Diff line change
Expand Up @@ -462,47 +462,7 @@ select opt in "${options[@]}"
break
;;
"test build (no autogen, no boot files)")
Hackintool
break
;;
"Get BitmaskDecode")
BitmaskDecode
break
;;
"Get MaciASL")
MaciASL
break
;;
"Get dmidecode")
dmidecode
break
;;
"Get IOReg-Devices")
Get-IOReg-Devices
break
;;
"Get NativeDisplayBrightness")
NDBrightness
break
;;
"Get SSDTTime")
SSDTTime
break
;;
"Get USBMap")
USBMap
break
;;
"Get QtiASL")
QtiASL
break
;;
"Get CsrDecode")
CsrDecode
break
;;
"Get gibMacOS")
gibMacOS
buildCloverTest
break
;;
"back to buildme")
Expand Down
8 changes: 5 additions & 3 deletions rEFIt_UEFI/Platform/AcpiPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ void DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam

if (pacCount > 0 && pacCount % 3 == 0) {
pacCount /= 3;
DBG(" (Found hidden SSDT %lld pcs)\n", pacCount);
DBG(" (Found hidden SSDT %lld pcs)\n", pacCount);

while (pacCount-- > 0) {
// Skip text marker and addr type tag
Expand All @@ -937,8 +937,10 @@ void DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam
CopyMem(&OemTableId[0], &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8);
OemTableId[8] = 0;
stripTrailingSpaces(OemTableId);
DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId,
((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length);
int innLen = ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length;
if (innLen < 0 || innLen > 0x20000) break;
DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId,
((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, innLen);
for (k = 0; k < 16; k++) {
DBG("%02hhX ", ((UINT8*)adr)[k]);
}
Expand Down
39 changes: 34 additions & 5 deletions rEFIt_UEFI/Platform/Nvram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ void *GetNvramVariable(
XString8 GetNvramVariableAsXString8(
IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL,
OUT UINTN *DataSize OPTIONAL)
OUT UINT32 *Attributes OPTIONAL)
{
EFI_STATUS Status;
XString8 returnValue;
Expand All @@ -166,9 +165,6 @@ XString8 GetNvramVariableAsXString8(
returnValue.setEmpty();
}
}
if (DataSize != NULL) {
*DataSize = IntDataSize;
}
returnValue.dataSized(IntDataSize+1)[IntDataSize] = 0;
returnValue.updateSize();
return returnValue;
Expand Down Expand Up @@ -334,6 +330,39 @@ IsDeletableVariable (
return FALSE;
}

#ifdef JIEF_DEBUG
EFI_STATUS
DumpNvram()
{
EFI_STATUS Status = EFI_NOT_FOUND;
EFI_GUID Guid;
XStringW Name = L""_XSW;
UINTN Size;

DbgHeader("DumpNvram");

ZeroMem (&Guid, sizeof(Guid));

do {
Size = Name.sizeInBytes();
Status = gRT->GetNextVariableName(&Size, Name.dataSized(Size+1), &Guid);
if (Status == EFI_BUFFER_TOO_SMALL) {
Status = gRT->GetNextVariableName (&Size, Name.dataSized(Size+1), &Guid);
}

if ( !EFI_ERROR(Status) ) {
XString8 s = GetNvramVariableAsXString8(Name.wc_str(), &Guid, NULL);
DBG("NVRAM : %s,%ls = '%s'\n", GuidLEToXString8(Guid).c_str(), Name.wc_str(), s.c_str());
}else if ( Status != EFI_NOT_FOUND ) {
DBG("GetNextVariableName returns '%s'\n", efiStrError(Status));
break;
}
} while( Status != EFI_NOT_FOUND );
return Status;
}

#endif

// Reset Native NVRAM by vit9696, reworked and implemented by Sherlocks
EFI_STATUS
ResetNativeNvram ()
Expand Down
9 changes: 7 additions & 2 deletions rEFIt_UEFI/Platform/Nvram.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ void
XString8 GetNvramVariableAsXString8(
IN CONST CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL,
OUT UINTN *DataSize OPTIONAL
OUT UINT32 *Attributes OPTIONAL
);

EFI_STATUS
Expand Down Expand Up @@ -119,4 +118,10 @@ RemoveStartupDiskVolume (void);
UINT64
GetEfiTimeInMs (IN EFI_TIME *T);

#ifdef JIEF_DEBUG
EFI_STATUS DumpNvram();
#endif



#endif /* PLATFORM_NVRAM_H_ */
Loading

0 comments on commit 2e38740

Please sign in to comment.