diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 12e19c580a7e05290b635e568fa8e4a5ad63c9b3..ad8e3270ef6b0bbae7e81656a05dd633f1c05ed8 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 54fe42f19ee50761c818a92d6b9c70a54f7a7ee7..e1c7490dca353fde18c29b3aad9043d6f516bb68 100644 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -1252,6 +1252,48 @@ behaviour that does not go to any other sections Set to empty string not to change console mode. Set to \texttt{Max} to try to use largest available console mode. +\item + \texttt{ConsoleBehaviourOs}\\ + \textbf{Type}: \texttt{plist\ string}\\ + \textbf{Default value}: Empty string\\ + \textbf{Description}: Set console control behaviour upon operating system load. + + Console control is a legacy protocol used for switching between text and graphics + screen output. Some firmwares do not provide it, yet select operating systems + require its presence, which is what \texttt{ProvideConsoleControl} UEFI quirk is for. + + When console control is available, OpenCore can be made console control aware, and + and set different modes for the operating system booter (\texttt{ConsoleBehaviourOs}), + which normally runs in graphics mode, and its own user interface + (\texttt{ConsoleBehaviourUi}), which normally runs in text mode. Possible + behaviours, set as values of these options, include: + + \begin{itemize} + \tightlist + \item Empty string --- Do not modify console control mode. + \item \texttt{Text} --- Switch to text mode. + \item \texttt{Graphics} --- Switch to graphics mode. + \item \texttt{ForceText} --- Switch to text mode and preserve it + (requires \texttt{ProvideConsoleControl}). + \item \texttt{ForceGraphics} --- Switch to graphics mode and preserve it + (require \texttt{ProvideConsoleControl}). + \end{itemize} + + On most firmwares it is reasonable to set \texttt{ConsoleBehaviourOs} + to \texttt{Graphics} and \texttt{ConsoleBehaviourUi} to \texttt{Text}. + On APTIO firmwares \texttt{ConsoleBehaviourUi} is best set to + \texttt{ForceText} to avoid visual glitches. + + \emph{Note}: \texttt{IgnoreTextInGraphics} may need to be enabled for select + firmware implementations. + +\item + \texttt{ConsoleBehaviourUi}\\ + \textbf{Type}: \texttt{plist\ string}\\ + \textbf{Default value}: Empty string\\ + \textbf{Description}: Set console control behaviour upon OpenCore user + interface load. Refer to \texttt{ConsoleBehaviourOs} description for details. + \item \texttt{HideSelf}\\ \textbf{Type}: \texttt{plist\ boolean}\\ @@ -2410,10 +2452,6 @@ tweaks for the onboard firmware. when other console control quirks are used (\texttt{IgnoreTextInGraphics} and \texttt{SetConsoleControl}). - \emph{Note}: Some drivers, like AppleUiSupport, may provide equivalent functionality. - These drivers are not guaranteed to adhere to the same logic, and if a quirk is - necessary, this option is preferred. - \item \texttt{ProvideConsoleGop}\\ \textbf{Type}: \texttt{plist\ boolean}\\ @@ -2434,41 +2472,6 @@ tweaks for the onboard firmware. or at least have an option for, select firmwares do not. As a result, operating system may freeze upon boot. Not recommended unless required. -\item - \texttt{SetConsoleControl}\\ - \textbf{Type}: \texttt{plist\ string}\\ - \textbf{Default value}: Empty string\\ - \textbf{Description}: Set console control behaviour upon boot. - - Different firmwares implement console control differently or do not implement - it at all. For the latter case it is enough to install a dummy console control - and hide all onscreen text in graphics mode. However, it is often not enough - for other firmwares, which do not show text in text mode, or display visual - glitches during text/graphics console control mode switching. Possible - behaviours include: - - \begin{itemize} - \tightlist - \item Empty string --- Do not modify console control mode. - \item \texttt{Graphics} --- Switch to graphics mode. - \item \texttt{Text} --- Switch to text mode. - \item \texttt{ForceGraphics} --- Switch to graphics mode and never change. - \item \texttt{ForceText} --- Switch to text mode and never change. - \end{itemize} - - Hints (assuming \texttt{ProvideConsoleControl} is \texttt{true}): - \begin{itemize} - \tightlist - \item On Insyde and Phoenix laptops, which do not show boot menu, try - \texttt{SetConsoleControl} \texttt{Text} and \texttt{IgnoreTextInGraphics} - \texttt{false}. - \item On APTIO IV and V with verbose output that cannot be disabled try - \texttt{SetConsoleControl} \texttt{ForceText} and \texttt{IgnoreTextInGraphics} - \texttt{true}. - \item On Duet with similar to APTIO issues try \texttt{SetConsoleControl} - empty string and \texttt{IgnoreTextInGraphics} \texttt{true}. - \end{itemize} - \end{enumerate} \section{Troubleshooting}\label{troubleshooting} diff --git a/Platform/OpenCore/OpenCore.c b/Platform/OpenCore/OpenCore.c index b9ad338bd18d694faae2a2fc21df5025451523b2..307f6da124098a9dfc1e9ffec9246f3981122c3e 100644 --- a/Platform/OpenCore/OpenCore.c +++ b/Platform/OpenCore/OpenCore.c @@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include @@ -92,6 +93,15 @@ OcEfiStartImagePrologue ( if (!IsWindows) { OcLoadKernelSupport (&mOpenCoreStorage, &mOpenCoreConfiguration); } + + // + // Request OS mode. + // + ConsoleControlSetBehaviour ( + ParseConsoleControlBehaviour ( + OC_BLOB_GET (&mOpenCoreConfiguration.Misc.Boot.ConsoleBehaviourOs) + ) + ); } } @@ -102,6 +112,15 @@ OcEfiStartImageEpilogue ( ) { if (mOpenCoreStartImageNest == 1) { + // + // Restore ui mode. + // + ConsoleControlSetBehaviour ( + ParseConsoleControlBehaviour ( + OC_BLOB_GET (&mOpenCoreConfiguration.Misc.Boot.ConsoleBehaviourUi) + ) + ); + if (!mOpenCoreStartImageIsWindows) { OcUnloadKernelSupport (); } diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index 5dc0366558d8a741e320ba92674cf567ad34b899..32dd7c2421a1a572174f3406e74f7ffe8d72f098 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -240,3 +240,15 @@ OcMiscLateInit ( return Status; } + +VOID +OcMiscUefiQuirksLoaded ( + IN OC_GLOBAL_CONFIG *Config + ) +{ + ConsoleControlSetBehaviour ( + ParseConsoleControlBehaviour ( + OC_BLOB_GET (&Config->Misc.Boot.ConsoleBehaviourUi) + ) + ); +} diff --git a/Platform/OpenCore/OpenCoreUefi.c b/Platform/OpenCore/OpenCoreUefi.c index 01f8a188cfe604469826f60195af2ccf63c91e97..6776bf91d9757978be4c7bf50a7205bfb9b5d8b7 100644 --- a/Platform/OpenCore/OpenCoreUefi.c +++ b/Platform/OpenCore/OpenCoreUefi.c @@ -223,8 +223,6 @@ OcLoadUefiSupport ( IN OC_CPU_INFO *CpuInfo ) { - OC_CONSOLE_CONTROL_BEHAVIOUR Behaviour; - if (Config->Uefi.Quirks.DisableWatchDog) { // // boot.efi kills watchdog only in FV2 UI. @@ -241,11 +239,7 @@ OcLoadUefiSupport ( } if (Config->Uefi.Quirks.ProvideConsoleControl) { - Behaviour = ParseConsoleControlBehaviour ( - OC_BLOB_GET (&Config->Uefi.Quirks.SetConsoleControl) - ); - ConfigureConsoleControl ( - Behaviour, + ConsoleControlConfigure ( Config->Uefi.Quirks.IgnoreTextInGraphics ); }