1

I want to read the "TSTR"-register (Thermal Sensor Thermometer Read Register) of my Intel Chipset. I have found that the __readmsr function is what I need. I have also setup a kernel driver since the function is only available in kernel mode.

But I have no clue how to access the register... In the datasheet of the chipset it is stated on page 857 that the offset adress of the register is TBARB+03h.

How can I use this adress? Are there tutorials out there that could help me?

Thanks!

Marius Anderie
  • 23
  • 1
  • 2
  • 12
  • Looks like it's actually a PCI register – Drew McGowen Aug 09 '13 at 20:19
  • "The base memory for these thermal memory mapped configuration registers is specified in the TBARB (D31:F6:Offset 40h)." that last bit of hex is indeed an offset in the PCI device's config space – Drew McGowen Aug 09 '13 at 20:20

2 Answers2

1

As far as I have figured out, trying to do the exact same thing, __readmsr is indeed the right command for accessing registers:

http://msdn.microsoft.com/en-us/library/y55zyfdx%28v=VS.100%29.aspx

however I am working on an i5, and Intel's documentation
http://www.intel.com/content/www/us/en/intelligent-systems/piketon/core-i7-800-i5-700-desktop-datasheet-vol-2.html
suggests that things like MC_RANK_VIRTUAL_TEMP entries are registers, so it ought to work, so you are on the right track probably.. the particular register is on page 272. So technically this is indeed the answer, __readmsr(1568) in my case.
However I am struggling to convince visual studio 2010 to build this in kernel mode, which it seems reluctant to do, I keep getting the Priviledged Instruction error.. When I get this out of the way and the whole program working I'll write a tutorial on the general process, but until then I only dare give a theoretical answer. If your compiler tends to listen to what you say, just add the /kernel compiler option, since you are only reading and not editing the registers it should be safe.

Edit: There is also this article, the answer more or less suggests what I'm trying to do, though not much more than I have so far, but take a look anyway:
How to access CPU's heat sensors?

Community
  • 1
  • 1
user3079666
  • 1,159
  • 10
  • 23
0

"This instruction must be executed at privilege level 0 or in real-address mode; otherwise, a general protection exception #GP(0) will be generated."

http://faydoc.tripod.com/cpu/rdmsr.htm

Adrian
  • 129
  • 1
  • 4