Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OcSmbiosLib: Cover NO DIMM information
  • Loading branch information
vit9696 committed Apr 28, 2021
1 parent eff77bd commit 5db7147
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 12 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -18,6 +18,7 @@ OpenCore Changelog
- Fixed wraparound when using arrow keys in OpenCanopy
- Updated builtin firmware versions for SMBIOS and the rest
- Added bundled Linux versions for userspace utilities
- Fixed fallback SMBIOS `Manufacturer` value to `NO DIMM` for empty slots

#### v0.6.8
- Switched to VS2019 toolchain for Windows builds
Expand Down
Binary file modified Docs/Configuration.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions Docs/Configuration.tex
Expand Up @@ -5329,6 +5329,21 @@ \subsubsection{Memory Device Properties}\label{platforminfomemorydevice}
\textbf{SMBIOS}: Memory Device (Type 17) --- Manufacturer\\
\textbf{Description}: Specifies the manufacturer of this memory device.

For empty slot this must be set to \texttt{NO DIMM} for macOS System Profiler
to correctly display memory slots on certain Mac models, e.g. \texttt{MacPro7,1}.
\texttt{MacPro7,1} imposes additional requirements on the memory layout:
\begin{itemize}
\tightlist
\item The amount of installed sticks must one of the following: 4, 6, 8, 10, 12.
Using any different value will cause an error in the System Profiler.
\item The amount of memory slots must equal to 12. Using any different value
will cause an error in the System Profiler.
\item Memory sticks must be installed in dedicated memory slots as explained
on the \href{https://support.apple.com/HT210103}{support page}. SMBIOS
memory devices are mapped to the following slots:
\texttt{8, 7, 10, 9, 12, 11, 5, 6, 3, 4, 1, 2}.
\end{itemize}

\item
\texttt{PartNumber}\\
\textbf{Type}: \texttt{plist\ string}\\
Expand Down
Binary file modified Docs/Differences/Differences.pdf
Binary file not shown.
23 changes: 19 additions & 4 deletions Docs/Differences/Differences.tex
@@ -1,7 +1,7 @@
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Apr 27 20:14:51 2021
%DIF ADD ../Configuration.tex Tue Apr 27 20:14:51 2021
%DIF DEL PreviousConfiguration.tex Sat Apr 10 16:12:14 2021
%DIF ADD ../Configuration.tex Thu Apr 29 01:37:41 2021

\usepackage{lmodern}
\usepackage{amssymb,amsmath}
Expand Down Expand Up @@ -5392,8 +5392,23 @@ \subsubsection{Memory Device Properties}\label{platforminfomemorydevice}
\textbf{SMBIOS}: Memory Device (Type 17) --- Manufacturer\\
\textbf{Description}: Specifies the manufacturer of this memory device.

\item
\texttt{PartNumber}\\
\DIFaddbegin \DIFadd{For empty slot this must be set to }\texttt{\DIFadd{NO DIMM}} \DIFadd{for macOS System Profiler
to correctly display memory slots on certain Mac models, e.g. }\texttt{\DIFadd{MacPro7,1}}\DIFadd{.
}\texttt{\DIFadd{MacPro7,1}} \DIFadd{imposes additional requirements on the memory layout:
}\begin{itemize}
\tightlist
\DIFaddend \item \DIFaddbegin \DIFadd{The amount of installed sticks must one of the following: 4, 6, 8, 10, 12.
Using any different value will cause an error in the System Profiler.
}\item \DIFadd{The amount of memory slots must equal to 12. Using any different value
will cause an error in the System Profiler.
}\item \DIFadd{Memory sticks must be installed in dedicated memory slots as explained
on the }\href{https://support.apple.com/HT210103}{\DIFadd{support page}}\DIFadd{. SMBIOS
memory devices are mapped to the following slots:
}\texttt{\DIFadd{8, 7, 10, 9, 12, 11, 5, 6, 3, 4, 1, 2}}\DIFadd{.
}\end{itemize}

\item
\DIFaddend \texttt{PartNumber}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: \texttt{Unknown}\\
\textbf{SMBIOS}: Memory Device (Type 17) --- Part Number\\
Expand Down
Binary file modified Docs/Errata/Errata.pdf
Binary file not shown.
27 changes: 19 additions & 8 deletions Library/OcSmbiosLib/SmbiosPatch.c
Expand Up @@ -826,9 +826,10 @@ PatchMemoryDevice (
OUT SMBIOS_HANDLE *Handle
)
{
UINT8 MinLength;
UINT8 StringIndex;
UINT8 FormFactor;
UINT8 MinLength;
UINT8 StringIndex;
UINT8 FormFactor;
CONST CHAR8 *DummyString;

*Handle = OcSmbiosInvalidHandle;
MinLength = sizeof (*Original.Standard.Type17);
Expand Down Expand Up @@ -863,11 +864,21 @@ PatchMemoryDevice (
//
// Some machines may have NULL values for these fields, which will cause SPMemoryReporter
// crashes or ??? to be displayed in About This Mac. Fallback to "Unknown" for such fields.
//
SMBIOS_OVERRIDE_S (Table, Standard.Type17->Manufacturer, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->SerialNumber, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->AssetTag, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->PartNumber, Original, NULL, &StringIndex, "Unknown");
// If there is no stick in the slot, the Manufacturer value must be "NO DIMM", this
// is checked in System Profiler, at least by iMacPro1,1 (see ExpansionSlotSupport.framework).
//
if (Table->CurrentPtr.Standard.Type17->Size > 0) {
SMBIOS_OVERRIDE_S (Table, Standard.Type17->Manufacturer, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->SerialNumber, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->AssetTag, Original, NULL, &StringIndex, "Unknown");
SMBIOS_OVERRIDE_S (Table, Standard.Type17->PartNumber, Original, NULL, &StringIndex, "Unknown");
} else {
SmbiosOverrideString (Table, "NO DIMM", &StringIndex);
Table->CurrentPtr.Standard.Type17->Manufacturer = StringIndex;
Table->CurrentPtr.Standard.Type17->SerialNumber = StringIndex;
Table->CurrentPtr.Standard.Type17->AssetTag = StringIndex;
Table->CurrentPtr.Standard.Type17->PartNumber = StringIndex;
}

SMBIOS_OVERRIDE_V (Table, Standard.Type17->Attributes, Original, NULL, NULL);
SMBIOS_OVERRIDE_V (Table, Standard.Type17->ExtendedSize, Original, NULL, NULL);
Expand Down

0 comments on commit 5db7147

Please sign in to comment.