Hi,
I have a project to do where I must display the CPU temperature. How should I do this?
Here I have a window wich has a timer and I need to display the CPU temperature too.
Thanks
Hi Rusica,
first things first: welcome to the forum.
To your question. That's a bit tricky. You have to check the temperature feature with the CPUID instruction. Set EAX = 1 and check the bit 22 of register EDX. Details could you find here (http://www.alterbit.ru/files/11.pdf).
Gunther
Thanks, but it's a bit harder for me, because I didn't work with masm before. I am a "rookie", but I want to learn.
Hi Rusica,
Quote from: Rusica on April 30, 2014, 03:31:08 AM
Thanks, but it's a bit harder for me, because I didn't work with masm before. I am a "rookie", but I want to learn.
the best thing you can do is to download the MASM32 package (download link in the upper right corner of the forum home page). It has a lot of examples and tutorials.
Gunther
A few other hints. There you'll find ADVANCED CONFIGURATION AND POWER INTERFACE SPECIFICATION (ACPI) specification (http://www.acpi.info/DOWNLOADS/ACPIspec50pdf.zip). It has over 900 pages and is a playground for the "overclocker". The next article describes the access of the driver ACPI.sys (http://msdn.microsoft.com/en-us/library/windows/hardware/Dn614028%28v=vs.85%29.aspx). Good luck.
Gunther
Using thermal monitor is privileged instruction, so fully relies on OS and returning to applications with help of WMI (http://theroadtodelphi.wordpress.com/wmi-delphi-code-creator), but seems that this not fully supported on client OSes, so best way is simple not to overload CPU usage, as I already recommended in BitBlt And CPU 100% (http://masm32.com/board/index.php?topic=3137.30) thread.
Thank you! I'll do that.
For the moment, can anyone help me with my homework, because ai did all I can do for now, and I need to do it imediately? :D
This is not a homework site unfortunately maybe google can offer you the help you need.
it's a tough assignment
some CPU's don't support tempurature
also - if you are running XP or earlier, you can use a driver
Vista and later have WHQL issues
CPU percentage is more easier to display in that window?
Rusica,
If you are running Windows, and all you want is CPU percentage, then use the Task Manager, Performance Tab. But, that does not fulfill the homework task.
Dave.
Getting LoadPercentage from WMI is really simple and straitforward ( unlike CPU temperature ,read the last post in this thread (http://social.msdn.microsoft.com/Forums/en-US/18ce0701-e87d-4414-a8b5-8be3908a21b8/reading-cpu-temperature-wmi?forum=vblanguage) if you want to know why)
Quote
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
comment * -----------------------------------------------------
Build this template with
"CONSOLE ASSEMBLE AND LINK"
----------------------------------------------------- *
.code
start:
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
call main
exit
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
main proc
invoke WinExec,chr$("wmic cpu get LoadPercentage /format:list /every:1 "),0 ; updates every second
ret
main endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end start
Press CTRL-C (or any key when prompted) to terminate it
Hi Rusica,
Quote from: Rusica on April 30, 2014, 04:33:01 AM
For the moment, can anyone help me with my homework, because ai did all I can do for now, and I need to do it imediately? :D
it's very simple: we've a NO HOMEWORK Rule, which you can find here (rule #9) (http://masm32.com/board/index.php?topic=4.0). But we can help finding errors and weaknesses in code which you provide.
Gunther
we don't mind helping
but, we won't do all the work for you
a common misconception is that an urgency on your part creates an emergency on ours :lol:
not our fault if you wait til it's due to ask for help
Super Dave,
I feel that displaying the CPU temp is a harder project than writing an O.S. :-)
It is not a homework assignment unless the Professor is cruel. :-)
No offense intended to Gunther. :-)
Andy
it is a cruel assignment - lol
especially if you want one that runs on XP, Vista, Win7, and Win8