From 2727e2dac6c61bb1df341eee483d953c1fae1925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Thu, 3 Jul 2025 07:46:12 +0200 Subject: [PATCH 01/10] MdeModulePkg: Make graphics console colors into PCDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoColorTheme.dsc.inc | 42 ++++++++++++ DasharoPayloadPkg/DasharoPayloadPkg.dsc | 24 +++++++ .../Include/Library/CustomizedDisplayLib.h | 34 ++++++++++ .../CustomizedDisplayLib.c | 65 ++++++++++++++---- .../CustomizedDisplayLib.inf | 19 ++++++ .../CustomizedDisplayLibInternal.c | 6 +- MdeModulePkg/MdeModulePkg.dec | 39 +++++++++++ .../GraphicsConsoleDxe/GraphicsConsole.c | 68 +++++++++++++------ .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf | 18 +++++ 9 files changed, 279 insertions(+), 36 deletions(-) create mode 100644 DasharoPayloadPkg/DasharoColorTheme.dsc.inc diff --git a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc new file mode 100644 index 0000000000..b248c2c953 --- /dev/null +++ b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc @@ -0,0 +1,42 @@ +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x30 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 + +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # Plain black +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } # Dark green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } # Dasharo green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } # White +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } # Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } # Magenta +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # Dasharo grey +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # Light grey + +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } \ No newline at end of file diff --git a/DasharoPayloadPkg/DasharoPayloadPkg.dsc b/DasharoPayloadPkg/DasharoPayloadPkg.dsc index 87650bd0c7..ae1d9762ef 100644 --- a/DasharoPayloadPkg/DasharoPayloadPkg.dsc +++ b/DasharoPayloadPkg/DasharoPayloadPkg.dsc @@ -680,6 +680,30 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000 !endif + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x0E + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x06 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x20 + [PcdsDynamicHii] !if $(TPM_ENABLE) == TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS diff --git a/MdeModulePkg/Include/Library/CustomizedDisplayLib.h b/MdeModulePkg/Include/Library/CustomizedDisplayLib.h index 1441bf6c10..d1dea1976a 100644 --- a/MdeModulePkg/Include/Library/CustomizedDisplayLib.h +++ b/MdeModulePkg/Include/Library/CustomizedDisplayLib.h @@ -249,6 +249,18 @@ GetPopupColor ( VOID ); +/** + Get OEM/Vendor specific title attribute colors. + + @retval Byte code color setting for title bar color. +**/ +UINT8 +EFIAPI +GetTitleColor ( + VOID + ); + + /** Get OEM/Vendor specific popup attribute colors. @@ -348,6 +360,28 @@ GetSubTitleTextColor ( VOID ); +/** + Get OEM/Vendor specific banner color attribute. + + @retval Byte code color setting for banner text color. +**/ +UINT8 +EFIAPI +GetBannerColor ( + VOID + ); + +/** + Get OEM/Vendor specific key help text color attribute. + + @retval Byte code color setting for key help text color. +**/ +UINT8 +EFIAPI +GetKeyHelpColor ( + VOID + ); + /** Count the storage space of a Unicode string. diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c index 8c984b5025..1aada24141 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c @@ -153,7 +153,7 @@ RefreshKeyHelp ( return; } - gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_TEXT | KEYHELP_BACKGROUND); + gST->ConOut->SetAttribute (gST->ConOut, GetKeyHelpColor()); if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) { return; @@ -534,7 +534,7 @@ CreateDialog ( // // Passing in a space results in the assumption that this is where typing will occur // - ClearLines (Start + 1, End - 1, Index + 1, Index + 1, POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND); + ClearLines (Start + 1, End - 1, Index + 1, Index + 1, GetPopupInverseColor()); PrintStringAt ( ((DimensionsWidth - LibGetStringWidth (String) / 2) / 2) + gScreenDimensions.LeftColumn + 1, Index + 1, @@ -798,7 +798,21 @@ GetPopupColor ( VOID ) { - return POPUP_TEXT | POPUP_BACKGROUND; + return PcdGet8 (PcdBrowserPopupTextColor) | PcdGet8 (PcdBrowserPopupBackgroundColor); +} + +/** + Get OEM/Vendor specific title colors. + + @retval Byte code color setting for popup color. +**/ +UINT8 +EFIAPI +GetTitleColor ( + VOID + ) +{ + return PcdGet8 (PcdBrowserTitleTextColor) | PcdGet8 (PcdBrowserTitleBackgroundColor); } /** @@ -812,7 +826,7 @@ GetPopupInverseColor ( VOID ) { - return POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND; + return PcdGet8 (PcdBrowserPopupInverseTextColor) | PcdGet8 (PcdBrowserPopupInverseBackgroundColor); } /** @@ -826,9 +840,8 @@ GetPickListColor ( VOID ) { - return PICKLIST_HIGHLIGHT_TEXT | PICKLIST_HIGHLIGHT_BACKGROUND; + return PcdGet8 (PcdBrowserPickListTextColor) | PcdGet8 (PcdBrowserPickListBackgroundColor); } - /** Get OEM/Vendor specific arrow color attribute. @@ -840,7 +853,7 @@ GetArrowColor ( VOID ) { - return ARROW_TEXT | ARROW_BACKGROUND; + return PcdGet8 (PcdBrowserArrowTextColor) | PcdGet8 (PcdBrowserArrowBackgroundColor); } /** @@ -854,7 +867,7 @@ GetInfoTextColor ( VOID ) { - return INFO_TEXT | FIELD_BACKGROUND; + return PcdGet8 (PcdBrowserInfoTextColor) | PcdGet8 (PcdBrowserInfoBackgroundColor); } /** @@ -868,7 +881,7 @@ GetHelpTextColor ( VOID ) { - return HELP_TEXT | FIELD_BACKGROUND; + return PcdGet8 (PcdBrowserHelpTextColor) | PcdGet8 (PcdBrowserHelpBackgroundColor); } /** @@ -882,7 +895,7 @@ GetGrayedTextColor ( VOID ) { - return FIELD_TEXT_GRAYED | FIELD_BACKGROUND; + return FIELD_TEXT_GRAYED | PcdGet8 (PcdBrowserFieldBackgroundColor); } /** @@ -910,7 +923,7 @@ GetFieldTextColor ( VOID ) { - return PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND; + return PcdGet8 (PcdBrowserFieldTextColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); } /** @@ -924,7 +937,35 @@ GetSubTitleTextColor ( VOID ) { - return PcdGet8 (PcdBrowserSubtitleTextColor) | FIELD_BACKGROUND; + return PcdGet8 (PcdBrowserSubtitleTextColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); +} + +/** + Get OEM/Vendor specific banner text color attribute. + + @retval Byte code color setting for banner text color. +**/ +UINT8 +EFIAPI +GetBannerColor ( + VOID + ) +{ + return PcdGet8 (PcdBrowserBannerTextColor) | PcdGet8 (PcdBrowserBannerBackgroundColor); +} + +/** + Get OEM/Vendor specific key help text color attribute. + + @retval Byte code color setting for key help text color. +**/ +UINT8 +EFIAPI +GetKeyHelpColor ( + VOID + ) +{ + return PcdGet8 (PcdBrowserKeyHelpTextColor) | PcdGet8 (PcdBrowserKeyHelpBackgroundColor); } /** diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf index 45fbdaf864..071e4ca70d 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf @@ -55,6 +55,25 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor ## CONSUMES diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c index 9eeea21792..9b15e17d93 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c @@ -63,7 +63,7 @@ PrintBannerInfo ( gScreenDimensions.RightColumn, gScreenDimensions.TopRow, FRONT_PAGE_HEADER_HEIGHT - 1 + gScreenDimensions.TopRow, - BANNER_TEXT | BANNER_BACKGROUND + GetBannerColor() ); // @@ -151,7 +151,7 @@ PrintFramework ( gScreenDimensions.RightColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1, - KEYHELP_TEXT | KEYHELP_BACKGROUND + GetKeyHelpColor() ); return; } @@ -169,7 +169,7 @@ PrintFramework ( // ? ? // +------------------------------------------------------------------------------+ // - gST->ConOut->SetAttribute (gST->ConOut, TITLE_TEXT | TITLE_BACKGROUND); + gST->ConOut->SetAttribute (gST->ConOut, GetTitleColor()); Character = BOXDRAW_DOWN_RIGHT; PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow, Character); diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 66e46184c7..d0eb660135 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -2001,6 +2001,45 @@ # @ValidList 0x80000005 | 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x00|UINT8|0x0001005A + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x10|UINT8|0x00010300 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x07|UINT8|0x00010301 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x10|UINT8|0x00010302 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x07|UINT8|0x00010303 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x00|UINT8|0x00010304 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x07|UINT8|0x00010305 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x01|UINT8|0x00010306 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x70|UINT8|0x00010307 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x0F|UINT8|0x00010308 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x70|UINT8|0x00010309 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x70|UINT8|0x0001030A + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x70|UINT8|0x0001030B + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x01|UINT8|0x0001030C + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x00|UINT8|0x0001030D + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x07|UINT8|0x0001030E + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x0F|UINT8|0x0001030F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30|UINT8|0x00010310 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0C|UINT8|0x00010311 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x70|UINT8|0x00010312 + + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } | VOID* | 0x00010400 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } | VOID* | 0x00010401 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0x98, 0x00 } | VOID* | 0x00010402 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0x00, 0x98, 0x98 } | VOID* | 0x00010403 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } | VOID* | 0x00010404 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } | VOID* | 0x00010405 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x98, 0x98, 0x00 } | VOID* | 0x00010406 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x98, 0x98, 0x98 } | VOID* | 0x00010407 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } | VOID* | 0x00010408 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } | VOID* | 0x00010409 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } | VOID* | 0x0001040A + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040B + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } | VOID* | 0x0001040C + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } | VOID* | 0x0001040D + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040E + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } | VOID* | 0x0001040F + + + ## Time in second to delay for SATA devices to spin-up for recovery. # @Prompt SATA spin-up delay time in second for recovery path. gEfiMdeModulePkgTokenSpaceGuid.PcdSataSpinUpDelayInSecForRecoveryPath|15|UINT16|0x0001005B diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index b895dafede..9e0e2aa6a4 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -60,29 +60,53 @@ EFI_GUID mFontPackageListGuid = { 0xf5f219d3, 0x7006, 0x4648, { 0xac, 0x8d, 0xd6, 0x1d, 0xfb, 0x7b, 0xc6, 0xad } }; + CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL }; -EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16] = { - // - // B G R reserved - // - { 0x00, 0x00, 0x00, 0x00 }, // BLACK - { 0x98, 0x00, 0x00, 0x00 }, // LIGHTBLUE - { 0x00, 0x98, 0x00, 0x00 }, // LIGHGREEN - { 0x98, 0x98, 0x00, 0x00 }, // LIGHCYAN - { 0x00, 0x00, 0x98, 0x00 }, // LIGHRED - { 0x98, 0x00, 0x98, 0x00 }, // MAGENTA - { 0x00, 0x98, 0x98, 0x00 }, // BROWN - { 0x98, 0x98, 0x98, 0x00 }, // LIGHTGRAY - { 0x30, 0x30, 0x30, 0x00 }, // DARKGRAY - BRIGHT BLACK - { 0xff, 0x00, 0x00, 0x00 }, // BLUE - { 0x00, 0xff, 0x00, 0x00 }, // LIME - { 0xff, 0xff, 0x00, 0x00 }, // CYAN - { 0x00, 0x00, 0xff, 0x00 }, // RED - { 0xff, 0x00, 0xff, 0x00 }, // FUCHSIA - { 0x00, 0xff, 0xff, 0x00 }, // YELLOW - { 0xff, 0xff, 0xff, 0x00 } // WHITE -}; +EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16]; + +/** + test + @param dest Protocol instance pointer. + @param source Handle of device to test. +**/ +VOID +CopyGraphicsPaletteColor( + OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL* dest, + IN VOID* source +) { + dest->Reserved = ((UINT8*)source)[0]; + dest->Red = ((UINT8*)source)[1]; + dest->Green = ((UINT8*)source)[2]; + dest->Blue = ((UINT8*)source)[3]; +} + +/** + test +**/ +VOID +InitGraphicsColors ( + VOID + ) +{ + CopyGraphicsPaletteColor(&mGraphicsEfiColors[0], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlack)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[1], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[2], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[3], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[4], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[5], PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[6], PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[7], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[8], PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[10], PcdGetPtr(PcdGraphicsConsoleColorPaletteLime)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[11], PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[12], PcdGetPtr(PcdGraphicsConsoleColorPaletteRed)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[13], PcdGetPtr(PcdGraphicsConsoleColorPaletteFuchsia)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[14], PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[15], PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite)); +} + EFI_NARROW_GLYPH mCursorGlyph = { 0x0000, @@ -365,6 +389,8 @@ InitializeGraphicsConsoleTextMode ( // *TextModeCount = ValidCount; *TextModeData = NewModeBuffer; + + InitGraphicsColors(); return EFI_SUCCESS; } diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf index bcfd306eee..fa96364d4a 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf @@ -68,5 +68,23 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite ## CONSUMES + + [UserExtensions.TianoCore."ExtraFiles"] GraphicsConsoleDxeExtra.uni From 8b6b5bd849b77d354919b723399c8c9e5ac233c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Fri, 4 Jul 2025 20:57:42 +0200 Subject: [PATCH 02/10] DasharoPayloadPkg.dsc: Add custom color palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoPayloadPkg.dsc | 61 ++++++++++++++++--------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/DasharoPayloadPkg/DasharoPayloadPkg.dsc b/DasharoPayloadPkg/DasharoPayloadPkg.dsc index ae1d9762ef..896f016fa8 100644 --- a/DasharoPayloadPkg/DasharoPayloadPkg.dsc +++ b/DasharoPayloadPkg/DasharoPayloadPkg.dsc @@ -78,7 +78,7 @@ # Vendor FFFF Device 0000 Prog Interface 1, BAR #0, Offset 0, Stride = 1, Clock 1843200 (0x1c2000) # # [Vendor] [Device] [----ClockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFifo] [Rsvd] [Vendor] - DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} + DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x60,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} # # Shell options: [BUILD_SHELL, MIN_BIN, NONE, UEFI_BIN] @@ -680,29 +680,46 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000 !endif - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x20 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x20 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x20 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x0E - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x00 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x06 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x70 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x70 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x70 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x20 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x20 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x00 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x20 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x0F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 + + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0x00, 0x98, 0x98 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } [PcdsDynamicHii] !if $(TPM_ENABLE) == TRUE From b7aa39d12f746afb06de3b1d6d55d016acfce1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Sat, 5 Jul 2025 14:49:57 +0200 Subject: [PATCH 03/10] MdeModulePkg: Add CustomizedDisplayLib grayed text color pcd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- .../Library/CustomizedDisplayLib/CustomizedDisplayLib.c | 2 +- .../Library/CustomizedDisplayLib/CustomizedDisplayLib.inf | 1 + MdeModulePkg/MdeModulePkg.dec | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c index 1aada24141..f83959e792 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c @@ -895,7 +895,7 @@ GetGrayedTextColor ( VOID ) { - return FIELD_TEXT_GRAYED | PcdGet8 (PcdBrowserFieldBackgroundColor); + return PcdGet8 (PcdBrowserFieldGrayedTestColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); } /** diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf index 071e4ca70d..02f3620d6c 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf @@ -77,3 +77,4 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor ## CONSUMES diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index d0eb660135..4ab61144f7 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -2020,6 +2020,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30|UINT8|0x00010310 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0C|UINT8|0x00010311 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x70|UINT8|0x00010312 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x70|UINT8|0x00010313 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } | VOID* | 0x00010400 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } | VOID* | 0x00010401 From 8ae3239e0fb282ba6719e8a0dc80c13cc0e5ec41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Sat, 5 Jul 2025 14:50:34 +0200 Subject: [PATCH 04/10] DasharoPayloadPkg.dsc: Add CustomizedDisplayLib grayed text pcd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoPayloadPkg.dsc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/DasharoPayloadPkg/DasharoPayloadPkg.dsc b/DasharoPayloadPkg/DasharoPayloadPkg.dsc index 896f016fa8..07b9745e8f 100644 --- a/DasharoPayloadPkg/DasharoPayloadPkg.dsc +++ b/DasharoPayloadPkg/DasharoPayloadPkg.dsc @@ -688,30 +688,32 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x02 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x70 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x70 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x70 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x70 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0x00, 0x98, 0x98 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } From e43903e950edb543c1458039b0f14980bb89d721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Sat, 5 Jul 2025 14:57:40 +0200 Subject: [PATCH 05/10] DasharoPaloadPkg.dsc: Adjust text colors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoPayloadPkg.dsc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DasharoPayloadPkg/DasharoPayloadPkg.dsc b/DasharoPayloadPkg/DasharoPayloadPkg.dsc index 07b9745e8f..a7f6086eef 100644 --- a/DasharoPayloadPkg/DasharoPayloadPkg.dsc +++ b/DasharoPayloadPkg/DasharoPayloadPkg.dsc @@ -686,24 +686,24 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x02 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x30 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x07 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x70 + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } From f248acb9ac3c4ebeee3639f073a33fc2282a8c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Tue, 16 Sep 2025 09:44:25 +0200 Subject: [PATCH 06/10] DasharoColorTheme.dsc.inc: Move color theme to a file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoColorTheme.dsc.inc | 34 ++++++++-------- DasharoPayloadPkg/DasharoPayloadPkg.dsc | 45 +-------------------- 2 files changed, 19 insertions(+), 60 deletions(-) diff --git a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc index b248c2c953..55b8eed2fa 100644 --- a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc +++ b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc @@ -1,4 +1,4 @@ -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F @@ -23,20 +23,20 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # Plain black -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } # Dark green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } # Dasharo green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } # White -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } # Red -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } # Magenta -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # Dasharo grey -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # Light grey +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # 0 Plain black +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } # 1 Dark green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } # 2 Dasharo green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } # 3 White +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } # 4 Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } # 5 Magenta +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # 6 Dasharo grey +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # 7 Light grey -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } \ No newline at end of file +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } # 00 Dark grey +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } # 10 Blue +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } # 20 Green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } # 30 Cyan +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } # 40 Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } # 50 Fuchsia +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } # 60 Yellow +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } # 70 White \ No newline at end of file diff --git a/DasharoPayloadPkg/DasharoPayloadPkg.dsc b/DasharoPayloadPkg/DasharoPayloadPkg.dsc index a7f6086eef..6e2f12a632 100644 --- a/DasharoPayloadPkg/DasharoPayloadPkg.dsc +++ b/DasharoPayloadPkg/DasharoPayloadPkg.dsc @@ -78,7 +78,7 @@ # Vendor FFFF Device 0000 Prog Interface 1, BAR #0, Offset 0, Stride = 1, Clock 1843200 (0x1c2000) # # [Vendor] [Device] [----ClockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFifo] [Rsvd] [Vendor] - DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x60,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} + DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} # # Shell options: [BUILD_SHELL, MIN_BIN, NONE, UEFI_BIN] @@ -680,48 +680,7 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000 !endif - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 - gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 - - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } - - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } +!include DasharoPayloadPkg/DasharoColorTheme.dsc.inc [PcdsDynamicHii] !if $(TPM_ENABLE) == TRUE From 1d0c1baa260d78982ed1a1a0e0812aad1b298e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Thu, 18 Sep 2025 11:43:13 +0200 Subject: [PATCH 07/10] DasharoColorTheme.dsc.inc: Add comments describing colors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoColorTheme.dsc.inc | 76 ++++++++++++++------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc index 55b8eed2fa..1a9fcea315 100644 --- a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc +++ b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc @@ -1,27 +1,55 @@ -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x30 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 +# Color codes defined at MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +# Foregrounds: +# 0x00 (EFI_BLACK) +# 0x01 (EFI_BLUE) +# 0x02 (EFI_GREEN) +# 0x03 (EFI_CYAN) +# 0x04 (EFI_RED) +# 0x05 (EFI_MAGENTA) +# 0x06 (EFI_BROWN) +# 0x07 (EFI_LIGHTGRAY) +# 0x08 (EFI_DARKGRAY) +# 0x09 (EFI_LIGHTBLUE) +# 0x0A (EFI_LIGHTGREEN) +# 0x0B (EFI_LIGHTCYAN) +# 0x0C (EFI_LIGHTRED) +# 0x0D (EFI_LIGHTMAGENTA) +# 0x0E (EFI_YELLOW) +# 0x0F (EFI_WHITE) +# +# Backgrounds: +# 0x00 (EFI_BACKGROUND_BLACK) +# 0x10 (EFI_BACKGROUND_BLUE) +# 0x20 (EFI_BACKGROUND_GREEN) +# 0x30 (EFI_BACKGROUND_CYAN) +# 0x40 (EFI_BACKGROUND_RED) +# 0x50 (EFI_BACKGROUND_MAGENTA) +# 0x60 (EFI_BACKGROUND_BROWN) +# 0x70 (EFI_BACKGROUND_LIGHTGRAY) +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F # White text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F # White text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F # White text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x06 # Grey text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 # Light grey text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 # White bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 # Grey text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 # White bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 # Grey text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 # White bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 # Green text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F # White text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 # Green text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 # Grey text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 # White bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F # White text +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 # Light grey text gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # 0 Plain black gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } # 1 Dark green From 2f5c91ba73e905a705fba4526f064e4eccdfa765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Sun, 21 Sep 2025 11:56:07 +0200 Subject: [PATCH 08/10] TerminalDxe: Use PCD color schemes & 24b colors in terminal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoColorTheme.dsc.inc | 19 +-- .../Universal/Console/TerminalDxe/Terminal.c | 32 +++++ .../Universal/Console/TerminalDxe/Terminal.h | 9 ++ .../Console/TerminalDxe/TerminalConOut.c | 110 +++--------------- .../Console/TerminalDxe/TerminalDxe.inf | 18 +++ 5 files changed, 84 insertions(+), 104 deletions(-) diff --git a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc index 1a9fcea315..fa8844e4c7 100644 --- a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc +++ b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc @@ -16,7 +16,7 @@ # 0x0D (EFI_LIGHTMAGENTA) # 0x0E (EFI_YELLOW) # 0x0F (EFI_WHITE) -# +# # Backgrounds: # 0x00 (EFI_BACKGROUND_BLACK) # 0x10 (EFI_BACKGROUND_BLUE) @@ -26,6 +26,7 @@ # 0x50 (EFI_BACKGROUND_MAGENTA) # 0x60 (EFI_BACKGROUND_BROWN) # 0x70 (EFI_BACKGROUND_LIGHTGRAY) + gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # Grey bg gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F # White text gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 # Grey bg @@ -60,11 +61,11 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # 6 Dasharo grey gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # 7 Light grey -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } # 00 Dark grey -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } # 10 Blue -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } # 20 Green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } # 30 Cyan -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } # 40 Red -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } # 50 Fuchsia -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } # 60 Yellow -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } # 70 White \ No newline at end of file +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } # 8 Dark grey +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } # 9 Blue +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } # A Green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } # B Cyan +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } # C Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } # D Fuchsia +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } # E Yellow +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } # F White \ No newline at end of file diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index adb14a7568..e76e01440a 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -327,6 +327,8 @@ InitializeTerminalConsoleTextMode ( *TextModeCount = ARRAY_SIZE (mTerminalConsoleModeData); + InitSerialColors(); + DEBUG_CODE_BEGIN (); INT32 Index; @@ -1409,3 +1411,33 @@ IsHotPlugDevice ( return FALSE; } + +TerminalEfiColor mTerminalEfiColors[16]; + +VOID CopyTerminalPaletteColor(IN UINT8* Src, OUT TerminalEfiColor* Dest) { + Dest->r = Src[1]; + Dest->g = Src[2]; + Dest->b = Src[3]; + //target->a = color[0]; +} + +VOID +InitSerialColors (VOID) +{ + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBlack), &mTerminalEfiColors[0]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue), &mTerminalEfiColors[1]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen), &mTerminalEfiColors[2]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan), &mTerminalEfiColors[3]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed), &mTerminalEfiColors[4]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta), &mTerminalEfiColors[5]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown), &mTerminalEfiColors[6]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray), &mTerminalEfiColors[15]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray), &mTerminalEfiColors[8]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue), &mTerminalEfiColors[9]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLime), &mTerminalEfiColors[10]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan), &mTerminalEfiColors[11]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteRed), &mTerminalEfiColors[12]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteFuchsia), &mTerminalEfiColors[13]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow), &mTerminalEfiColors[14]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite), &mTerminalEfiColors[7]); +} diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h index 61fbd808ae..ea283ef008 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -169,12 +169,21 @@ typedef struct { CHAR8 Ascii; } UNICODE_TO_CHAR; +typedef struct { + UINT8 r; + UINT8 g; + UINT8 b; +} TerminalEfiColor; +VOID CopyTerminalPaletteColor(IN UINT8* Src, OUT TerminalEfiColor* Dest); +VOID InitSerialColors (VOID); + // // Global Variables // extern EFI_DRIVER_BINDING_PROTOCOL gTerminalDriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2; +extern TerminalEfiColor mTerminalEfiColors[16]; /** The user Entry Point for module Terminal. The user code starts with this function. diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c index 7809869e7d..cd1a6d4564 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c @@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "Terminal.h" +#include // // This list is used to define the valid extend chars. @@ -74,7 +75,6 @@ UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = { }; CHAR16 mSetModeString[] = { ESC, '[', '=', '3', 'h', 0 }; -CHAR16 mSetAttributeString[] = { ESC, '[', '0', 'm', ESC, '[', '4', '0', 'm', ESC, '[', '4', '0', 'm', 0 }; CHAR16 mClearScreenString[] = { ESC, '[', '2', 'J', 0 }; CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0 }; CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 }; @@ -527,13 +527,12 @@ TerminalConOutSetAttribute ( IN UINTN Attribute ) { - UINT8 ForegroundControl; - UINT8 BackgroundControl; - UINT8 BrightControl; - INT32 SavedColumn; - INT32 SavedRow; - EFI_STATUS Status; - TERMINAL_DEV *TerminalDevice; + TerminalEfiColor ForegroundControl; + TerminalEfiColor BackgroundControl; + INT32 SavedColumn; + INT32 SavedRow; + EFI_STATUS Status; + TERMINAL_DEV *TerminalDevice; SavedColumn = 0; SavedRow = 0; @@ -562,96 +561,17 @@ TerminalConOutSetAttribute ( // convert Attribute value to terminal emulator // understandable foreground color // - switch (Attribute & 0x07) { - case EFI_BLACK: - ForegroundControl = 30; - break; - - case EFI_BLUE: - ForegroundControl = 34; - break; - - case EFI_GREEN: - ForegroundControl = 32; - break; - - case EFI_CYAN: - ForegroundControl = 36; - break; - - case EFI_RED: - ForegroundControl = 31; - break; - - case EFI_MAGENTA: - ForegroundControl = 35; - break; - - case EFI_BROWN: - ForegroundControl = 33; - break; - - default: - - case EFI_LIGHTGRAY: - ForegroundControl = 37; - break; - } - - // - // bit4 of the Attribute indicates bright control - // of terminal emulator. - // - BrightControl = (UINT8)((Attribute >> 3) & 1); - - // - // convert Attribute value to terminal emulator - // understandable background color. - // - switch ((Attribute >> 4) & 0x07) { - case EFI_BLACK: - BackgroundControl = 40; - break; - - case EFI_BLUE: - BackgroundControl = 44; - break; - - case EFI_GREEN: - BackgroundControl = 42; - break; - - case EFI_CYAN: - BackgroundControl = 46; - break; - - case EFI_RED: - BackgroundControl = 41; - break; - - case EFI_MAGENTA: - BackgroundControl = 45; - break; - - case EFI_BROWN: - BackgroundControl = 43; - break; - - default: - - case EFI_LIGHTGRAY: - BackgroundControl = 47; - break; - } + ForegroundControl = mTerminalEfiColors[Attribute & 0x07]; + BackgroundControl = mTerminalEfiColors[(Attribute >> 4) & 0x07]; // // terminal emulator's control sequence to set attributes // - mSetAttributeString[BRIGHT_CONTROL_OFFSET] = (CHAR16)('0' + BrightControl); - mSetAttributeString[FOREGROUND_CONTROL_OFFSET + 0] = (CHAR16)('0' + (ForegroundControl / 10)); - mSetAttributeString[FOREGROUND_CONTROL_OFFSET + 1] = (CHAR16)('0' + (ForegroundControl % 10)); - mSetAttributeString[BACKGROUND_CONTROL_OFFSET + 0] = (CHAR16)('0' + (BackgroundControl / 10)); - mSetAttributeString[BACKGROUND_CONTROL_OFFSET + 1] = (CHAR16)('0' + (BackgroundControl % 10)); + CHAR16 mSetTerminalColorString[64]; + UnicodeSPrint(mSetTerminalColorString, sizeof(mSetTerminalColorString), + L"%c[38;2;%u;%u;%um%c[48;2;%u;%u;%um", + ESC, ForegroundControl.r, ForegroundControl.g, ForegroundControl.b, + ESC, BackgroundControl.r, BackgroundControl.g, BackgroundControl.b); // // save current column and row @@ -661,7 +581,7 @@ TerminalConOutSetAttribute ( SavedRow = This->Mode->CursorRow; TerminalDevice->OutputEscChar = TRUE; - Status = This->OutputString (This, mSetAttributeString); + Status = This->OutputString (This, mSetTerminalColorString); TerminalDevice->OutputEscChar = FALSE; if (EFI_ERROR (Status)) { diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf index fe7fce636f..4c735d630a 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf @@ -56,6 +56,7 @@ DebugLib PcdLib BaseLib + PrintLib [Guids] ## SOMETIMES_PRODUCES ## Variable:L"ConInDev" @@ -88,6 +89,23 @@ [Pcd] gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite ## CONSUMES + # [Event] # # Relative timer event set by UnicodeToEfiKey(), used to be one 2 seconds input timeout. From a91e241b31d8bab1783ab7ebf53f10335972e3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Wed, 17 Dec 2025 12:45:53 +0100 Subject: [PATCH 09/10] MdeModulePkg.dec & all deps: fix invalid vga color names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- DasharoPayloadPkg/DasharoColorTheme.dsc.inc | 26 +++++++++++-------- MdeModulePkg/MdeModulePkg.dec | 20 +++++++------- .../GraphicsConsoleDxe/GraphicsConsole.c | 20 +++++++------- .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf | 20 +++++++------- .../Universal/Console/TerminalDxe/Terminal.c | 20 +++++++------- .../Console/TerminalDxe/TerminalDxe.inf | 20 +++++++------- 6 files changed, 65 insertions(+), 61 deletions(-) diff --git a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc index fa8844e4c7..5043c1042e 100644 --- a/DasharoPayloadPkg/DasharoColorTheme.dsc.inc +++ b/DasharoPayloadPkg/DasharoColorTheme.dsc.inc @@ -26,6 +26,10 @@ # 0x50 (EFI_BACKGROUND_MAGENTA) # 0x60 (EFI_BACKGROUND_BROWN) # 0x70 (EFI_BACKGROUND_LIGHTGRAY) +# +# Because the background color in EDK2 does not support the bright bit, only +# colors 0-7 are available for backgrounds. To use colors like WHITE, some of +# the colors 0-7 need to be remapped to RGB value of white. gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # Grey bg gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F # White text @@ -34,7 +38,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F # Wh gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 # Grey bg gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F # White text gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x06 # Grey text -gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x06 # Grey bg +gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x60 # Grey bg gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 # Light grey text gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 # White bg gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 # Grey text @@ -53,19 +57,19 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 # Gr gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 # Light grey text gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # 0 Plain black -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } # 1 Dark green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x38, 0xD4, 0x30 } # 2 Dasharo green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0xFF } # 3 White -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } # 4 Red -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } # 5 Magenta +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0x98 } # 1 Dark green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen | { 0x00, 0x38, 0xD4, 0x30 } # 2 Dasharo green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0xFF } # 3 cyan remapped to White for backgrounds +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0x98, 0x00, 0x00 } # 4 Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta | { 0x00, 0x98, 0x00, 0x98 } # 5 Magenta gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # 6 Dasharo grey gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # 7 Light grey gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } # 8 Dark grey -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } # 9 Blue -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } # A Green -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } # B Cyan -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } # C Red -gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } # D Fuchsia +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0xFF } # 9 Blue +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0xFF, 0x00 } # A Green +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0x00 } # B Cyan +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0xFF, 0x00, 0x00 } # C Red +gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0xFF, 0x00, 0xFF } # D Fuchsia gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } # E Yellow gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } # F White \ No newline at end of file diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 4ab61144f7..373ea42681 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -2023,19 +2023,19 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x70|UINT8|0x00010313 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } | VOID* | 0x00010400 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0x98 } | VOID* | 0x00010401 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0x98, 0x00 } | VOID* | 0x00010402 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0x00, 0x98, 0x98 } | VOID* | 0x00010403 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0x98, 0x00, 0x00 } | VOID* | 0x00010404 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0x98, 0x00, 0x98 } | VOID* | 0x00010405 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0x98 } | VOID* | 0x00010401 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen | { 0x00, 0x00, 0x98, 0x00 } | VOID* | 0x00010402 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0x00, 0x98, 0x98 } | VOID* | 0x00010403 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0x98, 0x00, 0x00 } | VOID* | 0x00010404 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta | { 0x00, 0x98, 0x00, 0x98 } | VOID* | 0x00010405 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x98, 0x98, 0x00 } | VOID* | 0x00010406 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x98, 0x98, 0x98 } | VOID* | 0x00010407 gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } | VOID* | 0x00010408 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0xFF } | VOID* | 0x00010409 - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime | { 0x00, 0x00, 0xFF, 0x00 } | VOID* | 0x0001040A - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040B - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0xFF, 0x00, 0x00 } | VOID* | 0x0001040C - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia | { 0x00, 0xFF, 0x00, 0xFF } | VOID* | 0x0001040D + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0xFF } | VOID* | 0x00010409 + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0xFF, 0x00 } | VOID* | 0x0001040A + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040B + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0xFF, 0x00, 0x00 } | VOID* | 0x0001040C + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0xFF, 0x00, 0xFF } | VOID* | 0x0001040D gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040E gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } | VOID* | 0x0001040F diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 9e0e2aa6a4..c4997dbfe4 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -90,19 +90,19 @@ InitGraphicsColors ( ) { CopyGraphicsPaletteColor(&mGraphicsEfiColors[0], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlack)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[1], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[2], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[3], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[4], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[5], PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[1], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[2], PcdGetPtr(PcdGraphicsConsoleColorPaletteGreen)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[3], PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[4], PcdGetPtr(PcdGraphicsConsoleColorPaletteRed)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[5], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightMagenta)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[6], PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[7], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[8], PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[10], PcdGetPtr(PcdGraphicsConsoleColorPaletteLime)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[11], PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[12], PcdGetPtr(PcdGraphicsConsoleColorPaletteRed)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[13], PcdGetPtr(PcdGraphicsConsoleColorPaletteFuchsia)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[10], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[11], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[12], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed)); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[13], PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[14], PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[15], PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite)); } diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf index fa96364d4a..1aa883356e 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf @@ -69,19 +69,19 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite ## CONSUMES diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index e76e01440a..c6af66127c 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -1425,19 +1425,19 @@ VOID InitSerialColors (VOID) { CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBlack), &mTerminalEfiColors[0]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue), &mTerminalEfiColors[1]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen), &mTerminalEfiColors[2]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan), &mTerminalEfiColors[3]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed), &mTerminalEfiColors[4]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta), &mTerminalEfiColors[5]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue), &mTerminalEfiColors[1]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteGreen), &mTerminalEfiColors[2]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan), &mTerminalEfiColors[3]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteRed), &mTerminalEfiColors[4]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightMagenta), &mTerminalEfiColors[5]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown), &mTerminalEfiColors[6]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray), &mTerminalEfiColors[15]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray), &mTerminalEfiColors[8]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue), &mTerminalEfiColors[9]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLime), &mTerminalEfiColors[10]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan), &mTerminalEfiColors[11]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteRed), &mTerminalEfiColors[12]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteFuchsia), &mTerminalEfiColors[13]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue, &mTerminalEfiColors[9]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen), &mTerminalEfiColors[10]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan), &mTerminalEfiColors[11]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed), &mTerminalEfiColors[12]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta), &mTerminalEfiColors[13]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow), &mTerminalEfiColors[14]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite), &mTerminalEfiColors[7]); } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf index 4c735d630a..d4fd615b5f 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf @@ -90,19 +90,19 @@ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLime ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteFuchsia ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite ## CONSUMES From c426ae7b4fe041533a61d3e1b2cb0caf865b48ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Go=C5=82a=C5=9B?= Date: Thu, 18 Dec 2025 08:05:24 +0100 Subject: [PATCH 10/10] TerminalConOut.c: Revert clearing bright bit for foreground control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Gołaś --- .../Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 2 +- MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 6 +++--- MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index c4997dbfe4..7ea54cfe42 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -98,7 +98,7 @@ InitGraphicsColors ( CopyGraphicsPaletteColor(&mGraphicsEfiColors[6], PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[7], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[8], PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray)); - CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue); + CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[10], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[11], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan)); CopyGraphicsPaletteColor(&mGraphicsEfiColors[12], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed)); diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index c6af66127c..1251b6c925 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -1431,13 +1431,13 @@ InitSerialColors (VOID) CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteRed), &mTerminalEfiColors[4]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightMagenta), &mTerminalEfiColors[5]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown), &mTerminalEfiColors[6]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray), &mTerminalEfiColors[15]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray), &mTerminalEfiColors[7]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray), &mTerminalEfiColors[8]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue, &mTerminalEfiColors[9]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue), &mTerminalEfiColors[9]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen), &mTerminalEfiColors[10]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan), &mTerminalEfiColors[11]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed), &mTerminalEfiColors[12]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta), &mTerminalEfiColors[13]); CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow), &mTerminalEfiColors[14]); - CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite), &mTerminalEfiColors[7]); + CopyTerminalPaletteColor((UINT8*)PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite), &mTerminalEfiColors[15]); } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c index cd1a6d4564..48c79adb0b 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c @@ -561,14 +561,14 @@ TerminalConOutSetAttribute ( // convert Attribute value to terminal emulator // understandable foreground color // - ForegroundControl = mTerminalEfiColors[Attribute & 0x07]; + ForegroundControl = mTerminalEfiColors[Attribute & 0x0F]; BackgroundControl = mTerminalEfiColors[(Attribute >> 4) & 0x07]; // // terminal emulator's control sequence to set attributes // CHAR16 mSetTerminalColorString[64]; - UnicodeSPrint(mSetTerminalColorString, sizeof(mSetTerminalColorString), + UnicodeSPrint(mSetTerminalColorString, sizeof(mSetTerminalColorString), L"%c[38;2;%u;%u;%um%c[48;2;%u;%u;%um", ESC, ForegroundControl.r, ForegroundControl.g, ForegroundControl.b, ESC, BackgroundControl.r, BackgroundControl.g, BackgroundControl.b);