Skip to content

Commit 5db7147

Browse files
committed
OcSmbiosLib: Cover NO DIMM information
1 parent eff77bd commit 5db7147

7 files changed

Lines changed: 54 additions & 12 deletions

File tree

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ OpenCore Changelog
1818
- Fixed wraparound when using arrow keys in OpenCanopy
1919
- Updated builtin firmware versions for SMBIOS and the rest
2020
- Added bundled Linux versions for userspace utilities
21+
- Fixed fallback SMBIOS `Manufacturer` value to `NO DIMM` for empty slots
2122

2223
#### v0.6.8
2324
- Switched to VS2019 toolchain for Windows builds

Docs/Configuration.pdf

859 Bytes
Binary file not shown.

Docs/Configuration.tex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,6 +5329,21 @@ \subsubsection{Memory Device Properties}\label{platforminfomemorydevice}
53295329
\textbf{SMBIOS}: Memory Device (Type 17) --- Manufacturer\\
53305330
\textbf{Description}: Specifies the manufacturer of this memory device.
53315331

5332+
For empty slot this must be set to \texttt{NO DIMM} for macOS System Profiler
5333+
to correctly display memory slots on certain Mac models, e.g. \texttt{MacPro7,1}.
5334+
\texttt{MacPro7,1} imposes additional requirements on the memory layout:
5335+
\begin{itemize}
5336+
\tightlist
5337+
\item The amount of installed sticks must one of the following: 4, 6, 8, 10, 12.
5338+
Using any different value will cause an error in the System Profiler.
5339+
\item The amount of memory slots must equal to 12. Using any different value
5340+
will cause an error in the System Profiler.
5341+
\item Memory sticks must be installed in dedicated memory slots as explained
5342+
on the \href{https://support.apple.com/HT210103}{support page}. SMBIOS
5343+
memory devices are mapped to the following slots:
5344+
\texttt{8, 7, 10, 9, 12, 11, 5, 6, 3, 4, 1, 2}.
5345+
\end{itemize}
5346+
53325347
\item
53335348
\texttt{PartNumber}\\
53345349
\textbf{Type}: \texttt{plist\ string}\\

Docs/Differences/Differences.pdf

4.89 KB
Binary file not shown.

Docs/Differences/Differences.tex

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
\documentclass[]{article}
22
%DIF LATEXDIFF DIFFERENCE FILE
3-
%DIF DEL PreviousConfiguration.tex Tue Apr 27 20:14:51 2021
4-
%DIF ADD ../Configuration.tex Tue Apr 27 20:14:51 2021
3+
%DIF DEL PreviousConfiguration.tex Sat Apr 10 16:12:14 2021
4+
%DIF ADD ../Configuration.tex Thu Apr 29 01:37:41 2021
55

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

5395-
\item
5396-
\texttt{PartNumber}\\
5395+
\DIFaddbegin \DIFadd{For empty slot this must be set to }\texttt{\DIFadd{NO DIMM}} \DIFadd{for macOS System Profiler
5396+
to correctly display memory slots on certain Mac models, e.g. }\texttt{\DIFadd{MacPro7,1}}\DIFadd{.
5397+
}\texttt{\DIFadd{MacPro7,1}} \DIFadd{imposes additional requirements on the memory layout:
5398+
}\begin{itemize}
5399+
\tightlist
5400+
\DIFaddend \item \DIFaddbegin \DIFadd{The amount of installed sticks must one of the following: 4, 6, 8, 10, 12.
5401+
Using any different value will cause an error in the System Profiler.
5402+
}\item \DIFadd{The amount of memory slots must equal to 12. Using any different value
5403+
will cause an error in the System Profiler.
5404+
}\item \DIFadd{Memory sticks must be installed in dedicated memory slots as explained
5405+
on the }\href{https://support.apple.com/HT210103}{\DIFadd{support page}}\DIFadd{. SMBIOS
5406+
memory devices are mapped to the following slots:
5407+
}\texttt{\DIFadd{8, 7, 10, 9, 12, 11, 5, 6, 3, 4, 1, 2}}\DIFadd{.
5408+
}\end{itemize}
5409+
5410+
\item
5411+
\DIFaddend \texttt{PartNumber}\\
53975412
\textbf{Type}: \texttt{plist\ string}\\
53985413
\textbf{Failsafe}: \texttt{Unknown}\\
53995414
\textbf{SMBIOS}: Memory Device (Type 17) --- Part Number\\

Docs/Errata/Errata.pdf

87 Bytes
Binary file not shown.

Library/OcSmbiosLib/SmbiosPatch.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,10 @@ PatchMemoryDevice (
826826
OUT SMBIOS_HANDLE *Handle
827827
)
828828
{
829-
UINT8 MinLength;
830-
UINT8 StringIndex;
831-
UINT8 FormFactor;
829+
UINT8 MinLength;
830+
UINT8 StringIndex;
831+
UINT8 FormFactor;
832+
CONST CHAR8 *DummyString;
832833

833834
*Handle = OcSmbiosInvalidHandle;
834835
MinLength = sizeof (*Original.Standard.Type17);
@@ -863,11 +864,21 @@ PatchMemoryDevice (
863864
//
864865
// Some machines may have NULL values for these fields, which will cause SPMemoryReporter
865866
// crashes or ??? to be displayed in About This Mac. Fallback to "Unknown" for such fields.
866-
//
867-
SMBIOS_OVERRIDE_S (Table, Standard.Type17->Manufacturer, Original, NULL, &StringIndex, "Unknown");
868-
SMBIOS_OVERRIDE_S (Table, Standard.Type17->SerialNumber, Original, NULL, &StringIndex, "Unknown");
869-
SMBIOS_OVERRIDE_S (Table, Standard.Type17->AssetTag, Original, NULL, &StringIndex, "Unknown");
870-
SMBIOS_OVERRIDE_S (Table, Standard.Type17->PartNumber, Original, NULL, &StringIndex, "Unknown");
867+
// If there is no stick in the slot, the Manufacturer value must be "NO DIMM", this
868+
// is checked in System Profiler, at least by iMacPro1,1 (see ExpansionSlotSupport.framework).
869+
//
870+
if (Table->CurrentPtr.Standard.Type17->Size > 0) {
871+
SMBIOS_OVERRIDE_S (Table, Standard.Type17->Manufacturer, Original, NULL, &StringIndex, "Unknown");
872+
SMBIOS_OVERRIDE_S (Table, Standard.Type17->SerialNumber, Original, NULL, &StringIndex, "Unknown");
873+
SMBIOS_OVERRIDE_S (Table, Standard.Type17->AssetTag, Original, NULL, &StringIndex, "Unknown");
874+
SMBIOS_OVERRIDE_S (Table, Standard.Type17->PartNumber, Original, NULL, &StringIndex, "Unknown");
875+
} else {
876+
SmbiosOverrideString (Table, "NO DIMM", &StringIndex);
877+
Table->CurrentPtr.Standard.Type17->Manufacturer = StringIndex;
878+
Table->CurrentPtr.Standard.Type17->SerialNumber = StringIndex;
879+
Table->CurrentPtr.Standard.Type17->AssetTag = StringIndex;
880+
Table->CurrentPtr.Standard.Type17->PartNumber = StringIndex;
881+
}
871882

872883
SMBIOS_OVERRIDE_V (Table, Standard.Type17->Attributes, Original, NULL, NULL);
873884
SMBIOS_OVERRIDE_V (Table, Standard.Type17->ExtendedSize, Original, NULL, NULL);

0 commit comments

Comments
 (0)