The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ossama on December 12, 2007, 05:56:04 AM

Title: detecting CPU Temperature
Post by: ossama on December 12, 2007, 05:56:04 AM
hello,
how can i detect my CPU temperature with masm.
thank you.
Title: Re: detecting CPU Temperature
Post by: Tedd on December 12, 2007, 01:26:13 PM
Search msdn for "wmi cpu temperature" :wink
(It's not a simple function call.)
Title: Re: detecting CPU Temperature
Post by: ossama on December 12, 2007, 02:06:50 PM
thank you TEDD
Title: Re: detecting CPU Temperature
Post by: ossama on December 12, 2007, 02:17:28 PM
is there any source code showing how to use this function ?
Title: Re: detecting CPU Temperature
Post by: P1 on December 12, 2007, 08:32:06 PM
You are invited to an elite group of programmers.

The ones who do it the first time for the rest of the new programmers to use in the future.

When your done, post the code.

Look over the current source code and make a try of it, if you need help translating it to MASM, post the code and question, and we will help you into this elite group.

Regards,  P1   :8)
Title: Re: detecting CPU Temperature
Post by: ossama on December 12, 2007, 10:07:59 PM
P1 , where is the code that you are talking about ?
Title: Re: detecting CPU Temperature
Post by: Mark Jones on December 13, 2007, 03:06:01 AM
I believe he just said, "Please code this for the rest of us, because nobody has made anything like this yet."
Title: Re: detecting CPU Temperature
Post by: sinsi on December 13, 2007, 03:13:13 AM
Isn't it all chipset-related anyway i.e. different ports/values/crap? Look on your motherboard's CD for one.
Title: Re: detecting CPU Temperature
Post by: Draakie on December 13, 2007, 06:36:11 AM
http://support.microsoft.com/default.aspx?scid=kb;[ln];306852
might get you started

PS: The link should be typed-out as the hyperlink above does'nt paste correctly to IE.
Title: Re: detecting CPU Temperature
Post by: MichaelW on December 13, 2007, 09:38:00 AM
AFAIK you cannot get the current value, from WMI or SMBIOS. Searching MSDN I see multiple statements to this effect,  here (http://msdn2.microsoft.com/en-us/library/aa394493.aspx) for example, and also at the link that Draakie posted. And on my system the WMI browser that akane posted  here (http://www.masm32.com/board/index.php?topic=4171.msg31404#msg31404) returns nothing for CIM_TemperatureSensor.
Title: Re: detecting CPU Temperature
Post by: ossama on December 13, 2007, 05:09:35 PM
Quote from: Mark Jones on December 13, 2007, 03:06:01 AM
I believe he just said, "Please code this for the rest of us, because nobody has made anything like this yet."

this is because my bad english,sorry
Title: Re: detecting CPU Temperature
Post by: ToutEnMasm on December 14, 2007, 06:00:48 PM
Hello,
It seems than http://www.masm32.com/board/index.php?topic=2594.msg20533#msg20533 can help you.
Just modify query

Title: Re: detecting CPU Temperature
Post by: ossama on December 14, 2007, 06:49:34 PM
merci ToutEnMasm,merci pour ton aid (ie, thank you for your help,for english men :green)
Title: Re: detecting CPU Temperature
Post by: ossama on December 16, 2007, 11:20:44 AM
are there sourcecodes/tutors written in other programming languages that use the "windows management instrementation", i will try to translate it to masm code.
thank you
Title: Re: detecting CPU Temperature
Post by: ToutEnMasm on December 16, 2007, 05:26:44 PM
Hello,
search c++ forum for that or wait that i finish a masm code with all the needed includes.
I am quite certain that Win32_TemperatureProbe need the install of a driver to work .
There is several tools who can read the temperature of a CPU.If one is enough small,run it on a debugger.
I have find a sample in c++ using a dll for ASUS,but that is all.
Searching msdn:
http://msdn2.microsoft.com/en-us/library/aa394493.aspx
Have a look at this C:\WINDOWS\SYSTEM32\wbem\wbemtest.exe  ! powerful tool !
The sample in basic need a cimwin32.dll located here
C:\WINDOWS\SYSTEM32\wbem\cimwin32.dll
The following download sample is a vb script extract from the windows SDK



[attachment deleted by admin]
Title: Re: detecting CPU Temperature
Post by: alkeiser on November 18, 2009, 10:47:43 AM
Quote from: ToutEnMasm on December 16, 2007, 05:26:44 PM
Hello,
search c++ forum for that or wait that i finish a masm code with all the needed includes.
I am quite certain that Win32_TemperatureProbe need the install of a driver to work .
There is several tools who can read the temperature of a CPU.If one is enough small,run it on a debugger.
I have find a sample in c++ using a dll for ASUS,but that is all.
Searching msdn:
http://msdn2.microsoft.com/en-us/library/aa394493.aspx
Have a look at this C:\WINDOWS\SYSTEM32\wbem\wbemtest.exe  ! powerful tool !
The sample in basic need a cimwin32.dll located here
C:\WINDOWS\SYSTEM32\wbem\cimwin32.dll
The following download sample is a vb script extract from the windows SDK

Sorry for BUMP....

I already download and run it.

but, it always appear message "No temperature probe data"
why is that?

is that script need some device or something?
Title: Re: detecting CPU Temperature
Post by: hutch-- on November 18, 2009, 11:02:49 AM
The problem is that temperature sensors are usually board specific so something that works on a particular board by Asus will not work on a Gigabyte board and likewise the Intel stuff only works on their boards.

Unless it becomes a part of the OS I doubt there will be a universal method any time soon.
Title: Re: detecting CPU Temperature
Post by: alkeiser on November 20, 2009, 01:56:41 PM
hmmmm....
but there is software like RealTemp, CoreTemp and Everest that can sense temperature in any board....

I wonder how they create it...

isn't it using assembly too?
Title: Re: detecting CPU Temperature
Post by: hutch-- on November 20, 2009, 02:53:05 PM
What the few that work tend to do is develop a technique for each board type and do a board detect when they start to ensure they use the correct method for the board. I used to use one that worked on an older Gigabyte Duo but not on the next model that I still have running. I found one by Gigabyte for that board but it was basically designed for the idiot fringe overclockers rather than just monitoring the board.
Title: Re: detecting CPU Temperature
Post by: z941998 on November 20, 2009, 03:32:45 PM
I would try and get a schematic of the motherboard and review it for external heat detecting circuits.
If any are found, you could use the circuitry to calc the address and get the required realtime data, it may be linked to an undocumented interrupt.

I have also seen it where the processor it self calcs the temp and stores it in the BIOS data area (kinda like CMOS), on newer (middle aged) systems.
The problem with this is no direct BIOS routines to call to get info, but if you find out were the data is you can search BIOS for what controls writing of data to that area, then create your own routine to do mimic/get this info.  The software tools will give you a reference also.

Some systems use the hidden ROM to control getting what you need.  This is the hardest of the three methods here to get what you need.