提交 2d4cf6b0 编写于 作者: V vit9696

OpenCoreMisc: Allow fine-tuning console control for UI and boot

上级 b0ec0856
...@@ -1252,6 +1252,48 @@ behaviour that does not go to any other sections ...@@ -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} Set to empty string not to change console mode. Set to \texttt{Max}
to try to use largest available console mode. 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 \item
\texttt{HideSelf}\\ \texttt{HideSelf}\\
\textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Type}: \texttt{plist\ boolean}\\
...@@ -2410,10 +2452,6 @@ tweaks for the onboard firmware. ...@@ -2410,10 +2452,6 @@ tweaks for the onboard firmware.
when other console control quirks are used (\texttt{IgnoreTextInGraphics} when other console control quirks are used (\texttt{IgnoreTextInGraphics}
and \texttt{SetConsoleControl}). 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 \item
\texttt{ProvideConsoleGop}\\ \texttt{ProvideConsoleGop}\\
\textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Type}: \texttt{plist\ boolean}\\
...@@ -2434,41 +2472,6 @@ tweaks for the onboard firmware. ...@@ -2434,41 +2472,6 @@ tweaks for the onboard firmware.
or at least have an option for, select firmwares do not. As a result, or at least have an option for, select firmwares do not. As a result,
operating system may freeze upon boot. Not recommended unless required. 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} \end{enumerate}
\section{Troubleshooting}\label{troubleshooting} \section{Troubleshooting}\label{troubleshooting}
......
...@@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ...@@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcAppleBootPolicyLib.h> #include <Library/OcAppleBootPolicyLib.h>
#include <Library/OcBootManagementLib.h> #include <Library/OcBootManagementLib.h>
#include <Library/OcConfigurationLib.h> #include <Library/OcConfigurationLib.h>
#include <Library/OcConsoleLib.h>
#include <Library/OcCpuLib.h> #include <Library/OcCpuLib.h>
#include <Library/OcDevicePathLib.h> #include <Library/OcDevicePathLib.h>
#include <Library/OcStorageLib.h> #include <Library/OcStorageLib.h>
...@@ -92,6 +93,15 @@ OcEfiStartImagePrologue ( ...@@ -92,6 +93,15 @@ OcEfiStartImagePrologue (
if (!IsWindows) { if (!IsWindows) {
OcLoadKernelSupport (&mOpenCoreStorage, &mOpenCoreConfiguration); OcLoadKernelSupport (&mOpenCoreStorage, &mOpenCoreConfiguration);
} }
//
// Request OS mode.
//
ConsoleControlSetBehaviour (
ParseConsoleControlBehaviour (
OC_BLOB_GET (&mOpenCoreConfiguration.Misc.Boot.ConsoleBehaviourOs)
)
);
} }
} }
...@@ -102,6 +112,15 @@ OcEfiStartImageEpilogue ( ...@@ -102,6 +112,15 @@ OcEfiStartImageEpilogue (
) )
{ {
if (mOpenCoreStartImageNest == 1) { if (mOpenCoreStartImageNest == 1) {
//
// Restore ui mode.
//
ConsoleControlSetBehaviour (
ParseConsoleControlBehaviour (
OC_BLOB_GET (&mOpenCoreConfiguration.Misc.Boot.ConsoleBehaviourUi)
)
);
if (!mOpenCoreStartImageIsWindows) { if (!mOpenCoreStartImageIsWindows) {
OcUnloadKernelSupport (); OcUnloadKernelSupport ();
} }
......
...@@ -240,3 +240,15 @@ OcMiscLateInit ( ...@@ -240,3 +240,15 @@ OcMiscLateInit (
return Status; return Status;
} }
VOID
OcMiscUefiQuirksLoaded (
IN OC_GLOBAL_CONFIG *Config
)
{
ConsoleControlSetBehaviour (
ParseConsoleControlBehaviour (
OC_BLOB_GET (&Config->Misc.Boot.ConsoleBehaviourUi)
)
);
}
...@@ -223,8 +223,6 @@ OcLoadUefiSupport ( ...@@ -223,8 +223,6 @@ OcLoadUefiSupport (
IN OC_CPU_INFO *CpuInfo IN OC_CPU_INFO *CpuInfo
) )
{ {
OC_CONSOLE_CONTROL_BEHAVIOUR Behaviour;
if (Config->Uefi.Quirks.DisableWatchDog) { if (Config->Uefi.Quirks.DisableWatchDog) {
// //
// boot.efi kills watchdog only in FV2 UI. // boot.efi kills watchdog only in FV2 UI.
...@@ -241,11 +239,7 @@ OcLoadUefiSupport ( ...@@ -241,11 +239,7 @@ OcLoadUefiSupport (
} }
if (Config->Uefi.Quirks.ProvideConsoleControl) { if (Config->Uefi.Quirks.ProvideConsoleControl) {
Behaviour = ParseConsoleControlBehaviour ( ConsoleControlConfigure (
OC_BLOB_GET (&Config->Uefi.Quirks.SetConsoleControl)
);
ConfigureConsoleControl (
Behaviour,
Config->Uefi.Quirks.IgnoreTextInGraphics Config->Uefi.Quirks.IgnoreTextInGraphics
); );
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册