6 Replies Latest reply on Jan 10, 2010 4:16 PM by mabra

    CPU Temperature of

    kenshin2k
      F3xA4[CurTmp]

      Hello guys,

      i am currently writing an cpu temp program in C#, which display the actual cpu temp of multicore systems like CoreTemp or RealTemp.

      I succeded in reading the CPU Temp of an Intel Processor by accesing an value in the MSR.

      For AMD i have no idea how i can access the value for CPU Temp.

      I found out that you need to access the PCI-defined configuration space

      F3xA4[CurTmp] , which contains an relative value, and with that value you can calculate with the amd formulas

      AMD K8 CPU Formula AMD - CoreTemp = DTS_Value - 49
      The formula for the K10* is: 'CPU Temp** = Value / 8'.

      BUT HOW TO ACCESS the F3xA4 programmaticly ...

      with intel i could use the readMSR functions to access the value in the MSR.

      but with amd..i have absoluty no idea how to access that value F3xA4...i googled for days ,searched over 100 forums but i found nothing.. i searched the amd documents too

      can someone help me please, my head is exploding on this one

       

      thx

        • CPU Temperature of
          dpaulson

           

          If the user is trying to do this in Windows, they'll need a driver to grant them ring0 access.  Windows will not let you access PCI configuration space without a driver.  There might be utilities you can find on the web to help you do this access. You might be able to look up HalGetBusDataByOffset on MSDN if you want to get into the driver business.

          You're basically going to need access to the processor registers that exist in PCI configuration space.  If you're on a single-node system, the access you suggest would be to:

          Bus: 0, Device: 24, Function: 3, Offset 0xA4

          Also note that if you read CurTmp as '0' then the processor is probably fused to have temperature sensors disabled.

            • CPU Temperature of
              kenshin2k

              Thank you,

              i have ring 0 access , because for the intel msr readings you need ring0 access. I am getting it from opensyslib library.

              I will give it a try with HalGetBusDataByOffset. 

              really thank you for that tip.

               

                • CPU Temperature of
                  kenshin2k

                  i have loaded an program HWDirect to acess pci config space..and just to see if the values there are correct for cpu temp..

                  Bus: 0, Device: 24, Function: 3, Offset 0xA4

                  i have to change it in

                  Bus: 0, Device: 1E, Function: 3, Offset 0xA4

                  the problem is...on the F3xA4 there is with HWDIRECT the Value FFFFFF

                  and when i try to get the value via coretemp...it says 20 degress..

                   

                  i dont see the problem...do you guys have any ideas??

                    • CPU Temperature of
                      kenshin2k

                      no one knows an answer ?

                      i really need help with reading cpu temp..there has to be an way..

                      but neither with external programm(for testing) or programmatically , i dont get any temp informationen..

                       

                       

                        • CPU Temperature of
                          blackshard

                          Sry for late reply.

                          I'm using winring0 library that allows access to Extended PCI Configuration Registers. This is my routine to gain access:

                          #define MISC_CONTROL_3 0x3+((0x18)<<3)

                          DWORD Griffin::getTctlRegister (void) {
                              DWORD miscReg;
                              DWORD curtmp;
                           
                              ReadPciConfigDwordEx (MISC_CONTROL_3,0xa4,&miscReg);
                           
                              curtmp=(miscReg >> 21) >> 3;
                           
                              return curtmp;
                          }

                           

                          This works for Turion processors (family 11h), dunno how it works for family 10h processors.

                            • CPU Temperature of
                              mabra

                              Hi !

                              I read this post, because I attempt to do the same.

                              The code in the last post here, does not work for me, using Athlon X2.

                              The code return alsways zero.

                              What could be wrong?

                              Any help/ideas would really be good!

                              Thanks anyway,

                              --mabra