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:
jief666 2021-04-23 15:20:48 +03:00
parent caa636eb6d
commit cc3c8fe0a7
29 changed files with 685 additions and 386 deletions

View File

@ -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 GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
DEFINE GCC53_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) 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_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 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))" 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 = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) 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 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) 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))" 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 = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) 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 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) RELEASEMACOS_XCODE8_X64_CXX_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS)

View File

@ -1,18 +1,17 @@
#!/bin/bash #!/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_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"` 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` OSTYPE=`uname -s`
#echo $OSTYPE #echo $OSTYPE
if [ -z "$1" ] if [ -z "$1" ]
then then
if [ -f ../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ] if [ -f "$SCRIPT_DIR"/../Build/Clover/DEBUG_GCC53/X64/CLOVERX64.debug ]
then 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" echo Using default file "$clover_debug_file"
else else
echo "Usage: $SCRIPT_ABS_FILENAME [Clover debug file]" echo "Usage: $SCRIPT_ABS_FILENAME [Clover debug file]"
@ -22,11 +21,6 @@ else
clover_debug_file="${1%.*}".debug clover_debug_file="${1%.*}".debug
fi fi
if [[ "$clover_debug_file" != '/'* ]]
then
clover_debug_file="$SHELL_PWD"/"$clover_debug_file"
fi
if ! [ -f "$clover_debug_file" ] if ! [ -f "$clover_debug_file" ]
then then
echo Debug file "$clover_debug_file" doesn\'t exist echo Debug file "$clover_debug_file" doesn\'t exist
@ -43,8 +37,8 @@ fi
echo clover_debug_file="$clover_debug_file" echo clover_debug_file="$clover_debug_file"
echo clover_efi_file="$clover_efi_file" echo clover_efi_file="$clover_efi_file"
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64 qemu_path="$SCRIPT_DIR"/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-v5.2.0/qemu-system-x86_64
#set -x #set -x
if [ "$OSTYPE" = "Darwin" ] if [ "$OSTYPE" = "Darwin" ]
@ -54,19 +48,19 @@ then
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'" echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
exit 1 exit 1
fi fi
if ! [ -f ./disk_image_gpt.img ] if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
then then
unzip -o ./disk_image_gpt.img.zip -d . unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip -d "$SCRIPT_DIR"
rm -rf ./__MACOSX rm -rf "$SCRIPT_DIR"/__MACOSX
fi fi
if pgrep qemu if pgrep qemu
then then
killall qemu-system-x86_64 killall qemu-system-x86_64
fi 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 shopt -s nocasematch
@ -87,7 +81,8 @@ then
sleep 1 # not 100% sure it's needed sleep 1 # not 100% sure it's needed
set -m set -m
cd . cd "$SCRIPT_DIR"
bios_file=("$(dirname "$qemu_path")"/bios*) bios_file=("$(dirname "$qemu_path")"/bios*)
"$qemu_path" \ "$qemu_path" \
@ -131,7 +126,7 @@ then
fi fi
adr="$(grep "$image_base_str" ./serial0_qemu_out.log | awk '{printf "0x%x",$NF}')" adr="$(grep "$image_base_str" ./serial0_qemu_out.log | awk '{printf "0x%x",$NF}')"
echo adr="$adr" echo adr="$adr"
GDB=gdb GDB=gdb
if [ -f ../../../toolchain.gdb/gdb ] if [ -f ../../../toolchain.gdb/gdb ]

View File

@ -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_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"` 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` OSTYPE=`uname -s`
#echo $OSTYPE #echo $OSTYPE
@ -18,8 +18,8 @@ then
echo clover_efi_file="$clover_efi_file" echo clover_efi_file="$clover_efi_file"
fi fi
qemu_path=./qemu_portable-v4.2.0/qemu-system-x86_64 qemu_path="$SCRIPT_DIR"/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-v5.2.0/qemu-system-x86_64
#set -x #set -x
if [ "$OSTYPE" = "Darwin" ] if [ "$OSTYPE" = "Darwin" ]
@ -29,22 +29,22 @@ then
echo "You must restore the folder \'"$(dirname "$qemu_path")"\'" echo "You must restore the folder \'"$(dirname "$qemu_path")"\'"
exit 1 exit 1
fi fi
if ! [ -f ./disk_image_gpt.img ] if ! [ -f "$SCRIPT_DIR"/disk_image_gpt.img ]
then then
unzip -o ./disk_image_gpt.img.zip unzip -o "$SCRIPT_DIR"/disk_image_gpt.img.zip -d "$SCRIPT_DIR"
rm -rf ./__MACOSX rm -rf "$SCRIPT_DIR"/__MACOSX
fi fi
if pgrep qemu if pgrep qemu
then then
killall qemu-system-x86_64 killall qemu-system-x86_64
fi 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" ] if ! [ -z "$clover_efi_file" ]
then then
hdiutil attach ./disk_image_gpt.img || exit 1 hdiutil attach "$SCRIPT_DIR"/disk_image_gpt.img || exit 1
shopt -s nocasematch shopt -s nocasematch
@ -64,7 +64,9 @@ then
fi fi
sleep 1 # not 100% sure it's needed sleep 1 # not 100% sure it's needed
set -m set -m
cd "$SCRIPT_DIR"
bios_file=("$(dirname "$qemu_path")"/bios*) bios_file=("$(dirname "$qemu_path")"/bios*)

View File

@ -26,7 +26,7 @@ if [[ "$SYSNAME" == Linux ]]; then
else else
declare -r NUMBER_OF_CPUS=$(sysctl -n hw.logicalcpu) declare -r NUMBER_OF_CPUS=$(sysctl -n hw.logicalcpu)
fi fi
declare -a EDK2_BUILD_OPTIONS= declare -a EDK2_BUILD_OPTIONS=--cmd-len=50000
print_option_help_wc= print_option_help_wc=
have_fmt= have_fmt=
PLATFORMFILE= PLATFORMFILE=

View File

@ -190,33 +190,34 @@ SetNvramVariable (
UINTN OldDataSize = 0; UINTN OldDataSize = 0;
UINT32 OldAttributes = 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); OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, &OldAttributes, &OldDataSize);
if (OldData != NULL) { if (OldData != NULL) {
// var already exists - check if it equal to new value // 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) && if ((OldAttributes == Attributes) &&
(OldDataSize == DataSize) && (OldDataSize == DataSize) &&
(CompareMem (OldData, Data, DataSize) == 0)) { (CompareMem (OldData, Data, DataSize) == 0)) {
// it's the same - do nothing // it's the same - do nothing
// DBG(", equal -> not writing again.\n"); DBG(", equal -> not writing again.\n");
FreePool(OldData); FreePool(OldData);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
// DBG(", not equal\n");
FreePool(OldData); FreePool(OldData);
// not the same - delete previous one if attributes are different // not the same - delete previous one if attributes are different
if (OldAttributes != Attributes) { if (OldAttributes != Attributes) {
Status = DeleteNvramVariable(VariableName, VendorGuid); 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 // DBG("\n"); // for debug without Status
Status = gRT->SetVariable(VariableName, VendorGuid, Attributes, DataSize, (void*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable 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; return Status;
} }
@ -244,7 +245,7 @@ AddNvramVariable (
EFI_STATUS Status; EFI_STATUS Status;
void *OldData; 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); OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, NULL, NULL);
if (OldData == NULL) { if (OldData == NULL) {
// set new value // set new value
@ -252,6 +253,7 @@ AddNvramVariable (
DBG(" -> writing new (%s)\n", efiStrError(Status)); DBG(" -> writing new (%s)\n", efiStrError(Status));
} else { } else {
FreePool(OldData); FreePool(OldData);
DBG(" -> already exists, abort\n");
Status = EFI_ABORTED; Status = EFI_ABORTED;
} }
return Status; return Status;

View File

@ -114,7 +114,6 @@ bool SelfOem::_setOemPathRelToSelfDir(bool isFirmwareClover, const XString8& OEM
EFI_STATUS SelfOem::_initialize() EFI_STATUS SelfOem::_initialize()
{ {
//DBG("%s : enter.\n", __FUNCTION__);
EFI_STATUS Status; EFI_STATUS Status;
if ( oemDirExists() ) { if ( oemDirExists() ) {
@ -134,11 +133,10 @@ EFI_STATUS SelfOem::_initialize()
assert( m_OemFulPath.notEmpty() ); assert( m_OemFulPath.notEmpty() );
} }
#ifdef DEBUG if ( m_KextsDir != NULL ) {
if ( m_KextsDir != NULL ) panic("%s : Kexts dir != NULL.", __FUNCTION__); log_technical_bug("%s : Kexts dir != NULL.", __PRETTY_FUNCTION__);
#else m_KextsDir = NULL;
if ( m_KextsDir != NULL ) return EFI_SUCCESS; }
#endif
if ( oemDirExists() ) { if ( oemDirExists() ) {
Status = m_OemDir->Open(m_OemDir, &m_KextsDir, KEXTS_DIRNAME.wc_str(), EFI_FILE_MODE_READ, 0); Status = m_OemDir->Open(m_OemDir, &m_KextsDir, KEXTS_DIRNAME.wc_str(), EFI_FILE_MODE_READ, 0);
if ( !EFI_ERROR(Status) ) { if ( !EFI_ERROR(Status) ) {
@ -167,11 +165,11 @@ EFI_STATUS SelfOem::_initialize()
}else{ }else{
} }
if ( m_KextsDir == NULL ) { if ( m_KextsDir == NULL ) {
assert( m_KextsPathRelToSelfDir.isEmpty() ); if ( m_KextsPathRelToSelfDir.notEmpty() ) log_technical_bug("%s : m_KextsPathRelToSelfDir.notEmpty()", __PRETTY_FUNCTION__);
assert( m_KextsFullPath.isEmpty() ); if ( m_KextsFullPath.notEmpty() ) log_technical_bug("%s : m_KextsFullPath.notEmpty()", __PRETTY_FUNCTION__);
}else{ }else{
assert( m_KextsPathRelToSelfDir.notEmpty() ); if ( m_KextsPathRelToSelfDir.isEmpty() ) log_technical_bug("%s : m_KextsPathRelToSelfDir.isEmpty()", __PRETTY_FUNCTION__);
assert( m_KextsFullPath.notEmpty() ); if ( m_KextsFullPath.isEmpty() ) log_technical_bug("%s : m_KextsFullPath.isEmpty()", __PRETTY_FUNCTION__);
} }
#ifdef JIEF_DEBUG #ifdef JIEF_DEBUG
if ( isKextsDirFound() ) { if ( isKextsDirFound() ) {
@ -180,14 +178,21 @@ EFI_STATUS SelfOem::_initialize()
DBG("Kexts dir = none\n"); DBG("Kexts dir = none\n");
} }
#endif #endif
//DBG("%s : leave.\n", __FUNCTION__);
return EFI_SUCCESS; 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]) 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() ) {
if ( m_ConfName.notEmpty() ) panic("%s : cannot be called twice. Use reinitialize.", __FUNCTION__); 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; m_ConfName = confName;
@ -195,42 +200,38 @@ EFI_STATUS SelfOem::initialize(const XString8& confName, bool isFirmwareClover,
_setOemPathRelToSelfDir(isFirmwareClover, OEMBoard, OEMProduct, frequency, nLanCards, gLanMac); _setOemPathRelToSelfDir(isFirmwareClover, OEMBoard, OEMProduct, frequency, nLanCards, gLanMac);
EFI_STATUS Status = _initialize(); EFI_STATUS Status = _initialize();
//DBG("%s : leave. Status=%s.\n", __FUNCTION__, efiStrError(Status));
return Status; return Status;
} }
void SelfOem::unInitialize() void SelfOem::unInitialize()
{ {
//DBG("%s : enter.\n", __FUNCTION__); if ( m_ConfName.isEmpty() ) {
#ifdef DEBUG log_technical_bug("%s : Already uninitialized.", __PRETTY_FUNCTION__);
if ( m_ConfName.isEmpty() ) panic("%s : Already uninitiialized.", __FUNCTION__); return;
#endif }
closeHandle(); closeHandle();
m_ConfName.setEmpty(); m_ConfName.setEmpty();
//DBG("%s : leave.\n", __FUNCTION__);
} }
EFI_STATUS SelfOem::reInitialize() EFI_STATUS SelfOem::reInitialize()
{ {
//DBG("%s : enter.\n", __FUNCTION__); if ( m_ConfName.isEmpty() ) {
#ifdef DEBUG log_technical_bug("%s : initialize() must called once first", __PRETTY_FUNCTION__);
if ( m_ConfName.isEmpty() ) panic("%s : initialize() must called once first", __FUNCTION__); return EFI_LOAD_ERROR;
#endif }
closeHandle(); closeHandle();
// No need to call _setOemPathRelToSelfDir again, but need to open m_OemDir, if it exists // No need to call _setOemPathRelToSelfDir again, but need to open m_OemDir, if it exists
if ( oemDirExists() ) { if ( oemDirExists() ) {
EFI_STATUS Status = self.getCloverDir().Open(&self.getCloverDir(), &m_OemDir, m_OemPathRelToSelfDir.wc_str(), EFI_FILE_MODE_READ, 0); EFI_STATUS Status = self.getCloverDir().Open(&self.getCloverDir(), &m_OemDir, m_OemPathRelToSelfDir.wc_str(), EFI_FILE_MODE_READ, 0);
if ( EFI_ERROR(Status) ) { if ( EFI_ERROR(Status) ) {
#ifdef DEBUG 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));
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)); return Status;
#else
return Status;
#endif
} }
} }
EFI_STATUS Status = _initialize(); EFI_STATUS Status = _initialize();
//DBG("%s : leave. Status=%s.\n", __FUNCTION__, efiStrError(Status));
return Status; return Status;
} }

View File

@ -45,6 +45,8 @@ public:
EFI_STATUS reInitialize(); EFI_STATUS reInitialize();
void closeHandle(); void closeHandle();
bool isInitialized() const { return m_ConfName.notEmpty(); }
const XString8& getConfName() { return m_ConfName; } const XString8& getConfName() { return m_ConfName; }
bool oemDirExists() { return m_OemPathRelToSelfDir.notEmpty(); } bool oemDirExists() { return m_OemPathRelToSelfDir.notEmpty(); }

View File

@ -295,19 +295,6 @@ bool SETTINGS_DATA::GUIClass::getDarkEmbedded(bool isDaylight) const {
EFI_STATUS EFI_STATUS
SaveSettings (); 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 * //ACPI_NAME_LIST *
//ParseACPIName(const XString8& String) //ParseACPIName(const XString8& String)

View File

@ -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); }; inline MacOsVersion GetOSVersion (IN LOADER_ENTRY *Entry) { return GetOSVersion(Entry->LoaderType, Entry->APFSTargetUUID, Entry->Volume, &Entry->BuildVersion); };
UINT32
GetCrc32 (
UINT8 *Buffer,
UINTN Size
);
void void
GetDevices(void); GetDevices(void);

View File

@ -128,6 +128,16 @@ XString8 Bytes2HexStr(UINT8 *data, UINTN len)
return result; 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; BOOLEAN haveError = FALSE;

View File

@ -120,6 +120,12 @@ inline UINTN EFIAPI AsciiStrDecimalToUintn(const XString8& String)
return AsciiStrDecimalToUintn(String.c_str()); return AsciiStrDecimalToUintn(String.c_str());
} }
UINT32 GetCrc32(UINT8 *Buffer, UINTN Size);
extern BOOLEAN haveError; extern BOOLEAN haveError;

View File

@ -1434,14 +1434,14 @@ UINT16 GetAdvancedCpuType()
return GetStandardCpuType(); return GetStandardCpuType();
} }
MACHINE_TYPES GetDefaultModel() MACHINE_TYPES GetDefaultModel(bool isMobile)
{ {
MACHINE_TYPES DefaultType = iMac132; MACHINE_TYPES DefaultType = iMac132;
if (gCPUStructure.Vendor != CPU_VENDOR_INTEL) { if (gCPUStructure.Vendor != CPU_VENDOR_INTEL) {
return MacPro61; return MacPro61;
} }
// TODO: Add more CPU models and configure the correct machines per CPU/GFX model // TODO: Add more CPU models and configure the correct machines per CPU/GFX model
if(gMobile) { if(isMobile) {
switch (gCPUStructure.Model) switch (gCPUStructure.Model)
{ {
case CPU_MODEL_ATOM: case CPU_MODEL_ATOM:

View File

@ -403,7 +403,7 @@ void
GetCPUProperties (void); GetCPUProperties (void);
MACHINE_TYPES MACHINE_TYPES
GetDefaultModel (void); GetDefaultModel (bool gMobile);
UINT16 UINT16
GetAdvancedCpuType (void); GetAdvancedCpuType (void);

View File

@ -1308,7 +1308,7 @@ void GetDefaultCpuSettings(SETTINGS_DATA& gSettings)
DbgHeader("GetDefaultCpuSettings"); DbgHeader("GetDefaultCpuSettings");
MACHINE_TYPES Model; MACHINE_TYPES Model;
//UINT64 msr = 0; //UINT64 msr = 0;
Model = GetDefaultModel(); Model = GetDefaultModel(gMobile);
gSettings.CPU.CpuType = GetAdvancedCpuType(); gSettings.CPU.CpuType = GetAdvancedCpuType();
SetDMISettingsForModel(gSettings, Model, TRUE); SetDMISettingsForModel(gSettings, Model, TRUE);

View File

@ -49,11 +49,7 @@ public:
} }
void setKeyValue(const XString8& xstring) void setKeyValue(const XString8& xstring)
{ {
#ifdef DEBUG if ( xstring.isEmpty() ) log_technical_bug("TagKey::setKeyValue() : xstring.isEmpty() ");
if ( xstring.isEmpty() ) panic("TagKey::setKeyValue() : xstring.isEmpty() ");
#else
if ( xstring.isEmpty() ) return; //don't change
#endif
_string = xstring; _string = xstring;
} }

View File

@ -552,7 +552,7 @@ DBG("%s : UpdateSmbiosString ProductName=%s\n", __PRETTY_FUNCTION__, gSettings.S
gSettings.Smbios.SerialNr.trim(); gSettings.Smbios.SerialNr.trim();
if( gSettings.Smbios.SerialNr.notEmpty() ){ if( gSettings.Smbios.SerialNr.notEmpty() ){
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type1->SerialNumber, gSettings.Smbios.SerialNr); 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(); gSettings.Smbios.BoardNumber.trim();
if( gSettings.Smbios.BoardNumber.notEmpty() ){ if( gSettings.Smbios.BoardNumber.notEmpty() ){
@ -725,7 +725,7 @@ void PatchTableType3()
gSettings.Smbios.SerialNr.trim(); gSettings.Smbios.SerialNr.trim();
if( gSettings.Smbios.SerialNr.notEmpty() ){ if( gSettings.Smbios.SerialNr.notEmpty() ){
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type3->SerialNumber, gSettings.Smbios.SerialNr); 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(); gSettings.Smbios.ChassisAssetTag.trim();
if( gSettings.Smbios.ChassisAssetTag.notEmpty() ){ if( gSettings.Smbios.ChassisAssetTag.notEmpty() ){

View File

@ -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) void panic(void)
{ {
panic(nullptr); panic(nullptr);

View File

@ -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 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 #ifdef _MSC_VER

View File

@ -79,6 +79,29 @@ void panic_ask(const char* format, ...)
#endif #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) void panic(void)
{ {

View File

@ -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 panic_ask(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
void log_technical_bug(const char* format, ...) __attribute__((__format__(__printf__, 1, 2)));
#endif #endif

View File

@ -22,13 +22,26 @@
template<class XStringClass_, class XStringArrayClass> template<class XStringClass_, class XStringArrayClass>
class XStringArray_/* : public XStringArraySuper*/ class XStringArray_/* : public XStringArraySuper*/
{ {
protected: protected:
XObjArray<XStringClass_> array; XObjArray<XStringClass_> array;
public: public:
typedef XStringClass_ XStringClass; typedef XStringClass_ XStringClass;
XStringArray_() : array() {}; 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(); } size_t size() const { return array.size(); }
void setEmpty() { array.setEmpty(); } void setEmpty() { array.setEmpty(); }
@ -269,32 +282,77 @@ class XStringArray_/* : public XStringArraySuper*/
class XString8Array : public XStringArray_<XString8, XString8Array> 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; extern const XString8Array NullXString8Array;
class XString16Array : public XStringArray_<XString16, XString16Array> 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; extern const XString16Array NullXString16Array;
class XString32Array : public XStringArray_<XString32, XString32Array> 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; extern const XString32Array NullXString32Array;
class XStringWArray : public XStringArray_<XStringW, XStringWArray> 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; extern const XStringWArray NullXStringWArray;
class ConstXString8Array : public XStringArray_<const XString8, ConstXString8Array> 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; extern const ConstXString8Array NullConstXString8Array;
class ConstXStringWArray : public XStringArray_<const XStringW, ConstXStringWArray> 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; extern const ConstXStringWArray NullConstXStringWArray;

View 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;
}

View File

@ -0,0 +1 @@
int xml_lite_reapeatingdict_tests();

View File

@ -57,7 +57,7 @@
//the function is not in the class and deals always with MainMenu //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 //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; LEGACY_ENTRY *Entry, *SubEntry;
REFIT_MENU_SCREEN *SubScreen; REFIT_MENU_SCREEN *SubScreen;
@ -65,20 +65,33 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
CHAR16 ShortcutLetter = 0; CHAR16 ShortcutLetter = 0;
// INTN i; // 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) { if (Volume == NULL) {
return false; return false;
} }
// Ignore this loader if it's device path is already present in another loader // Ignore this loader if it's device path is already present in another loader
for (UINTN i = 0; i < MainMenu.Entries.size(); ++i) { for (UINTN i = 0; i < MainMenu.Entries.size(); ++i) {
REFIT_ABSTRACT_MENU_ENTRY& MainEntry = MainMenu.Entries[i]; REFIT_ABSTRACT_MENU_ENTRY& MainEntry = MainMenu.Entries[i];
// DBG("entry %lld\n", i); // DBG("entry %lld\n", i);
// Only want legacy // Only want legacy
if (MainEntry.getLEGACY_ENTRY()) { if (MainEntry.getLEGACY_ENTRY()) {
if ( MainEntry.getLEGACY_ENTRY()->DevicePathString.isEqualIC(Volume->DevicePathString) ) { if ( MainEntry.getLEGACY_ENTRY()->DevicePathString.isEqualIC(Volume->DevicePathString) ) {
return true; return true;
}
} }
} }
}
XStringW LoaderTitle;
if ( _LoaderTitle.isEmpty() ) {
LoaderTitle = Volume->LegacyOS->Name;
}else{
LoaderTitle = _LoaderTitle;
}
XStringW LTitle; XStringW LTitle;
if (LoaderTitle.isEmpty()) { if (LoaderTitle.isEmpty()) {
if (Volume->LegacyOS->Name.notEmpty()) { if (Volume->LegacyOS->Name.notEmpty()) {
@ -97,22 +110,21 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
// prepare the menu entry // prepare the menu entry
Entry = new LEGACY_ENTRY(); Entry = new LEGACY_ENTRY();
if (!FullTitle.isEmpty()) { if ( FullTitle.notEmpty() ) {
Entry->Title = FullTitle; Entry->Title = FullTitle;
} else { } else {
if (ThemeX.BootCampStyle) { if (ThemeX.BootCampStyle) {
Entry->Title = LTitle; Entry->Title = LTitle;
} else { } else {
Entry->Title = L"Boot "_XSW + LoaderTitle + L" from "_XSW + VolDesc; Entry->Title.SWPrintf("Boot %ls from %ls", LoaderTitle.wc_str(), VolDesc.wc_str());
// Entry->Title.SWPrintf("Boot %ls from %ls", LoaderTitle->wc_str(), VolDesc);
} }
} }
DBG(" Entry->Title=%ls\n", Entry->Title.wc_str());
// DBG("Title=%ls\n", Entry->Title);
Entry->Row = 0; Entry->Row = 0;
Entry->ShortcutLetter = (Hotkey == 0) ? ShortcutLetter : Hotkey; Entry->ShortcutLetter = (Hotkey == 0) ? ShortcutLetter : Hotkey;
if (Image) { if ( Image && !Image->isEmpty() ) {
Entry->Image = *Image; Entry->Image = *Image;
} else { } else {
Entry->Image = ThemeX.LoadOSIcon(Volume->LegacyOS->IconName); Entry->Image = ThemeX.LoadOSIcon(Volume->LegacyOS->IconName);
@ -319,9 +331,9 @@ void AddCustomLegacy(void)
continue; continue;
} }
} }
if (/*(Volume->BootType != BOOTING_BY_PBR) && */ if ((Volume->BootType != BOOTING_BY_PBR) &&
(Volume->BootType >= BOOTING_BY_MBR) /*&& (Volume->BootType != BOOTING_BY_MBR) &&
(Volume->BootType != BOOTING_BY_CD)*/ ) { (Volume->BootType != BOOTING_BY_CD)) {
DBG("skipped because volume is not legacy bootable\n"); DBG("skipped because volume is not legacy bootable\n");
continue; 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"); DBG("skipped because volume is hidden\n");
continue; continue;
} }
// Check for exact volume matches // Check for exact volume matches
if (Custom.settings.Volume.notEmpty()) { if (Custom.settings.Volume.notEmpty()) {
if ((StrStr(Volume->DevicePathString.wc_str(), Custom.settings.Volume.wc_str()) == NULL) && 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); DriveIcon.Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.DriveImagePath);
} }
// Create a legacy entry for this volume // Create a legacy entry for this volume
DBG("\n");
if (AddLegacyEntry(Custom.settings.FullTitle, Custom.settings.Title, Volume, &MainIcon, &DriveIcon, Custom.settings.Hotkey, TRUE)) if (AddLegacyEntry(Custom.settings.FullTitle, Custom.settings.Title, Volume, &MainIcon, &DriveIcon, Custom.settings.Hotkey, TRUE))
{ {
DBG("match!\n"); // DBG("match!\n");
} }
} }
} }

View 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

View File

@ -926,10 +926,14 @@ const XIcon& XTheme::LoadOSIcon(const XString8& Full)
DBG(" Full=%s\n", Full.c_str()); DBG(" Full=%s\n", Full.c_str());
if (!ReturnIcon->isEmpty()) return *ReturnIcon; if (!ReturnIcon->isEmpty()) return *ReturnIcon;
} }
// else something if ( Full !="unknown"_XS8 ) {
if (DummyIcon.isEmpty()) { //initialize once per session return LoadOSIcon("unknown"_XS8);
DummyIcon.Image.DummyImage(MainEntriesSize); }else{
DummyIcon.setFilled(); // else something
if (DummyIcon.isEmpty()) { //initialize once per session
DummyIcon.Image.DummyImage(MainEntriesSize);
DummyIcon.setFilled();
}
} }
return DummyIcon; return DummyIcon;
} }

View File

@ -79,11 +79,11 @@ EFI_STATUS egLoadFile(const EFI_FILE* BaseDir, IN CONST CHAR16 *FileName,
FileInfo = EfiLibFileInfo(FileHandle); FileInfo = EfiLibFileInfo(FileHandle);
if (FileInfo == NULL) { if (FileInfo == NULL) {
FileHandle->Close(FileHandle); FileHandle->Close(FileHandle);
Status = EFI_NOT_READY;
goto Error; goto Error;
} }
ReadSize = FileInfo->FileSize; ReadSize = FileInfo->FileSize;
if (ReadSize > MAX_FILE_SIZE) if (ReadSize > MAX_FILE_SIZE) ReadSize = MAX_FILE_SIZE;
ReadSize = MAX_FILE_SIZE;
FreePool(FileInfo); FreePool(FileInfo);
BufferSize = (UINTN)ReadSize; // was limited to 1 GB above, so this is safe 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) { if (FileDataLength) {
*FileDataLength = BufferSize; *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; return Status;
Error: Error:
if (FileData) { if (FileData) {
@ -115,6 +120,11 @@ Error:
if (FileDataLength) { if (FileDataLength) {
*FileDataLength = 0; *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; return Status;
} }
//Slice - this is gEfiPartTypeSystemPartGuid //Slice - this is gEfiPartTypeSystemPartGuid

View File

@ -31,34 +31,107 @@
# #
[Sources] [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-conf.h
../Include/Library/printf_lite.h ../Include/Library/printf_lite.h
PlatformEFI/include/printf_lite-test-cpp_conf.h cpp_foundation/shared_ptr.cpp
PlatformEFI/include/Platform.h cpp_foundation/shared_ptr.h
PlatformEFI/include/XToolsConf.h cpp_foundation/unicode_conversions.cpp
PlatformEFI/posix/posix.h cpp_foundation/unicode_conversions.h
PlatformEFI/posix/limits.h cpp_foundation/XArray.h
PlatformEFI/posix/stdarg.h cpp_foundation/XBuffer.cpp
PlatformEFI/posix/stddef.h cpp_foundation/XBuffer.h
PlatformEFI/posix/stdint.h cpp_foundation/XObjArray.h
PlatformEFI/posix/stdlib.h cpp_foundation/XRBuffer.cpp
PlatformEFI/posix/stdio.h cpp_foundation/XRBuffer.h
PlatformEFI/posix/stdio.cpp cpp_foundation/XString.cpp
PlatformEFI/posix/string.h cpp_foundation/XString.h
PlatformEFI/posix/string.cpp cpp_foundation/XStringAbstract.h
PlatformEFI/posix/strings.h cpp_foundation/XStringArray.cpp
PlatformEFI/posix/strings.cpp cpp_foundation/XStringArray.h
PlatformEFI/posix/strlen.cpp cpp_foundation/XToolsCommon.h
PlatformEFI/posix/wchar.h cpp_lib/undefinable.h
PlatformEFI/posix/wchar.cpp cpp_lib/XmlLiteArrayTypes.cpp
PlatformEFI/posix/abort.h cpp_lib/XmlLiteArrayTypes.h
PlatformEFI/posix/abort.cpp cpp_lib/XmlLiteCompositeTypes.cpp
PlatformEFI/posix/posix_additions.h cpp_lib/XmlLiteCompositeTypes.h
PlatformEFI/posix/posix_additions.cpp 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/BootTypes.h
include/Devices.h include/Devices.h
include/DsdtFixList.h include/DsdtFixList.h
@ -72,220 +145,171 @@
include/Pci.h include/Pci.h
include/QuirksCodes.h include/QuirksCodes.h
include/remove_ref.h include/remove_ref.h
include/rename_helper.h
include/syslinux_mbr.h
include/TagTypes.h include/TagTypes.h
include/VolumeTypes.h include/VolumeTypes.h
refit/main.cpp libeg/BmLib.cpp
refit/icns.cpp libeg/BmLib.h
refit/lib.cpp libeg/EfiFileLib.h
refit/lib.h libeg/egemb_font.cpp
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/egemb_icons.cpp libeg/egemb_icons.cpp
libeg/egemb_icons_dark.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.cpp
libeg/FloatLib.h 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.cpp
libeg/nanosvg.h libeg/nanosvg.h
libeg/nanosvgrast.cpp libeg/nanosvgrast.cpp
libeg/VectorGraphics.h libeg/scroll_images.cpp
libeg/text.cpp
libeg/VectorGraphics.cpp libeg/VectorGraphics.cpp
libeg/libeg.h libeg/VectorGraphics.h
libeg/libegint.h libeg/XCinema.cpp
libeg/XImage.cpp libeg/XCinema.h
libeg/XImage.h
libeg/XIcon.cpp libeg/XIcon.cpp
libeg/XIcon.h libeg/XIcon.h
libeg/XImage.cpp
libeg/XImage.h
libeg/XPointer.cpp libeg/XPointer.cpp
libeg/XPointer.h libeg/XPointer.h
libeg/XTheme.cpp libeg/XTheme.cpp
libeg/XTheme.h libeg/XTheme.h
libeg/XCinema.cpp
libeg/XCinema.h
Platform/AcpiPatcher.h
Platform/AcpiPatcher.cpp Platform/AcpiPatcher.cpp
Platform/APFS.h Platform/AcpiPatcher.h
Platform/APFS.cpp Platform/AmlGenerator.cpp
Platform/ati_reg.h Platform/AmlGenerator.h
Platform/AmlGenerator.cpp Platform/APFS.cpp
Platform/AmlGenerator.h Platform/APFS.h
Platform/ati.cpp Platform/ati.cpp
Platform/ati.h Platform/ati.h
PlatformEFI/BasicIO.cpp Platform/ati_reg.h
Platform/BasicIO.h Platform/b64cdecode.cpp
# Platform/BiosVideo.h Platform/b64cdecode.h
# Platform/Bmp.h Platform/BasicIO.h
Platform/boot.h Platform/BdsConnect.cpp
PlatformEFI/BootLog.cpp Platform/boot.h
Platform/BootLog.h Platform/BootLog.h
Platform/BootOptions.h Platform/BootOptions.cpp
Platform/BootOptions.cpp Platform/BootOptions.h
Platform/card_vlist.h Platform/card_vlist.cpp
Platform/card_vlist.cpp Platform/card_vlist.h
Platform/Console.h Platform/Console.cpp
Platform/Console.cpp Platform/Console.h
Platform/cpu.h Platform/cpu.cpp
Platform/cpu.cpp Platform/cpu.h
Platform/DataHubCpu.h Platform/DataHub.cpp
Platform/DataHubCpu.cpp Platform/DataHub.h
# Platform/DataHubRecords.h Platform/DataHubCpu.cpp
Platform/device_inject.cpp Platform/DataHubCpu.h
Platform/device_inject.h Platform/DataHubExt.h
# Platform/device_tree.cpp Platform/DevicePath.cpp
# Platform/device_tree.h Platform/device_inject.cpp
Platform/Edid.h Platform/device_inject.h
Platform/Edid.cpp Platform/Edid.cpp
Platform/Events.cpp Platform/Edid.h
Platform/Events.h Platform/Events.cpp
Platform/FixBiosDsdt.h Platform/Events.h
Platform/FixBiosDsdt.cpp Platform/FixBiosDsdt.cpp
Platform/gma.h Platform/FixBiosDsdt.h
Platform/gma.cpp Platform/gma.cpp
Platform/guid.h Platform/gma.h
Platform/guid.cpp Platform/guid.cpp
Platform/hda.h Platform/guid.h
Platform/hda.cpp Platform/hda.cpp
Platform/HdaCodecDump.h Platform/hda.h
Platform/HdaCodecDump.cpp Platform/HdaCodecDump.cpp
Platform/Injectors.h Platform/HdaCodecDump.h
Platform/Hibernate.cpp
Platform/Hibernate.h
Platform/Injectors.cpp Platform/Injectors.cpp
Platform/KERNEL_AND_KEXT_PATCHES.h Platform/Injectors.h
Platform/KERNEL_AND_KEXT_PATCHES.cpp Platform/KERNEL_AND_KEXT_PATCHES.cpp
Platform/kernel_patcher.h Platform/KERNEL_AND_KEXT_PATCHES.h
Platform/kernel_patcher.cpp Platform/kernel_patcher.cpp
Platform/kernel_patcher.h
Platform/KextList.cpp
Platform/KextList.h
Platform/kext_inject.cpp Platform/kext_inject.cpp
Platform/kext_inject.h Platform/kext_inject.h
Platform/kext_patcher.cpp Platform/kext_patcher.cpp
Platform/KextList.h Platform/LegacyBiosThunk.cpp
Platform/KextList.cpp Platform/LegacyBiosThunk.h
Platform/LegacyBiosThunk.h Platform/LegacyBoot.cpp
Platform/LegacyBiosThunk.cpp Platform/LegacyBoot.h
Platform/LegacyBoot.h
Platform/LegacyBoot.cpp
Platform/MacOsVersion.cpp Platform/MacOsVersion.cpp
Platform/MacOsVersion.h Platform/MacOsVersion.h
Platform/MemoryOperation.h
Platform/MemoryOperation.c Platform/MemoryOperation.c
Platform/MemoryOperation.h
Platform/memvendors.h Platform/memvendors.h
Platform/nvidia.h Platform/Net.cpp
Platform/nvidia.cpp Platform/Net.h
Platform/Net.h Platform/nvidia.cpp
Platform/Net.cpp Platform/nvidia.h
Platform/Nvram.h Platform/Nvram.cpp
Platform/Nvram.cpp Platform/Nvram.h
Platform/platformdata.h Platform/platformdata.cpp
Platform/platformdata.cpp Platform/platformdata.h
Platform/PlatformDriverOverride.h Platform/PlatformDriverOverride.cpp
Platform/PlatformDriverOverride.cpp Platform/PlatformDriverOverride.h
Platform/plist/base64.h
Platform/plist/base64.cpp Platform/plist/base64.cpp
Platform/plist/plist.h Platform/plist/base64.h
Platform/plist/plist.cpp Platform/plist/plist.cpp
Platform/plist/TagArray.h Platform/plist/plist.h
Platform/plist/TagArray.cpp Platform/plist/TagArray.cpp
Platform/plist/TagBool.h Platform/plist/TagArray.h
Platform/plist/TagBool.cpp Platform/plist/TagBool.cpp
Platform/plist/TagData.h Platform/plist/TagBool.h
Platform/plist/TagData.cpp Platform/plist/TagData.cpp
Platform/plist/TagDate.h Platform/plist/TagData.h
Platform/plist/TagDate.cpp Platform/plist/TagDate.cpp
Platform/plist/TagDict.h Platform/plist/TagDate.h
Platform/plist/TagDict.cpp Platform/plist/TagDict.cpp
Platform/plist/TagFloat.h Platform/plist/TagDict.h
Platform/plist/TagFloat.cpp Platform/plist/TagFloat.cpp
Platform/plist/TagInt64.h Platform/plist/TagFloat.h
Platform/plist/TagInt64.cpp Platform/plist/TagInt64.cpp
Platform/plist/TagKey.h Platform/plist/TagInt64.h
Platform/plist/TagKey.cpp Platform/plist/TagKey.cpp
Platform/plist/TagString8.h Platform/plist/TagKey.h
Platform/plist/TagString8.cpp Platform/plist/TagString8.cpp
Platform/plist/xml.h Platform/plist/TagString8.h
Platform/plist/xml.cpp Platform/plist/xml.cpp
# Platform/Pointer.cpp Platform/plist/xml.h
Platform/Self.cpp Platform/Self.cpp
Platform/Self.h Platform/Self.h
Platform/SelfOem.cpp Platform/SelfOem.cpp
Platform/SelfOem.h Platform/SelfOem.h
Platform/Settings.cpp Platform/Settings.cpp
Platform/Settings.h Platform/Settings.h
Platform/smbios.h Platform/smbios.cpp
Platform/smbios.cpp Platform/smbios.h
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/sound.cpp Platform/sound.cpp
Platform/spd.cpp
Platform/spd.h
Platform/sse3_5_patcher.h
Platform/sse3_patcher.h
Platform/StartupSound.cpp Platform/StartupSound.cpp
Platform/StartupSound.h Platform/StartupSound.h
# Platform/sse3_patcher.h Platform/StateGenerator.cpp
# Platform/sse3_5_patcher.h Platform/StateGenerator.h
Platform/usbfix.cpp
Platform/usbfix.h
Platform/Utils.cpp
Platform/Utils.h
Platform/VersionString.cpp Platform/VersionString.cpp
Platform/VersionString.h Platform/VersionString.h
Platform/Volumes.cpp Platform/Volumes.cpp
Platform/Volumes.h Platform/Volumes.h
Platform/DataHub.cpp PlatformEFI/BasicIO.cpp
Platform/DataHub.h PlatformEFI/BootLog.cpp
Platform/DataHubExt.h
../Version.h
PlatformEFI/cpp_util/globals_ctor.cpp PlatformEFI/cpp_util/globals_ctor.cpp
PlatformEFI/cpp_util/globals_ctor.h PlatformEFI/cpp_util/globals_ctor.h
PlatformEFI/cpp_util/globals_dtor.cpp PlatformEFI/cpp_util/globals_dtor.cpp
@ -293,65 +317,38 @@
PlatformEFI/cpp_util/operatorNewDelete.cpp PlatformEFI/cpp_util/operatorNewDelete.cpp
PlatformEFI/cpp_util/operatorNewDelete.h PlatformEFI/cpp_util/operatorNewDelete.h
PlatformEFI/cpp_util/pure_virtual.cpp PlatformEFI/cpp_util/pure_virtual.cpp
cpp_foundation/unicode_conversions.cpp PlatformEFI/include/Platform.h
cpp_foundation/unicode_conversions.h PlatformEFI/include/printf_lite-test-cpp_conf.h
cpp_foundation/XArray.h PlatformEFI/include/printlib-test-cpp_conf.h
cpp_foundation/XBuffer.cpp PlatformEFI/include/XToolsConf.h
cpp_foundation/XBuffer.h PlatformEFI/posix/abort.cpp
cpp_foundation/XRBuffer.cpp PlatformEFI/posix/abort.h
cpp_foundation/XRBuffer.h PlatformEFI/posix/limits.h
cpp_foundation/XObjArray.h PlatformEFI/posix/posix.h
cpp_foundation/XStringAbstract.h PlatformEFI/posix/posix_additions.cpp
cpp_foundation/XString.cpp PlatformEFI/posix/posix_additions.h
cpp_foundation/XString.h PlatformEFI/posix/stdarg.h
cpp_foundation/XStringArray.cpp PlatformEFI/posix/stdbool.h
cpp_foundation/XStringArray.h PlatformEFI/posix/stddef.h
cpp_foundation/XStringArray.cpp PlatformEFI/posix/stdint.h
cpp_foundation/XToolsCommon.h PlatformEFI/posix/stdio.cpp
# cpp_foundation/XUINTN.cpp PlatformEFI/posix/stdio.h
# cpp_foundation/XUINTN.h PlatformEFI/posix/stdlib.h
cpp_lib/undefinable.h PlatformEFI/posix/string.cpp
cpp_unit_test/all_tests.h PlatformEFI/posix/string.h
cpp_unit_test/all_tests.cpp PlatformEFI/posix/strings.cpp
# cpp_unit_test/config-test.h PlatformEFI/posix/strings.h
# cpp_unit_test/config-test.cpp PlatformEFI/posix/strlen.cpp
cpp_unit_test/find_replace_mask_Clover_tests.h PlatformEFI/posix/wchar.cpp
cpp_unit_test/find_replace_mask_Clover_tests.cpp PlatformEFI/posix/wchar.h
cpp_unit_test/find_replace_mask_OC_tests.h refit/icns.cpp
cpp_unit_test/find_replace_mask_OC_tests.cpp refit/lib.cpp
cpp_unit_test/global_test.h refit/lib.h
cpp_unit_test/global_test.cpp refit/main.cpp
cpp_unit_test/LoadOptions_test.cpp refit/menu.cpp
cpp_unit_test/LoadOptions_test.h refit/menu.h
cpp_unit_test/MacOsVersion_test.cpp refit/screen.cpp
cpp_unit_test/MacOsVersion_test.h refit/screen.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
[Sources.IA32] [Sources.IA32]
PlatformIA32/ftol.asm | MSFT PlatformIA32/ftol.asm | MSFT

View File

@ -482,37 +482,37 @@ static void ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl
Volume->LegacyOS->Name = L"FreeDOS"_XSW; Volume->LegacyOS->Name = L"FreeDOS"_XSW;
Volume->LegacyOS->Type = OSTYPE_VAR; Volume->LegacyOS->Type = OSTYPE_VAR;
Volume->BootType = BOOTING_BY_PBR; Volume->BootType = BOOTING_BY_PBR;
/*
} else if (FindMem(SectorBuffer, 512, "OS2LDR", 6) >= 0 || } else if (FindMem(SectorBuffer, 512, "OS2LDR", 6) >= 0 ||
FindMem(SectorBuffer, 512, "OS2BOOT", 7) >= 0) { FindMem(SectorBuffer, 512, "OS2BOOT", 7) >= 0) {
Volume->HasBootCode = TRUE; Volume->HasBootCode = TRUE;
Volume->LegacyOS->IconName = L"ecomstation"; Volume->LegacyOS->IconName = L"ecomstation"_XSW;
Volume->LegacyOS->Name = L"eComStation"; Volume->LegacyOS->Name = L"eComStation"_XSW;
Volume->LegacyOS->Type = OSTYPE_VAR; Volume->LegacyOS->Type = OSTYPE_VAR;
Volume->BootType = BOOTING_BY_PBR; Volume->BootType = BOOTING_BY_PBR;
} else if (FindMem(SectorBuffer, 512, "Be Boot Loader", 14) >= 0) { } else if (FindMem(SectorBuffer, 512, "Be Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE; Volume->HasBootCode = TRUE;
Volume->LegacyOS->IconName = L"beos"; Volume->LegacyOS->IconName = L"beos"_XSW;
Volume->LegacyOS->Name = L"BeOS"; Volume->LegacyOS->Name = L"BeOS"_XSW;
Volume->LegacyOS->Type = OSTYPE_VAR; Volume->LegacyOS->Type = OSTYPE_VAR;
Volume->BootType = BOOTING_BY_PBR; Volume->BootType = BOOTING_BY_PBR;
} else if (FindMem(SectorBuffer, 512, "yT Boot Loader", 14) >= 0) { } else if (FindMem(SectorBuffer, 512, "yT Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE; Volume->HasBootCode = TRUE;
Volume->LegacyOS->IconName = L"zeta"; Volume->LegacyOS->IconName = L"zeta"_XSW;
Volume->LegacyOS->Name = L"ZETA"; Volume->LegacyOS->Name = L"ZETA"_XSW;
Volume->LegacyOS->Type = OSTYPE_VAR; Volume->LegacyOS->Type = OSTYPE_VAR;
Volume->BootType = BOOTING_BY_PBR; Volume->BootType = BOOTING_BY_PBR;
} else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 || } else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
FindMem(SectorBuffer, 512, "haiku_loader", 12) >= 0) { FindMem(SectorBuffer, 512, "haiku_loader", 12) >= 0) {
Volume->HasBootCode = TRUE; Volume->HasBootCode = TRUE;
Volume->LegacyOS->IconName = L"haiku"; Volume->LegacyOS->IconName = L"haiku"_XSW;
Volume->LegacyOS->Name = L"Haiku"; Volume->LegacyOS->Name = L"Haiku"_XSW;
Volume->LegacyOS->Type = OSTYPE_VAR; Volume->LegacyOS->Type = OSTYPE_VAR;
Volume->BootType = BOOTING_BY_PBR; Volume->BootType = BOOTING_BY_PBR;
*/
} }
} }
@ -530,10 +530,10 @@ static void ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl
Volume->HasBootCode = FALSE; Volume->HasBootCode = FALSE;
#ifdef JIEF_DEBUG #ifdef JIEF_DEBUG
//*Bootable = TRUE; ////*Bootable = TRUE;
//Volume->HasBootCode = TRUE; //Volume->HasBootCode = TRUE;
//Volume->LegacyOS->IconName = L"win"; //Volume->LegacyOS->IconName = L"win"_XSW;
//Volume->LegacyOS->Name = L"Windows"; //Volume->LegacyOS->Name = L"Windows"_XSW;
//Volume->LegacyOS->Type = OSTYPE_WIN; //Volume->LegacyOS->Type = OSTYPE_WIN;
//Volume->BootType = BOOTING_BY_PBR; //Volume->BootType = BOOTING_BY_PBR;
#endif #endif