mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-12 09:54:36 +01:00
Fix bug : it was ignoring legacy with PBR, MBR and CD.
Uncomment eComStation, BeOS, ZETA and Haiku legacy boot sector detection. Return unknown icon instead of dummy. Improve legacy entries title when _LoaderTitle is empty. Create log_technical_bug(). Temporary redirected to panic. Hardened egLoadFile(). Hardened SelfOem. Copy ctor in XStringArray. Improve qemu launch scripts.
This commit is contained in:
parent
caa636eb6d
commit
cc3c8fe0a7
@ -2079,7 +2079,7 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
|
||||
DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
|
||||
|
||||
DEFINE GCC53_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS)
|
||||
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -fno-unwind-tables -Wno-incompatible-ms-struct -mms-bitfields -fno-ms-extensions -ffreestanding -fno-exceptions -nostdinc
|
||||
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -fno-unwind-tables -Wno-incompatible-ms-struct -mms-bitfields -fno-ms-extensions -ffreestanding -fno-exceptions
|
||||
DEFINE GCC53_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections,-z,common-page-size=0x40,--defsym=PECOFF_HEADER_SIZE=0x240,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
|
||||
|
||||
DEFINE GCC53_IA32_X64_ASLDLINK_FLAGS = DEF(GCC53_IA32_X64_DLINK_COMMON),--entry,ReferenceAcpiTable,-u,ReferenceAcpiTable
|
||||
@ -2593,12 +2593,12 @@ RELEASEMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAG
|
||||
|
||||
|
||||
|
||||
DEBUG_XCODE8_X64_CC_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
|
||||
DEBUGMACOS_XCODE8_X64_CC_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS)
|
||||
DEBUG_XCODE8_X64_CC_FLAGS = -g3 -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
|
||||
DEBUGMACOS_XCODE8_X64_CC_FLAGS = -g3 -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS)
|
||||
RELEASE_XCODE8_X64_CC_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror
|
||||
RELEASEMACOS_XCODE8_X64_CC_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS)
|
||||
DEBUG_XCODE8_X64_CXX_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
|
||||
DEBUGMACOS_XCODE8_X64_CXX_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS)
|
||||
DEBUG_XCODE8_X64_CXX_FLAGS = -g3 -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
|
||||
DEBUGMACOS_XCODE8_X64_CXX_FLAGS = -g3 -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS)
|
||||
RELEASE_XCODE8_X64_CXX_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror
|
||||
RELEASEMACOS_XCODE8_X64_CXX_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS)
|
||||
|
||||
|
@ -1,18 +1,17 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"`
|
||||
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
|
||||
SHELL_PWD=$PWD
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
# we can't cd "$SCRIPT_DIR" because the 1st arg maybe a relative path to the current dir (and NOT relative to the SCRIPT_DIR)
|
||||
|
||||
OSTYPE=`uname -s`
|
||||
#echo $OSTYPE
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
if [ -f ../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ]
|
||||
if [ -f "$SCRIPT_DIR"/../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ]
|
||||
then
|
||||
clover_debug_file=../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug
|
||||
clover_debug_file="$SCRIPT_DIR"/../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug
|
||||
echo Using default file "$clover_debug_file"
|
||||
else
|
||||
echo "Usage: $SCRIPT_ABS_FILENAME [Clover debug file]"
|
||||
@ -22,11 +21,6 @@ else
|
||||
clover_debug_file="${1%.*}".debug
|
||||
fi
|
||||
|
||||
if [[ "$clover_debug_file" != '/'* ]]
|
||||
then
|
||||
clover_debug_file="$SHELL_PWD"/"$clover_debug_file"
|
||||
fi
|
||||
|
||||
if ! [ -f "$clover_debug_file" ]
|
||||
then
|
||||
echo Debug file "$clover_debug_file" doesn\'t exist
|
||||
@ -43,8 +37,8 @@ fi
|
||||
echo clover_debug_file="$clover_debug_file"
|
||||
echo clover_efi_file="$clover_efi_file"
|
||||
|
||||
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64
|
||||
qemu_path=./qemu_portable-v5.2.0/qemu-system-x86_64
|
||||
qemu_path="$SCRIPT_DIR"/qemu_portable-v4.2.0/qemu-system-x86_64
|
||||
qemu_path="$SCRIPT_DIR"/qemu_portable-v5.2.0/qemu-system-x86_64
|
||||
#set -x
|
||||
|
||||
if [ "$OSTYPE" = "Darwin" ]
|
||||
@ -54,19 +48,19 @@ then
|
||||
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
|
||||
exit 1
|
||||
fi
|
||||
if ! [ -f ./disk_image_gpt.img ]
|
||||
if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
|
||||
then
|
||||
unzip -o ./disk_image_gpt.img.zip -d .
|
||||
rm -rf ./__MACOSX
|
||||
unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip -d "$SCRIPT_DIR"
|
||||
rm -rf "$SCRIPT_DIR"/__MACOSX
|
||||
fi
|
||||
|
||||
if pgrep qemu
|
||||
then
|
||||
killall qemu-system-x86_64
|
||||
fi
|
||||
> ./serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
|
||||
> "$SCRIPT_DIR"/serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
|
||||
|
||||
hdiutil attach ./disk_image_gpt.img || exit 1
|
||||
hdiutil attach "$SCRIPT_DIR"/disk_image_gpt.img || exit 1
|
||||
|
||||
shopt -s nocasematch
|
||||
|
||||
@ -87,7 +81,8 @@ then
|
||||
sleep 1 # not 100% sure it's needed
|
||||
set -m
|
||||
|
||||
cd .
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
bios_file=("$(dirname "$qemu_path")"/bios*)
|
||||
|
||||
"$qemu_path" \
|
||||
@ -131,7 +126,7 @@ then
|
||||
fi
|
||||
|
||||
adr="$(grep "$image_base_str" ./serial0_qemu_out.log | awk '{printf "0x%x",$NF}')"
|
||||
echo adr="$adr"
|
||||
echo adr="$adr"
|
||||
|
||||
GDB=gdb
|
||||
if [ -f ../../../toolchain.gdb/gdb ]
|
||||
|
20
Qemu/launch
20
Qemu/launch
@ -2,7 +2,7 @@
|
||||
SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"`
|
||||
SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"`
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
# we can't cd "$SCRIPT_DIR" because the 1st arg maybe a relative path to the current dir (and NOT relative to the SCRIPT_DIR)
|
||||
|
||||
OSTYPE=`uname -s`
|
||||
#echo $OSTYPE
|
||||
@ -18,8 +18,8 @@ then
|
||||
echo clover_efi_file="$clover_efi_file"
|
||||
fi
|
||||
|
||||
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64
|
||||
qemu_path=./qemu_portable-v5.2.0/qemu-system-x86_64
|
||||
qemu_path="$SCRIPT_DIR"/qemu_portable-v4.2.0/qemu-system-x86_64
|
||||
qemu_path="$SCRIPT_DIR"/qemu_portable-v5.2.0/qemu-system-x86_64
|
||||
#set -x
|
||||
|
||||
if [ "$OSTYPE" = "Darwin" ]
|
||||
@ -29,22 +29,22 @@ then
|
||||
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
|
||||
exit 1
|
||||
fi
|
||||
if ! [ -f ./disk_image_gpt.img ]
|
||||
if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
|
||||
then
|
||||
unzip -o ./disk_image_gpt.img.zip
|
||||
rm -rf ./__MACOSX
|
||||
unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip -d "$SCRIPT_DIR"
|
||||
rm -rf "$SCRIPT_DIR"/__MACOSX
|
||||
fi
|
||||
|
||||
if pgrep qemu
|
||||
then
|
||||
killall qemu-system-x86_64
|
||||
fi
|
||||
> ./serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
|
||||
> "$SCRIPT_DIR"/serial0_qemu_out.log # empty file without erasing it. Useful for editor for refreshing and reloading.
|
||||
|
||||
if ! [ -z "$clover_efi_file" ]
|
||||
then
|
||||
|
||||
hdiutil attach ./disk_image_gpt.img || exit 1
|
||||
hdiutil attach "$SCRIPT_DIR"/disk_image_gpt.img || exit 1
|
||||
|
||||
shopt -s nocasematch
|
||||
|
||||
@ -64,7 +64,9 @@ then
|
||||
fi
|
||||
|
||||
sleep 1 # not 100% sure it's needed
|
||||
set -m
|
||||
set -m
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
bios_file=("$(dirname "$qemu_path")"/bios*)
|
||||
|
||||
|
@ -26,7 +26,7 @@ if [[ "$SYSNAME" == Linux ]]; then
|
||||
else
|
||||
declare -r NUMBER_OF_CPUS=$(sysctl -n hw.logicalcpu)
|
||||
fi
|
||||
declare -a EDK2_BUILD_OPTIONS=
|
||||
declare -a EDK2_BUILD_OPTIONS=--cmd-len=50000
|
||||
print_option_help_wc=
|
||||
have_fmt=
|
||||
PLATFORMFILE=
|
||||
|
@ -190,33 +190,34 @@ SetNvramVariable (
|
||||
UINTN OldDataSize = 0;
|
||||
UINT32 OldAttributes = 0;
|
||||
|
||||
// DBG("SetNvramVariable (%ls, guid, 0x%X, %lld):", VariableName, Attributes, DataSize);
|
||||
DBG("SetNvramVariable (%ls, guid, 0x%X, %lld):", VariableName, Attributes, DataSize);
|
||||
OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, &OldAttributes, &OldDataSize);
|
||||
if (OldData != NULL) {
|
||||
// var already exists - check if it equal to new value
|
||||
// DBG(" exists(0x%X, %lld)", OldAttributes, OldDataSize);
|
||||
DBG(" exists(0x%X, %lld)", OldAttributes, OldDataSize);
|
||||
if ((OldAttributes == Attributes) &&
|
||||
(OldDataSize == DataSize) &&
|
||||
(CompareMem (OldData, Data, DataSize) == 0)) {
|
||||
// it's the same - do nothing
|
||||
// DBG(", equal -> not writing again.\n");
|
||||
DBG(", equal -> not writing again.\n");
|
||||
FreePool(OldData);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
// DBG(", not equal\n");
|
||||
|
||||
FreePool(OldData);
|
||||
|
||||
// not the same - delete previous one if attributes are different
|
||||
if (OldAttributes != Attributes) {
|
||||
Status = DeleteNvramVariable(VariableName, VendorGuid);
|
||||
// DBG(", diff. attr: deleting old (%s)", efiStrError(Status));
|
||||
DBG(", diff. attr: deleting old (%s)", efiStrError(Status));
|
||||
}else{
|
||||
DBG(", not equal");
|
||||
}
|
||||
}
|
||||
// DBG("\n"); // for debug without Status
|
||||
|
||||
Status = gRT->SetVariable(VariableName, VendorGuid, Attributes, DataSize, (void*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable
|
||||
// DBG(" -> writing new (%s)\n", efiStrError(Status));
|
||||
DBG(" -> writing new (%s)\n", efiStrError(Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -244,7 +245,7 @@ AddNvramVariable (
|
||||
EFI_STATUS Status;
|
||||
void *OldData;
|
||||
|
||||
DBG("SetNvramVariable (%ls, guid, 0x%X, %lld):\n", VariableName, Attributes, DataSize);
|
||||
DBG("AddNvramVariable (%ls, guid, 0x%X, %lld):", VariableName, Attributes, DataSize);
|
||||
OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, NULL, NULL);
|
||||
if (OldData == NULL) {
|
||||
// set new value
|
||||
@ -252,6 +253,7 @@ AddNvramVariable (
|
||||
DBG(" -> writing new (%s)\n", efiStrError(Status));
|
||||
} else {
|
||||
FreePool(OldData);
|
||||
DBG(" -> already exists, abort\n");
|
||||
Status = EFI_ABORTED;
|
||||
}
|
||||
return Status;
|
||||
|
@ -114,7 +114,6 @@ bool SelfOem::_setOemPathRelToSelfDir(bool isFirmwareClover, const XString8& OEM
|
||||
|
||||
EFI_STATUS SelfOem::_initialize()
|
||||
{
|
||||
//DBG("%s : enter.\n", __FUNCTION__);
|
||||
EFI_STATUS Status;
|
||||
|
||||
if ( oemDirExists() ) {
|
||||
@ -134,11 +133,10 @@ EFI_STATUS SelfOem::_initialize()
|
||||
assert( m_OemFulPath.notEmpty() );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if ( m_KextsDir != NULL ) panic("%s : Kexts dir != NULL.", __FUNCTION__);
|
||||
#else
|
||||
if ( m_KextsDir != NULL ) return EFI_SUCCESS;
|
||||
#endif
|
||||
if ( m_KextsDir != NULL ) {
|
||||
log_technical_bug("%s : Kexts dir != NULL.", __PRETTY_FUNCTION__);
|
||||
m_KextsDir = NULL;
|
||||
}
|
||||
if ( oemDirExists() ) {
|
||||
Status = m_OemDir->Open(m_OemDir, &m_KextsDir, KEXTS_DIRNAME.wc_str(), EFI_FILE_MODE_READ, 0);
|
||||
if ( !EFI_ERROR(Status) ) {
|
||||
@ -167,11 +165,11 @@ EFI_STATUS SelfOem::_initialize()
|
||||
}else{
|
||||
}
|
||||
if ( m_KextsDir == NULL ) {
|
||||
assert( m_KextsPathRelToSelfDir.isEmpty() );
|
||||
assert( m_KextsFullPath.isEmpty() );
|
||||
if ( m_KextsPathRelToSelfDir.notEmpty() ) log_technical_bug("%s : m_KextsPathRelToSelfDir.notEmpty()", __PRETTY_FUNCTION__);
|
||||
if ( m_KextsFullPath.notEmpty() ) log_technical_bug("%s : m_KextsFullPath.notEmpty()", __PRETTY_FUNCTION__);
|
||||
}else{
|
||||
assert( m_KextsPathRelToSelfDir.notEmpty() );
|
||||
assert( m_KextsFullPath.notEmpty() );
|
||||
if ( m_KextsPathRelToSelfDir.isEmpty() ) log_technical_bug("%s : m_KextsPathRelToSelfDir.isEmpty()", __PRETTY_FUNCTION__);
|
||||
if ( m_KextsFullPath.isEmpty() ) log_technical_bug("%s : m_KextsFullPath.isEmpty()", __PRETTY_FUNCTION__);
|
||||
}
|
||||
#ifdef JIEF_DEBUG
|
||||
if ( isKextsDirFound() ) {
|
||||
@ -180,14 +178,21 @@ EFI_STATUS SelfOem::_initialize()
|
||||
DBG("Kexts dir = none\n");
|
||||
}
|
||||
#endif
|
||||
//DBG("%s : leave.\n", __FUNCTION__);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS SelfOem::initialize(const XString8& confName, bool isFirmwareClover, const XString8& OEMBoard, const XString8& OEMProduct, INT32 frequency, UINTN nLanCards, UINT8 gLanMac[4][6])
|
||||
{
|
||||
//DBG("%s : enter.\n", __FUNCTION__);
|
||||
if ( m_ConfName.notEmpty() ) panic("%s : cannot be called twice. Use reinitialize.", __FUNCTION__);
|
||||
if ( m_ConfName.notEmpty() ) {
|
||||
log_technical_bug("%s : cannot be called twice. Use reinitialize.", __PRETTY_FUNCTION__);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
// confName must not be empty as it serves as a flag to know if it's initialized or not.
|
||||
// {confName}.plist will also be used to detect OEM dir.
|
||||
if ( confName.isEmpty() ) {
|
||||
log_technical_bug("%s : cannot be called with empty config name.", __PRETTY_FUNCTION__);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
m_ConfName = confName;
|
||||
|
||||
@ -195,42 +200,38 @@ EFI_STATUS SelfOem::initialize(const XString8& confName, bool isFirmwareClover,
|
||||
_setOemPathRelToSelfDir(isFirmwareClover, OEMBoard, OEMProduct, frequency, nLanCards, gLanMac);
|
||||
|
||||
EFI_STATUS Status = _initialize();
|
||||
//DBG("%s : leave. Status=%s.\n", __FUNCTION__, efiStrError(Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
void SelfOem::unInitialize()
|
||||
{
|
||||
//DBG("%s : enter.\n", __FUNCTION__);
|
||||
#ifdef DEBUG
|
||||
if ( m_ConfName.isEmpty() ) panic("%s : Already uninitiialized.", __FUNCTION__);
|
||||
#endif
|
||||
if ( m_ConfName.isEmpty() ) {
|
||||
log_technical_bug("%s : Already uninitialized.", __PRETTY_FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
closeHandle();
|
||||
m_ConfName.setEmpty();
|
||||
//DBG("%s : leave.\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
EFI_STATUS SelfOem::reInitialize()
|
||||
{
|
||||
//DBG("%s : enter.\n", __FUNCTION__);
|
||||
#ifdef DEBUG
|
||||
if ( m_ConfName.isEmpty() ) panic("%s : initialize() must called once first", __FUNCTION__);
|
||||
#endif
|
||||
if ( m_ConfName.isEmpty() ) {
|
||||
log_technical_bug("%s : initialize() must called once first", __PRETTY_FUNCTION__);
|
||||
return EFI_LOAD_ERROR;
|
||||
}
|
||||
|
||||
closeHandle();
|
||||
|
||||
// No need to call _setOemPathRelToSelfDir again, but need to open m_OemDir, if it exists
|
||||
if ( oemDirExists() ) {
|
||||
EFI_STATUS Status = self.getCloverDir().Open(&self.getCloverDir(), &m_OemDir, m_OemPathRelToSelfDir.wc_str(), EFI_FILE_MODE_READ, 0);
|
||||
if ( EFI_ERROR(Status) ) {
|
||||
#ifdef DEBUG
|
||||
panic("Impossible to reopen dir '%ls\\%ls', although it was opened the first time : %s", self.getCloverDirFullPath().wc_str(), m_OemPathRelToSelfDir.wc_str(), efiStrError(Status));
|
||||
#else
|
||||
return Status;
|
||||
#endif
|
||||
log_technical_bug("Impossible to reopen dir '%ls\\%ls', although it was opened the first time : %s", self.getCloverDirFullPath().wc_str(), m_OemPathRelToSelfDir.wc_str(), efiStrError(Status));
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
EFI_STATUS Status = _initialize();
|
||||
//DBG("%s : leave. Status=%s.\n", __FUNCTION__, efiStrError(Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
EFI_STATUS reInitialize();
|
||||
void closeHandle();
|
||||
|
||||
bool isInitialized() const { return m_ConfName.notEmpty(); }
|
||||
|
||||
const XString8& getConfName() { return m_ConfName; }
|
||||
|
||||
bool oemDirExists() { return m_OemPathRelToSelfDir.notEmpty(); }
|
||||
|
@ -295,19 +295,6 @@ bool SETTINGS_DATA::GUIClass::getDarkEmbedded(bool isDaylight) const {
|
||||
EFI_STATUS
|
||||
SaveSettings ();
|
||||
|
||||
UINT32
|
||||
GetCrc32 (
|
||||
UINT8 *Buffer,
|
||||
UINTN Size
|
||||
)
|
||||
{
|
||||
UINT32 x = 0;
|
||||
UINT32 *Fake = (UINT32*)Buffer;
|
||||
if (!Fake) return 0;
|
||||
Size >>= 2;
|
||||
while (Size--) x+= *Fake++;
|
||||
return x;
|
||||
}
|
||||
//
|
||||
//ACPI_NAME_LIST *
|
||||
//ParseACPIName(const XString8& String)
|
||||
|
@ -2294,12 +2294,6 @@ MacOsVersion GetOSVersion(int LoaderType, const XStringW& APFSTargetUUID, const
|
||||
inline MacOsVersion GetOSVersion (IN LOADER_ENTRY *Entry) { return GetOSVersion(Entry->LoaderType, Entry->APFSTargetUUID, Entry->Volume, &Entry->BuildVersion); };
|
||||
|
||||
|
||||
UINT32
|
||||
GetCrc32 (
|
||||
UINT8 *Buffer,
|
||||
UINTN Size
|
||||
);
|
||||
|
||||
void
|
||||
GetDevices(void);
|
||||
|
||||
|
@ -128,6 +128,16 @@ XString8 Bytes2HexStr(UINT8 *data, UINTN len)
|
||||
return result;
|
||||
}
|
||||
|
||||
UINT32 GetCrc32(UINT8 *Buffer, UINTN Size)
|
||||
{
|
||||
UINT32 x = 0;
|
||||
UINT32 *Fake = (UINT32*)Buffer;
|
||||
if (!Fake) return 0;
|
||||
Size >>= 2;
|
||||
while (Size--) x+= *Fake++;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN haveError = FALSE;
|
||||
|
||||
|
@ -120,6 +120,12 @@ inline UINTN EFIAPI AsciiStrDecimalToUintn(const XString8& String)
|
||||
return AsciiStrDecimalToUintn(String.c_str());
|
||||
}
|
||||
|
||||
|
||||
UINT32 GetCrc32(UINT8 *Buffer, UINTN Size);
|
||||
|
||||
|
||||
|
||||
|
||||
extern BOOLEAN haveError;
|
||||
|
||||
|
||||
|
@ -1434,14 +1434,14 @@ UINT16 GetAdvancedCpuType()
|
||||
return GetStandardCpuType();
|
||||
}
|
||||
|
||||
MACHINE_TYPES GetDefaultModel()
|
||||
MACHINE_TYPES GetDefaultModel(bool isMobile)
|
||||
{
|
||||
MACHINE_TYPES DefaultType = iMac132;
|
||||
if (gCPUStructure.Vendor != CPU_VENDOR_INTEL) {
|
||||
return MacPro61;
|
||||
}
|
||||
// TODO: Add more CPU models and configure the correct machines per CPU/GFX model
|
||||
if(gMobile) {
|
||||
if(isMobile) {
|
||||
switch (gCPUStructure.Model)
|
||||
{
|
||||
case CPU_MODEL_ATOM:
|
||||
|
@ -403,7 +403,7 @@ void
|
||||
GetCPUProperties (void);
|
||||
|
||||
MACHINE_TYPES
|
||||
GetDefaultModel (void);
|
||||
GetDefaultModel (bool gMobile);
|
||||
|
||||
UINT16
|
||||
GetAdvancedCpuType (void);
|
||||
|
@ -1308,7 +1308,7 @@ void GetDefaultCpuSettings(SETTINGS_DATA& gSettings)
|
||||
DbgHeader("GetDefaultCpuSettings");
|
||||
MACHINE_TYPES Model;
|
||||
//UINT64 msr = 0;
|
||||
Model = GetDefaultModel();
|
||||
Model = GetDefaultModel(gMobile);
|
||||
gSettings.CPU.CpuType = GetAdvancedCpuType();
|
||||
SetDMISettingsForModel(gSettings, Model, TRUE);
|
||||
|
||||
|
@ -49,11 +49,7 @@ public:
|
||||
}
|
||||
void setKeyValue(const XString8& xstring)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if ( xstring.isEmpty() ) panic("TagKey::setKeyValue() : xstring.isEmpty() ");
|
||||
#else
|
||||
if ( xstring.isEmpty() ) return; //don't change
|
||||
#endif
|
||||
if ( xstring.isEmpty() ) log_technical_bug("TagKey::setKeyValue() : xstring.isEmpty() ");
|
||||
_string = xstring;
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ DBG("%s : UpdateSmbiosString ProductName=%s\n", __PRETTY_FUNCTION__, gSettings.S
|
||||
gSettings.Smbios.SerialNr.trim();
|
||||
if( gSettings.Smbios.SerialNr.notEmpty() ){
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type1->SerialNumber, gSettings.Smbios.SerialNr);
|
||||
DBG("%s : UpdateSmbiosString SerialNr=%s\n", __PRETTY_FUNCTION__, gSettings.Smbios.SerialNr.c_str());
|
||||
//DBG("%s : UpdateSmbiosString SerialNr=%s\n", __PRETTY_FUNCTION__, gSettings.Smbios.SerialNr.c_str());
|
||||
}
|
||||
gSettings.Smbios.BoardNumber.trim();
|
||||
if( gSettings.Smbios.BoardNumber.notEmpty() ){
|
||||
@ -725,7 +725,7 @@ void PatchTableType3()
|
||||
gSettings.Smbios.SerialNr.trim();
|
||||
if( gSettings.Smbios.SerialNr.notEmpty() ){
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type3->SerialNumber, gSettings.Smbios.SerialNr);
|
||||
DBG("%s : UpdateSmbiosString SerialNr=%s\n", __PRETTY_FUNCTION__, gSettings.Smbios.SerialNr.c_str());
|
||||
//DBG("%s : UpdateSmbiosString SerialNr=%s\n", __PRETTY_FUNCTION__, gSettings.Smbios.SerialNr.c_str());
|
||||
}
|
||||
gSettings.Smbios.ChassisAssetTag.trim();
|
||||
if( gSettings.Smbios.ChassisAssetTag.notEmpty() ){
|
||||
|
@ -96,6 +96,30 @@ void panic_ask(const char* format, ...)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Future version to log about pontential technical bugs
|
||||
* It's not done yes. So far, it's just panic
|
||||
* TODO:
|
||||
*/
|
||||
void log_technical_bug(const char* format, ...)
|
||||
{
|
||||
#ifdef PANIC_CAN_RETURN
|
||||
if ( stop_at_panic ) {
|
||||
VA_LIST va;
|
||||
VA_START(va, format);
|
||||
panic_(format, va); // panic doesn't return
|
||||
// VA_END(va);
|
||||
}else{
|
||||
i_have_panicked = true;
|
||||
}
|
||||
#else
|
||||
VA_LIST va;
|
||||
VA_START(va, format);
|
||||
panic_(format, va); // panic doesn't return
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void panic(void)
|
||||
{
|
||||
panic(nullptr);
|
||||
|
@ -34,6 +34,7 @@ void panic(const char* format, ...) __attribute__((__format__(__printf__, 1, 2))
|
||||
|
||||
|
||||
void panic_ask(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
|
||||
void log_technical_bug(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
@ -79,6 +79,29 @@ void panic_ask(const char* format, ...)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Future version to log about pontential technical bugs
|
||||
* It's not done yes. So far, it's just panic
|
||||
* TODO:
|
||||
*/
|
||||
void log_technical_bug(const char* format, ...)
|
||||
{
|
||||
#ifdef PANIC_CAN_RETURN
|
||||
if ( stop_at_panic ) {
|
||||
VA_LIST va;
|
||||
VA_START(va, format);
|
||||
panic_(format, va); // panic doesn't return
|
||||
// VA_END(va);
|
||||
}else{
|
||||
i_have_panicked = true;
|
||||
}
|
||||
#else
|
||||
VA_LIST va;
|
||||
VA_START(va, format);
|
||||
panic_(format, va); // panic doesn't return
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void panic(void)
|
||||
{
|
||||
|
@ -34,6 +34,7 @@ void panic(const char* format, ...) __attribute__((__format__(__printf__, 1, 2))
|
||||
;
|
||||
|
||||
void panic_ask(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
|
||||
void log_technical_bug(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -22,13 +22,26 @@
|
||||
template<class XStringClass_, class XStringArrayClass>
|
||||
class XStringArray_/* : public XStringArraySuper*/
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
XObjArray<XStringClass_> array;
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef XStringClass_ XStringClass;
|
||||
|
||||
XStringArray_() : array() {};
|
||||
|
||||
XStringArray_(const XStringArray_& other) : array() {
|
||||
array = other.array;
|
||||
}
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
XStringArray_(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : array() {
|
||||
for ( size_t idx = 0 ; idx < other.size() ; ++idx ) {
|
||||
array.AddCopy(other[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
// template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
// XStringArrayClass& operator =(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) { array = other.array; return *((XStringArrayClass*)this); }
|
||||
|
||||
size_t size() const { return array.size(); }
|
||||
void setEmpty() { array.setEmpty(); }
|
||||
@ -269,32 +282,77 @@ class XStringArray_/* : public XStringArraySuper*/
|
||||
|
||||
class XString8Array : public XStringArray_<XString8, XString8Array>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<XString8, XString8Array>;
|
||||
|
||||
XString8Array() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
XString8Array(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
|
||||
// template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
// XStringArrayClass& operator =(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) { array = other.array; return *((XStringArrayClass*)this); }
|
||||
};
|
||||
extern const XString8Array NullXString8Array;
|
||||
|
||||
class XString16Array : public XStringArray_<XString16, XString16Array>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<XString16, XString16Array>;
|
||||
|
||||
XString16Array() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
XString16Array(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
};
|
||||
extern const XString16Array NullXString16Array;
|
||||
|
||||
class XString32Array : public XStringArray_<XString32, XString32Array>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<XString32, XString32Array>;
|
||||
|
||||
XString32Array() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
XString32Array(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
};
|
||||
extern const XString32Array NullXString32Array;
|
||||
|
||||
class XStringWArray : public XStringArray_<XStringW, XStringWArray>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<XStringW, XStringWArray>;
|
||||
|
||||
XStringWArray() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
XStringWArray(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
};
|
||||
extern const XStringWArray NullXStringWArray;
|
||||
|
||||
|
||||
class ConstXString8Array : public XStringArray_<const XString8, ConstXString8Array>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<const XString8, ConstXString8Array>;
|
||||
|
||||
ConstXString8Array() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
ConstXString8Array(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
};
|
||||
extern const ConstXString8Array NullConstXString8Array;
|
||||
|
||||
class ConstXStringWArray : public XStringArray_<const XStringW, ConstXStringWArray>
|
||||
{
|
||||
public:
|
||||
using super = XStringArray_<const XStringW, ConstXStringWArray>;
|
||||
|
||||
ConstXStringWArray() : super() {}
|
||||
|
||||
template<typename OtherXStringClass_, class OtherXStringArrayClass>
|
||||
ConstXStringWArray(const XStringArray_<OtherXStringClass_, OtherXStringArrayClass>& other) : super(other) {}
|
||||
};
|
||||
extern const ConstXStringWArray NullConstXStringWArray;
|
||||
|
||||
|
160
rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp
Executable file
160
rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.cpp
Executable file
@ -0,0 +1,160 @@
|
||||
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
||||
#include "../cpp_foundation/XString.h"
|
||||
#include "../cpp_foundation/XStringArray.h"
|
||||
//#include "../cpp_foundation/unicode_conversions.h"
|
||||
//#include "../Platform/plist/plist.h"
|
||||
|
||||
#include "../cpp_lib/XmlLiteSimpleTypes.h"
|
||||
#include "../cpp_lib/XmlLiteCompositeTypes.h"
|
||||
#include "../cpp_lib/XmlLiteDictTypes.h"
|
||||
#include "../cpp_lib/XmlLiteParser.h"
|
||||
|
||||
|
||||
static int breakpoint(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
static XmlLiteParser gXmlLiteParser;
|
||||
|
||||
|
||||
static int repeatingdict_test1()
|
||||
{
|
||||
bool b;
|
||||
|
||||
class DictClass : public XmlRepeatingDict<XmlAddKey<XmlKeyDisablable, XmlString8>>
|
||||
{
|
||||
public:
|
||||
} dict;
|
||||
|
||||
|
||||
const char* config_test =
|
||||
"<dict>\r\n\
|
||||
<key>key1.1</key>\r\n\
|
||||
<string>foo1.1</string>\r\n\
|
||||
<key>key1.2</key>\r\n\
|
||||
<string>foo1.2</string>\r\n\
|
||||
<key>key1.3</key>\r\n\
|
||||
<string>foo1.3</string>\r\n\
|
||||
<key>key1.4</key>\r\n\
|
||||
<string>foo1.4</string>\r\n\
|
||||
</dict>\r\n\
|
||||
</plist>";
|
||||
|
||||
gXmlLiteParser.init(config_test);
|
||||
b = dict.parseFromXmlLite(&gXmlLiteParser, "/"_XS8, true);
|
||||
//gXmlLiteParser.printfErrorsAndWarnings();
|
||||
for ( size_t idx = 0 ; idx < dict.valueArray().size() ; idx++ ) {
|
||||
printf("%s %s\n", dict.valueArray()[idx].key().value().c_str(), dict.valueArray()[idx].value().c_str());
|
||||
}
|
||||
if ( !b ) return breakpoint(1);
|
||||
if ( gXmlLiteParser.getErrorsAndWarnings().size() != 0 ) return breakpoint(1);
|
||||
// if ( mainDict.arrayValue()[0].key() != "key1.1"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[0].value() != "foo1.1"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[1].key() != "key1.2"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[1].value() != "foo1.2"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[2].key() != "key1.3"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[2].value() != "foo1.3"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[3].key() != "key1.4"_XS8 ) return breakpoint(14);
|
||||
// if ( mainDict.arrayValue()[3].value() != "foo1.4"_XS8 ) return breakpoint(14);
|
||||
//
|
||||
// if ( !b ) return breakpoint(1);
|
||||
// gXmlLiteParser.init(config_test);
|
||||
// mainDict.validate(&gXmlLiteParser, "/"_XS8, XmlParserPosition(), true);
|
||||
////gXmlLiteParser.printfErrorsAndWarnings();
|
||||
// if ( !b ) return breakpoint(1);
|
||||
// if ( gXmlLiteParser.getErrorsAndWarnings().size() != 1 ) return breakpoint(1);
|
||||
// if ( !gXmlLiteParser.getErrorsAndWarnings()[0].msg.contains("ict1 tag") ) return breakpoint(14);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int repeatingdict_test2()
|
||||
{
|
||||
bool b;
|
||||
|
||||
class SubDictClass : public XmlAddKey<XmlKey, XmlDict>
|
||||
{
|
||||
public:
|
||||
// using ValueType = Main2Dict_Class;
|
||||
|
||||
XmlBool xmlBool = XmlBool();
|
||||
XmlString8 xmlString = XmlString8();
|
||||
|
||||
XmlDictField m_fields[2] = {
|
||||
{"keybool", xmlBool},
|
||||
{"keystring", xmlString},
|
||||
};
|
||||
|
||||
virtual void getFields(XmlDictField** fields, size_t* nb) override { *fields = m_fields; *nb = sizeof(m_fields)/sizeof(m_fields[0]); };
|
||||
};
|
||||
|
||||
|
||||
class DictClass : public XmlRepeatingDict<SubDictClass>
|
||||
{
|
||||
public:
|
||||
} dict;
|
||||
|
||||
|
||||
const char* config_test =
|
||||
"<dict>\r\n\
|
||||
<key>array2.1</key>\r\n\
|
||||
<dict>\r\n\
|
||||
<key>keybool</key>\r\n\
|
||||
<true/>\r\n\
|
||||
<key>keystring</key>\r\n\
|
||||
<string>foo2.1</string>\r\n\
|
||||
</dict>\r\n\
|
||||
<key>array2.2</key>\r\n\
|
||||
<dict>\r\n\
|
||||
<key>keybool</key>\r\n\
|
||||
<false/>\r\n\
|
||||
<key>keystring</key>\r\n\
|
||||
<string>foo2.2</string>\r\n\
|
||||
</dict>\r\n\
|
||||
</dict>\r\n\
|
||||
</plist>";
|
||||
|
||||
gXmlLiteParser.init(config_test);
|
||||
b = dict.parseFromXmlLite(&gXmlLiteParser, "/"_XS8, true);
|
||||
gXmlLiteParser.printfErrorsAndWarnings();
|
||||
for ( size_t idx = 0 ; idx < dict.valueArray().size() ; idx++ ) {
|
||||
auto item = dict.valueArray()[idx];
|
||||
printf("%s %d %s\n", dict.valueArray()[idx].key().value().c_str(), dict.valueArray()[idx].xmlBool.value(), dict.valueArray()[idx].xmlString.value().c_str());
|
||||
}
|
||||
if ( !b ) return breakpoint(1);
|
||||
if ( gXmlLiteParser.getErrorsAndWarnings().size() != 0 ) return breakpoint(1);
|
||||
if ( dict.valueArray()[0].xmlBool.value() != true ) return breakpoint(14);
|
||||
if ( dict.valueArray()[0].xmlString.value() != "foo2.1"_XS8 ) return breakpoint(14);
|
||||
if ( dict.valueArray()[1].xmlBool.value() != false ) return breakpoint(14);
|
||||
if ( dict.valueArray()[1].xmlString.value() != "foo2.2"_XS8 ) return breakpoint(14);
|
||||
|
||||
// gXmlLiteParser.init(config_test);
|
||||
// mainDict.validate(&gXmlLiteParser, "/"_XS8, XmlParserPosition(), true);
|
||||
////gXmlLiteParser.printfErrorsAndWarnings();
|
||||
// if ( !b ) return breakpoint(1);
|
||||
// if ( gXmlLiteParser.getErrorsAndWarnings().size() != 1 ) return breakpoint(1);
|
||||
// if ( !gXmlLiteParser.getErrorsAndWarnings()[0].msg.contains("dict2 tag") ) return breakpoint(14);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int xml_lite_reapeatingdict_tests()
|
||||
{
|
||||
|
||||
int ret;
|
||||
|
||||
ret = repeatingdict_test1();
|
||||
if ( ret ) return ret;
|
||||
|
||||
ret = repeatingdict_test2();
|
||||
if ( ret ) return ret;
|
||||
|
||||
// ret = repeatingdict_test3();
|
||||
// if ( ret ) return ret;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
1
rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.h
Executable file
1
rEFIt_UEFI/cpp_unit_test/xml_lite-reapeatingdict-test.h
Executable file
@ -0,0 +1 @@
|
||||
int xml_lite_reapeatingdict_tests();
|
@ -57,7 +57,7 @@
|
||||
|
||||
//the function is not in the class and deals always with MainMenu
|
||||
//I made args as pointers to have an ability to call with NULL
|
||||
BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTitle, IN REFIT_VOLUME *Volume, IN const XIcon* Image, IN const XIcon* DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry)
|
||||
BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& _LoaderTitle, IN REFIT_VOLUME *Volume, IN const XIcon* Image, IN const XIcon* DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry)
|
||||
{
|
||||
LEGACY_ENTRY *Entry, *SubEntry;
|
||||
REFIT_MENU_SCREEN *SubScreen;
|
||||
@ -65,20 +65,33 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
|
||||
CHAR16 ShortcutLetter = 0;
|
||||
// INTN i;
|
||||
|
||||
DBG(" AddLegacyEntry:\n");
|
||||
DBG(" FullTitle=%ls\n", FullTitle.wc_str());
|
||||
DBG(" LoaderTitle=%ls\n", _LoaderTitle.wc_str());
|
||||
DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str());
|
||||
|
||||
if (Volume == NULL) {
|
||||
return false;
|
||||
}
|
||||
// Ignore this loader if it's device path is already present in another loader
|
||||
for (UINTN i = 0; i < MainMenu.Entries.size(); ++i) {
|
||||
REFIT_ABSTRACT_MENU_ENTRY& MainEntry = MainMenu.Entries[i];
|
||||
for (UINTN i = 0; i < MainMenu.Entries.size(); ++i) {
|
||||
REFIT_ABSTRACT_MENU_ENTRY& MainEntry = MainMenu.Entries[i];
|
||||
// DBG("entry %lld\n", i);
|
||||
// Only want legacy
|
||||
if (MainEntry.getLEGACY_ENTRY()) {
|
||||
if ( MainEntry.getLEGACY_ENTRY()->DevicePathString.isEqualIC(Volume->DevicePathString) ) {
|
||||
return true;
|
||||
}
|
||||
// Only want legacy
|
||||
if (MainEntry.getLEGACY_ENTRY()) {
|
||||
if ( MainEntry.getLEGACY_ENTRY()->DevicePathString.isEqualIC(Volume->DevicePathString) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XStringW LoaderTitle;
|
||||
if ( _LoaderTitle.isEmpty() ) {
|
||||
LoaderTitle = Volume->LegacyOS->Name;
|
||||
}else{
|
||||
LoaderTitle = _LoaderTitle;
|
||||
}
|
||||
|
||||
XStringW LTitle;
|
||||
if (LoaderTitle.isEmpty()) {
|
||||
if (Volume->LegacyOS->Name.notEmpty()) {
|
||||
@ -97,22 +110,21 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
|
||||
|
||||
// prepare the menu entry
|
||||
Entry = new LEGACY_ENTRY();
|
||||
if (!FullTitle.isEmpty()) {
|
||||
if ( FullTitle.notEmpty() ) {
|
||||
Entry->Title = FullTitle;
|
||||
} else {
|
||||
if (ThemeX.BootCampStyle) {
|
||||
Entry->Title = LTitle;
|
||||
} else {
|
||||
Entry->Title = L"Boot "_XSW + LoaderTitle + L" from "_XSW + VolDesc;
|
||||
// Entry->Title.SWPrintf("Boot %ls from %ls", LoaderTitle->wc_str(), VolDesc);
|
||||
Entry->Title.SWPrintf("Boot %ls from %ls", LoaderTitle.wc_str(), VolDesc.wc_str());
|
||||
}
|
||||
}
|
||||
DBG(" Entry->Title=%ls\n", Entry->Title.wc_str());
|
||||
|
||||
// DBG("Title=%ls\n", Entry->Title);
|
||||
Entry->Row = 0;
|
||||
Entry->ShortcutLetter = (Hotkey == 0) ? ShortcutLetter : Hotkey;
|
||||
|
||||
if (Image) {
|
||||
if ( Image && !Image->isEmpty() ) {
|
||||
Entry->Image = *Image;
|
||||
} else {
|
||||
Entry->Image = ThemeX.LoadOSIcon(Volume->LegacyOS->IconName);
|
||||
@ -319,9 +331,9 @@ void AddCustomLegacy(void)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (/*(Volume->BootType != BOOTING_BY_PBR) && */
|
||||
(Volume->BootType >= BOOTING_BY_MBR) /*&&
|
||||
(Volume->BootType != BOOTING_BY_CD)*/ ) {
|
||||
if ((Volume->BootType != BOOTING_BY_PBR) &&
|
||||
(Volume->BootType != BOOTING_BY_MBR) &&
|
||||
(Volume->BootType != BOOTING_BY_CD)) {
|
||||
DBG("skipped because volume is not legacy bootable\n");
|
||||
continue;
|
||||
}
|
||||
@ -352,11 +364,15 @@ void AddCustomLegacy(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ShowVolume || (Volume->Hidden)) {
|
||||
if ( !ShowVolume ) {
|
||||
DBG("skipped because volume ShowVolume==false\n");
|
||||
continue;
|
||||
}
|
||||
if ( Volume->Hidden ) {
|
||||
DBG("skipped because volume is hidden\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Check for exact volume matches
|
||||
if (Custom.settings.Volume.notEmpty()) {
|
||||
if ((StrStr(Volume->DevicePathString.wc_str(), Custom.settings.Volume.wc_str()) == NULL) &&
|
||||
@ -385,9 +401,10 @@ void AddCustomLegacy(void)
|
||||
DriveIcon.Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.DriveImagePath);
|
||||
}
|
||||
// Create a legacy entry for this volume
|
||||
DBG("\n");
|
||||
if (AddLegacyEntry(Custom.settings.FullTitle, Custom.settings.Title, Volume, &MainIcon, &DriveIcon, Custom.settings.Hotkey, TRUE))
|
||||
{
|
||||
DBG("match!\n");
|
||||
// DBG("match!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
rEFIt_UEFI/generate_source_list.sh
Executable file
8
rEFIt_UEFI/generate_source_list.sh
Executable file
@ -0,0 +1,8 @@
|
||||
|
||||
echo " ../Include/Library/printf_lite-conf.h"
|
||||
echo " ../Include/Library/printf_lite.h"
|
||||
|
||||
find . -not -path "./PlatformPOSIX/*" -and -not -path "./PlatformIA32/*" -and \( -name "*.h" -or -name "*.cpp" -or -name "*.c" \) -print0 | sort -fz | while read -d $'\0' file
|
||||
do
|
||||
echo -e " "$(echo "$file" | sed 's|./||')
|
||||
done
|
@ -926,10 +926,14 @@ const XIcon& XTheme::LoadOSIcon(const XString8& Full)
|
||||
DBG(" Full=%s\n", Full.c_str());
|
||||
if (!ReturnIcon->isEmpty()) return *ReturnIcon;
|
||||
}
|
||||
// else something
|
||||
if (DummyIcon.isEmpty()) { //initialize once per session
|
||||
DummyIcon.Image.DummyImage(MainEntriesSize);
|
||||
DummyIcon.setFilled();
|
||||
if ( Full !="unknown"_XS8 ) {
|
||||
return LoadOSIcon("unknown"_XS8);
|
||||
}else{
|
||||
// else something
|
||||
if (DummyIcon.isEmpty()) { //initialize once per session
|
||||
DummyIcon.Image.DummyImage(MainEntriesSize);
|
||||
DummyIcon.setFilled();
|
||||
}
|
||||
}
|
||||
return DummyIcon;
|
||||
}
|
||||
|
@ -79,11 +79,11 @@ EFI_STATUS egLoadFile(const EFI_FILE* BaseDir, IN CONST CHAR16 *FileName,
|
||||
FileInfo = EfiLibFileInfo(FileHandle);
|
||||
if (FileInfo == NULL) {
|
||||
FileHandle->Close(FileHandle);
|
||||
Status = EFI_NOT_READY;
|
||||
goto Error;
|
||||
}
|
||||
ReadSize = FileInfo->FileSize;
|
||||
if (ReadSize > MAX_FILE_SIZE)
|
||||
ReadSize = MAX_FILE_SIZE;
|
||||
if (ReadSize > MAX_FILE_SIZE) ReadSize = MAX_FILE_SIZE;
|
||||
FreePool(FileInfo);
|
||||
|
||||
BufferSize = (UINTN)ReadSize; // was limited to 1 GB above, so this is safe
|
||||
@ -107,6 +107,11 @@ EFI_STATUS egLoadFile(const EFI_FILE* BaseDir, IN CONST CHAR16 *FileName,
|
||||
if (FileDataLength) {
|
||||
*FileDataLength = BufferSize;
|
||||
}
|
||||
// be 100% sure that we don't return EFI_SUCCESS with *FileData == NULL
|
||||
if ( !EFI_ERROR(Status) && *FileData == NULL ) {
|
||||
log_technical_bug("%s : EFI_ERROR(Status) && ConfigPtr", __PRETTY_FUNCTION__);
|
||||
return EFI_COMPROMISED_DATA;
|
||||
}
|
||||
return Status;
|
||||
Error:
|
||||
if (FileData) {
|
||||
@ -115,6 +120,11 @@ Error:
|
||||
if (FileDataLength) {
|
||||
*FileDataLength = 0;
|
||||
}
|
||||
// be 100% sure that we don't return EFI_SUCCESS with *FileData == NULL
|
||||
if ( !EFI_ERROR(Status) && *FileData == NULL ) {
|
||||
log_technical_bug("%s : EFI_ERROR(Status) && ConfigPtr", __PRETTY_FUNCTION__);
|
||||
return EFI_COMPROMISED_DATA;
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
//Slice - this is gEfiPartTypeSystemPartGuid
|
||||
|
@ -31,34 +31,107 @@
|
||||
#
|
||||
|
||||
[Sources]
|
||||
# EfiLib/GenericBdsLib.h
|
||||
# EfiLib/BmLib.c
|
||||
# Platform/DevicePath.c #included into GenericBdsLib
|
||||
Platform/BdsConnect.cpp #included into GenericBdsLib
|
||||
../Include/Library/printf_lite-conf.h
|
||||
../Include/Library/printf_lite.h
|
||||
PlatformEFI/include/printf_lite-test-cpp_conf.h
|
||||
PlatformEFI/include/Platform.h
|
||||
PlatformEFI/include/XToolsConf.h
|
||||
PlatformEFI/posix/posix.h
|
||||
PlatformEFI/posix/limits.h
|
||||
PlatformEFI/posix/stdarg.h
|
||||
PlatformEFI/posix/stddef.h
|
||||
PlatformEFI/posix/stdint.h
|
||||
PlatformEFI/posix/stdlib.h
|
||||
PlatformEFI/posix/stdio.h
|
||||
PlatformEFI/posix/stdio.cpp
|
||||
PlatformEFI/posix/string.h
|
||||
PlatformEFI/posix/string.cpp
|
||||
PlatformEFI/posix/strings.h
|
||||
PlatformEFI/posix/strings.cpp
|
||||
PlatformEFI/posix/strlen.cpp
|
||||
PlatformEFI/posix/wchar.h
|
||||
PlatformEFI/posix/wchar.cpp
|
||||
PlatformEFI/posix/abort.h
|
||||
PlatformEFI/posix/abort.cpp
|
||||
PlatformEFI/posix/posix_additions.h
|
||||
PlatformEFI/posix/posix_additions.cpp
|
||||
cpp_foundation/shared_ptr.cpp
|
||||
cpp_foundation/shared_ptr.h
|
||||
cpp_foundation/unicode_conversions.cpp
|
||||
cpp_foundation/unicode_conversions.h
|
||||
cpp_foundation/XArray.h
|
||||
cpp_foundation/XBuffer.cpp
|
||||
cpp_foundation/XBuffer.h
|
||||
cpp_foundation/XObjArray.h
|
||||
cpp_foundation/XRBuffer.cpp
|
||||
cpp_foundation/XRBuffer.h
|
||||
cpp_foundation/XString.cpp
|
||||
cpp_foundation/XString.h
|
||||
cpp_foundation/XStringAbstract.h
|
||||
cpp_foundation/XStringArray.cpp
|
||||
cpp_foundation/XStringArray.h
|
||||
cpp_foundation/XToolsCommon.h
|
||||
cpp_lib/undefinable.h
|
||||
cpp_lib/XmlLiteArrayTypes.cpp
|
||||
cpp_lib/XmlLiteArrayTypes.h
|
||||
cpp_lib/XmlLiteCompositeTypes.cpp
|
||||
cpp_lib/XmlLiteCompositeTypes.h
|
||||
cpp_lib/XmlLiteDictTypes.cpp
|
||||
cpp_lib/XmlLiteDictTypes.h
|
||||
cpp_lib/XmlLiteParser.cpp
|
||||
cpp_lib/XmlLiteParser.h
|
||||
cpp_lib/XmlLiteSimpleTypes.cpp
|
||||
cpp_lib/XmlLiteSimpleTypes.h
|
||||
cpp_lib/XmlLiteUnionTypes.cpp
|
||||
cpp_lib/XmlLiteUnionTypes.h
|
||||
cpp_unit_test/all_tests.cpp
|
||||
cpp_unit_test/all_tests.h
|
||||
cpp_unit_test/find_replace_mask_Clover_tests.cpp
|
||||
cpp_unit_test/find_replace_mask_Clover_tests.h
|
||||
cpp_unit_test/find_replace_mask_OC_tests.cpp
|
||||
cpp_unit_test/find_replace_mask_OC_tests.h
|
||||
cpp_unit_test/global_test.cpp
|
||||
cpp_unit_test/global_test.h
|
||||
cpp_unit_test/LoadOptions_test.cpp
|
||||
cpp_unit_test/LoadOptions_test.h
|
||||
cpp_unit_test/MacOsVersion_test.cpp
|
||||
cpp_unit_test/MacOsVersion_test.h
|
||||
cpp_unit_test/plist_tests.cpp
|
||||
cpp_unit_test/plist_tests.h
|
||||
cpp_unit_test/printf_lite-test.cpp
|
||||
cpp_unit_test/printf_lite-test.h
|
||||
cpp_unit_test/printlib-test.cpp
|
||||
cpp_unit_test/printlib-test.h
|
||||
cpp_unit_test/strcasecmp_test.cpp
|
||||
cpp_unit_test/strcasecmp_test.h
|
||||
cpp_unit_test/strcmp_test.cpp
|
||||
cpp_unit_test/strcmp_test.h
|
||||
cpp_unit_test/strlen_test.cpp
|
||||
cpp_unit_test/strlen_test.h
|
||||
cpp_unit_test/strncmp_test.cpp
|
||||
cpp_unit_test/strncmp_test.h
|
||||
cpp_unit_test/XArray_tests.cpp
|
||||
cpp_unit_test/XArray_tests.h
|
||||
cpp_unit_test/XBuffer_tests.cpp
|
||||
cpp_unit_test/XBuffer_tests.h
|
||||
cpp_unit_test/XObjArray_tests.cpp
|
||||
cpp_unit_test/XObjArray_tests.h
|
||||
cpp_unit_test/XStringArray_test.cpp
|
||||
cpp_unit_test/XStringArray_test.h
|
||||
cpp_unit_test/XString_test.cpp
|
||||
cpp_unit_test/XString_test.h
|
||||
cpp_unit_test/XToolsCommon_test.cpp
|
||||
cpp_unit_test/XToolsCommon_test.h
|
||||
entry_scan/bootscreen.cpp
|
||||
entry_scan/bootscreen.h
|
||||
entry_scan/CanonicalDB.h
|
||||
entry_scan/CloverDB.h
|
||||
entry_scan/CloverKEK.h
|
||||
entry_scan/common.cpp
|
||||
entry_scan/common.h
|
||||
entry_scan/entry_scan.h
|
||||
entry_scan/legacy.cpp
|
||||
entry_scan/loader.cpp
|
||||
entry_scan/loader.h
|
||||
entry_scan/lockedgraphics.cpp
|
||||
entry_scan/MSKEK.h
|
||||
entry_scan/MSPCADB.h
|
||||
entry_scan/MSUEFICADB.h
|
||||
entry_scan/secureboot.cpp
|
||||
entry_scan/secureboot.h
|
||||
entry_scan/securebootkeys.h
|
||||
entry_scan/securehash.cpp
|
||||
entry_scan/securemenu.cpp
|
||||
entry_scan/securevars.cpp
|
||||
entry_scan/tool.cpp
|
||||
entry_scan/tool.h
|
||||
gui/menu_items/menu_globals.h
|
||||
gui/menu_items/menu_items.cpp
|
||||
gui/menu_items/menu_items.h
|
||||
gui/REFIT_MAINMENU_SCREEN.cpp
|
||||
gui/REFIT_MAINMENU_SCREEN.h
|
||||
gui/REFIT_MENU_SCREEN.cpp
|
||||
gui/REFIT_MENU_SCREEN.h
|
||||
gui/shared_with_menu.cpp
|
||||
gui/shared_with_menu.h
|
||||
include/BootTypes.h
|
||||
include/Devices.h
|
||||
include/DsdtFixList.h
|
||||
@ -72,220 +145,171 @@
|
||||
include/Pci.h
|
||||
include/QuirksCodes.h
|
||||
include/remove_ref.h
|
||||
include/rename_helper.h
|
||||
include/syslinux_mbr.h
|
||||
include/TagTypes.h
|
||||
include/VolumeTypes.h
|
||||
refit/main.cpp
|
||||
refit/icns.cpp
|
||||
refit/lib.cpp
|
||||
refit/lib.h
|
||||
refit/menu.cpp
|
||||
refit/menu.h
|
||||
refit/screen.cpp
|
||||
refit/screen.h
|
||||
entry_scan/common.cpp
|
||||
entry_scan/common.h
|
||||
entry_scan/legacy.cpp
|
||||
entry_scan/loader.h
|
||||
entry_scan/loader.cpp
|
||||
entry_scan/tool.cpp
|
||||
entry_scan/secureboot.h
|
||||
entry_scan/secureboot.cpp
|
||||
entry_scan/securehash.cpp
|
||||
entry_scan/securemenu.cpp
|
||||
entry_scan/securevars.cpp
|
||||
entry_scan/bootscreen.cpp
|
||||
entry_scan/bootscreen.h
|
||||
entry_scan/lockedgraphics.cpp
|
||||
entry_scan/CanonicalDB.h
|
||||
entry_scan/CloverDB.h
|
||||
entry_scan/CloverKEK.h
|
||||
entry_scan/MSKEK.h
|
||||
entry_scan/MSPCADB.h
|
||||
entry_scan/MSUEFICADB.h
|
||||
entry_scan/entry_scan.h
|
||||
entry_scan/securebootkeys.h
|
||||
gui/menu_items/menu_items.h
|
||||
gui/menu_items/menu_items.cpp
|
||||
gui/menu_items/menu_globals.h
|
||||
gui/REFIT_MENU_SCREEN.cpp
|
||||
gui/REFIT_MENU_SCREEN.h
|
||||
gui/REFIT_MAINMENU_SCREEN.cpp
|
||||
gui/REFIT_MAINMENU_SCREEN.h
|
||||
gui/shared_with_menu.cpp
|
||||
gui/shared_with_menu.h
|
||||
libeg/BmLib.cpp
|
||||
libeg/BmLib.h
|
||||
libeg/EfiFileLib.h
|
||||
libeg/egemb_font.cpp
|
||||
libeg/egemb_icons.cpp
|
||||
libeg/egemb_icons_dark.cpp
|
||||
libeg/egemb_font.cpp
|
||||
libeg/scroll_images.cpp
|
||||
libeg/BmLib.h
|
||||
libeg/BmLib.cpp
|
||||
libeg/image.h
|
||||
libeg/image.cpp
|
||||
# libeg/load_bmp.cpp
|
||||
libeg/load_icns.cpp
|
||||
libeg/libscreen.cpp
|
||||
libeg/lodepng.cpp
|
||||
libeg/lodepng.h
|
||||
libeg/text.cpp
|
||||
libeg/FloatLib.cpp
|
||||
libeg/FloatLib.h
|
||||
libeg/image.cpp
|
||||
libeg/image.h
|
||||
libeg/libeg.h
|
||||
libeg/libegint.h
|
||||
libeg/libscreen.cpp
|
||||
libeg/load_icns.cpp
|
||||
libeg/lodepng.cpp
|
||||
libeg/lodepng.h
|
||||
libeg/nanosvg.cpp
|
||||
libeg/nanosvg.h
|
||||
libeg/nanosvgrast.cpp
|
||||
libeg/VectorGraphics.h
|
||||
libeg/scroll_images.cpp
|
||||
libeg/text.cpp
|
||||
libeg/VectorGraphics.cpp
|
||||
libeg/libeg.h
|
||||
libeg/libegint.h
|
||||
libeg/XImage.cpp
|
||||
libeg/XImage.h
|
||||
libeg/VectorGraphics.h
|
||||
libeg/XCinema.cpp
|
||||
libeg/XCinema.h
|
||||
libeg/XIcon.cpp
|
||||
libeg/XIcon.h
|
||||
libeg/XImage.cpp
|
||||
libeg/XImage.h
|
||||
libeg/XPointer.cpp
|
||||
libeg/XPointer.h
|
||||
libeg/XTheme.cpp
|
||||
libeg/XTheme.h
|
||||
libeg/XCinema.cpp
|
||||
libeg/XCinema.h
|
||||
Platform/AcpiPatcher.h
|
||||
Platform/AcpiPatcher.cpp
|
||||
Platform/APFS.h
|
||||
Platform/APFS.cpp
|
||||
Platform/ati_reg.h
|
||||
Platform/AmlGenerator.cpp
|
||||
Platform/AmlGenerator.h
|
||||
Platform/ati.cpp
|
||||
Platform/ati.h
|
||||
PlatformEFI/BasicIO.cpp
|
||||
Platform/BasicIO.h
|
||||
# Platform/BiosVideo.h
|
||||
# Platform/Bmp.h
|
||||
Platform/boot.h
|
||||
PlatformEFI/BootLog.cpp
|
||||
Platform/BootLog.h
|
||||
Platform/BootOptions.h
|
||||
Platform/BootOptions.cpp
|
||||
Platform/card_vlist.h
|
||||
Platform/card_vlist.cpp
|
||||
Platform/Console.h
|
||||
Platform/Console.cpp
|
||||
Platform/cpu.h
|
||||
Platform/cpu.cpp
|
||||
Platform/DataHubCpu.h
|
||||
Platform/DataHubCpu.cpp
|
||||
# Platform/DataHubRecords.h
|
||||
Platform/device_inject.cpp
|
||||
Platform/device_inject.h
|
||||
# Platform/device_tree.cpp
|
||||
# Platform/device_tree.h
|
||||
Platform/Edid.h
|
||||
Platform/Edid.cpp
|
||||
Platform/Events.cpp
|
||||
Platform/Events.h
|
||||
Platform/FixBiosDsdt.h
|
||||
Platform/FixBiosDsdt.cpp
|
||||
Platform/gma.h
|
||||
Platform/gma.cpp
|
||||
Platform/guid.h
|
||||
Platform/guid.cpp
|
||||
Platform/hda.h
|
||||
Platform/hda.cpp
|
||||
Platform/HdaCodecDump.h
|
||||
Platform/HdaCodecDump.cpp
|
||||
Platform/Injectors.h
|
||||
Platform/AcpiPatcher.h
|
||||
Platform/AmlGenerator.cpp
|
||||
Platform/AmlGenerator.h
|
||||
Platform/APFS.cpp
|
||||
Platform/APFS.h
|
||||
Platform/ati.cpp
|
||||
Platform/ati.h
|
||||
Platform/ati_reg.h
|
||||
Platform/b64cdecode.cpp
|
||||
Platform/b64cdecode.h
|
||||
Platform/BasicIO.h
|
||||
Platform/BdsConnect.cpp
|
||||
Platform/boot.h
|
||||
Platform/BootLog.h
|
||||
Platform/BootOptions.cpp
|
||||
Platform/BootOptions.h
|
||||
Platform/card_vlist.cpp
|
||||
Platform/card_vlist.h
|
||||
Platform/Console.cpp
|
||||
Platform/Console.h
|
||||
Platform/cpu.cpp
|
||||
Platform/cpu.h
|
||||
Platform/DataHub.cpp
|
||||
Platform/DataHub.h
|
||||
Platform/DataHubCpu.cpp
|
||||
Platform/DataHubCpu.h
|
||||
Platform/DataHubExt.h
|
||||
Platform/DevicePath.cpp
|
||||
Platform/device_inject.cpp
|
||||
Platform/device_inject.h
|
||||
Platform/Edid.cpp
|
||||
Platform/Edid.h
|
||||
Platform/Events.cpp
|
||||
Platform/Events.h
|
||||
Platform/FixBiosDsdt.cpp
|
||||
Platform/FixBiosDsdt.h
|
||||
Platform/gma.cpp
|
||||
Platform/gma.h
|
||||
Platform/guid.cpp
|
||||
Platform/guid.h
|
||||
Platform/hda.cpp
|
||||
Platform/hda.h
|
||||
Platform/HdaCodecDump.cpp
|
||||
Platform/HdaCodecDump.h
|
||||
Platform/Hibernate.cpp
|
||||
Platform/Hibernate.h
|
||||
Platform/Injectors.cpp
|
||||
Platform/KERNEL_AND_KEXT_PATCHES.h
|
||||
Platform/Injectors.h
|
||||
Platform/KERNEL_AND_KEXT_PATCHES.cpp
|
||||
Platform/kernel_patcher.h
|
||||
Platform/KERNEL_AND_KEXT_PATCHES.h
|
||||
Platform/kernel_patcher.cpp
|
||||
Platform/kernel_patcher.h
|
||||
Platform/KextList.cpp
|
||||
Platform/KextList.h
|
||||
Platform/kext_inject.cpp
|
||||
Platform/kext_inject.h
|
||||
Platform/kext_patcher.cpp
|
||||
Platform/KextList.h
|
||||
Platform/KextList.cpp
|
||||
Platform/LegacyBiosThunk.h
|
||||
Platform/LegacyBiosThunk.cpp
|
||||
Platform/LegacyBoot.h
|
||||
Platform/LegacyBoot.cpp
|
||||
Platform/LegacyBiosThunk.cpp
|
||||
Platform/LegacyBiosThunk.h
|
||||
Platform/LegacyBoot.cpp
|
||||
Platform/LegacyBoot.h
|
||||
Platform/MacOsVersion.cpp
|
||||
Platform/MacOsVersion.h
|
||||
Platform/MemoryOperation.h
|
||||
Platform/MemoryOperation.c
|
||||
Platform/MemoryOperation.h
|
||||
Platform/memvendors.h
|
||||
Platform/nvidia.h
|
||||
Platform/nvidia.cpp
|
||||
Platform/Net.h
|
||||
Platform/Net.cpp
|
||||
Platform/Nvram.h
|
||||
Platform/Nvram.cpp
|
||||
Platform/platformdata.h
|
||||
Platform/platformdata.cpp
|
||||
Platform/PlatformDriverOverride.h
|
||||
Platform/PlatformDriverOverride.cpp
|
||||
Platform/plist/base64.h
|
||||
Platform/Net.cpp
|
||||
Platform/Net.h
|
||||
Platform/nvidia.cpp
|
||||
Platform/nvidia.h
|
||||
Platform/Nvram.cpp
|
||||
Platform/Nvram.h
|
||||
Platform/platformdata.cpp
|
||||
Platform/platformdata.h
|
||||
Platform/PlatformDriverOverride.cpp
|
||||
Platform/PlatformDriverOverride.h
|
||||
Platform/plist/base64.cpp
|
||||
Platform/plist/plist.h
|
||||
Platform/plist/base64.h
|
||||
Platform/plist/plist.cpp
|
||||
Platform/plist/TagArray.h
|
||||
Platform/plist/plist.h
|
||||
Platform/plist/TagArray.cpp
|
||||
Platform/plist/TagBool.h
|
||||
Platform/plist/TagArray.h
|
||||
Platform/plist/TagBool.cpp
|
||||
Platform/plist/TagData.h
|
||||
Platform/plist/TagBool.h
|
||||
Platform/plist/TagData.cpp
|
||||
Platform/plist/TagDate.h
|
||||
Platform/plist/TagData.h
|
||||
Platform/plist/TagDate.cpp
|
||||
Platform/plist/TagDict.h
|
||||
Platform/plist/TagDate.h
|
||||
Platform/plist/TagDict.cpp
|
||||
Platform/plist/TagFloat.h
|
||||
Platform/plist/TagDict.h
|
||||
Platform/plist/TagFloat.cpp
|
||||
Platform/plist/TagInt64.h
|
||||
Platform/plist/TagFloat.h
|
||||
Platform/plist/TagInt64.cpp
|
||||
Platform/plist/TagKey.h
|
||||
Platform/plist/TagInt64.h
|
||||
Platform/plist/TagKey.cpp
|
||||
Platform/plist/TagString8.h
|
||||
Platform/plist/TagKey.h
|
||||
Platform/plist/TagString8.cpp
|
||||
Platform/plist/xml.h
|
||||
Platform/plist/TagString8.h
|
||||
Platform/plist/xml.cpp
|
||||
# Platform/Pointer.cpp
|
||||
Platform/plist/xml.h
|
||||
Platform/Self.cpp
|
||||
Platform/Self.h
|
||||
Platform/SelfOem.cpp
|
||||
Platform/SelfOem.h
|
||||
Platform/Settings.cpp
|
||||
Platform/Settings.h
|
||||
Platform/smbios.h
|
||||
Platform/smbios.cpp
|
||||
Platform/spd.cpp
|
||||
Platform/spd.h
|
||||
Platform/StateGenerator.cpp
|
||||
Platform/StateGenerator.h
|
||||
# Platform/stringTable.cpp
|
||||
Platform/usbfix.h
|
||||
Platform/usbfix.cpp
|
||||
Platform/Utils.cpp
|
||||
Platform/Utils.h
|
||||
# Platform/UsbMass.h
|
||||
# Platform/UsbMassBoot.h
|
||||
# Platform/UsbMassImpl.h
|
||||
# Platform/VesaBiosExtensions.h
|
||||
Platform/b64cdecode.h
|
||||
Platform/b64cdecode.cpp
|
||||
# Platform/MachO-loader.h
|
||||
# Platform/LoaderUefi.h
|
||||
Platform/Hibernate.cpp
|
||||
Platform/Hibernate.h
|
||||
Platform/smbios.cpp
|
||||
Platform/smbios.h
|
||||
Platform/sound.cpp
|
||||
Platform/spd.cpp
|
||||
Platform/spd.h
|
||||
Platform/sse3_5_patcher.h
|
||||
Platform/sse3_patcher.h
|
||||
Platform/StartupSound.cpp
|
||||
Platform/StartupSound.h
|
||||
# Platform/sse3_patcher.h
|
||||
# Platform/sse3_5_patcher.h
|
||||
Platform/StateGenerator.cpp
|
||||
Platform/StateGenerator.h
|
||||
Platform/usbfix.cpp
|
||||
Platform/usbfix.h
|
||||
Platform/Utils.cpp
|
||||
Platform/Utils.h
|
||||
Platform/VersionString.cpp
|
||||
Platform/VersionString.h
|
||||
Platform/Volumes.cpp
|
||||
Platform/Volumes.h
|
||||
Platform/DataHub.cpp
|
||||
Platform/DataHub.h
|
||||
Platform/DataHubExt.h
|
||||
../Version.h
|
||||
PlatformEFI/BasicIO.cpp
|
||||
PlatformEFI/BootLog.cpp
|
||||
PlatformEFI/cpp_util/globals_ctor.cpp
|
||||
PlatformEFI/cpp_util/globals_ctor.h
|
||||
PlatformEFI/cpp_util/globals_dtor.cpp
|
||||
@ -293,65 +317,38 @@
|
||||
PlatformEFI/cpp_util/operatorNewDelete.cpp
|
||||
PlatformEFI/cpp_util/operatorNewDelete.h
|
||||
PlatformEFI/cpp_util/pure_virtual.cpp
|
||||
cpp_foundation/unicode_conversions.cpp
|
||||
cpp_foundation/unicode_conversions.h
|
||||
cpp_foundation/XArray.h
|
||||
cpp_foundation/XBuffer.cpp
|
||||
cpp_foundation/XBuffer.h
|
||||
cpp_foundation/XRBuffer.cpp
|
||||
cpp_foundation/XRBuffer.h
|
||||
cpp_foundation/XObjArray.h
|
||||
cpp_foundation/XStringAbstract.h
|
||||
cpp_foundation/XString.cpp
|
||||
cpp_foundation/XString.h
|
||||
cpp_foundation/XStringArray.cpp
|
||||
cpp_foundation/XStringArray.h
|
||||
cpp_foundation/XStringArray.cpp
|
||||
cpp_foundation/XToolsCommon.h
|
||||
# cpp_foundation/XUINTN.cpp
|
||||
# cpp_foundation/XUINTN.h
|
||||
cpp_lib/undefinable.h
|
||||
cpp_unit_test/all_tests.h
|
||||
cpp_unit_test/all_tests.cpp
|
||||
# cpp_unit_test/config-test.h
|
||||
# cpp_unit_test/config-test.cpp
|
||||
cpp_unit_test/find_replace_mask_Clover_tests.h
|
||||
cpp_unit_test/find_replace_mask_Clover_tests.cpp
|
||||
cpp_unit_test/find_replace_mask_OC_tests.h
|
||||
cpp_unit_test/find_replace_mask_OC_tests.cpp
|
||||
cpp_unit_test/global_test.h
|
||||
cpp_unit_test/global_test.cpp
|
||||
cpp_unit_test/LoadOptions_test.cpp
|
||||
cpp_unit_test/LoadOptions_test.h
|
||||
cpp_unit_test/MacOsVersion_test.cpp
|
||||
cpp_unit_test/MacOsVersion_test.h
|
||||
cpp_unit_test/printf_lite-test.cpp
|
||||
cpp_unit_test/printf_lite-test.h
|
||||
cpp_unit_test/printlib-test.h
|
||||
cpp_unit_test/strlen_test.cpp
|
||||
cpp_unit_test/strlen_test.h
|
||||
cpp_unit_test/strcmp_test.cpp
|
||||
cpp_unit_test/strcmp_test.h
|
||||
cpp_unit_test/strncmp_test.cpp
|
||||
cpp_unit_test/strncmp_test.h
|
||||
cpp_unit_test/XArray_tests.cpp
|
||||
cpp_unit_test/XArray_tests.h
|
||||
cpp_unit_test/XBuffer_tests.cpp
|
||||
cpp_unit_test/XBuffer_tests.h
|
||||
# cpp_unit_test/xml_lite-test.cpp
|
||||
# cpp_unit_test/xml_lite-test.h
|
||||
cpp_unit_test/XObjArray_tests.cpp
|
||||
cpp_unit_test/XObjArray_tests.h
|
||||
cpp_unit_test/XString_test.cpp
|
||||
cpp_unit_test/XString_test.h
|
||||
cpp_unit_test/XStringArray_test.cpp
|
||||
cpp_unit_test/XStringArray_test.h
|
||||
cpp_unit_test/plist_tests.cpp
|
||||
cpp_unit_test/plist_tests.h
|
||||
cpp_unit_test/XToolsCommon_test.cpp
|
||||
cpp_unit_test/XToolsCommon_test.h
|
||||
# cpp_unit_test/XUINTN_test.cpp
|
||||
# cpp_unit_test/XUINTN_test.h
|
||||
PlatformEFI/include/Platform.h
|
||||
PlatformEFI/include/printf_lite-test-cpp_conf.h
|
||||
PlatformEFI/include/printlib-test-cpp_conf.h
|
||||
PlatformEFI/include/XToolsConf.h
|
||||
PlatformEFI/posix/abort.cpp
|
||||
PlatformEFI/posix/abort.h
|
||||
PlatformEFI/posix/limits.h
|
||||
PlatformEFI/posix/posix.h
|
||||
PlatformEFI/posix/posix_additions.cpp
|
||||
PlatformEFI/posix/posix_additions.h
|
||||
PlatformEFI/posix/stdarg.h
|
||||
PlatformEFI/posix/stdbool.h
|
||||
PlatformEFI/posix/stddef.h
|
||||
PlatformEFI/posix/stdint.h
|
||||
PlatformEFI/posix/stdio.cpp
|
||||
PlatformEFI/posix/stdio.h
|
||||
PlatformEFI/posix/stdlib.h
|
||||
PlatformEFI/posix/string.cpp
|
||||
PlatformEFI/posix/string.h
|
||||
PlatformEFI/posix/strings.cpp
|
||||
PlatformEFI/posix/strings.h
|
||||
PlatformEFI/posix/strlen.cpp
|
||||
PlatformEFI/posix/wchar.cpp
|
||||
PlatformEFI/posix/wchar.h
|
||||
refit/icns.cpp
|
||||
refit/lib.cpp
|
||||
refit/lib.h
|
||||
refit/main.cpp
|
||||
refit/menu.cpp
|
||||
refit/menu.h
|
||||
refit/screen.cpp
|
||||
refit/screen.h
|
||||
|
||||
[Sources.IA32]
|
||||
PlatformIA32/ftol.asm | MSFT
|
||||
|
@ -482,37 +482,37 @@ static void ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl
|
||||
Volume->LegacyOS->Name = L"FreeDOS"_XSW;
|
||||
Volume->LegacyOS->Type = OSTYPE_VAR;
|
||||
Volume->BootType = BOOTING_BY_PBR;
|
||||
/*
|
||||
|
||||
} else if (FindMem(SectorBuffer, 512, "OS2LDR", 6) >= 0 ||
|
||||
FindMem(SectorBuffer, 512, "OS2BOOT", 7) >= 0) {
|
||||
Volume->HasBootCode = TRUE;
|
||||
Volume->LegacyOS->IconName = L"ecomstation";
|
||||
Volume->LegacyOS->Name = L"eComStation";
|
||||
Volume->LegacyOS->IconName = L"ecomstation"_XSW;
|
||||
Volume->LegacyOS->Name = L"eComStation"_XSW;
|
||||
Volume->LegacyOS->Type = OSTYPE_VAR;
|
||||
Volume->BootType = BOOTING_BY_PBR;
|
||||
|
||||
} else if (FindMem(SectorBuffer, 512, "Be Boot Loader", 14) >= 0) {
|
||||
Volume->HasBootCode = TRUE;
|
||||
Volume->LegacyOS->IconName = L"beos";
|
||||
Volume->LegacyOS->Name = L"BeOS";
|
||||
Volume->LegacyOS->IconName = L"beos"_XSW;
|
||||
Volume->LegacyOS->Name = L"BeOS"_XSW;
|
||||
Volume->LegacyOS->Type = OSTYPE_VAR;
|
||||
Volume->BootType = BOOTING_BY_PBR;
|
||||
|
||||
} else if (FindMem(SectorBuffer, 512, "yT Boot Loader", 14) >= 0) {
|
||||
Volume->HasBootCode = TRUE;
|
||||
Volume->LegacyOS->IconName = L"zeta";
|
||||
Volume->LegacyOS->Name = L"ZETA";
|
||||
Volume->LegacyOS->IconName = L"zeta"_XSW;
|
||||
Volume->LegacyOS->Name = L"ZETA"_XSW;
|
||||
Volume->LegacyOS->Type = OSTYPE_VAR;
|
||||
Volume->BootType = BOOTING_BY_PBR;
|
||||
|
||||
} else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
|
||||
FindMem(SectorBuffer, 512, "haiku_loader", 12) >= 0) {
|
||||
Volume->HasBootCode = TRUE;
|
||||
Volume->LegacyOS->IconName = L"haiku";
|
||||
Volume->LegacyOS->Name = L"Haiku";
|
||||
Volume->LegacyOS->IconName = L"haiku"_XSW;
|
||||
Volume->LegacyOS->Name = L"Haiku"_XSW;
|
||||
Volume->LegacyOS->Type = OSTYPE_VAR;
|
||||
Volume->BootType = BOOTING_BY_PBR;
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -530,10 +530,10 @@ static void ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl
|
||||
Volume->HasBootCode = FALSE;
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
//*Bootable = TRUE;
|
||||
////*Bootable = TRUE;
|
||||
//Volume->HasBootCode = TRUE;
|
||||
//Volume->LegacyOS->IconName = L"win";
|
||||
//Volume->LegacyOS->Name = L"Windows";
|
||||
//Volume->LegacyOS->IconName = L"win"_XSW;
|
||||
//Volume->LegacyOS->Name = L"Windows"_XSW;
|
||||
//Volume->LegacyOS->Type = OSTYPE_WIN;
|
||||
//Volume->BootType = BOOTING_BY_PBR;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user