提交 bb990c8c 编写于 作者: V vit9696

OpenCoreMisc: Perform serial init separately via SerialInit option

上级 62a88ddf
......@@ -31,6 +31,7 @@ OpenCore Changelog
- Added MacBookPro16,4 model code
- Updated builtin firmware versions for SMBIOS and the rest
- Fixed OSXSAVE reporting when emulating CPUID on newer CPUs
- Added `SerialInit` option to perform serial initialisation separately
#### v0.5.9
- Added full HiDPI support in OpenCanopy
......
......@@ -2700,6 +2700,25 @@ cat Kernel.panic | grep macOSProcessedStackshotData |
\texttt{NOOPT}, \texttt{RELEASE}.
\end{itemize}
\item
\texttt{SerialInit}\\
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Perform serial port initialisation.
This option will perform serial port initialisation within OpenCore prior to enabling
(any) debug logging. Serial port configuration is defined via PCDs at compile time
in \texttt{gEfiMdeModulePkgTokenSpaceGuid} GUID. Default values as found in
\texttt{MdeModulePkg.dec} are as follows:
\begin{itemize}
\tightlist
\item \texttt{PcdSerialBaudRate} --- Baud rate: \texttt{115200}.
\item \texttt{PcdSerialLineControl} --- Line control: no parity, 8 data bits, 1 stop bit.
\end{itemize}
See more details in \hyperref[troubleshootingdebug]{\texttt{Debugging}} section.
\item
\texttt{SysReport}\\
\textbf{Type}: \texttt{plist\ boolean}\\
......@@ -5636,8 +5655,8 @@ page. For IDA Pro you will need IDA Pro 7.3 or newer, refer to
for more details.
To obtain the log during boot you can make the use of serial port debugging. Serial port
debugging is enabled in \texttt{Target}, e.g. \texttt{0xB} for onscreen with serial. OpenCore
uses \texttt{115200} baud rate, \texttt{8} data bits, no parity, and \texttt{1} stop bit.
debugging is enabled in \texttt{Target}, e.g. \texttt{0xB} for onscreen with serial. To
initialise serial within OpenCore use \texttt{SerialInit} configuration option.
For macOS your best choice are CP2102-based UART devices. Connect motherboard \texttt{TX}
to USB UART \texttt{RX}, and motherboard \texttt{GND} to USB UART \texttt{GND}. Use
\texttt{screen} utility to get the output, or download GUI software, such as
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Jun 2 03:55:18 2020
%DIF ADD ../Configuration.tex Sat Jul 25 18:44:25 2020
%DIF ADD ../Configuration.tex Sat Jul 25 19:03:36 2020
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -2788,7 +2788,29 @@ cat Kernel.panic | grep macOSProcessedStackshotData |
\end{itemize}
\item
\texttt{SysReport}\\
\DIFaddbegin \texttt{\DIFadd{SerialInit}}\\
\textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ boolean}}\\
\textbf{\DIFadd{Failsafe}}\DIFadd{: }\texttt{\DIFadd{false}}\\
\textbf{\DIFadd{Description}}\DIFadd{: Perform serial port initialisation.
}
\DIFadd{This option will perform serial port initialisation within OpenCore prior to enabling
(any) debug logging. Serial port configuration is defined via PCDs at compile time
in }\texttt{\DIFadd{gEfiMdeModulePkgTokenSpaceGuid}} \DIFadd{GUID. Default values as found in
}\texttt{\DIFadd{MdeModulePkg.dec}} \DIFadd{are as follows:
}
\begin{itemize}
\tightlist
\item \texttt{\DIFadd{PcdSerialBaudRate}} \DIFadd{--- Baud rate: }\texttt{\DIFadd{115200}}\DIFadd{.
}\item \texttt{\DIFadd{PcdSerialLineControl}} \DIFadd{--- Line control: no parity, 8 data bits, 1 stop bit.
}\end{itemize}
\DIFadd{See more details in }\hyperref[troubleshootingdebug]{\texttt{Debugging}} \DIFadd{section.
}
\item
\DIFaddend \texttt{SysReport}\\
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Produce system report on ESP folder.
......@@ -5756,8 +5778,11 @@ page. For IDA Pro you will need IDA Pro 7.3 or newer, refer to
for more details.
To obtain the log during boot you can make the use of serial port debugging. Serial port
debugging is enabled in \texttt{Target}, e.g. \texttt{0xB} for onscreen with serial. OpenCore
uses \texttt{115200} baud rate, \texttt{8} data bits, no parity, and \texttt{1} stop bit.
debugging is enabled in \texttt{Target}, e.g. \texttt{0xB} for onscreen with serial. \DIFdelbegin \DIFdel{OpenCore
uses }\DIFdelend \DIFaddbegin \DIFadd{To
initialise serial within OpenCore use }\DIFaddend \texttt{\DIFdelbegin \DIFdel{115200}\DIFdelend \DIFaddbegin \DIFadd{SerialInit}\DIFaddend } \DIFdelbegin \DIFdel{baud rate, }\texttt{\DIFdel{8}} %DIFAUXCMD
\DIFdel{data bits, no parity, and }\texttt{\DIFdel{1}} %DIFAUXCMD
\DIFdel{stop bit}\DIFdelend \DIFaddbegin \DIFadd{configuration option}\DIFaddend .
For macOS your best choice are CP2102-based UART devices. Connect motherboard \texttt{TX}
to USB UART \texttt{RX}, and motherboard \texttt{GND} to USB UART \texttt{GND}. Use
\texttt{screen} utility to get the output, or download GUI software, such as
......
......@@ -676,6 +676,8 @@
<integer>0</integer>
<key>DisplayLevel</key>
<integer>2147483650</integer>
<key>SerialInit</key>
<false/>
<key>SysReport</key>
<false/>
<key>Target</key>
......
......@@ -676,6 +676,8 @@
<integer>0</integer>
<key>DisplayLevel</key>
<integer>2147483650</integer>
<key>SerialInit</key>
<false/>
<key>SysReport</key>
<false/>
<key>Target</key>
......
......@@ -291,6 +291,7 @@
_(BOOLEAN , AppleDebug , , FALSE , ()) \
_(BOOLEAN , ApplePanic , , FALSE , ()) \
_(BOOLEAN , DisableWatchDog , , FALSE , ()) \
_(BOOLEAN , SerialInit , , FALSE , ()) \
_(BOOLEAN , SysReport , , FALSE , ())
OC_DECLARE (OC_MISC_DEBUG)
......
......@@ -346,6 +346,7 @@ mMiscConfigurationDebugSchema[] = {
OC_SCHEMA_BOOLEAN_IN ("DisableWatchDog", OC_GLOBAL_CONFIG, Misc.Debug.DisableWatchDog),
OC_SCHEMA_INTEGER_IN ("DisplayDelay", OC_GLOBAL_CONFIG, Misc.Debug.DisplayDelay),
OC_SCHEMA_INTEGER_IN ("DisplayLevel", OC_GLOBAL_CONFIG, Misc.Debug.DisplayLevel),
OC_SCHEMA_BOOLEAN_IN ("SerialInit", OC_GLOBAL_CONFIG, Misc.Debug.SerialInit),
OC_SCHEMA_BOOLEAN_IN ("SysReport", OC_GLOBAL_CONFIG, Misc.Debug.SysReport),
OC_SCHEMA_INTEGER_IN ("Target", OC_GLOBAL_CONFIG, Misc.Debug.Target)
};
......
......@@ -534,11 +534,6 @@ OcConfigureLogProtocol (
}
}
if (!EFI_ERROR (Status)
&& (Options & (OC_LOG_SERIAL | OC_LOG_ENABLE)) == (OC_LOG_SERIAL | OC_LOG_ENABLE)) {
SerialPortInitialize ();
}
if (LogRoot != NULL) {
if (!EFI_ERROR (Status)) {
if (OC_LOG_PRIVATE_DATA_FROM_OC_LOG_THIS (OcLog)->AsciiBufferSize > 0) {
......
......@@ -100,6 +100,7 @@
OcMacInfoLib
PcdLib
PrintLib
SerialPortLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
......
......@@ -27,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcSmbiosLib.h>
#include <Library/OcStringLib.h>
#include <Library/PrintLib.h>
#include <Library/SerialPortLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
......@@ -536,6 +537,10 @@ OcMiscEarlyInit (
gBS->SetWatchdogTimer (0, 0, 0, NULL);
}
if (Config->Misc.Debug.SerialInit) {
SerialPortInitialize ();
}
OcConfigureLogProtocol (
Config->Misc.Debug.Target,
Config->Misc.Debug.DisplayDelay,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册