OpenCoreMisc: Support ConsoleMode configuration option

This commit is contained in:
vit9696 2019-04-19 12:35:14 +03:00
parent c87d0fe735
commit 2872d4f11c
4 changed files with 42 additions and 0 deletions

Binary file not shown.

View File

@ -1206,6 +1206,15 @@ behaviour that does not go to any other sections
\begin{enumerate}
\item
\texttt{ConsoleMode}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Default value}: Empty string\\
\textbf{Description}: Sets console output mode as specified
with the \texttt{WxH} (e.g. \texttt{80x24}) formatted string.
Set to empty string not to change console mode. Set to \texttt{Max}
to try to use largest available console mode.
\item
\texttt{HideSelf}\\
\textbf{Type}: \texttt{plist\ boolean}\\

View File

@ -353,6 +353,8 @@
<dict>
<key>Boot</key>
<dict>
<key>ConsoleMode</key>
<string></string>
<key>HideSelf</key>
<true/>
<key>ReinstallProtocol</key>

View File

@ -209,5 +209,36 @@ OcMiscLateInit (
));
}
ParseConsoleMode (
OC_BLOB_GET (&Config->Misc.Boot.ConsoleMode),
&Width,
&Height,
&SetMax
);
DEBUG ((
DEBUG_INFO,
"OC: Requested console mode is %u:%u@%u (max: %d) from %a\n",
Width,
Height,
Bpp,
SetMax,
OC_BLOB_GET (&Config->Misc.Boot.ConsoleMode)
));
if (SetMax || (Width > 0 && Height > 0)) {
Status = SetConsoleMode (Width, Height);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Changed console mode to %u:%u@%u (max: %d) from %a - %r\n",
Width,
Height,
Bpp,
SetMax,
OC_BLOB_GET (&Config->Misc.Boot.ConsoleMode),
Status
));
}
return Status;
}