|
|
|
|
 请问在程序中怎么读取CPU的温度 - yulongcn [ 2005-06-13 22:03 | 16 byte(s)]
 Re: 请问在程序中怎么读取CPU的温度 - coly [ 2005-06-16 09:50 | 831 byte(s)]
 Re: 请问在程序中怎么读取CPU的温度 - keyinwind [ 2005-06-22 13:22 | 55 byte(s)]
 Re: 请问在程序中怎么读取CPU的温度 - bx_bird [ 2005-06-16 09:39 | 218 byte(s)]
 Re: 请问在程序中怎么读取CPU的温度 - BNN [ 2005-06-16 08:21 | 390 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
Usually, for a CPU, there are some performance counters or something like that, with which you can read for profiling purpose.
Please get the vendor's CPU spec and see if there is a chapter related to this part. I only did something like control the CPU power usage and...yet did anything about your mentioend here.
Wish helpful,
BNN
|
|
|
----
天若有情天亦老,人间正道是沧桑。
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
usually there is a sensor chip connect to southbridge by i2c bus which can be read/controlled by your program.
and usually it has a alarm pin connect to southbridge to generate interrupt when thermal overload.
|
|
|
----
黑暗中有无尽的美
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
根本的方法就是通过I2C总线去读取温度传感器的数值,一般来说,是通过硬件监控芯片来访问的,而不是直接读取寄存器。PC上比较常见的硬件监控芯片由W83627等。可以通过映射到南桥的寄存器来访问I2C总线,从这个超级IO芯片中读取对应于CPU温度的传感器数值。
一般来所,读到的数值并不是直接可以用的,要根据对应硬件监控芯片的spec来进行数值的转换运算(例如风扇转速可能要求一个倒数),才能得到最终可以读懂的数值。
好在,已经有很多软件将I2C的通信都封装起来了,可以很方便的使用,这方面你可以看看lmsensor是如何做的。如果你指向针对某一个特定的硬件环境来做的话,那么程序可以写的很简单的。
除此之外,在集成了IPMI规范的BMC芯片的主板上,可以通过IPMI协议来访问对应的硬件健康信息,这种方式中,与硬件相关的细节都被BMC中的程序屏蔽了,因此驱动程序只需要通过与BMC通信的系统接口按照协议读取想要的监控信息就行了,非常的方便。
|
|
|
----
|
|
[Original]
[Print]
[Top]
|
|
|