diff --git a/Application/Bootstrap/Bootstrap.c b/Application/Bootstrap/Bootstrap.c index 508db619..836a6360 100644 --- a/Application/Bootstrap/Bootstrap.c +++ b/Application/Bootstrap/Bootstrap.c @@ -47,7 +47,7 @@ LoadOpenCore ( ASSERT (ImageHandle != NULL); BufferSize = 0; - Buffer = ReadFile (FileSystem, OPEN_CORE_IMAGE_PATH, &BufferSize, BASE_16MB); + Buffer = ReadFile (FileSystem, OPEN_CORE_DRIVER_PATH, &BufferSize, BASE_16MB); if (Buffer == NULL) { DEBUG ((DEBUG_ERROR, "BS: Failed to locate valid OpenCore image - %p!\n", Buffer)); return EFI_NOT_FOUND; @@ -154,7 +154,7 @@ UefiMain ( // // We have just started at EFI/BOOT/BOOTx64.efi. // We need to run OpenCore on this partition as it failed automatically. - // The image is optionally located at OPEN_CORE_IMAGE_PATH file. + // The image is optionally located at OPEN_CORE_DRIVER_PATH file. // LoadedImage = NULL; diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 10d3c946..c9ceb199 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 545faccf..44693e6d 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -2126,6 +2126,47 @@ behaviour that does not go to any other sections \begin{enumerate} +\item + \texttt{ConsoleAttributes}\\ + \textbf{Type}: \texttt{plist\ integer}\\ + \textbf{Failsafe}: \texttt{0}\\ + \textbf{Description}: Sets specific attributes for console. + + Text renderer supports colour arguments as a sum of foreground and background + colors according to UEFI specification. The value of black background and + black foreground (\texttt{0}) is reserved. List of colour names: + + \begin{itemize} + \tightlist + \item \texttt{0x00} --- \texttt{EFI\_BLACK} + \item \texttt{0x01} --- \texttt{EFI\_BLUE} + \item \texttt{0x02} --- \texttt{EFI\_GREEN} + \item \texttt{0x03} --- \texttt{EFI\_CYAN} + \item \texttt{0x04} --- \texttt{EFI\_RED} + \item \texttt{0x05} --- \texttt{EFI\_MAGENTA} + \item \texttt{0x06} --- \texttt{EFI\_BROWN} + \item \texttt{0x07} --- \texttt{EFI\_LIGHTGRAY} + \item \texttt{0x08} --- \texttt{EFI\_DARKGRAY} + \item \texttt{0x09} --- \texttt{EFI\_LIGHTBLUE} + \item \texttt{0x0A} --- \texttt{EFI\_LIGHTGREEN} + \item \texttt{0x0B} --- \texttt{EFI\_LIGHTCYAN} + \item \texttt{0x0C} --- \texttt{EFI\_LIGHTRED} + \item \texttt{0x0D} --- \texttt{EFI\_LIGHTMAGENTA} + \item \texttt{0x0E} --- \texttt{EFI\_YELLOW} + \item \texttt{0x0F} --- \texttt{EFI\_WHITE} + \item \texttt{0x00} --- \texttt{EFI\_BACKGROUND\_BLACK} + \item \texttt{0x10} --- \texttt{EFI\_BACKGROUND\_BLUE} + \item \texttt{0x20} --- \texttt{EFI\_BACKGROUND\_GREEN} + \item \texttt{0x30} --- \texttt{EFI\_BACKGROUND\_CYAN} + \item \texttt{0x40} --- \texttt{EFI\_BACKGROUND\_RED} + \item \texttt{0x50} --- \texttt{EFI\_BACKGROUND\_MAGENTA} + \item \texttt{0x60} --- \texttt{EFI\_BACKGROUND\_BROWN} + \item \texttt{0x70} --- \texttt{EFI\_BACKGROUND\_LIGHTGRAY} + \end{itemize} + + \emph{Note}: This option may not work well with \texttt{System} text renderer. + Setting a background different from black could help testing proper GOP functioning. + \item \texttt{HibernateMode}\\ \textbf{Type}: \texttt{plist\ string}\\ @@ -2174,41 +2215,38 @@ behaviour that does not go to any other sections \textbf{Failsafe}: \texttt{0}\\ \textbf{Description}: Sets specific attributes for picker. - Builtin picker supports colour arguments as a sum of foreground and background - colors according to UEFI specification. The value of black background and - black foreground (\texttt{0}) is reserved. List of colour names: + Different pickers may be configured through the attribute mask containing + OpenCore-reserved (\texttt{BIT0}\textasciitilde\texttt{BIT15}) and OEM-specific + (\texttt{BIT16}\textasciitilde\texttt{BIT31}) values. + + Current OpenCore values include: \begin{itemize} \tightlist - \item \texttt{0x00} --- \texttt{EFI\_BLACK} - \item \texttt{0x01} --- \texttt{EFI\_BLUE} - \item \texttt{0x02} --- \texttt{EFI\_GREEN} - \item \texttt{0x03} --- \texttt{EFI\_CYAN} - \item \texttt{0x04} --- \texttt{EFI\_RED} - \item \texttt{0x05} --- \texttt{EFI\_MAGENTA} - \item \texttt{0x06} --- \texttt{EFI\_BROWN} - \item \texttt{0x07} --- \texttt{EFI\_LIGHTGRAY} - \item \texttt{0x08} --- \texttt{EFI\_DARKGRAY} - \item \texttt{0x09} --- \texttt{EFI\_LIGHTBLUE} - \item \texttt{0x0A} --- \texttt{EFI\_LIGHTGREEN} - \item \texttt{0x0B} --- \texttt{EFI\_LIGHTCYAN} - \item \texttt{0x0C} --- \texttt{EFI\_LIGHTRED} - \item \texttt{0x0D} --- \texttt{EFI\_LIGHTMAGENTA} - \item \texttt{0x0E} --- \texttt{EFI\_YELLOW} - \item \texttt{0x0F} --- \texttt{EFI\_WHITE} - \item \texttt{0x00} --- \texttt{EFI\_BACKGROUND\_BLACK} - \item \texttt{0x10} --- \texttt{EFI\_BACKGROUND\_BLUE} - \item \texttt{0x20} --- \texttt{EFI\_BACKGROUND\_GREEN} - \item \texttt{0x30} --- \texttt{EFI\_BACKGROUND\_CYAN} - \item \texttt{0x40} --- \texttt{EFI\_BACKGROUND\_RED} - \item \texttt{0x50} --- \texttt{EFI\_BACKGROUND\_MAGENTA} - \item \texttt{0x60} --- \texttt{EFI\_BACKGROUND\_BROWN} - \item \texttt{0x70} --- \texttt{EFI\_BACKGROUND\_LIGHTGRAY} + \item \texttt{0x0001} --- \texttt{OC\_ATTR\_USE\_VOLUME\_ICON}, provides custom icons + for boot entries: + \begin{itemize} + \tightlist + \item \texttt{.VolumeIcon.icns} file at \texttt{Preboot} root for APFS. + \item \texttt{.VolumeIcon.icns} file at volume root for other filesystems. + \item \texttt{.icns} file for \texttt{Tools}. + \end{itemize} + Volume icons can be set in Finder. + \item \texttt{0x0002} --- \texttt{OC\_ATTR\_USE\_DISK\_LABEL\_FILE}, provides custom + rendered titles for boot entries: + \begin{itemize} + \tightlist + \item \texttt{.disk\_label} (\texttt{.disk\_label\_2x}) file near bootloader for all filesystems. + \item \texttt{.icns}\DIFaddend } \DIFdelbegin \DIFdel{--- }\DIFdelend \DIFaddbegin \DIFadd{file for }\DIFaddend \texttt{\DIFdelbegin \DIFdel{EFI\_CYAN}\DIFdelend \DIFaddbegin \DIFadd{Tools}\DIFaddend }\DIFaddbegin \DIFadd{. + }\end{itemize} + \DIFadd{Volume icons can be set in Finder. + }\DIFaddend \item \texttt{\DIFdelbegin \DIFdel{0x04}\DIFdelend \DIFaddbegin \DIFadd{0x0002}\DIFaddend } --- \texttt{\DIFdelbegin \DIFdel{EFI}\DIFdelend \DIFaddbegin \DIFadd{OC}\DIFaddend \_\DIFdelbegin \DIFdel{RED}\DIFdelend \DIFaddbegin \DIFadd{ATTR\_USE\_DISK\_LABEL\_FILE}\DIFaddend }\DIFaddbegin \DIFadd{, provides custom + rendered titles for boot entries: + }\begin{itemize} + \tightlist + \DIFaddend \item \texttt{\DIFdelbegin \DIFdel{0x05}\DIFdelend \DIFaddbegin \DIFadd{.disk\_label}\DIFaddend } \DIFdelbegin \DIFdel{--- }\DIFdelend \DIFaddbegin \DIFadd{(}\DIFaddend \texttt{\DIFdelbegin \DIFdel{EFI}\DIFdelend \DIFaddbegin \DIFadd{.disk}\DIFaddend \_\DIFdelbegin \DIFdel{MAGENTA}\DIFdelend \DIFaddbegin \DIFadd{label\_2x}\DIFaddend }\DIFaddbegin \DIFadd{) file near bootloader for all filesystems. + }\DIFaddend \item \texttt{\DIFdelbegin \DIFdel{0x06}\DIFdelend \DIFaddbegin \DIFadd{ HideSelf + ConsoleAttributes + 0 PickerAttributes 0 PickerAudioAssist diff --git a/Docs/SampleFull.plist b/Docs/SampleFull.plist index beed95f7..e82c305c 100644 --- a/Docs/SampleFull.plist +++ b/Docs/SampleFull.plist @@ -591,6 +591,8 @@ HideSelf + ConsoleAttributes + 0 PickerAttributes 0 PickerAudioAssist diff --git a/Include/Library/OcBootManagementLib.h b/Include/Library/OcBootManagementLib.h index e4c965a9..894a4b3a 100755 --- a/Include/Library/OcBootManagementLib.h +++ b/Include/Library/OcBootManagementLib.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,21 @@ typedef struct OC_PICKER_CONTEXT_ OC_PICKER_CONTEXT; #define OC_MENU_DISK_IMAGE L" (dmg)" #define OC_MENU_EXTERNAL L" (external)" +/** + Paths allowed to be accessible by the interfaces. +**/ +#define OPEN_CORE_IMAGE_PATH L"Resources\\Image\\" +#define OPEN_CORE_LABEL_PATH L"Resources\\Label\\" +#define OPEN_CORE_AUDIO_PATH L"Resources\\Audio\\" +#define OPEN_CORE_FONT_PATH L"Resources\\Font\\" + +/** + Attributes supported by the interfaces. +**/ +#define OC_ATTR_USE_VOLUME_ICON BIT0 +#define OC_ATTR_USE_DISK_LABEL_FILE BIT1 +#define OC_ATTR_USE_GENERIC_LABEL_IMAGE BIT2 + /** Default timeout for IDLE timeout during menu picker navigation before VoiceOver toggle. @@ -80,7 +96,8 @@ typedef UINT32 OC_BOOT_ENTRY_TYPE; #define OC_BOOT_WINDOWS BIT4 #define OC_BOOT_EXTERNAL_OS BIT5 #define OC_BOOT_EXTERNAL_TOOL BIT6 -#define OC_BOOT_SYSTEM BIT7 +#define OC_BOOT_RESET_NVRAM BIT7 +#define OC_BOOT_SYSTEM (OC_BOOT_RESET_NVRAM) /** Picker mode. @@ -513,6 +530,12 @@ struct OC_PICKER_CONTEXT_ { // UINT32 ConsoleAttributes; // + // Picker attribues: + // - BIT0~BIT15 are OpenCore reserved. + // - BIT16~BIT31 are OEM-specific. + // + UINT32 PickerAttributes; + // // Enable polling boot arguments. // BOOLEAN PollAppleHotKeys; @@ -579,7 +602,7 @@ struct OC_PICKER_CONTEXT_ { @param[in] BootPolicy Apple Boot Policy Protocol. @param[in] BootEntry Located boot entry. - @retval EFI_SUCCESS The entry point is described successfully. + @retval EFI_SUCCESS The entry point is described successfully. **/ EFI_STATUS OcDescribeBootEntry ( @@ -587,6 +610,46 @@ OcDescribeBootEntry ( IN OUT OC_BOOT_ENTRY *BootEntry ); +/** + Get '.disk_label' or '.disk_label_2x' file contents, if exists. + + @param[in] BootPolicy Apple Boot Policy Protocol. + @param[in] BootEntry Located boot entry. + @param[in] Scale User interface scale. + @param[out] ImageData File contents. + @param[out] DataLength File length. + + @retval EFI_SUCCESS The file was read successfully. +**/ +EFI_STATUS +OcGetBootEntryLabelImage ( + IN OC_PICKER_CONTEXT *Context, + IN APPLE_BOOT_POLICY_PROTOCOL *BootPolicy, + IN OC_BOOT_ENTRY *BootEntry, + IN UINT8 Scale, + OUT VOID **ImageData, + OUT UINT32 *DataLength + ); + +/** + Get '.VolumeIcon.icns' file contents, if exists. + + @param[in] BootPolicy Apple Boot Policy Protocol. + @param[in] BootEntry Located boot entry. + @param[out] ImageData File contents. + @param[out] DataLength File length. + + @retval EFI_SUCCESS The file was read successfully. +**/ +EFI_STATUS +OcGetBootEntryIcon ( + IN OC_PICKER_CONTEXT *Context, + IN APPLE_BOOT_POLICY_PROTOCOL *BootPolicy, + IN OC_BOOT_ENTRY *BootEntry, + OUT VOID **ImageData, + OUT UINT32 *DataLength + ); + /** Release boot entry contents allocated from pool. diff --git a/Include/Library/OcConfigurationLib.h b/Include/Library/OcConfigurationLib.h index ea32c60c..11ad1bbe 100644 --- a/Include/Library/OcConfigurationLib.h +++ b/Include/Library/OcConfigurationLib.h @@ -272,6 +272,7 @@ #define OC_MISC_BOOT_FIELDS(_, __) \ _(OC_STRING , PickerMode , , OC_STRING_CONSTR ("Builtin", _, __) , OC_DESTR (OC_STRING)) \ _(OC_STRING , HibernateMode , , OC_STRING_CONSTR ("None", _, __) , OC_DESTR (OC_STRING)) \ + _(UINT32 , ConsoleAttributes , , 0 , ()) \ _(UINT32 , PickerAttributes , , 0 , ()) \ _(UINT32 , TakeoffDelay , , 0 , ()) \ _(UINT32 , Timeout , , 0 , ()) \ diff --git a/Include/OpenCore.h b/Include/OpenCore.h index af9458c5..3a90d493 100644 --- a/Include/OpenCore.h +++ b/Include/OpenCore.h @@ -45,7 +45,7 @@ #error "Unknown target definition" #endif -#define OPEN_CORE_IMAGE_PATH L"EFI\\OC\\OpenCore.efi" +#define OPEN_CORE_DRIVER_PATH L"EFI\\OC\\OpenCore.efi" #define OPEN_CORE_ROOT_PATH L"EFI\\OC" @@ -63,8 +63,6 @@ #define OPEN_CORE_TOOL_PATH L"Tools\\" -#define OPEN_CORE_AUDIO_PATH L"Resources\\Audio\\" - #define OPEN_CORE_NVRAM_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS) #define OPEN_CORE_NVRAM_NV_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE) diff --git a/Library/OcBootManagementLib/BootAudio.c b/Library/OcBootManagementLib/BootAudio.c index 81049241..a2b68c84 100644 --- a/Library/OcBootManagementLib/BootAudio.c +++ b/Library/OcBootManagementLib/BootAudio.c @@ -186,11 +186,11 @@ OcPlayAudioEntry ( OcPlayAudioFile (Context, OcVoiceOverAudioFilemacOS_TimeMachine, FALSE); } else if (Entry->Type == OC_BOOT_WINDOWS) { OcPlayAudioFile (Context, OcVoiceOverAudioFileWindows, FALSE); + } else if (Entry->Type == OC_BOOT_RESET_NVRAM || StrStr (Entry->Name, OC_MENU_RESET_NVRAM_ENTRY) != NULL) { + OcPlayAudioFile (Context, OcVoiceOverAudioFileResetNVRAM, FALSE); } else if (StrStr (Entry->Name, OC_MENU_UEFI_SHELL_ENTRY) != NULL) { OcPlayAudioFile (Context, OcVoiceOverAudioFileUEFI_Shell, FALSE); - } else if (StrStr (Entry->Name, OC_MENU_RESET_NVRAM_ENTRY) != NULL) { - OcPlayAudioFile (Context, OcVoiceOverAudioFileResetNVRAM, FALSE); - } else if (Entry->Type == OC_BOOT_EXTERNAL_OS) { + } else if (Entry->Type == OC_BOOT_EXTERNAL_OS) { OcPlayAudioFile (Context, OcVoiceOverAudioFileExternalOS, FALSE); } else if (Entry->Type == OC_BOOT_EXTERNAL_TOOL) { OcPlayAudioFile (Context, OcVoiceOverAudioFileExternalTool, FALSE); diff --git a/Library/OcBootManagementLib/BootEntryInfo.c b/Library/OcBootManagementLib/BootEntryInfo.c index c6855eac..b8d4b24f 100644 --- a/Library/OcBootManagementLib/BootEntryInfo.c +++ b/Library/OcBootManagementLib/BootEntryInfo.c @@ -15,6 +15,7 @@ #include "BootManagementInternal.h" #include +#include #include #include @@ -49,7 +50,7 @@ InternalGetAppleDiskLabel ( } UnicodeSPrint (DiskLabelPath, DiskLabelPathSize, L"%s%s", BootDirectoryName, LabelFilename); - DEBUG ((DEBUG_INFO, "Trying to get label from %s\n", DiskLabelPath)); + DEBUG ((DEBUG_INFO, "OCBM: Trying to get label from %s\n", DiskLabelPath)); AsciiDiskLabel = (CHAR8 *) ReadFile (FileSystem, DiskLabelPath, &DiskLabelLength, OC_MAX_VOLUME_LABEL_SIZE); FreePool (DiskLabelPath); @@ -67,6 +68,48 @@ InternalGetAppleDiskLabel ( return UnicodeDiskLabel; } +EFI_STATUS +InternalGetAppleImage ( + IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, + IN CONST CHAR16 *DirectoryName, + IN CONST CHAR16 *LabelFilename, + OUT VOID **ImageData, + OUT UINT32 *DataSize + ) +{ + CHAR16 *ImagePath; + UINTN ImagePathSize; + + ImagePathSize = StrSize (DirectoryName) + StrSize (LabelFilename) - sizeof (CHAR16); + ImagePath = AllocatePool (ImagePathSize); + + if (ImagePath == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + UnicodeSPrint (ImagePath, ImagePathSize, L"%s%s", DirectoryName, LabelFilename); + DEBUG ((DEBUG_INFO, "OCBM: Trying to get image from %s\n", ImagePath)); + + *ImageData = ReadFile (FileSystem, ImagePath, DataSize, BASE_16MB); + + FreePool (ImagePath); + + if (*ImageData == NULL) { + return EFI_NOT_FOUND; + } + + // + // Whether it is disk label or .icns, disk label is always smaller. + // Early abort on obviously small images. + // + if (*DataSize <= sizeof (APPLE_DISK_LABEL)) { + FreePool (*ImageData); + return EFI_UNSUPPORTED; + } + + return EFI_SUCCESS; +} + STATIC CHAR16 * GetAppleRecoveryNameFromPlist ( diff --git a/Library/OcBootManagementLib/BootEntryManagement.c b/Library/OcBootManagementLib/BootEntryManagement.c index a7592ed9..b9fbe2bf 100644 --- a/Library/OcBootManagementLib/BootEntryManagement.c +++ b/Library/OcBootManagementLib/BootEntryManagement.c @@ -24,6 +24,7 @@ #include #include #include +#include EFI_STATUS OcDescribeBootEntry ( @@ -131,6 +132,154 @@ OcDescribeBootEntry ( return EFI_SUCCESS; } +EFI_STATUS +OcGetBootEntryLabelImage ( + IN OC_PICKER_CONTEXT *Context, + IN APPLE_BOOT_POLICY_PROTOCOL *BootPolicy, + IN OC_BOOT_ENTRY *BootEntry, + IN UINT8 Scale, + OUT VOID **ImageData, + OUT UINT32 *DataLength + ) +{ + EFI_STATUS Status; + CHAR16 *BootDirectoryName; + EFI_HANDLE Device; + EFI_HANDLE ApfsVolumeHandle; + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem; + + *ImageData = NULL; + *DataLength = 0; + + if (BootEntry->Type == OC_BOOT_EXTERNAL_TOOL || BootEntry->Type == OC_BOOT_RESET_NVRAM) { + ASSERT (Context->CustomDescribe != NULL); + + Status = Context->CustomDescribe ( + Context->CustomEntryContext, + BootEntry, + Scale, + NULL, + NULL, + ImageData, + DataLength + ); + + DEBUG ((DEBUG_INFO, "OCB: Get custom label %s - %r\n", BootEntry->Name, Status)); + return Status; + } + + ASSERT (BootEntry->DevicePath != NULL); + + Status = BootPolicy->DevicePathToDirPath ( + BootEntry->DevicePath, + &BootDirectoryName, + &Device, + &ApfsVolumeHandle + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->HandleProtocol ( + Device, + &gEfiSimpleFileSystemProtocolGuid, + (VOID **) &FileSystem + ); + + if (EFI_ERROR (Status)) { + FreePool (BootDirectoryName); + return Status; + } + + Status = InternalGetAppleImage ( + FileSystem, + BootDirectoryName, + Scale == 2 ? L".disk_label_2x" : L".disk_label", + ImageData, + DataLength + ); + + DEBUG ((DEBUG_INFO, "OCB: Get normal label %s - %r\n", BootEntry->Name, Status)); + FreePool (BootDirectoryName); + + return Status; +} + +EFI_STATUS +OcGetBootEntryIcon ( + IN OC_PICKER_CONTEXT *Context, + IN APPLE_BOOT_POLICY_PROTOCOL *BootPolicy, + IN OC_BOOT_ENTRY *BootEntry, + OUT VOID **ImageData, + OUT UINT32 *DataLength + ) +{ + EFI_STATUS Status; + CHAR16 *BootDirectoryName; + EFI_HANDLE Device; + EFI_HANDLE ApfsVolumeHandle; + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem; + + *ImageData = NULL; + *DataLength = 0; + + if (BootEntry->Type == OC_BOOT_EXTERNAL_TOOL || BootEntry->Type == OC_BOOT_RESET_NVRAM) { + ASSERT (Context->CustomDescribe != NULL); + + Status = Context->CustomDescribe ( + Context->CustomEntryContext, + BootEntry, + 0, + ImageData, + DataLength, + NULL, + NULL + ); + + DEBUG ((DEBUG_INFO, "Get custom icon %s - %r\n", BootEntry->Name, Status)); + return Status; + } + + ASSERT (BootEntry->DevicePath != NULL); + + Status = BootPolicy->DevicePathToDirPath ( + BootEntry->DevicePath, + &BootDirectoryName, + &Device, + &ApfsVolumeHandle + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->HandleProtocol ( + Device, + &gEfiSimpleFileSystemProtocolGuid, + (VOID **) &FileSystem + ); + + if (EFI_ERROR (Status)) { + FreePool (BootDirectoryName); + return Status; + } + + Status = InternalGetAppleImage ( + FileSystem, + L"", + L".VolumeIcon.icns", + ImageData, + DataLength + ); + + DEBUG ((DEBUG_INFO, "OCB: Get normal icon %s - %r\n", BootEntry->Name, Status)); + + FreePool (BootDirectoryName); + + return Status; +} + VOID OcResetBootEntry ( IN OUT OC_BOOT_ENTRY *BootEntry @@ -442,7 +591,7 @@ OcScanForBootEntries ( return EFI_OUT_OF_RESOURCES; } - Entries[EntryIndex].Type = OC_BOOT_SYSTEM; + Entries[EntryIndex].Type = OC_BOOT_RESET_NVRAM; Entries[EntryIndex].SystemAction = InternalSystemActionResetNvram; ++EntryIndex; } @@ -471,7 +620,7 @@ OcLoadBootEntry ( EFI_HANDLE EntryHandle; INTERNAL_DMG_LOAD_CONTEXT DmgLoadContext; - if (BootEntry->Type == OC_BOOT_SYSTEM) { + if ((BootEntry->Type & OC_BOOT_SYSTEM) != 0) { ASSERT (BootEntry->SystemAction != NULL); return BootEntry->SystemAction (); } diff --git a/Library/OcBootManagementLib/BootManagementInternal.h b/Library/OcBootManagementLib/BootManagementInternal.h index d26d3b3d..8a6b07d4 100644 --- a/Library/OcBootManagementLib/BootManagementInternal.h +++ b/Library/OcBootManagementLib/BootManagementInternal.h @@ -66,6 +66,15 @@ InternalGetAppleDiskLabel ( IN CONST CHAR16 *LabelFilename ); +EFI_STATUS +InternalGetAppleImage ( + IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, + IN CONST CHAR16 *DirectoryName, + IN CONST CHAR16 *LabelFilename, + OUT VOID **ImageData, + OUT UINT32 *DataSize + ); + CHAR16 * InternalGetAppleRecoveryName ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index db0e8da7..d20d4435 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -1114,7 +1114,7 @@ InternalLoadBootEntry ( // // System entries are not loaded but called directly. // - ASSERT (BootEntry->Type != OC_BOOT_SYSTEM); + ASSERT ((BootEntry->Type & OC_BOOT_SYSTEM) == 0); ASSERT (Context != NULL); ASSERT (DmgLoadContext != NULL); diff --git a/Library/OcConfigurationLib/OcConfigurationLib.c b/Library/OcConfigurationLib/OcConfigurationLib.c index 963c6bd7..03ccc83c 100644 --- a/Library/OcConfigurationLib/OcConfigurationLib.c +++ b/Library/OcConfigurationLib/OcConfigurationLib.c @@ -321,6 +321,7 @@ mMiscBlessOverrideSchema = OC_SCHEMA_STRING (NULL); STATIC OC_SCHEMA mMiscConfigurationBootSchema[] = { + OC_SCHEMA_INTEGER_IN ("ConsoleAttributes", OC_GLOBAL_CONFIG, Misc.Boot.ConsoleAttributes), OC_SCHEMA_STRING_IN ("HibernateMode", OC_GLOBAL_CONFIG, Misc.Boot.HibernateMode), OC_SCHEMA_BOOLEAN_IN ("HideAuxiliary", OC_GLOBAL_CONFIG, Misc.Boot.HideAuxiliary), OC_SCHEMA_BOOLEAN_IN ("HideSelf", OC_GLOBAL_CONFIG, Misc.Boot.HideSelf), @@ -649,11 +650,6 @@ OcConfigurationInit ( return EFI_SUCCESS; } -/** - Free configuration structure. - - @param[in,out] Config Configuration structure. -**/ VOID OcConfigurationFree ( IN OUT OC_GLOBAL_CONFIG *Config diff --git a/OpenCorePkg.xcodeproj/project.pbxproj b/OpenCorePkg.xcodeproj/project.pbxproj index 85e9600d..acf4e77d 100644 --- a/OpenCorePkg.xcodeproj/project.pbxproj +++ b/OpenCorePkg.xcodeproj/project.pbxproj @@ -7,6 +7,18 @@ objects = { /* Begin PBXBuildFile section */ + 350857EC24216525005A0D86 /* OcUnicodeLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A95240C213400D54CBB /* OcUnicodeLib.c */; }; + 350857ED24220712005A0D86 /* GuiApp.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857D42421373F005A0D86 /* GuiApp.c */; }; + 350857EE2422071A005A0D86 /* OpenCanopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 350857DA2421373F005A0D86 /* OpenCanopy.h */; }; + 350857EF24220721005A0D86 /* BmfLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 350857D52421373F005A0D86 /* BmfLib.h */; }; + 350857F024220724005A0D86 /* OcBootstrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857DD2421373F005A0D86 /* OcBootstrap.c */; }; + 350857F124220727005A0D86 /* GuiApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 350857DE2421373F005A0D86 /* GuiApp.h */; }; + 350857F224220729005A0D86 /* GuiIo.h in Headers */ = {isa = PBXBuildFile; fileRef = 350857DF2421373F005A0D86 /* GuiIo.h */; }; + 350857F32422072D005A0D86 /* OpenCanopy.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857E02421373F005A0D86 /* OpenCanopy.c */; }; + 350857F424220730005A0D86 /* BitmapFont.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857E12421373F005A0D86 /* BitmapFont.c */; }; + 350857F524220733005A0D86 /* BmfFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 350857E42421373F005A0D86 /* BmfFile.h */; }; + 350857F624220737005A0D86 /* BootPicker.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857E32421373F005A0D86 /* BootPicker.c */; }; + 350857F72422073B005A0D86 /* OutputStGop.c in Sources */ = {isa = PBXBuildFile; fileRef = 350857DC2421373F005A0D86 /* OutputStGop.c */; }; 3511D58D23FDB2A800CC3B17 /* OpenCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3511D57C23FDB2A700CC3B17 /* OpenCore.h */; }; 3511D58E23FDB2A800CC3B17 /* Bootstrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D58023FDB2A800CC3B17 /* Bootstrap.c */; }; 3511D58F23FDB2A800CC3B17 /* OpenCoreUefi.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D58323FDB2A800CC3B17 /* OpenCoreUefi.c */; }; @@ -18,13 +30,11 @@ 3511D59523FDB2A800CC3B17 /* OpenCoreDevProps.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D58923FDB2A800CC3B17 /* OpenCoreDevProps.c */; }; 3511D59623FDB2A800CC3B17 /* OpenCoreNvram.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D58A23FDB2A800CC3B17 /* OpenCoreNvram.c */; }; 3511D59723FDB2A800CC3B17 /* OpenCoreKernel.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D58C23FDB2A800CC3B17 /* OpenCoreKernel.c */; }; - 3511D5CC23FDB37200CC3B17 /* NdkBootPicker.c in Sources */ = {isa = PBXBuildFile; fileRef = 3511D5CB23FDB37200CC3B17 /* NdkBootPicker.c */; }; 35366BF8240C213500D54CBB /* OcMachoLibInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366A8D240C213400D54CBB /* OcMachoLibInternal.h */; }; 35366BF9240C213500D54CBB /* Header.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A8F240C213400D54CBB /* Header.c */; }; 35366BFA240C213500D54CBB /* Symbols.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A90240C213400D54CBB /* Symbols.c */; }; 35366BFB240C213500D54CBB /* Relocations.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A91240C213400D54CBB /* Relocations.c */; }; 35366BFC240C213500D54CBB /* CxxSymbols.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A92240C213400D54CBB /* CxxSymbols.c */; }; - 35366BFD240C213500D54CBB /* OcUnicodeLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A95240C213400D54CBB /* OcUnicodeLib.c */; }; 35366BFE240C213500D54CBB /* OcAsciiLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A96240C213400D54CBB /* OcAsciiLib.c */; }; 35366BFF240C213500D54CBB /* lodepng.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366A99240C213400D54CBB /* lodepng.h */; }; 35366C00240C213500D54CBB /* OcPng.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366A9A240C213400D54CBB /* OcPng.c */; }; @@ -51,13 +61,10 @@ 35366C15240C213500D54CBB /* KeyHandler.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AB9240C213400D54CBB /* KeyHandler.c */; }; 35366C16240C213500D54CBB /* PointerHandler.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366ABA240C213400D54CBB /* PointerHandler.c */; }; 35366C17240C213500D54CBB /* OcDeviceTreeLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366ABC240C213400D54CBB /* OcDeviceTreeLib.c */; }; - 35366C18240C213500D54CBB /* OcUnicodeCollationEngLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366ABF240C213400D54CBB /* OcUnicodeCollationEngLib.c */; }; - 35366C19240C213500D54CBB /* OcUnicodeCollationEngLibInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366AC1240C213400D54CBB /* OcUnicodeCollationEngLibInternal.h */; }; 35366C1A240C213500D54CBB /* OcHashServicesLibInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366AC3240C213400D54CBB /* OcHashServicesLibInternal.h */; }; 35366C1B240C213500D54CBB /* OcHashServicesLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AC4240C213400D54CBB /* OcHashServicesLib.c */; }; 35366C1C240C213500D54CBB /* OcAppleChunklistLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AC7240C213400D54CBB /* OcAppleChunklistLib.c */; }; 35366C1D240C213500D54CBB /* OcHeciLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366ACA240C213400D54CBB /* OcHeciLib.c */; }; - 35366C1E240C213500D54CBB /* OcConsoleControlEntryModeLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366ACD240C213400D54CBB /* OcConsoleControlEntryModeLib.c */; }; 35366C1F240C213500D54CBB /* OcAppleImageVerification.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AD1240C213400D54CBB /* OcAppleImageVerification.c */; }; 35366C20240C213500D54CBB /* OcAppleImageConversionLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AD4240C213400D54CBB /* OcAppleImageConversionLib.c */; }; 35366C21240C213500D54CBB /* Aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AD6240C213400D54CBB /* Aes.c */; }; @@ -71,7 +78,6 @@ 35366C29240C213500D54CBB /* PasswordHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE0240C213400D54CBB /* PasswordHash.c */; }; 35366C2A240C213500D54CBB /* BigNumWordMul64.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE2240C213400D54CBB /* BigNumWordMul64.c */; }; 35366C2B240C213500D54CBB /* ChaCha.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE3240C213400D54CBB /* ChaCha.c */; }; - 35366C2C240C213500D54CBB /* RsaDigitalSign.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE4240C213400D54CBB /* RsaDigitalSign.c */; }; 35366C2D240C213500D54CBB /* Md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE5240C213400D54CBB /* Md5.c */; }; 35366C2E240C213500D54CBB /* SecureMem.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE6240C213400D54CBB /* SecureMem.c */; }; 35366C2F240C213500D54CBB /* DirectReset.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366AE8240C213400D54CBB /* DirectReset.c */; }; @@ -230,15 +236,6 @@ 35366CCF240C213500D54CBB /* OcTemplateLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BD7240C213500D54CBB /* OcTemplateLib.c */; }; 35366CD0240C213500D54CBB /* OcCompilerIntrinsicsLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BD9240C213500D54CBB /* OcCompilerIntrinsicsLib.c */; }; 35366CD1240C213500D54CBB /* MsvcMath32.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BDB240C213500D54CBB /* MsvcMath32.c */; }; - 35366CD2240C213500D54CBB /* CustomSlide.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BDE240C213500D54CBB /* CustomSlide.c */; }; - 35366CD3240C213500D54CBB /* ContextSwitchSupport.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BE0240C213500D54CBB /* ContextSwitchSupport.c */; }; - 35366CD5240C213500D54CBB /* ContextSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366BE2240C213500D54CBB /* ContextSwitch.h */; }; - 35366CD6240C213500D54CBB /* BootCompatInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366BE3240C213500D54CBB /* BootCompatInternal.h */; }; - 35366CD7240C213500D54CBB /* ServiceOverrides.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BE4240C213500D54CBB /* ServiceOverrides.c */; }; - 35366CD8240C213500D54CBB /* ContextSwitchSupport.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BE6240C213500D54CBB /* ContextSwitchSupport.c */; }; - 35366CD9240C213500D54CBB /* ContextSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366BE7240C213500D54CBB /* ContextSwitch.h */; }; - 35366CDA240C213500D54CBB /* KernelSupport.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BE8240C213500D54CBB /* KernelSupport.c */; }; - 35366CDB240C213500D54CBB /* OcAppleBootCompatLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BE9240C213500D54CBB /* OcAppleBootCompatLib.c */; }; 35366CDC240C213500D54CBB /* MemoryMap.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BEB240C213500D54CBB /* MemoryMap.c */; }; 35366CDD240C213500D54CBB /* VirtualMemory.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BEC240C213500D54CBB /* VirtualMemory.c */; }; 35366CDE240C213500D54CBB /* LegacyRegionLock.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BED240C213500D54CBB /* LegacyRegionLock.c */; }; @@ -247,34 +244,30 @@ 35366CE1240C213500D54CBB /* OcAppleRamDiskLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BF3240C213500D54CBB /* OcAppleRamDiskLib.c */; }; 35366CE2240C213500D54CBB /* OcSmcLib.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366BF5240C213500D54CBB /* OcSmcLib.c */; }; 35366CE3240C213500D54CBB /* OcSmcLibInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 35366BF7240C213500D54CBB /* OcSmcLibInternal.h */; }; - 35C7411224055115005CB6EF /* GetTscEmu.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C73DEB24055113005CB6EF /* GetTscEmu.c */; }; - 35C7411324055115005CB6EF /* GuiApp.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C73DEC24055113005CB6EF /* GuiApp.c */; }; - 35C7411424055115005CB6EF /* GUI.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C73DED24055113005CB6EF /* GUI.c */; }; - 35C7411524055115005CB6EF /* BmfLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C73DEE24055113005CB6EF /* BmfLib.h */; }; - 35C7430124055116005CB6EF /* Helvetica_fnt.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C740ED24055114005CB6EF /* Helvetica_fnt.c */; }; - 35C7430524055116005CB6EF /* Helvetica_png.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C740F724055114005CB6EF /* Helvetica_png.c */; }; - 35C7430724055116005CB6EF /* InputSimTextIn.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C740FA24055114005CB6EF /* InputSimTextIn.c */; }; - 35C7430824055116005CB6EF /* InputSimAbsPtr.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C740FB24055114005CB6EF /* InputSimAbsPtr.c */; }; - 35C7430A24055116005CB6EF /* OutputFbGop.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410024055114005CB6EF /* OutputFbGop.c */; }; - 35C7430B24055116005CB6EF /* StGopShared.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410124055114005CB6EF /* StGopShared.c */; }; - 35C7430C24055116005CB6EF /* OutputStGop.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410224055114005CB6EF /* OutputStGop.c */; }; - 35C7430D24055116005CB6EF /* OcBootstrap.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410324055114005CB6EF /* OcBootstrap.c */; }; - 35C7430E24055116005CB6EF /* HwOps.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410424055115005CB6EF /* HwOps.c */; }; - 35C7430F24055116005CB6EF /* GuiApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C7410524055115005CB6EF /* GuiApp.h */; }; - 35C7431024055116005CB6EF /* GUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C7410624055115005CB6EF /* GUI.h */; }; - 35C7431124055116005CB6EF /* HwOpsEmu.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410724055115005CB6EF /* HwOpsEmu.c */; }; - 35C7431224055116005CB6EF /* BitmapFontUser.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410824055115005CB6EF /* BitmapFontUser.c */; }; - 35C7431324055116005CB6EF /* GuiIo.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C7410924055115005CB6EF /* GuiIo.h */; }; - 35C7431424055116005CB6EF /* OcBootstrapEmu.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410B24055115005CB6EF /* OcBootstrapEmu.c */; }; - 35C7431524055116005CB6EF /* BitmapFont.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410C24055115005CB6EF /* BitmapFont.c */; }; - 35C7431624055116005CB6EF /* BootPicker.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7410E24055115005CB6EF /* BootPicker.c */; }; - 35C7431724055116005CB6EF /* HwOps.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C7410F24055115005CB6EF /* HwOps.h */; }; - 35C7431824055116005CB6EF /* BmfFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C7411024055115005CB6EF /* BmfFile.h */; }; - 35C7431924055116005CB6EF /* GetTscHw.c in Sources */ = {isa = PBXBuildFile; fileRef = 35C7411124055115005CB6EF /* GetTscHw.c */; }; 35F6ACA6240C22EE00D6FA49 /* Canary.c in Sources */ = {isa = PBXBuildFile; fileRef = 35366B48240C213400D54CBB /* Canary.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 350857D42421373F005A0D86 /* GuiApp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GuiApp.c; sourceTree = ""; }; + 350857D52421373F005A0D86 /* BmfLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BmfLib.h; sourceTree = ""; }; + 350857D62421373F005A0D86 /* OpenCanopy.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenCanopy.inf; sourceTree = ""; }; + 350857D82421373F005A0D86 /* InputSimTextIn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = InputSimTextIn.c; sourceTree = ""; }; + 350857D92421373F005A0D86 /* InputSimAbsPtr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = InputSimAbsPtr.c; sourceTree = ""; }; + 350857DA2421373F005A0D86 /* OpenCanopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenCanopy.h; sourceTree = ""; }; + 350857DC2421373F005A0D86 /* OutputStGop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OutputStGop.c; sourceTree = ""; }; + 350857DD2421373F005A0D86 /* OcBootstrap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcBootstrap.c; sourceTree = ""; }; + 350857DE2421373F005A0D86 /* GuiApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuiApp.h; sourceTree = ""; }; + 350857DF2421373F005A0D86 /* GuiIo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuiIo.h; sourceTree = ""; }; + 350857E02421373F005A0D86 /* OpenCanopy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OpenCanopy.c; sourceTree = ""; }; + 350857E12421373F005A0D86 /* BitmapFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BitmapFont.c; sourceTree = ""; }; + 350857E32421373F005A0D86 /* BootPicker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BootPicker.c; sourceTree = ""; }; + 350857E42421373F005A0D86 /* BmfFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BmfFile.h; sourceTree = ""; }; + 350857E62421628D005A0D86 /* OcUnicodeCollationEngLocal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcUnicodeCollationEngLocal.c; sourceTree = ""; }; + 350857E72421628D005A0D86 /* OcUnicodeCollationEngLocalLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcUnicodeCollationEngLocalLib.inf; sourceTree = ""; }; + 350857E82421628D005A0D86 /* OcUnicodeCollationEngGenericLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcUnicodeCollationEngGenericLib.inf; sourceTree = ""; }; + 350857E92421628D005A0D86 /* OcUnicodeCollationEngGeneric.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcUnicodeCollationEngGeneric.c; sourceTree = ""; }; + 350857EA2421628D005A0D86 /* OcUnicodeCollationEngCommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcUnicodeCollationEngCommon.c; sourceTree = ""; }; + 350857EB2421628D005A0D86 /* OcUnicodeCollationEngInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcUnicodeCollationEngInternal.h; sourceTree = ""; }; 3511D55E23FDB2A700CC3B17 /* Configuration.tex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Configuration.tex; sourceTree = ""; }; 3511D55F23FDB2A700CC3B17 /* BuildDocs.tool */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = BuildDocs.tool; sourceTree = ""; }; 3511D56023FDB2A700CC3B17 /* SampleFull.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SampleFull.plist; sourceTree = ""; }; @@ -315,7 +308,6 @@ 3511D58B23FDB2A800CC3B17 /* OpenCore.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenCore.inf; sourceTree = ""; }; 3511D58C23FDB2A800CC3B17 /* OpenCoreKernel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OpenCoreKernel.c; sourceTree = ""; }; 3511D59823FDB2D900CC3B17 /* lib__OpenCorePkg__index.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = lib__OpenCorePkg__index.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - 3511D5CB23FDB37200CC3B17 /* NdkBootPicker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = NdkBootPicker.c; path = ../NdkBootPicker/NdkBootPicker.c; sourceTree = ""; }; 35366A8D240C213400D54CBB /* OcMachoLibInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcMachoLibInternal.h; sourceTree = ""; }; 35366A8E240C213400D54CBB /* OcMachoLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcMachoLib.inf; sourceTree = ""; }; 35366A8F240C213400D54CBB /* Header.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Header.c; sourceTree = ""; }; @@ -357,9 +349,6 @@ 35366ABA240C213400D54CBB /* PointerHandler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = PointerHandler.c; sourceTree = ""; }; 35366ABC240C213400D54CBB /* OcDeviceTreeLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcDeviceTreeLib.c; sourceTree = ""; }; 35366ABD240C213400D54CBB /* OcDeviceTreeLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcDeviceTreeLib.inf; sourceTree = ""; }; - 35366ABF240C213400D54CBB /* OcUnicodeCollationEngLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcUnicodeCollationEngLib.c; sourceTree = ""; }; - 35366AC0240C213400D54CBB /* OcUnicodeCollationEngLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcUnicodeCollationEngLib.inf; sourceTree = ""; }; - 35366AC1240C213400D54CBB /* OcUnicodeCollationEngLibInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcUnicodeCollationEngLibInternal.h; sourceTree = ""; }; 35366AC3240C213400D54CBB /* OcHashServicesLibInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcHashServicesLibInternal.h; sourceTree = ""; }; 35366AC4240C213400D54CBB /* OcHashServicesLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcHashServicesLib.c; sourceTree = ""; }; 35366AC5240C213400D54CBB /* OcHashServicesLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcHashServicesLib.inf; sourceTree = ""; }; @@ -587,17 +576,6 @@ 35366BD9240C213500D54CBB /* OcCompilerIntrinsicsLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcCompilerIntrinsicsLib.c; sourceTree = ""; }; 35366BDA240C213500D54CBB /* OcCompilerIntrinsicsLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcCompilerIntrinsicsLib.inf; sourceTree = ""; }; 35366BDB240C213500D54CBB /* MsvcMath32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = MsvcMath32.c; sourceTree = ""; }; - 35366BDD240C213500D54CBB /* OcAppleBootCompatLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcAppleBootCompatLib.inf; sourceTree = ""; }; - 35366BDE240C213500D54CBB /* CustomSlide.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CustomSlide.c; sourceTree = ""; }; - 35366BE0240C213500D54CBB /* ContextSwitchSupport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ContextSwitchSupport.c; sourceTree = ""; }; - 35366BE1240C213500D54CBB /* ContextSwitch.nasm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.nasm; path = ContextSwitch.nasm; sourceTree = ""; }; - 35366BE2240C213500D54CBB /* ContextSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextSwitch.h; sourceTree = ""; }; - 35366BE3240C213500D54CBB /* BootCompatInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BootCompatInternal.h; sourceTree = ""; }; - 35366BE4240C213500D54CBB /* ServiceOverrides.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ServiceOverrides.c; sourceTree = ""; }; - 35366BE6240C213500D54CBB /* ContextSwitchSupport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ContextSwitchSupport.c; sourceTree = ""; }; - 35366BE7240C213500D54CBB /* ContextSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextSwitch.h; sourceTree = ""; }; - 35366BE8240C213500D54CBB /* KernelSupport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = KernelSupport.c; sourceTree = ""; }; - 35366BE9240C213500D54CBB /* OcAppleBootCompatLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcAppleBootCompatLib.c; sourceTree = ""; }; 35366BEB240C213500D54CBB /* MemoryMap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = MemoryMap.c; sourceTree = ""; }; 35366BEC240C213500D54CBB /* VirtualMemory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VirtualMemory.c; sourceTree = ""; }; 35366BED240C213500D54CBB /* LegacyRegionLock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LegacyRegionLock.c; sourceTree = ""; }; @@ -610,33 +588,6 @@ 35366BF6240C213500D54CBB /* OcSmcLib.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OcSmcLib.inf; sourceTree = ""; }; 35366BF7240C213500D54CBB /* OcSmcLibInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcSmcLibInternal.h; sourceTree = ""; }; 357E232523F2A06B00BC930F /* UDK */ = {isa = PBXFileReference; lastKnownFileType = folder; path = UDK; sourceTree = ""; }; - 358C68E4240C2F3100DEBA5E /* Helvetica_0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Helvetica_0.png; sourceTree = ""; }; - 35C73DEB24055113005CB6EF /* GetTscEmu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GetTscEmu.c; sourceTree = ""; }; - 35C73DEC24055113005CB6EF /* GuiApp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GuiApp.c; sourceTree = ""; }; - 35C73DED24055113005CB6EF /* GUI.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GUI.c; sourceTree = ""; }; - 35C73DEE24055113005CB6EF /* BmfLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BmfLib.h; sourceTree = ""; }; - 35C740ED24055114005CB6EF /* Helvetica_fnt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Helvetica_fnt.c; sourceTree = ""; }; - 35C740F724055114005CB6EF /* Helvetica_png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Helvetica_png.c; sourceTree = ""; }; - 35C740FA24055114005CB6EF /* InputSimTextIn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = InputSimTextIn.c; sourceTree = ""; }; - 35C740FB24055114005CB6EF /* InputSimAbsPtr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = InputSimAbsPtr.c; sourceTree = ""; }; - 35C740FD24055114005CB6EF /* Bmf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Bmf; sourceTree = ""; }; - 35C7410024055114005CB6EF /* OutputFbGop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OutputFbGop.c; sourceTree = ""; }; - 35C7410124055114005CB6EF /* StGopShared.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = StGopShared.c; sourceTree = ""; }; - 35C7410224055114005CB6EF /* OutputStGop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OutputStGop.c; sourceTree = ""; }; - 35C7410324055114005CB6EF /* OcBootstrap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcBootstrap.c; sourceTree = ""; }; - 35C7410424055115005CB6EF /* HwOps.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = HwOps.c; sourceTree = ""; }; - 35C7410524055115005CB6EF /* GuiApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuiApp.h; sourceTree = ""; }; - 35C7410624055115005CB6EF /* GUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUI.h; sourceTree = ""; }; - 35C7410724055115005CB6EF /* HwOpsEmu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = HwOpsEmu.c; sourceTree = ""; }; - 35C7410824055115005CB6EF /* BitmapFontUser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BitmapFontUser.c; sourceTree = ""; }; - 35C7410924055115005CB6EF /* GuiIo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuiIo.h; sourceTree = ""; }; - 35C7410A24055115005CB6EF /* GUI.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GUI.inf; sourceTree = ""; }; - 35C7410B24055115005CB6EF /* OcBootstrapEmu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OcBootstrapEmu.c; sourceTree = ""; }; - 35C7410C24055115005CB6EF /* BitmapFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BitmapFont.c; sourceTree = ""; }; - 35C7410E24055115005CB6EF /* BootPicker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BootPicker.c; sourceTree = ""; }; - 35C7410F24055115005CB6EF /* HwOps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HwOps.h; sourceTree = ""; }; - 35C7411024055115005CB6EF /* BmfFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BmfFile.h; sourceTree = ""; }; - 35C7411124055115005CB6EF /* GetTscHw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GetTscHw.c; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -650,6 +601,64 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 350857D32421373F005A0D86 /* OpenCanopy */ = { + isa = PBXGroup; + children = ( + 350857D42421373F005A0D86 /* GuiApp.c */, + 350857D52421373F005A0D86 /* BmfLib.h */, + 350857D62421373F005A0D86 /* OpenCanopy.inf */, + 350857D72421373F005A0D86 /* Input */, + 350857DA2421373F005A0D86 /* OpenCanopy.h */, + 350857DB2421373F005A0D86 /* Output */, + 350857DD2421373F005A0D86 /* OcBootstrap.c */, + 350857DE2421373F005A0D86 /* GuiApp.h */, + 350857DF2421373F005A0D86 /* GuiIo.h */, + 350857E02421373F005A0D86 /* OpenCanopy.c */, + 350857E12421373F005A0D86 /* BitmapFont.c */, + 350857E22421373F005A0D86 /* Views */, + 350857E42421373F005A0D86 /* BmfFile.h */, + ); + path = OpenCanopy; + sourceTree = ""; + }; + 350857D72421373F005A0D86 /* Input */ = { + isa = PBXGroup; + children = ( + 350857D82421373F005A0D86 /* InputSimTextIn.c */, + 350857D92421373F005A0D86 /* InputSimAbsPtr.c */, + ); + path = Input; + sourceTree = ""; + }; + 350857DB2421373F005A0D86 /* Output */ = { + isa = PBXGroup; + children = ( + 350857DC2421373F005A0D86 /* OutputStGop.c */, + ); + path = Output; + sourceTree = ""; + }; + 350857E22421373F005A0D86 /* Views */ = { + isa = PBXGroup; + children = ( + 350857E32421373F005A0D86 /* BootPicker.c */, + ); + path = Views; + sourceTree = ""; + }; + 350857E52421628C005A0D86 /* OcUnicodeCollationEngLib */ = { + isa = PBXGroup; + children = ( + 350857E62421628D005A0D86 /* OcUnicodeCollationEngLocal.c */, + 350857E72421628D005A0D86 /* OcUnicodeCollationEngLocalLib.inf */, + 350857E82421628D005A0D86 /* OcUnicodeCollationEngGenericLib.inf */, + 350857E92421628D005A0D86 /* OcUnicodeCollationEngGeneric.c */, + 350857EA2421628D005A0D86 /* OcUnicodeCollationEngCommon.c */, + 350857EB2421628D005A0D86 /* OcUnicodeCollationEngInternal.h */, + ); + path = OcUnicodeCollationEngLib; + sourceTree = ""; + }; 3511D55D23FDB2A600CC3B17 /* Docs */ = { isa = PBXGroup; children = ( @@ -735,7 +744,7 @@ 3511D58123FDB2A800CC3B17 /* Platform */ = { isa = PBXGroup; children = ( - 35C73DEA24055113005CB6EF /* GUI */, + 350857D32421373F005A0D86 /* OpenCanopy */, 3511D58223FDB2A800CC3B17 /* OpenCore */, ); path = Platform; @@ -761,6 +770,7 @@ 35366A8B240C213300D54CBB /* Library */ = { isa = PBXGroup; children = ( + 350857E52421628C005A0D86 /* OcUnicodeCollationEngLib */, 35366A8C240C213400D54CBB /* OcMachoLib */, 35366A93240C213400D54CBB /* OcStringLib */, 35366A97240C213400D54CBB /* OcPngLib */, @@ -770,7 +780,6 @@ 35366AAF240C213400D54CBB /* OcRtcLib */, 35366AB2240C213400D54CBB /* OcAppleEventLib */, 35366ABB240C213400D54CBB /* OcDeviceTreeLib */, - 35366ABE240C213400D54CBB /* OcUnicodeCollationEngLib */, 35366AC2240C213400D54CBB /* OcHashServicesLib */, 35366AC6240C213400D54CBB /* OcAppleChunklistLib */, 35366AC9240C213400D54CBB /* OcHeciLib */, @@ -812,7 +821,6 @@ 35366BD2240C213500D54CBB /* OcOSInfoLib */, 35366BD5240C213500D54CBB /* OcTemplateLib */, 35366BD8240C213500D54CBB /* OcCompilerIntrinsicsLib */, - 35366BDC240C213500D54CBB /* OcAppleBootCompatLib */, 35366BEA240C213500D54CBB /* OcMemoryLib */, 35366BF1240C213500D54CBB /* OcAppleRamDiskLib */, 35366BF4240C213500D54CBB /* OcSmcLib */, @@ -924,16 +932,6 @@ path = OcDeviceTreeLib; sourceTree = ""; }; - 35366ABE240C213400D54CBB /* OcUnicodeCollationEngLib */ = { - isa = PBXGroup; - children = ( - 35366ABF240C213400D54CBB /* OcUnicodeCollationEngLib.c */, - 35366AC0240C213400D54CBB /* OcUnicodeCollationEngLib.inf */, - 35366AC1240C213400D54CBB /* OcUnicodeCollationEngLibInternal.h */, - ); - path = OcUnicodeCollationEngLib; - sourceTree = ""; - }; 35366AC2240C213400D54CBB /* OcHashServicesLib */ = { isa = PBXGroup; children = ( @@ -1560,40 +1558,6 @@ path = OcCompilerIntrinsicsLib; sourceTree = ""; }; - 35366BDC240C213500D54CBB /* OcAppleBootCompatLib */ = { - isa = PBXGroup; - children = ( - 35366BDD240C213500D54CBB /* OcAppleBootCompatLib.inf */, - 35366BDE240C213500D54CBB /* CustomSlide.c */, - 35366BDF240C213500D54CBB /* X64 */, - 35366BE3240C213500D54CBB /* BootCompatInternal.h */, - 35366BE4240C213500D54CBB /* ServiceOverrides.c */, - 35366BE5240C213500D54CBB /* IA32 */, - 35366BE8240C213500D54CBB /* KernelSupport.c */, - 35366BE9240C213500D54CBB /* OcAppleBootCompatLib.c */, - ); - path = OcAppleBootCompatLib; - sourceTree = ""; - }; - 35366BDF240C213500D54CBB /* X64 */ = { - isa = PBXGroup; - children = ( - 35366BE0240C213500D54CBB /* ContextSwitchSupport.c */, - 35366BE1240C213500D54CBB /* ContextSwitch.nasm */, - 35366BE2240C213500D54CBB /* ContextSwitch.h */, - ); - path = X64; - sourceTree = ""; - }; - 35366BE5240C213500D54CBB /* IA32 */ = { - isa = PBXGroup; - children = ( - 35366BE6240C213500D54CBB /* ContextSwitchSupport.c */, - 35366BE7240C213500D54CBB /* ContextSwitch.h */, - ); - path = IA32; - sourceTree = ""; - }; 35366BEA240C213500D54CBB /* OcMemoryLib */ = { isa = PBXGroup; children = ( @@ -1630,7 +1594,6 @@ isa = PBXGroup; children = ( 35366A8B240C213300D54CBB /* Library */, - 3511D5CB23FDB37200CC3B17 /* NdkBootPicker.c */, 3511D57D23FDB2A700CC3B17 /* Application */, 3511D55D23FDB2A600CC3B17 /* Docs */, 3511D57B23FDB2A700CC3B17 /* Include */, @@ -1640,72 +1603,6 @@ ); sourceTree = ""; }; - 35C73DEA24055113005CB6EF /* GUI */ = { - isa = PBXGroup; - children = ( - 35C73DEB24055113005CB6EF /* GetTscEmu.c */, - 35C73DEC24055113005CB6EF /* GuiApp.c */, - 35C73DED24055113005CB6EF /* GUI.c */, - 35C73DEE24055113005CB6EF /* BmfLib.h */, - 35C740EB24055114005CB6EF /* Images */, - 35C740F924055114005CB6EF /* Input */, - 35C740FD24055114005CB6EF /* Bmf */, - 35C740FF24055114005CB6EF /* Output */, - 35C7410324055114005CB6EF /* OcBootstrap.c */, - 35C7410424055115005CB6EF /* HwOps.c */, - 35C7410524055115005CB6EF /* GuiApp.h */, - 35C7410624055115005CB6EF /* GUI.h */, - 35C7410724055115005CB6EF /* HwOpsEmu.c */, - 35C7410824055115005CB6EF /* BitmapFontUser.c */, - 35C7410924055115005CB6EF /* GuiIo.h */, - 35C7410A24055115005CB6EF /* GUI.inf */, - 35C7410B24055115005CB6EF /* OcBootstrapEmu.c */, - 35C7410C24055115005CB6EF /* BitmapFont.c */, - 35C7410D24055115005CB6EF /* Views */, - 35C7410F24055115005CB6EF /* HwOps.h */, - 35C7411024055115005CB6EF /* BmfFile.h */, - 35C7411124055115005CB6EF /* GetTscHw.c */, - ); - path = GUI; - sourceTree = ""; - }; - 35C740EB24055114005CB6EF /* Images */ = { - isa = PBXGroup; - children = ( - 358C68E4240C2F3100DEBA5E /* Helvetica_0.png */, - 35C740ED24055114005CB6EF /* Helvetica_fnt.c */, - 35C740F724055114005CB6EF /* Helvetica_png.c */, - ); - path = Images; - sourceTree = ""; - }; - 35C740F924055114005CB6EF /* Input */ = { - isa = PBXGroup; - children = ( - 35C740FA24055114005CB6EF /* InputSimTextIn.c */, - 35C740FB24055114005CB6EF /* InputSimAbsPtr.c */, - ); - path = Input; - sourceTree = ""; - }; - 35C740FF24055114005CB6EF /* Output */ = { - isa = PBXGroup; - children = ( - 35C7410024055114005CB6EF /* OutputFbGop.c */, - 35C7410124055114005CB6EF /* StGopShared.c */, - 35C7410224055114005CB6EF /* OutputStGop.c */, - ); - path = Output; - sourceTree = ""; - }; - 35C7410D24055115005CB6EF /* Views */ = { - isa = PBXGroup; - children = ( - 35C7410E24055115005CB6EF /* BootPicker.c */, - ); - path = Views; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1718,8 +1615,6 @@ 35366C4A240C213500D54CBB /* Img4oids.h in Headers */, 35366C05240C213500D54CBB /* DataHub.h in Headers */, 35366BF8240C213500D54CBB /* OcMachoLibInternal.h in Headers */, - 35C7431724055116005CB6EF /* HwOps.h in Headers */, - 35366CD5240C213500D54CBB /* ContextSwitch.h in Headers */, 35366C64240C213500D54CBB /* deflate.h in Headers */, 35366C65240C213500D54CBB /* zlib.h in Headers */, 35366C25240C213500D54CBB /* BigNumLibInternal.h in Headers */, @@ -1733,10 +1628,10 @@ 35366CC4240C213500D54CBB /* OcCpuInternals.h in Headers */, 35366C38240C213500D54CBB /* oids.h in Headers */, 35366C37240C213500D54CBB /* DER_Encode.h in Headers */, - 35C7431324055116005CB6EF /* GuiIo.h in Headers */, 35366C9C240C213500D54CBB /* OcRngInternals.h in Headers */, 35366C3A240C213500D54CBB /* DER_Decode.h in Headers */, 35366C6E240C213500D54CBB /* lzvn.h in Headers */, + 350857EE2422071A005A0D86 /* OpenCanopy.h in Headers */, 35366BFF240C213500D54CBB /* lodepng.h in Headers */, 35366CB2240C213500D54CBB /* VirtualFsInternal.h in Headers */, 35366C8D240C213500D54CBB /* AIKTarget.h in Headers */, @@ -1745,17 +1640,17 @@ 35366C60240C213500D54CBB /* trees.h in Headers */, 35366C3E240C213500D54CBB /* DER_Keys.h in Headers */, 35366CAC240C213500D54CBB /* OcAudioInternal.h in Headers */, - 35366CD6240C213500D54CBB /* BootCompatInternal.h in Headers */, 35366C6A240C213500D54CBB /* crc32.h in Headers */, 35366C3C240C213500D54CBB /* DER_CertCrl.h in Headers */, 35366C10240C213500D54CBB /* AppleEventInternal.h in Headers */, 35366C92240C213500D54CBB /* AIM.h in Headers */, 35366C45240C213500D54CBB /* libDERImg4_config.h in Headers */, - 35366C19240C213500D54CBB /* OcUnicodeCollationEngLibInternal.h in Headers */, 35366C58240C213500D54CBB /* lzss.h in Headers */, + 350857F124220727005A0D86 /* GuiApp.h in Headers */, 35366C6D240C213500D54CBB /* zconf.h in Headers */, 35366C84240C213500D54CBB /* AIK.h in Headers */, 35366C9E240C213500D54CBB /* OcHdaDevicesInternal.h in Headers */, + 350857F224220729005A0D86 /* GuiIo.h in Headers */, 35366CA1240C213500D54CBB /* OcFirmwareVolumeLibInternal.h in Headers */, 35366C8E240C213500D54CBB /* AIKShim.h in Headers */, 35366C5F240C213500D54CBB /* inffixed.h in Headers */, @@ -1765,19 +1660,16 @@ 35366C5A240C213500D54CBB /* zutil.h in Headers */, 35366C47240C213500D54CBB /* DER_Img4Manifest.h in Headers */, 35366C61240C213500D54CBB /* inffast.h in Headers */, + 350857F524220733005A0D86 /* BmfFile.h in Headers */, 35366C83240C213500D54CBB /* AIKSource.h in Headers */, 35366C3D240C213500D54CBB /* asn1Types.h in Headers */, 35366C44240C213500D54CBB /* libDER_config.h in Headers */, - 35366CD9240C213500D54CBB /* ContextSwitch.h in Headers */, 35366C87240C213500D54CBB /* AIKTranslate.h in Headers */, 35366C26240C213500D54CBB /* BigNumLib.h in Headers */, - 35C7431824055116005CB6EF /* BmfFile.h in Headers */, - 35C7431024055116005CB6EF /* GUI.h in Headers */, - 35C7411524055115005CB6EF /* BmfLib.h in Headers */, + 350857EF24220721005A0D86 /* BmfLib.h in Headers */, 35366C49240C213500D54CBB /* libDERImg4.h in Headers */, 35366CA7240C213500D54CBB /* OcLogInternal.h in Headers */, 35366C79240C213500D54CBB /* Ubsan.h in Headers */, - 35C7430F24055116005CB6EF /* GuiApp.h in Headers */, 35366C1A240C213500D54CBB /* OcHashServicesLibInternal.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1860,18 +1752,19 @@ buildActionMask = 2147483647; files = ( 35366C21240C213500D54CBB /* Aes.c in Sources */, - 35C7431524055116005CB6EF /* BitmapFont.c in Sources */, 35366C8B240C213500D54CBB /* AIKSource.c in Sources */, 35366C7E240C213500D54CBB /* NativeOverflow.c in Sources */, 35366C97240C213500D54CBB /* OcAppleDiskImageBlockIo.c in Sources */, 35366C01240C213500D54CBB /* lodepng.c in Sources */, - 35C7430124055116005CB6EF /* Helvetica_fnt.c in Sources */, 35366C80240C213500D54CBB /* OcAppleBootPolicyLib.c in Sources */, 35366C98240C213500D54CBB /* OcAppleDiskImageLibInternal.c in Sources */, 35366CE0240C213500D54CBB /* UmmMalloc.c in Sources */, 35366C52240C213500D54CBB /* BootAudio.c in Sources */, 35366C72240C213500D54CBB /* SmbiosInternal.c in Sources */, 35366C9D240C213500D54CBB /* OcHdaDevicesLib.c in Sources */, + 350857EC24216525005A0D86 /* OcUnicodeLib.c in Sources */, + 350857F72422073B005A0D86 /* OutputStGop.c in Sources */, + 350857F024220724005A0D86 /* OcBootstrap.c in Sources */, 35366CB1240C213500D54CBB /* VirtualFs.c in Sources */, 35366C62240C213500D54CBB /* crc32.c in Sources */, 35366C8F240C213500D54CBB /* AIKData.c in Sources */, @@ -1890,25 +1783,19 @@ 3511D58E23FDB2A800CC3B17 /* Bootstrap.c in Sources */, 35366C7B240C213500D54CBB /* BitOverflow.c in Sources */, 35366CB9240C213500D54CBB /* KernelReader.c in Sources */, - 35C7430524055116005CB6EF /* Helvetica_png.c in Sources */, 35366C9F240C213500D54CBB /* OcFirmwareVolumeLib.c in Sources */, 35366C57240C213500D54CBB /* lzss.c in Sources */, 35366C03240C213500D54CBB /* OcDataHubLib.c in Sources */, 35366C15240C213500D54CBB /* KeyHandler.c in Sources */, 35366C76240C213500D54CBB /* OcStorageLib.c in Sources */, - 35C7411324055115005CB6EF /* GuiApp.c in Sources */, - 35C7430C24055116005CB6EF /* OutputStGop.c in Sources */, 35366C32240C213500D54CBB /* ReleaseUsbOwnership.c in Sources */, 35366CD0240C213500D54CBB /* OcCompilerIntrinsicsLib.c in Sources */, - 35C7411224055115005CB6EF /* GetTscEmu.c in Sources */, 35366C50240C213500D54CBB /* PolicyManagement.c in Sources */, 35366CAB240C213500D54CBB /* OcAudioWave.c in Sources */, 3511D59423FDB2A800CC3B17 /* OpenCorePlatform.c in Sources */, 35366CA0240C213500D54CBB /* FvOnFv2Thunk.c in Sources */, - 35C7430B24055116005CB6EF /* StGopShared.c in Sources */, 35366CBB240C213500D54CBB /* OpenFile.c in Sources */, 35366CA4240C213500D54CBB /* DebugHelp.c in Sources */, - 35366CDB240C213500D54CBB /* OcAppleBootCompatLib.c in Sources */, 3511D59223FDB2A800CC3B17 /* OpenCoreAcpi.c in Sources */, 35366C75240C213500D54CBB /* SmbiosPatch.c in Sources */, 35366CB4240C213500D54CBB /* PrelinkedContext.c in Sources */, @@ -1916,13 +1803,11 @@ 35366C06240C213500D54CBB /* ConsoleControl.c in Sources */, 35366CB3240C213500D54CBB /* PrelinkedKext.c in Sources */, 35366CAE240C213500D54CBB /* OcAudioVoiceOver.c in Sources */, - 3511D5CC23FDB37200CC3B17 /* NdkBootPicker.c in Sources */, 35366CCE240C213500D54CBB /* OcOSInfoLib.c in Sources */, 35366CBD240C213500D54CBB /* GptPartitionEntry.c in Sources */, 35366CAA240C213500D54CBB /* OcAudio.c in Sources */, 35366C93240C213500D54CBB /* OcFirmwarePasswordLib.c in Sources */, 35366C1C240C213500D54CBB /* OcAppleChunklistLib.c in Sources */, - 35366CD7240C213500D54CBB /* ServiceOverrides.c in Sources */, 35F6ACA6240C22EE00D6FA49 /* Canary.c in Sources */, 35366C82240C213500D54CBB /* OcAcpiLib.c in Sources */, 3511D59723FDB2A800CC3B17 /* OpenCoreKernel.c in Sources */, @@ -1930,27 +1815,23 @@ 35366C02240C213500D54CBB /* OcSerializeLib.c in Sources */, 35366C1D240C213500D54CBB /* OcHeciLib.c in Sources */, 35366BFB240C213500D54CBB /* Relocations.c in Sources */, - 35C7431124055116005CB6EF /* HwOpsEmu.c in Sources */, + 350857F624220737005A0D86 /* BootPicker.c in Sources */, 35366C4B240C213500D54CBB /* OcBootManagementLib.c in Sources */, 35366C2D240C213500D54CBB /* Md5.c in Sources */, 35366C51240C213500D54CBB /* DefaultEntryChoice.c in Sources */, 35366CC0240C213500D54CBB /* GetVolumeLabel.c in Sources */, 35366C7F240C213500D54CBB /* OcAppleKeysLib.c in Sources */, 3511D58F23FDB2A800CC3B17 /* OpenCoreUefi.c in Sources */, - 35366CDA240C213500D54CBB /* KernelSupport.c in Sources */, 35366CDE240C213500D54CBB /* LegacyRegionLock.c in Sources */, 35366CC6240C213500D54CBB /* FrequencyDetect.c in Sources */, 35366C90240C213500D54CBB /* AIT.c in Sources */, 35366C68240C213500D54CBB /* uncompr.c in Sources */, 35366C28240C213500D54CBB /* BigNumPrimitives.c in Sources */, 35366CCF240C213500D54CBB /* OcTemplateLib.c in Sources */, - 35366C1E240C213500D54CBB /* OcConsoleControlEntryModeLib.c in Sources */, 35366C24240C213500D54CBB /* BigNumWordMul64.c in Sources */, 3511D59623FDB2A800CC3B17 /* OpenCoreNvram.c in Sources */, - 35C7431424055116005CB6EF /* OcBootstrapEmu.c in Sources */, 35366CDC240C213500D54CBB /* MemoryMap.c in Sources */, 35366BFE240C213500D54CBB /* OcAsciiLib.c in Sources */, - 35C7430E24055116005CB6EF /* HwOps.c in Sources */, 35366C11240C213500D54CBB /* OcAppleEventLib.c in Sources */, 35366C7C240C213500D54CBB /* TripleOverflow.c in Sources */, 35366C56240C213500D54CBB /* VariableManagement.c in Sources */, @@ -1959,17 +1840,14 @@ 35366C08240C213500D54CBB /* ResolutionParsing.c in Sources */, 35366C0F240C213500D54CBB /* OcRtcLib.c in Sources */, 35366C4D240C213500D54CBB /* DmgBootSupport.c in Sources */, + 350857ED24220712005A0D86 /* GuiApp.c in Sources */, 35366CBC240C213500D54CBB /* FsConnectQuirk.c in Sources */, 35366C0E240C213500D54CBB /* TextOutputBuiltin.c in Sources */, 35366CB7240C213500D54CBB /* CommonPatches.c in Sources */, 35366C41240C213500D54CBB /* DER_Encode.c in Sources */, - 35C7430A24055116005CB6EF /* OutputFbGop.c in Sources */, - 35366C18240C213500D54CBB /* OcUnicodeCollationEngLib.c in Sources */, 35366C5D240C213500D54CBB /* compress.c in Sources */, 35366C33240C213500D54CBB /* DataPatcher.c in Sources */, 35366CBE240C213500D54CBB /* ReadFile.c in Sources */, - 35C7431224055116005CB6EF /* BitmapFontUser.c in Sources */, - 35C7430D24055116005CB6EF /* OcBootstrap.c in Sources */, 35366C6C240C213500D54CBB /* adler32.c in Sources */, 35366CA2240C213500D54CBB /* ExpandDevicePath.c in Sources */, 35366C89240C213500D54CBB /* AIKMap.c in Sources */, @@ -1977,13 +1855,11 @@ 35366CA3240C213500D54CBB /* OcDevicePathLib.c in Sources */, 35366C23240C213500D54CBB /* BigNumMontgomery.c in Sources */, 35366C77240C213500D54CBB /* OcAppleSecureBootLib.c in Sources */, - 35C7430724055116005CB6EF /* InputSimTextIn.c in Sources */, 35366CCA240C213500D54CBB /* OcConfigurationLib.c in Sources */, 35366C46240C213500D54CBB /* Img4oids.c in Sources */, 35366CE2240C213500D54CBB /* OcSmcLib.c in Sources */, 35366C53240C213500D54CBB /* BootArguments.c in Sources */, 35366C16240C213500D54CBB /* PointerHandler.c in Sources */, - 35C7431924055116005CB6EF /* GetTscHw.c in Sources */, 35366C14240C213500D54CBB /* EventQueue.c in Sources */, 35366C00240C213500D54CBB /* OcPng.c in Sources */, 35366C27240C213500D54CBB /* Sha1.c in Sources */, @@ -1991,19 +1867,16 @@ 35366CE1240C213500D54CBB /* OcAppleRamDiskLib.c in Sources */, 35366CC7240C213500D54CBB /* AppleCpuSupport.c in Sources */, 35366CC3240C213500D54CBB /* LocateFileSystem.c in Sources */, + 350857F32422072D005A0D86 /* OpenCanopy.c in Sources */, 35366C0D240C213500D54CBB /* TextOutputSystem.c in Sources */, 35366C09240C213500D54CBB /* UgaPassThrough.c in Sources */, 35366C3B240C213500D54CBB /* DER_Digest.c in Sources */, 35366CDF240C213500D54CBB /* LegacyRegionUnLock.c in Sources */, 35366C5C240C213500D54CBB /* inflate.c in Sources */, - 35366C2C240C213500D54CBB /* RsaDigitalSign.c in Sources */, - 35366CD2240C213500D54CBB /* CustomSlide.c in Sources */, 35366C3F240C213500D54CBB /* DER_Decode.c in Sources */, - 35C7430824055116005CB6EF /* InputSimAbsPtr.c in Sources */, 35366C67240C213500D54CBB /* inftrees.c in Sources */, 35366C85240C213500D54CBB /* AIKTarget.c in Sources */, 35366C40240C213500D54CBB /* oids.c in Sources */, - 35366CD8240C213500D54CBB /* ContextSwitchSupport.c in Sources */, 35366C31240C213500D54CBB /* UninstallAllProtocolInterfaces.c in Sources */, 35366C1F240C213500D54CBB /* OcAppleImageVerification.c in Sources */, 35366CA9240C213500D54CBB /* OcAudioGenBeep.c in Sources */, @@ -2029,12 +1902,10 @@ 35366C1B240C213500D54CBB /* OcHashServicesLib.c in Sources */, 35366C30240C213500D54CBB /* Math.c in Sources */, 35366CD1240C213500D54CBB /* MsvcMath32.c in Sources */, - 35366CD3240C213500D54CBB /* ContextSwitchSupport.c in Sources */, 35366C12240C213500D54CBB /* AppleEvent.c in Sources */, 35366CA6240C213500D54CBB /* OcLog.c in Sources */, 35366CB5240C213500D54CBB /* Link.c in Sources */, 35366C54240C213500D54CBB /* AppleHibernate.c in Sources */, - 35C7411424055115005CB6EF /* GUI.c in Sources */, 35366CB6240C213500D54CBB /* KextPatcher.c in Sources */, 35366CB8240C213500D54CBB /* Vtables.c in Sources */, 35366C71240C213500D54CBB /* DebugSmbios.c in Sources */, @@ -2044,15 +1915,14 @@ 35366C6B240C213500D54CBB /* inffast.c in Sources */, 35366CA8240C213500D54CBB /* OcDebugLogLib.c in Sources */, 35366C5E240C213500D54CBB /* deflate.c in Sources */, - 35366BFD240C213500D54CBB /* OcUnicodeLib.c in Sources */, 35366C22240C213500D54CBB /* Sha2.c in Sources */, 35366C81240C213500D54CBB /* OcAppleUserInterfaceThemeLib.c in Sources */, - 35C7431624055116005CB6EF /* BootPicker.c in Sources */, 35366C2F240C213500D54CBB /* DirectReset.c in Sources */, 35366C63240C213500D54CBB /* infback.c in Sources */, 35366BFA240C213500D54CBB /* Symbols.c in Sources */, 35366CAD240C213500D54CBB /* OcAudioLib.c in Sources */, 35366C70240C213500D54CBB /* OcAppleKeyMapLib.c in Sources */, + 350857F424220730005A0D86 /* BitmapFont.c in Sources */, 35366C0A240C213500D54CBB /* OcConsoleLib.c in Sources */, 35366CB0240C213500D54CBB /* VirtualVolume.c in Sources */, 35366C17240C213500D54CBB /* OcDeviceTreeLib.c in Sources */, @@ -2208,17 +2078,21 @@ GCC_PREPROCESSOR_DEFINITIONS = ( MACH_LITTLE_ENDIAN, OC_TARGET_RELEASE, - MDE_CPU_X64, ); - HEADER_SEARCH_PATHS = "$(SRCROOT)/UDK/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/UDK/MdePkg/Include/X64", + "$(SRCROOT)/UDK/**", + ); MACOSX_DEPLOYMENT_TARGET = 10.14; OTHER_CFLAGS = ( "-fdiagnostics-absolute-paths", "-include", "$(SRCROOT)/UDK/Build/OpenCorePkg/RELEASE_XCODE5/X64/OpenCorePkg/Platform/OpenCore/OpenCore/DEBUG/AutoGen.h", "-include", - "$(SRCROOT)/UDK/MdePkg/Include/Uefi.h", + "$(SRCROOT)/UDK/Build/OpenCorePkg/RELEASE_XCODE5/X64/OpenCorePkg/Platform/OpenCore/OpenCore/DEBUG/AutoGen.c", + "-fshort-wchar", ); + OTHER_LDFLAGS = "-###"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -2239,17 +2113,21 @@ GCC_PREPROCESSOR_DEFINITIONS = ( MACH_LITTLE_ENDIAN, OC_TARGET_RELEASE, - MDE_CPU_X64, ); - HEADER_SEARCH_PATHS = "$(SRCROOT)/UDK/**"; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/UDK/MdePkg/Include/X64", + "$(SRCROOT)/UDK/**", + ); MACOSX_DEPLOYMENT_TARGET = 10.14; OTHER_CFLAGS = ( "-fdiagnostics-absolute-paths", "-include", "$(SRCROOT)/UDK/Build/OpenCorePkg/RELEASE_XCODE5/X64/OpenCorePkg/Platform/OpenCore/OpenCore/DEBUG/AutoGen.h", "-include", - "$(SRCROOT)/UDK/MdePkg/Include/Uefi.h", + "$(SRCROOT)/UDK/Build/OpenCorePkg/RELEASE_XCODE5/X64/OpenCorePkg/Platform/OpenCore/OpenCore/DEBUG/AutoGen.c", + "-fshort-wchar", ); + OTHER_LDFLAGS = "-###"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Platform/OpenCanopy/GuiApp.c b/Platform/OpenCanopy/GuiApp.c index 8b964d62..fcecbd13 100644 --- a/Platform/OpenCanopy/GuiApp.c +++ b/Platform/OpenCanopy/GuiApp.c @@ -14,6 +14,11 @@ #include #include #include +#include +#include +#include + +#include #include "OpenCanopy.h" #include "BmfLib.h" @@ -38,22 +43,126 @@ InternalContextDestruct ( IN OUT BOOT_PICKER_GUI_CONTEXT *Context ) { + // TODO: maybe refactor it to an array? InternalSafeFreePool (Context->Cursor.Buffer); InternalSafeFreePool (Context->EntryBackSelected.Buffer); InternalSafeFreePool (Context->EntrySelector.BaseImage.Buffer); InternalSafeFreePool (Context->EntrySelector.HoldImage.Buffer); InternalSafeFreePool (Context->EntryIconInternal.Buffer); - InternalSafeFreePool (Context->EntryIconInternal.Buffer); - InternalSafeFreePool (Context->EntryIconExternal.Buffer); InternalSafeFreePool (Context->EntryIconExternal.Buffer); + InternalSafeFreePool (Context->EntryIconTool.Buffer); InternalSafeFreePool (Context->FontContext.FontImage.Buffer); + InternalSafeFreePool (Context->EntryLabelEFIBoot.Buffer); + InternalSafeFreePool (Context->EntryLabelWindows.Buffer); + InternalSafeFreePool (Context->EntryLabelRecovery.Buffer); + InternalSafeFreePool (Context->EntryLabelMacOS.Buffer); + InternalSafeFreePool (Context->EntryLabelTool.Buffer); + InternalSafeFreePool (Context->EntryLabelShell.Buffer); + InternalSafeFreePool (Context->EntryLabelResetNVRAM.Buffer); + /* + InternalSafeFreePool (Context->Poof[0].Buffer); + InternalSafeFreePool (Context->Poof[1].Buffer); + InternalSafeFreePool (Context->Poof[2].Buffer); + InternalSafeFreePool (Context->Poof[3].Buffer); + InternalSafeFreePool (Context->Poof[4].Buffer); + */ } +STATIC +RETURN_STATUS +LoadImageFileFromStorageForScale ( + IN OC_STORAGE_CONTEXT *Storage, + IN CONST CHAR8 *ImageFilePath, + IN CONST CHAR8 *ImageFileExt, + IN UINT8 Scale, + OUT VOID **FileData, + OUT UINT32 *FileSize + ) +{ + EFI_STATUS Status; + CHAR16 Path[OC_STORAGE_SAFE_PATH_MAX]; + + ASSERT (Scale == 1 || Scale == 2); + + Status = OcUnicodeSafeSPrint ( + Path, + sizeof (Path), + OPEN_CORE_IMAGE_PATH L"%a%a.%a", + ImageFilePath, + Scale == 2 ? "@2x" : "", + ImageFileExt + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "OCUI: Cannot fit %a\n", ImageFilePath)); + return EFI_OUT_OF_RESOURCES; + } + + *FileData = OcStorageReadFileUnicode (Storage, Path, FileSize); + + if (*FileData == NULL) { + DEBUG ((DEBUG_WARN, "OCUI: Failed to load %s\n", Path)); + return RETURN_NOT_FOUND; + } + + if (*FileSize == 0) { + FreePool (*FileData); + DEBUG ((DEBUG_WARN, "OCUI: Empty %s\n", Path)); + return RETURN_NOT_FOUND; + } + + return RETURN_SUCCESS; +} + + +STATIC +RETURN_STATUS +LoadLabelFileFromStorageForScale ( + IN OC_STORAGE_CONTEXT *Storage, + IN CONST CHAR8 *LabelFilePath, + IN UINT8 Scale, + OUT VOID **FileData, + OUT UINT32 *FileSize + ) +{ + EFI_STATUS Status; + CHAR16 Path[OC_STORAGE_SAFE_PATH_MAX]; + + ASSERT (Scale == 1 || Scale == 2); + + Status = OcUnicodeSafeSPrint ( + Path, + sizeof (Path), + OPEN_CORE_LABEL_PATH L"%a.%a", + LabelFilePath, + Scale == 2 ? "l2x" : "lbl" + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "OCUI: Cannot fit %a\n", LabelFilePath)); + return EFI_OUT_OF_RESOURCES; + } + + *FileData = OcStorageReadFileUnicode (Storage, Path, FileSize); + + if (*FileData == NULL) { + DEBUG ((DEBUG_WARN, "OCUI: Failed to load %s\n", Path)); + return RETURN_NOT_FOUND; + } + + if (*FileSize == 0) { + FreePool (*FileData); + DEBUG ((DEBUG_WARN, "OCUI: Empty %s\n", Path)); + return RETURN_NOT_FOUND; + } + + return RETURN_SUCCESS; +} RETURN_STATUS LoadImageFromStorage ( IN OC_STORAGE_CONTEXT *Storage, - IN CONST CHAR16 *ImageFilePath, + IN CONST CHAR8 *ImageFilePath, + IN CONST CHAR8 *ImageFileExt, + IN UINT8 Scale, OUT VOID *Image, IN CONST EFI_GRAPHICS_OUTPUT_BLT_PIXEL *HighlightPixel OPTIONAL ) @@ -62,7 +171,16 @@ LoadImageFromStorage ( UINT32 ImageSize; RETURN_STATUS Status; - ImageData = OcStorageReadFileUnicode (Storage, ImageFilePath, &ImageSize); + ASSERT (Scale == 1 || Scale == 2); + + Status = LoadImageFileFromStorageForScale ( + Storage, + ImageFilePath, + ImageFileExt, + Scale, + &ImageData, + &ImageSize + ); if (ImageData == NULL) { return EFI_NOT_FOUND; } @@ -75,6 +193,40 @@ LoadImageFromStorage ( FreePool (ImageData); + if (RETURN_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "OCUI: Failed to decode image %a - %\n", ImageFilePath, Status)); + } + + return Status; +} + +RETURN_STATUS +LoadLabelFromStorage ( + IN OC_STORAGE_CONTEXT *Storage, + IN CONST CHAR8 *ImageFilePath, + IN UINT8 Scale, + OUT GUI_IMAGE *Image + ) +{ + VOID *ImageData; + UINT32 ImageSize; + RETURN_STATUS Status; + + ASSERT (Scale == 1 || Scale == 2); + + Status = LoadLabelFileFromStorageForScale (Storage, ImageFilePath, Scale, &ImageData, &ImageSize); + if (RETURN_ERROR (Status)) { + return Status; + } + + Status = GuiLabelToImage (Image, ImageData, ImageSize, Scale); + + FreePool (ImageData); + + if (RETURN_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "OCUI: Failed to decode label %a - %r\n", ImageFilePath, Status)); + } + return Status; } @@ -94,24 +246,60 @@ InternalContextConstruct ( VOID *FontData; UINT32 FontImageSize; UINT32 FontDataSize; + UINTN UiScaleSize; ASSERT (Context != NULL); + Context->Scale = 1; + UiScaleSize = sizeof (Context->Scale); + + Status = gRT->GetVariable ( + APPLE_UI_SCALE_VARIABLE_NAME, + &gAppleVendorVariableGuid, + NULL, + &UiScaleSize, + (VOID *) &Context->Scale + ); + + if (EFI_ERROR (Status) || Context->Scale != 2) { + Context->Scale = 1; + } + + // FIXME: Add support for 2x scaling. + Context->Scale = 1; + Context->BootEntry = NULL; - Status = LoadImageFromStorage (Storage, L"Resources\\Image\\Cursor.png", &Context->Cursor, NULL); - Status |= LoadImageFromStorage (Storage, L"Resources\\Image\\Selected.png", &Context->EntryBackSelected, NULL); - Status |= LoadImageFromStorage (Storage, L"Resources\\Image\\Selector.png", &Context->EntrySelector, &HighlightPixel); - Status |= LoadImageFromStorage (Storage, L"Resources\\Image\\InternalHardDrive.png", &Context->EntryIconInternal, NULL); - Status |= LoadImageFromStorage (Storage, L"Resources\\Image\\ExternalHardDrive.png", &Context->EntryIconExternal, NULL); + Status = LoadImageFromStorage (Storage, "Cursor", "png", Context->Scale, &Context->Cursor, NULL); + Status |= LoadImageFromStorage (Storage, "Selected", "png", Context->Scale, &Context->EntryBackSelected, NULL); + Status |= LoadImageFromStorage (Storage, "InternalHardDrive", "png", Context->Scale, &Context->EntryIconInternal, NULL); + Status |= LoadImageFromStorage (Storage, "ExternalHardDrive", "png", Context->Scale, &Context->EntryIconExternal, NULL); + Status |= LoadImageFromStorage (Storage, "Tool", "png", Context->Scale, &Context->EntryIconTool, NULL); + Status |= LoadImageFromStorage (Storage, "Selector", "png", Context->Scale, &Context->EntrySelector, &HighlightPixel); + Status |= LoadLabelFromStorage (Storage, "EFIBoot", Context->Scale, &Context->EntryLabelEFIBoot); + Status |= LoadLabelFromStorage (Storage, "Windows", Context->Scale, &Context->EntryLabelWindows); + Status |= LoadLabelFromStorage (Storage, "Recovery", Context->Scale, &Context->EntryLabelRecovery); + Status |= LoadLabelFromStorage (Storage, "ResetNVRAM", Context->Scale, &Context->EntryLabelResetNVRAM); + Status |= LoadLabelFromStorage (Storage, "Tool", Context->Scale, &Context->EntryLabelTool); + Status |= LoadLabelFromStorage (Storage, "Shell", Context->Scale, &Context->EntryLabelShell); + Status |= LoadLabelFromStorage (Storage, "macOS", Context->Scale, &Context->EntryLabelMacOS); + + /* + Status |= LoadImageFromStorage (Storage, "ToolbarPoof1128x128", "png", Context->Scale, &Context->Poof[0], NULL); + Status |= LoadImageFromStorage (Storage, "ToolbarPoof2128x128", "png", Context->Scale, &Context->Poof[1], NULL); + Status |= LoadImageFromStorage (Storage, "ToolbarPoof3128x128", "png", Context->Scale, &Context->Poof[2], NULL); + Status |= LoadImageFromStorage (Storage, "ToolbarPoof4128x128", "png", Context->Scale, &Context->Poof[3], NULL); + Status |= LoadImageFromStorage (Storage, "ToolbarPoof5128x128", "png", Context->Scale, &Context->Poof[4], NULL); + */ if (RETURN_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "OCUI: Failed to load images\n")); InternalContextDestruct (Context); return RETURN_UNSUPPORTED; } - FontImage = OcStorageReadFileUnicode (Storage, L"Resources\\Font\\Font.png", &FontImageSize); - FontData = OcStorageReadFileUnicode (Storage, L"Resources\\Font\\Font.bin", &FontDataSize); + FontImage = OcStorageReadFileUnicode (Storage, OPEN_CORE_FONT_PATH L"Font.png", &FontImageSize); + FontData = OcStorageReadFileUnicode (Storage, OPEN_CORE_FONT_PATH L"Font.bin", &FontDataSize); if (FontImage != NULL && FontData != NULL) { Result = GuiFontConstruct ( @@ -126,11 +314,11 @@ InternalContextConstruct ( } if (!Result) { - DEBUG ((DEBUG_WARN, "BMF: Font failed\n")); + DEBUG ((DEBUG_WARN, "OCUI: Font init failed\n")); InternalContextDestruct (Context); return RETURN_UNSUPPORTED; } - + return RETURN_SUCCESS; } diff --git a/Platform/OpenCanopy/GuiApp.h b/Platform/OpenCanopy/GuiApp.h index 24ee0dcf..2dc03680 100644 --- a/Platform/OpenCanopy/GuiApp.h +++ b/Platform/OpenCanopy/GuiApp.h @@ -11,16 +11,28 @@ #include "OpenCanopy.h" #include "BmfLib.h" +#include + typedef struct { GUI_CLICK_IMAGE EntrySelector; GUI_IMAGE EntryIconInternal; GUI_IMAGE EntryIconExternal; + GUI_IMAGE EntryIconTool; + GUI_IMAGE EntryLabelEFIBoot; + GUI_IMAGE EntryLabelWindows; + GUI_IMAGE EntryLabelRecovery; + GUI_IMAGE EntryLabelMacOS; + GUI_IMAGE EntryLabelTool; + GUI_IMAGE EntryLabelShell; + GUI_IMAGE EntryLabelResetNVRAM; + // GUI_IMAGE Poof[5]; GUI_IMAGE EntryBackSelected; GUI_IMAGE Cursor; GUI_FONT_CONTEXT FontContext; VOID *BootEntry; BOOLEAN HideAuxiliary; BOOLEAN Refresh; + UINT8 Scale; } BOOT_PICKER_GUI_CONTEXT; RETURN_STATUS @@ -32,10 +44,9 @@ BootPickerViewInitialize ( RETURN_STATUS BootPickerEntriesAdd ( + IN OC_PICKER_CONTEXT *Context, IN CONST BOOT_PICKER_GUI_CONTEXT *GuiContext, - IN CONST CHAR16 *Name, - IN VOID *EntryContext, - IN BOOLEAN IsExternal, + IN OC_BOOT_ENTRY *Entry, IN BOOLEAN Default ); diff --git a/Platform/OpenCanopy/OcBootstrap.c b/Platform/OpenCanopy/OcBootstrap.c index b6081f5a..b050d015 100644 --- a/Platform/OpenCanopy/OcBootstrap.c +++ b/Platform/OpenCanopy/OcBootstrap.c @@ -55,10 +55,9 @@ OcShowMenuByOc ( for (Index = 0; Index < Count; ++Index) { Status = BootPickerEntriesAdd ( + Context, &mGuiContext, - BootEntries[Index].Name, &BootEntries[Index], - BootEntries[Index].IsExternal, Index == DefaultEntry ); if (RETURN_ERROR (Status)) { @@ -149,7 +148,7 @@ UefiMain ( ); if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "OCE: Another GUI is already present\n")); + DEBUG ((DEBUG_ERROR, "OCUI: Another GUI is already present\n")); return EFI_ALREADY_STARTED; } @@ -165,9 +164,9 @@ UefiMain ( ); if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "OCE: Registered custom GUI protocol\n")); + DEBUG ((DEBUG_INFO, "OCUI: Registered custom GUI protocol\n")); } else { - DEBUG ((DEBUG_ERROR, "OCE: Failed to install GUI protocol - %r\n", Status)); + DEBUG ((DEBUG_ERROR, "OCUI: Failed to install GUI protocol - %r\n", Status)); } return Status; diff --git a/Platform/OpenCanopy/OpenCanopy.c b/Platform/OpenCanopy/OpenCanopy.c index 124d6ffa..094cc5d5 100644 --- a/Platform/OpenCanopy/OpenCanopy.c +++ b/Platform/OpenCanopy/OpenCanopy.c @@ -7,6 +7,9 @@ #include +#include +#include + #include #include #include @@ -14,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +54,29 @@ STATIC UINT64 mStartTsc = 0; // STATIC UINT8 mNumValidDrawReqs = 0; STATIC GUI_DRAW_REQUEST mDrawRequests[4] = { { 0 } }; +// +// Disk label palette. +// +STATIC +CONST UINT8 +mAppleDiskLabelImagePalette[256] = { + [0x00] = 255, + [0xf6] = 238, + [0xf7] = 221, + [0x2a] = 204, + [0xf8] = 187, + [0xf9] = 170, + [0x55] = 153, + [0xfa] = 136, + [0xfb] = 119, + [0x80] = 102, + [0xfc] = 85, + [0xfd] = 68, + [0xab] = 51, + [0xfe] = 34, + [0xff] = 17, + [0xd6] = 0 +}; BOOLEAN GuiClipChildBounds ( @@ -927,7 +954,7 @@ GuiLibConstruct ( mOutputContext = GuiOutputConstruct (); if (mOutputContext == NULL) { - DEBUG ((DEBUG_ERROR, "Failed to initialise output\n")); + DEBUG ((DEBUG_ERROR, "OCUI: Failed to initialise output\n")); return EFI_UNSUPPORTED; } @@ -944,12 +971,12 @@ GuiLibConstruct ( OutputInfo->VerticalResolution ); if (mPointerContext == NULL) { - DEBUG ((DEBUG_WARN, "Failed to initialise pointer\n")); + DEBUG ((DEBUG_WARN, "OCUI: Failed to initialise pointer\n")); } mKeyContext = GuiKeyConstruct (); if (mKeyContext == NULL) { - DEBUG ((DEBUG_WARN, "Failed to initialise key input\n")); + DEBUG ((DEBUG_WARN, "OCUI: Failed to initialise key input\n")); } if (mPointerContext == NULL && mKeyContext == NULL) { @@ -960,7 +987,7 @@ GuiLibConstruct ( mScreenBufferDelta = OutputInfo->HorizontalResolution * sizeof (*mScreenBuffer); mScreenBuffer = AllocatePool (OutputInfo->VerticalResolution * mScreenBufferDelta); if (mScreenBuffer == NULL) { - DEBUG ((DEBUG_ERROR, "GUI alloc failure\n")); + DEBUG ((DEBUG_ERROR, "OCUI: GUI alloc failure\n")); GuiLibDestruct (); return EFI_OUT_OF_RESOURCES; } @@ -1196,11 +1223,127 @@ GuiDrawLoop ( } while (!DrawContext->ExitLoop (DrawContext->GuiContext)); } +RETURN_STATUS +GuiIcnsToImageIcon ( + OUT GUI_IMAGE *Image, + IN VOID *IcnsImage, + IN UINT32 IcnsImageSize, + IN UINT8 Scale + ) +{ + EFI_STATUS Status; + UINT32 Offset; + UINT32 RecordLength; + APPLE_ICNS_RECORD *Record; + + ASSERT (Scale == 1 || Scale == 2); + + // + // We do not need to support 'it32' 128x128 icon format, + // because Finder automatically converts the icons to PNG-based + // when assigning volume icon. + // + + if (IcnsImageSize < sizeof (APPLE_ICNS_RECORD)*2) { + return EFI_INVALID_PARAMETER; + } + + Record = IcnsImage; + if (Record->Type != APPLE_ICNS_MAGIC || SwapBytes32 (Record->Size) != IcnsImageSize) { + return EFI_SECURITY_VIOLATION; + } + + Offset = sizeof (APPLE_ICNS_RECORD); + while (Offset < IcnsImageSize - sizeof (APPLE_ICNS_RECORD)) { + Record = (APPLE_ICNS_RECORD *) ((UINT8 *) IcnsImage + Offset); + RecordLength = SwapBytes32 (Record->Size); + + // + // 1. Record smaller than its header is invalid. + // 2. Record overflowing UINT32 is invalid. + // 3. Record larger than file size is invalid. + // + if (RecordLength < sizeof (APPLE_ICNS_RECORD) + || OcOverflowAddU32 (Offset, RecordLength, &Offset) + || Offset > IcnsImageSize) { + return EFI_SECURITY_VIOLATION; + } + + if ((Scale == 1 && Record->Type == APPLE_ICNS_IC07) + || (Scale == 2 && Record->Type == APPLE_ICNS_IC13)) { + Status = GuiPngToImage ( + Image, + Record->Data, + RecordLength - sizeof (APPLE_ICNS_RECORD) + ); + + if (!EFI_ERROR (Status)) { + if (Image->Width != APPLE_DISK_ICON_DIMENSION * Scale + || Image->Height != APPLE_DISK_ICON_DIMENSION * Scale) { + FreePool (Image->Buffer); + Status = EFI_UNSUPPORTED; + } + } + + return Status; + } + } + + return RETURN_NOT_FOUND; +} + +EFI_STATUS +GuiLabelToImage ( + OUT GUI_IMAGE *Image, + IN VOID *RawData, + IN UINT32 DataLength, + IN UINT8 Scale + ) +{ + APPLE_DISK_LABEL *Label; + UINT32 PixelIdx; + + ASSERT (RawData != NULL); + ASSERT (Scale == 1 || Scale == 2); + + if (DataLength < sizeof (APPLE_DISK_LABEL)) { + return EFI_INVALID_PARAMETER; + } + + Label = RawData; + Image->Width = SwapBytes16 (Label->Width); + Image->Height = SwapBytes16 (Label->Height); + + if (Image->Width > APPLE_DISK_LABEL_MAX_WIDTH * Scale + || Image->Height > APPLE_DISK_LABEL_MAX_HEIGHT * Scale + || DataLength != sizeof (APPLE_DISK_LABEL) + Image->Width * Image->Height) { + DEBUG ((DEBUG_INFO, "OCUI: Invalid label has %dx%d dims at %u size\n", Image->Width, Image->Height, DataLength)); + return EFI_SECURITY_VIOLATION; + } + + Image->Buffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocatePool ( + Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + ); + + if (Image->Buffer == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + for (PixelIdx = 0; PixelIdx < Image->Width * Image->Height; PixelIdx++) { + Image->Buffer[PixelIdx].Blue = 255 - mAppleDiskLabelImagePalette[Label->Data[PixelIdx]]; + Image->Buffer[PixelIdx].Green = 255 - mAppleDiskLabelImagePalette[Label->Data[PixelIdx]]; + Image->Buffer[PixelIdx].Red = 255 - mAppleDiskLabelImagePalette[Label->Data[PixelIdx]]; + Image->Buffer[PixelIdx].Reserved = 255; + } + + return EFI_SUCCESS; +} + RETURN_STATUS GuiPngToImage ( - IN OUT GUI_IMAGE *Image, - IN VOID *ImageData, - IN UINTN ImageDataSize + OUT GUI_IMAGE *Image, + IN VOID *ImageData, + IN UINT32 ImageDataSize ) { EFI_STATUS Status; @@ -1218,7 +1361,7 @@ GuiPngToImage ( ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "OCUI: DecodePNG...%r\n", Status)); + DEBUG ((DEBUG_INFO, "OCUI: DecodePNG - %r\n", Status)); return Status; } @@ -1356,12 +1499,11 @@ GuiGetInterpolatedValue ( UINT32 DeltaTime; ASSERT (Interpol != NULL); - ASSERT (Interpol->StartTime <= CurrentTime); ASSERT (Interpol->Duration > 0); STATIC CONST UINT32 InterpolFpTimeFactor = 1U << 12U; - if (CurrentTime == Interpol->StartTime) { + if (CurrentTime <= Interpol->StartTime) { return Interpol->StartValue; } diff --git a/Platform/OpenCanopy/OpenCanopy.h b/Platform/OpenCanopy/OpenCanopy.h index e33c5230..1e1d1b4f 100644 --- a/Platform/OpenCanopy/OpenCanopy.h +++ b/Platform/OpenCanopy/OpenCanopy.h @@ -5,8 +5,8 @@ SPDX-License-Identifier: BSD-3-Clause **/ -#ifndef BOOT_LIQUOR_H -#define BOOT_LIQUOR_H +#ifndef OPEN_CANOPY_H +#define OPEN_CANOPY_H #include #include @@ -132,13 +132,30 @@ struct GUI_DRAWING_CONTEXT_ { GUI_EXIT_LOOP ExitLoop; LIST_ENTRY Animations; VOID *GuiContext; + UINT8 Scale; }; RETURN_STATUS GuiPngToImage ( - IN OUT GUI_IMAGE *Image, - IN VOID *ImageData, - IN UINTN ImageDataSize + OUT GUI_IMAGE *Image, + IN VOID *ImageData, + IN UINT32 ImageDataSize + ); + +RETURN_STATUS +GuiIcnsToImageIcon ( + OUT GUI_IMAGE *Image, + IN VOID *IcnsImage, + IN UINT32 IcnsImageSize, + IN UINT8 Scale + ); + +RETURN_STATUS +GuiLabelToImage ( + OUT GUI_IMAGE *Image, + IN VOID *RawData, + IN UINT32 DataLength, + IN UINT8 Scale ); VOID @@ -275,4 +292,4 @@ GuiPngToClickImage ( IN CONST EFI_GRAPHICS_OUTPUT_BLT_PIXEL *HighlightPixel ); -#endif // BOOT_LIQUOR_H +#endif // OPEN_CANOPY_H diff --git a/Platform/OpenCanopy/Views/BootPicker.c b/Platform/OpenCanopy/Views/BootPicker.c index 640ff6a0..6d6457a0 100644 --- a/Platform/OpenCanopy/Views/BootPicker.c +++ b/Platform/OpenCanopy/Views/BootPicker.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include "../OpenCanopy.h" #include "../BmfLib.h" @@ -33,8 +36,8 @@ #define BOOT_SELECTOR_BUTTON_SPACE BOOT_ENTRY_LABEL_SPACE + BOOT_ENTRY_LABEL_HEIGHT + 3 #define BOOT_SELECTOR_HEIGHT BOOT_SELECTOR_BACKGROUND_DIMENSION + BOOT_SELECTOR_BUTTON_SPACE + BOOT_SELECTOR_BUTTON_DIMENSION -#define BOOT_ENTRY_WIDTH BOOT_ENTRY_DIMENSION -#define BOOT_ENTRY_HEIGHT BOOT_ENTRY_DIMENSION + BOOT_ENTRY_LABEL_SPACE + BOOT_ENTRY_LABEL_HEIGHT +#define BOOT_ENTRY_WIDTH (BOOT_ENTRY_DIMENSION) +#define BOOT_ENTRY_HEIGHT (BOOT_ENTRY_DIMENSION + BOOT_ENTRY_LABEL_SPACE + BOOT_ENTRY_LABEL_HEIGHT) typedef struct { GUI_OBJ_CHILD Hdr; @@ -44,9 +47,10 @@ typedef struct { typedef struct { GUI_OBJ_CHILD Hdr; - CONST GUI_IMAGE *EntryIcon; + GUI_IMAGE EntryIcon; GUI_IMAGE Label; VOID *Context; + BOOLEAN CustomIcon; } GUI_VOLUME_ENTRY; typedef struct { @@ -59,6 +63,7 @@ extern GUI_VOLUME_PICKER mBootPicker; extern GUI_OBJ_CLICKABLE mBootPickerSelector; STATIC UINT8 mBootPickerOpacity = 0xFF; +STATIC UINT8 mBootPickerImageIndex = 0; BOOLEAN GuiClickableIsHit ( @@ -413,7 +418,11 @@ InternalBootPickerEntryDraw ( ASSERT (Context != NULL); Entry = BASE_CR (This, GUI_VOLUME_ENTRY, Hdr.Obj); - EntryIcon = Entry->EntryIcon; + /*if (mBootPickerImageIndex < 5) { + EntryIcon = &((BOOT_PICKER_GUI_CONTEXT *) DrawContext->GuiContext)->Poof[mBootPickerImageIndex]; + } else */{ + EntryIcon = &Entry->EntryIcon; + } Label = &Entry->Label; ASSERT (This->Width == BOOT_ENTRY_DIMENSION); @@ -441,8 +450,8 @@ InternalBootPickerEntryDraw ( // // Draw the label horizontally centered. // - ASSERT (Label->Width <= BOOT_ENTRY_DIMENSION); - ASSERT (Label->Height == BOOT_ENTRY_LABEL_HEIGHT); + //ASSERT (Label->Width <= BOOT_ENTRY_DIMENSION); + //ASSERT (Label->Height == BOOT_ENTRY_LABEL_HEIGHT); GuiDrawChildImage ( Label, @@ -451,7 +460,7 @@ InternalBootPickerEntryDraw ( BaseX, BaseY, (BOOT_ENTRY_DIMENSION - Label->Width) / 2, - BOOT_ENTRY_DIMENSION + BOOT_ENTRY_LABEL_SPACE, + BOOT_ENTRY_DIMENSION + BOOT_ENTRY_LABEL_SPACE + BOOT_ENTRY_LABEL_HEIGHT - Label->Height, OffsetX, OffsetY, Width, @@ -498,7 +507,7 @@ InternalBootPickerEntryPtrEvent ( Entry = BASE_CR (This, GUI_VOLUME_ENTRY, Hdr.Obj); IsHit = GuiClickableIsHit ( - Entry->EntryIcon, + &Entry->EntryIcon, OffsetX - (BOOT_ENTRY_DIMENSION - BOOT_ENTRY_ICON_DIMENSION) / 2, OffsetY - (BOOT_ENTRY_DIMENSION - BOOT_ENTRY_ICON_DIMENSION) / 2 ); @@ -718,45 +727,166 @@ GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ mBootPickerView = { INITIALIZE_LIST_HEAD_VARIABLE (mBootPicker.Hdr.Link) }; +STATIC +RETURN_STATUS +CopyLabel ( + OUT GUI_IMAGE *Destination, + IN CONST GUI_IMAGE *Source + ) +{ + Destination->Width = Source->Width; + Destination->Height = Source->Height; + Destination->Buffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocateCopyPool ( + sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * Source->Width * Source->Height, + Source->Buffer + ); + + if (Destination->Buffer == NULL) { + return RETURN_OUT_OF_RESOURCES; + } + + return RETURN_SUCCESS; +} + RETURN_STATUS BootPickerEntriesAdd ( + IN OC_PICKER_CONTEXT *Context, IN CONST BOOT_PICKER_GUI_CONTEXT *GuiContext, - IN CONST CHAR16 *Name, - IN VOID *EntryContext, - IN BOOLEAN IsExternal, + IN OC_BOOT_ENTRY *Entry, IN BOOLEAN Default ) { - BOOLEAN Result; + APPLE_BOOT_POLICY_PROTOCOL *AppleBootPolicy; + RETURN_STATUS Status; GUI_VOLUME_ENTRY *VolumeEntry; LIST_ENTRY *ListEntry; CONST GUI_VOLUME_ENTRY *PrevEntry; + UINT32 IconFileSize; + VOID *IconFileData; + BOOLEAN UseVolumeIcon; + BOOLEAN UseDiskLabel; + BOOLEAN UseGenericLabel; + BOOLEAN Result; ASSERT (GuiContext != NULL); - ASSERT (Name != NULL); + ASSERT (Entry != NULL); + + DEBUG ((DEBUG_INFO, "OCUI: Console attributes: %d\n", Context->ConsoleAttributes)); + + UseVolumeIcon = (Context->PickerAttributes & OC_ATTR_USE_VOLUME_ICON) != 0; + UseDiskLabel = (Context->PickerAttributes & OC_ATTR_USE_DISK_LABEL_FILE) != 0; + UseGenericLabel = (Context->PickerAttributes & OC_ATTR_USE_GENERIC_LABEL_IMAGE) != 0; + + DEBUG ((DEBUG_INFO, "OCUI: UseDiskLabel: %d, UseGenericLabel: %d\n", UseDiskLabel, UseGenericLabel)); VolumeEntry = AllocateZeroPool (sizeof (*VolumeEntry)); if (VolumeEntry == NULL) { return RETURN_OUT_OF_RESOURCES; } - Result = GuiGetLabel ( - &VolumeEntry->Label, - &GuiContext->FontContext, - Name, - StrLen (Name) - ); - if (!Result) { - DEBUG ((DEBUG_WARN, "BMF: label failed\n")); - return RETURN_UNSUPPORTED; + AppleBootPolicy = OcAppleBootPolicyInstallProtocol (FALSE); + if (AppleBootPolicy == NULL) { + DEBUG ((DEBUG_ERROR, "OCUI: AppleBootPolicy locate failure\n")); + return EFI_NOT_FOUND; } - VolumeEntry->Context = EntryContext; - - if (!IsExternal) { - VolumeEntry->EntryIcon = &GuiContext->EntryIconInternal; + if (UseDiskLabel) { + Status = OcGetBootEntryLabelImage ( + Context, + AppleBootPolicy, + Entry, + GuiContext->Scale, + &IconFileData, + &IconFileSize + ); + if (!EFI_ERROR (Status)) { + Status = GuiLabelToImage ( + &VolumeEntry->Label, + IconFileData, + IconFileSize, + GuiContext->Scale + ); + } } else { - VolumeEntry->EntryIcon = &GuiContext->EntryIconExternal; + Status = EFI_UNSUPPORTED; + } + + if (EFI_ERROR (Status) && UseGenericLabel) { + switch (Entry->Type) { + case OC_BOOT_UNKNOWN: + case OC_BOOT_EXTERNAL_OS: + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelEFIBoot); + break; + + case OC_BOOT_APPLE_RECOVERY: + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelRecovery); + break; + + case OC_BOOT_WINDOWS: + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelWindows); + break; + + case OC_BOOT_EXTERNAL_TOOL: + if (StrStr (Entry->Name, OC_MENU_RESET_NVRAM_ENTRY) != NULL) { + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelResetNVRAM); + } else if (StrStr (Entry->Name, OC_MENU_UEFI_SHELL_ENTRY) != NULL) { + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelShell); + } else { + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelTool); + } + break; + + case OC_BOOT_APPLE_OS: + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelMacOS); + break; + + case OC_BOOT_RESET_NVRAM: + Status = CopyLabel (&VolumeEntry->Label, &GuiContext->EntryLabelResetNVRAM); + break; + + default: + DEBUG ((DEBUG_ERROR, "OCUI: Entry kind %d unsupported", Entry->Type)); + return RETURN_UNSUPPORTED; + } + } + + if (EFI_ERROR (Status)) { + Result = GuiGetLabel ( + &VolumeEntry->Label, + &GuiContext->FontContext, + Entry->Name, + StrLen (Entry->Name) + ); + if (!Result) { + DEBUG ((DEBUG_WARN, "OCUI: label failed\n")); + return RETURN_UNSUPPORTED; + } + } + + VolumeEntry->Context = Entry; + + if (UseVolumeIcon) { + Status = OcGetBootEntryIcon (Context, AppleBootPolicy, Entry, &IconFileData, &IconFileSize); + + if (!EFI_ERROR (Status)) { + Status = GuiIcnsToImageIcon (&VolumeEntry->EntryIcon, IconFileData, IconFileSize, GuiContext->Scale); + FreePool (IconFileData); + if (!EFI_ERROR (Status)) { + VolumeEntry->CustomIcon = TRUE; + } + } + } else { + Status = EFI_UNSUPPORTED; + } + + if (EFI_ERROR (Status)) { + if (Entry->Type == OC_BOOT_EXTERNAL_TOOL || Entry->Type == OC_BOOT_SYSTEM) { + CopyMem (&VolumeEntry->EntryIcon, &GuiContext->EntryIconTool, sizeof (VolumeEntry->EntryIcon)); + } else if (!Entry->IsExternal) { + CopyMem (&VolumeEntry->EntryIcon, &GuiContext->EntryIconInternal, sizeof (VolumeEntry->EntryIcon)); + } else { + CopyMem (&VolumeEntry->EntryIcon, &GuiContext->EntryIconExternal, sizeof (VolumeEntry->EntryIcon)); + } } VolumeEntry->Hdr.Parent = &mBootPicker.Hdr.Obj; @@ -798,6 +928,10 @@ InternalBootPickerEntryDestruct ( ASSERT (Entry != NULL); ASSERT (Entry->Label.Buffer != NULL); + if (Entry->CustomIcon) { + FreePool (Entry->EntryIcon.Buffer); + } + FreePool (Entry->Label.Buffer); FreePool (Entry); } @@ -892,6 +1026,56 @@ InternalBootPickerAnimateOpacity ( return FALSE; } +STATIC GUI_INTERPOLATION mBpAnimInfoImageList; + +VOID +InitBpAnimImageList ( + IN GUI_INTERPOL_TYPE Type, + IN UINT64 StartTime, + IN UINT64 Duration + ) +{ + mBpAnimInfoImageList.Type = Type; + mBpAnimInfoImageList.StartTime = StartTime; + mBpAnimInfoImageList.Duration = Duration; + mBpAnimInfoImageList.StartValue = 0; + mBpAnimInfoImageList.EndValue = 5; + + mBootPickerOpacity = 0; +} + + +BOOLEAN +InternalBootPickerAnimateImageList ( + IN VOID *Context OPTIONAL, + IN OUT GUI_DRAWING_CONTEXT *DrawContext, + IN UINT64 CurrentTime + ) +{ + GUI_VOLUME_ENTRY *Entry; + CONST GUI_IMAGE *EntryIcon; + + Entry = BASE_CR (&mBootPicker.Hdr.Obj, GUI_VOLUME_ENTRY, Hdr.Obj); + EntryIcon = &Entry->EntryIcon; + + //mBootPickerImageIndex++; + mBootPickerImageIndex = (UINT8)GuiGetInterpolatedValue (&mBpAnimInfoImageList, CurrentTime); + //Entry->EntryIcon = &((GUI_IMAGE*)Context)[mBootPickerImageIndex]; + GuiRedrawObject ( + &mBootPicker.Hdr.Obj, + DrawContext, + mBootPicker.Hdr.Obj.OffsetX, + mBootPicker.Hdr.Obj.OffsetY, + TRUE + ); + + if (mBootPickerImageIndex == mBpAnimInfoImageList.EndValue) { + return TRUE; + } + + return FALSE; +} + STATIC GUI_INTERPOLATION mBpAnimInfoSinMove; VOID @@ -995,6 +1179,15 @@ BootPickerViewInitialize ( mBootPicker.Hdr.Obj.OffsetX = mBootPickerView.Width / 2; mBootPicker.Hdr.Obj.OffsetY = (mBootPickerView.Height - mBootPicker.Hdr.Obj.Height) / 2; + // TODO: animations should be tied to UI objects, not global + // Each object has its own list of animations. + // How to animate addition of one or more boot entries? + // 1. MOVE: + // - Calculate the delta by which each entry moves to the left or to the right. + // ∆i = (N(added after) - N(added before)) + // Conditions for delta function: + // + InitBpAnimSinMov (GuiInterpolTypeSmooth, 0, 25); STATIC GUI_ANIMATION PickerAnim; PickerAnim.Context = NULL; @@ -1007,5 +1200,13 @@ BootPickerViewInitialize ( PickerAnim2.Animate = InternalBootPickerAnimateOpacity; InsertHeadList (&DrawContext->Animations, &PickerAnim2.Link); + /* + InitBpAnimImageList(GuiInterpolTypeLinear, 25, 25); + STATIC GUI_ANIMATION PoofAnim; + PoofAnim.Context = GuiContext->Poof; + PoofAnim.Animate = InternalBootPickerAnimateImageList; + InsertHeadList(&DrawContext->Animations, &PoofAnim.Link); + */ + return RETURN_SUCCESS; } diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index 730180e7..0a10c2b2 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -163,12 +163,20 @@ OcToolDescribeEntry ( *IconData = NULL; *IconDataSize = 0; - Status = OcUnicodeSafeSPrint ( - DescPath, - sizeof (DescPath), - OPEN_CORE_TOOL_PATH "%s.icns", - ChosenEntry->PathName - ); + if (ChosenEntry->Type == OC_BOOT_RESET_NVRAM) { + Status = StrCpyS ( + DescPath, + sizeof (DescPath), + OPEN_CORE_IMAGE_PATH "ResetNVRAM.icns" + ); + } else { + Status = OcUnicodeSafeSPrint ( + DescPath, + sizeof (DescPath), + OPEN_CORE_TOOL_PATH "%s.icns", + ChosenEntry->PathName + ); + } if (!EFI_ERROR (Status)) { if (OcStorageExistsFileUnicode (Context, DescPath)) { *IconData = OcStorageReadFileUnicode ( @@ -180,10 +188,12 @@ OcToolDescribeEntry ( } } else { DEBUG (( - DEBUG_INFO, - "OC: Tool label %s%s.icns does not fit path!\n", - OPEN_CORE_TOOL_PATH, - DescPath + DEBUG_WARN, + "OC: Custom label %s%s.icns does not fit path!\n", + ChosenEntry->Type == OC_BOOT_RESET_NVRAM + ? OPEN_CORE_IMAGE_PATH : OPEN_CORE_TOOL_PATH, + ChosenEntry->Type == OC_BOOT_RESET_NVRAM + ? L"ResetNVRAM": ChosenEntry->PathName )); } } @@ -192,13 +202,23 @@ OcToolDescribeEntry ( *LabelData = NULL; *LabelDataSize = 0; - Status = OcUnicodeSafeSPrint ( - DescPath, - sizeof (DescPath), - OPEN_CORE_TOOL_PATH "%s.lbl%a", - ChosenEntry->PathName, - LabelScale == 2 ? "2x" : "" - ); + if (ChosenEntry->Type == OC_BOOT_RESET_NVRAM) { + Status = OcUnicodeSafeSPrint ( + DescPath, + sizeof (DescPath), + OPEN_CORE_LABEL_PATH "ResetNVRAM.%a", + LabelScale == 2 ? "l2x" : "lbl" + ); + } else { + Status = OcUnicodeSafeSPrint ( + DescPath, + sizeof (DescPath), + OPEN_CORE_TOOL_PATH "%s.%a", + ChosenEntry->PathName, + LabelScale == 2 ? "l2x" : "lbl" + ); + } + if (!EFI_ERROR (Status)) { if (OcStorageExistsFileUnicode (Context, DescPath)) { *LabelData = OcStorageReadFileUnicode ( @@ -210,15 +230,27 @@ OcToolDescribeEntry ( } } else { DEBUG (( - DEBUG_INFO, - "OC: Tool label %s%s.lbl%a does not fit path!\n", - OPEN_CORE_TOOL_PATH, - DescPath, - LabelScale == 2 ? "2x" : "" + DEBUG_WARN, + "OC: Custom label %s%s.%a does not fit path!\n", + ChosenEntry->Type == OC_BOOT_RESET_NVRAM + ? OPEN_CORE_LABEL_PATH : OPEN_CORE_TOOL_PATH, + ChosenEntry->Type == OC_BOOT_RESET_NVRAM + ? L"ResetNVRAM" : ChosenEntry->PathName, + LabelScale == 2 ? "l2x" : "lbl" )); } } + DEBUG (( + DEBUG_INFO, + "OC: Got label %d icon %d for type %u - %s\n", + HasLabel, + HasIcon, + ChosenEntry->Type, + ChosenEntry->Type == OC_BOOT_RESET_NVRAM + ? L"ResetNVRAM" : ChosenEntry->PathName + )); + if (HasIcon || HasLabel) { return EFI_SUCCESS; } @@ -601,7 +633,8 @@ OcMiscBoot ( Context->RequestPrivilege = OcShowSimplePasswordRequest; Context->ShowMenu = OcShowSimpleBootMenu; Context->PickerMode = PickerMode; - Context->ConsoleAttributes = Config->Misc.Boot.PickerAttributes; + Context->ConsoleAttributes = Config->Misc.Boot.ConsoleAttributes; + Context->PickerAttributes = Config->Misc.Boot.PickerAttributes; if ((Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_VERSION_UI) != 0) { Context->TitleSuffix = OcMiscGetVersionString (); diff --git a/macbuild.tool b/macbuild.tool index 83631659..14309554 100755 --- a/macbuild.tool +++ b/macbuild.tool @@ -21,6 +21,10 @@ package() { mkdir -p tmp/EFI/OC/Kexts || exit 1 mkdir -p tmp/EFI/OC/Tools || exit 1 mkdir -p tmp/EFI/BOOT || exit 1 + mkdir -p tmp/EFI/Resources/Audio || exit 1 + mkdir -p tmp/EFI/Resources/Font || exit 1 + mkdir -p tmp/EFI/Resources/Image || exit 1 + mkdir -p tmp/EFI/Resources/Label || exit 1 mkdir -p tmp/Docs/AcpiSamples || exit 1 mkdir -p tmp/Utilities || exit 1 cp BootKicker.efi tmp/EFI/OC/Tools/ || exit 1