reading motherboard I/O address?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

No problem, we all like to help here :)
And thanks to Pupil also, now i can add another chip to my RAIDmonitor program :)

Regards,

Berikco

http://www.benny.zeb.be
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: reading motherboard I/O address?

Post by doctorized »

I want to read system temperature, fans' speed etc. Is there any working code available?
I use openlibsys and till now I can take the sensor's code number by reading at port $2F and writing at port $2E.
I can also take the "base address", as cpu-z refers it. I do not know where exactly is needed.

Code: Select all

;I am not sure if the following four lines are really needed.
WriteIoPortByte($2E,$87)
WriteIoPortByte($2E,$01)
WriteIoPortByte($2E,$55)
WriteIoPortByte($2E,$55)

WriteIoPortByte($2E,$20)
SensorChipID.l = ReadIOPortByte($2F) & $FF
WriteIoPortByte($2E,$21)
SensorChipID = (SensorChipID << 8) | (ReadIOPortByte($2F) & $FF)
Debug Hex(SensorChipID)
;Switch to the sensor logical device
WriteIoPortByte($2E,7)
WriteIoPortByte($2F,4)
;Get the IO base address
WriteIoPortByte($2E,$60)
tmp.l = ReadIOPortByte($2F) & $FF
WriteIoPortByte($2E,$61)
tmp = (tmp << 8) | (ReadIOPortByte($2F) & $FF)
Debug Hex(tmp)
;Check the activation register and base address
WriteIoPortByte($2E,$30)
tmp1.l = ReadIOPortByte($2F) & $FF
If tmp1 & 1 = 0
	If tmp
		Debug "address " + Str(tmp) + ", but not activated"
	Else
		Debug "not activated"
	EndIf
EndIf
If tmp = 0
	Debug "no address specified"
Else
	Debug "SUCCESS"
EndIf
Post Reply