How can Mac OS X tell what kind of RAM is in the machine? For example I was working on one that had DDR3 RAM @ 1600MHz and I thought it wasn't possible to know the RAM without physically opening the case and looking at it.How can this be done on other systems?
RAM sticks have a small chip on them called the Serial Presence Detect [1], which contains information such as capacity, preferred timings, manufacturer, and even a serial number.
SPD information is accessible by OSes using the i2c bus (which also includes things like temperature sensors). I think you can directly read the SPDs from Linux using various i2c utilities.
This image from the Wikipedia article has a good picture of it:
UPDATE:
Some PCs have soldered on RAM instead of RAM DIMMs/SODIMMs. The firmware on these PCs come from the factory with the information about the RAM built in to the same flash storage that the firmware lives on - and then the firmware will setup a "virtual SPD" that OSes can use to query/detect in the same manner.
From gregdavill.github.io [2]:
When laptops started moving memory onto the mainboard, instead of in sockets, they still needed a mechanism to emulate SPD info, so that your OS can correctly detect and show you information about the memory installed in your system. Instead of populating an EEPROM, they simply embed this info inside the BIOS FLASH. Part of the BIOS boot sequence is to extract an SPD table from FLASH, and create a virtual SPD that the OS can query.
That article specifically talks about a Dell XPS13 - and also mentions "resistor straps" - the firmware will check (via GPIO pins accessible via the chipset) for the presence of these straps--allowing the same firmware for different motherboard versions. From there the firmware sets the virtual SPD accordingly.
[1] http://en.wikipedia.org/wiki/Serial_presence_detectdmidecode --type memory
lets you see some of the information. Apparently it can output a manufacturer and serial number, but at least on my system those are reported as simply ManufacturerN
and SerNumN
with N
being what appears to be the slot number. - user
dmidecode
parsed something that the BIOS puts together on boot. The BIOS should read the SPD and report accordingly - buggy BIOSes are nothing new though. - LawrenceC
lshw
can give you a lot of information, including those of RAM. - Shahbaz
On Windows:
wmic memoryChip get /?
Will give you various RAM information you can ask for right from the command prompt.
For example,
wmic memorychip get serialnumber
Gives you the serial number. You can also use Speed
, Model
sometimes, Manufacturer
and more.
WMI is the Windows method of querying SMBIOS [1] data. Apple, Linux, Windows and anyone else who wants to run on most hardware made needs to support SMBIOS at some level, for different reasons.
You can use SMBIOS (e.g. through WMI or WMIC in Windows) to also gather hard drive information, network information (is it a 10/100 or 10/100/1000 card?).
To take it one step further, every manufacturer has a code for MAC addresses on NICs. RAM also has a manufacturers code. So all you have to do to get their code, for example my 2 x2GB in this laptop are 830B, is build a database for the manufacturers (830B might be one brand and then resold too!) and also what models mean what. That is how CPUz works I believe—basic queries and a really complete and current database.
[1] http://en.wikipedia.org/wiki/System_Management_BIOSdmidecode
which purely queries and decodes DMI information is available as a Windows port too. - syneticon-dj
The memory speed and type is negotiated with the bios and can be read by the operating system.
There is a very good website giving you a deeper level of understanding about these things at http://www.computermemoryupgrade.net/index1.html
But you can easily figure out which types and speed you have without opening the cover via:
Apple -> About This Mac -> More Info -> System Report
Open Hardware -> Memory
You should see each stick of RAM including Size, Type and Speed (and for fun, Status to make sure it's ok)
On many Linux distributions (e.g. Debian), you can use the lshw hardware lister [1]
sudo lshw |grep DDR
description: SODIMM DDR3 Synchronous 1067 MHz (0.9 ns)
description: SODIMM DDR3 Synchronous 1067 MHz (0.9 ns)
I guess that RAM, like all other hardware, reports its description and capabilities to the OS. If Linux can do it, I see no reason why OSX can't.
If your distribution doesn't have lshw installed, you can install it using your package manager, e.g.
aptitude install lshw
or download it from the project website.
[1] http://ezix.org/project/wiki/HardwareLiSterlshw
is not available on OS X: - slhck
OSX lshw
and saw this post on the apple website and I assumed it existed for OSX without actually reading the post in question. (blush). Anyway, my point here was that if Linux can see the RAM type why shouldn't OSX? - terdon
On Mac OS X run from terminal:
$ system_profiler SPMemoryDataType
The RAM stick stores its timing, speed, and type on a little chip on the stick. How does your computer know how fast to run the RAM without corrupting its data? Same chip. Apple simply chooses to display this data as well.
To complement ultrasawblade's answer, on Linux, to decode the SPD data, you can use the decode-dimms
perl
script from the
i2c-tools
[1]:
sudo modprobe -a i2c-i801 eeprom
decode-dimms
Or for the HTML fancy formatted one:
decode-dimms -f | w3m -T text/html
(w3m being a text based browser/pager). Or of course:
decode-dimms -f > dimms.html
xdg-open dimms.html
[1] http://www.lm-sensors.org/wiki/I2CToolsSpeccy [1] is a Windows software that will tell you many many things about your computer including RAM type/size/total slots/available slots.
[1] http://www.piriform.com/speccy/download