diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index e40907c6..f8753088 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 1117b9aa..dcb38cc9 100644 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -1413,9 +1413,10 @@ u=$(nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | sed 's/.*GPT,\([^,]*\ ioreg -lw0 -p IODeviceTree | grep boot-log | sort | sed 's/.*<\(.*\)>.*/\1/' | xxd -r -p \end{lstlisting} - UEFI variable log may get truncated on some firmwares. - Using non-volatile flag will write the log to NVRAM flash after every - printed line. To obtain UEFI variable log use the following command + UEFI variable log does not include some messages and has no performance data. For safety + reasons log size is limited to 32 kilobytes. Some firmwares may truncate it much earlier + or drop completely if they have no memory. Using non-volatile flag will write the log to + NVRAM flash after every printed line. To obtain UEFI variable log use the following command in macOS: \begin{lstlisting}[label=nvramlog, style=ocbash] nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-log | @@ -1429,7 +1430,11 @@ nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-log | nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version \end{lstlisting} - \emph{Note}: File logging is currently not implemented. + File logging will create a file named \texttt{opencore.log} at EFI volume root with + log contents. Please be warned that some file system drivers present in firmwares are + not reliable, and may corrupt data when writing files through UEFI. Log is attempted + to be written in the safest manner, and thus is very slow. Ensure that + \texttt{DisableWatchDog} is set to \texttt{true} when you use a slow drive. \end{enumerate} diff --git a/Include/OpenCore.h b/Include/OpenCore.h index 8cb1883e..c58764f5 100644 --- a/Include/OpenCore.h +++ b/Include/OpenCore.h @@ -60,6 +60,8 @@ #define OPEN_CORE_CONFIG_PATH L"config.plist" +#define OPEN_CORE_LOG_PATH L"opencore.log" + #define OPEN_CORE_ACPI_PATH L"ACPI\\Custom\\" #define OPEN_CORE_UEFI_DRIVER_PATH L"Drivers\\" diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index aacfc76c..5b2e1082 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -123,7 +123,9 @@ OcMiscEarlyInit ( Config->Misc.Debug.Target, Config->Misc.Debug.DisplayDelay, (UINTN) Config->Misc.Debug.DisplayLevel, - (UINTN) Config->Misc.Security.HaltLevel + (UINTN) Config->Misc.Security.HaltLevel, + OPEN_CORE_LOG_PATH, + Storage->FileSystem ); DEBUG (( diff --git a/Platform/OpenCore/OpenCoreNvram.c b/Platform/OpenCore/OpenCoreNvram.c index 0b3aee54..0aa66e4e 100644 --- a/Platform/OpenCore/OpenCoreNvram.c +++ b/Platform/OpenCore/OpenCoreNvram.c @@ -93,7 +93,7 @@ OcReportVersion ( OC_VERSION_VARIABLE_NAME, &gOcVendorVariableGuid, OPEN_CORE_NVRAM_ATTR, - sizeof (mOpenCoreVersion), + AsciiStrLen (mOpenCoreVersion), &mOpenCoreVersion[0] ); }