1
votes

I can see from my OS the informations about my hard disk, RAM and CPU. But I've never told my OS these info.

  1. How does my OS know it?
  2. Is there some place in the hard disk or CPU or RAM that stores this kind of information?
  3. Is there some standard about the format of this kind of information?
2

2 Answers

2
votes

SMBIOS (formerly known as DMI) contains much of this information. SMBIOS is a a data structure/API that is part of the BIOS/UEFI firmware and contains info like brand and model of the computer, etc.

The rest is gathered by the OS querying hardware directly.

0
votes

Answer grabbed from superuser by Mokubai.

You don't need to tell it because each device already knows (or has a way) to identify itself.

If you get the idea that every device is accessed via address and data lines, and in some cases only data lines then you come to the relaisation that in those data lines you need some kind of "protocol" that determines just how you talk to those devices.

In amongst that protocol you have commands that say "read this" and "send that" or "put this over there". It is also relatively easy to have a command that says "identify yourself" which, rather than reading a block of disk or memory or painting a pixel a particular colour, will return a premade string or set of strings that tell the driver or operating system what that device is. Using a series of identity commands you could discover a device type, it's capabilities and what driver might be able to work with it.

You don't need to tell a device what it is, because it already knows. And you don't need to tell the operating system what it is because it can ask the device itself.

You don't tell people what they're called and how they talk, you ask them.


Each device has it's own protocol for these messages, and they don't store the details of other devices because to do so would be insane and near useless given that you can remove any device at any time. Your hard drive doesn't need to store information about your memory or graphics card except for the driver that the operating system uses to talk to it with.

The PC UEFI specification would define a core set of system specifications that every computer has, allowing the processor to be powered up and for a program stored in an EEPROM to begin the asbolute basic system probing necessary to determine the processor, set up the RAM, find a disk and display and thus continue to boot the computer.

From there the UEFI system would hand over to the operating system which would have more detailed probing and identification procedures, but it all starts at the most basic "I have a processor, what is around me?" situation.