flat assembler
Message board for the users of flat assembler.

Index > Main > reading sensor data

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
how do i read cpu temperature, fan speed, etc?
Post 14 Oct 2010, 14:05
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Hello Wink
Usually in PC desktop there are Super I/O chip, ( I/O ports 0x2e 0x2f or 0x4e 0x4f LPC bus ) with integrated Hardware Monitor register ( within Super I/O or SMBus), in notebook Embedded Controller chip , in both cases you need the datasheet of your device
Cool

_________________
Nil Volentibus Arduum Razz
Post 14 Oct 2010, 14:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
b1528932 wrote:
how do i read cpu temperature, fan speed, etc?
Download Speedfan.
Post 14 Oct 2010, 14:28
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Post 14 Oct 2010, 16:34
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
if im asking on asm forum, how obvious is that im not interested in programs?


do you have some more info about super io?
Post 14 Oct 2010, 16:41
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
You'll probably have some luck by looking at lm-sensors sources. In some cases the specs are public, for instance this is the one my motherboard has: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83627THFd.pdf

What I didn't find info about when I was trying to write an alarm to know when the chipset fan get stuck, was how to coordinate access to the chip. It is clear that I had to perform in/out operation on ports with 290h base, but how to make sure no other program is not operating the chip at the same time?

The fan became useless so I've pulled it out, and used 80mm fan extracted from a defunct PSU in front of the chipset so my interest ceased since then Razz
Post 14 Oct 2010, 17:42
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
To Loco Wink
Code:
    MOV    DX,295H        ; INDEX  Base Address + 5
@@:    
    IN    AL,DX        ; Read status Device
    TEST    AL,80H        ; bit 7 = 1 ? ( Device Busy ? )
    JS    @B            


I wrote a tool to detect Super I/O but it has a very limited database ( Device Support )anyway this chpset are supported:

Code:
;---------
; WINBOND
;---------

W83627HF
W83627HG              
W83627HF/HG
W83627F
W83627G
W83627F/G
W83627THF
W83627THG            
W83627THF/HG
W83627SF
W83637HF
W83637HG
W83637HF/HG
W83697F
W83697HF
W83697SF
W83697UF/UG
W83627DH
W83L517D/D-F
W83627EHF/EHG
W83627EF/EG
W83627UHG


;---------
; ITE
;---------

IT8510E/TE/G
IT8511E/TE/G
IT8700F
IT8702F
IT8705F/AF
IT8710F
IT8711F
IT8712F
IT8761E

;---------
; SMSC
;---------

LPC47M172
LPC47B27x
LPC47B37x
LPC47U33x
LPC47B34X
LPC47S42x
LPC47M10x/LPC47M112/LPC47M13x
LPC47M14x
LPC47M15x/LPC47M192
LPC47M182
    

Search the datasheet of this device and write your tool... Razz

_________________
Nil Volentibus Arduum Razz
Post 14 Oct 2010, 19:14
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
DJ Mauretto, sure that simple? Still, although somewhat unluckily, two threads may successfully detected the not-busy condition and attempt to start an operation on the device.

Probably none of the free and commercial tools out there cares about this anyway and access the device freely though... (Do you happen to have some reversing done of any of the tools showing how is this done? Razz)

Thanks for the code anyway.
Post 14 Oct 2010, 19:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
LocoDelAssembly: This is why we have driver models. So that multi-threading OSes can make sure the access is properly partitioned and coordinated. The "proper" way would be to find the driver that is designated to handle that device and use driver control functions to do the work.
Post 15 Oct 2010, 00:05
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
And of course I've considered that and not such a thing exists... You could see that in SpeedFan for instance, which use a driver to get access to the hardware, but in no way it expects an installed device-specific driver to query the sensor data.
Post 15 Oct 2010, 00:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
If there is no driver for it then it is probably being controlled by SMM. In which case you have no way of coordinating it, you just have to hope for the best.
Post 15 Oct 2010, 00:34
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Sorry but I never think in terms of operating systems,
I like hardware and system programming, but independent of the various operating systems,
if you want to experiment with the hardware there is only a platform, Real Mode or DOS,
or a mini operating system written by you Wink
If you like experimenting with the hardware in an operating system must follow the procedures set by your operating system, very boring ..

_________________
Nil Volentibus Arduum Razz
Post 15 Oct 2010, 12:10
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2913
Location: [RSP+8*5]
bitRAKE
In most cases ACPI needs to be told the OS is to manage devices connected to thermal management (if it can be controlled). Otherwise BIOS assumes a legacy system which will not interfere - SMM is setup to protect hardware by BIOS. DOS doesn't mean full hardware access on my machines - have to preempt BIOS for that. Wink
Post 16 Oct 2010, 01:39
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.