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 Kale.

My motherboard manual states:

The hardware monitoring features for temperatures, fans and voltages will occupy the I/O address from 294H to 297H.

any idea how i can read these values using PB to determine the heat, speeds etc...?

--Kale

New to PureBasic and falling in Love! :)
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.

Hi Kale,

This is the main area where i use PB for.
First you need to know what hardware monitor chip your board got. LM78 WD83782D etc...
And you need to know its interface, on ISAbus or SMBus, i think you have chip on ISAbus with that address.
And with the datasheet of the chip, its no problem.

I can read ISA and SMBus now.
If it's on SMBus, you need to find the SMBus baseadr in PCI config space.
i have this working on Intel PIIX4 , Intel 82801BA and Serverworks CSB5 Southbridges.
Hardware monitor chips LM78, WD83781D, WD83782D, ASUS AS99127F

On my homepage, you see my app , wich also monitors RAID controllers, and an AVI of it.
http://www.benny.zeb.be/projects.htm

If you can identify your board's hardware monitor chip, i'm sure i can help you.

If running on NT-W2K-XP, you will need a IO driver like winio to access the chips registers.



Regards,

Berikco

http://www.benny.zeb.be
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 Kale.

The chip used is the Winbond W83697HF super I/O chip. It connects to the Southbridge's LPC interface.

--Kale

New to PureBasic and falling in Love! :)
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.

Hehe, the WD83627HF i'm working on now.
But my TYAN Board uses its SMBus to connect to it.
On ISA is easyer.
I will post a sample using winio later....
i have to rewrite, because i use TvicHW32 for portIO wich is not free




Regards,

Berikco

http://www.benny.zeb.be
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 SoulTaker.

Hi Berikco,

I wrote a C DLL for Visual Basic to do I/O for an I/O card i bought for my system, but it was ISA my new System is all PCI and AGP. If it will help i could dig up the DLL source and see if i can make it work in PureBasic?



Abit BD7-II Raid P4 1.9 gHz 384 Ram Xtasy GFroce 3 TI 200 CD-RW DirectX 9.0 Beta 3 Sound Blaster Live! XP Pro, Registered PureBasic User Version 3.40 For Windows.
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 Danilo.

My DLL import for WinIO is http://home.t-online.de/home/ExpressTrack/PB_WinIO.zip since some month...
Made with earlier version of DLL-importer - i´ll redo this import later.

cya,
...Danilo

(registered PureBasic user)
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.

Hi Kale,


I quicly wrote something using Danilo's dll import above.
Should give the temperature of mainboard.
I can't test, W83697HF is on SMBus here.

Code: Select all

If InitializeWinIo()  SetPortVal($295, $27, 1)  ; mb temp
  GetPortVal($296, @result, 1)
  MessageRequester("Temp ",StrU(result,#byte),0)
Else
  MessageRequester("ERROR","Error initializing WinIO driver",0)
EndIf

ShutdownWinIo()
You just write the register you want to read to $295
And read it's value at $296



Regards,

Berikco

http://www.benny.zeb.be
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 Kale.

great ill give it a go when i get back home :)

--Kale

New to PureBasic and falling in Love! :)
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.
Originally posted by Kale

great ill give it a go when i get back home :)
Okay, if this works, al others is very easy.
Temp is reported as is.
All other values need some calculations, like 3.3V is reported in steps of 16mV
If works, check in BIOS if values ar the same.

Regards,

Berikco

http://www.benny.zeb.be
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 Kale.

hmmm, im having no luck in getting this to work. how is Danilo's dll import installed?

I tried another way using win95IO.dll with this code:

Code: Select all

If OpenLibrary(0, "win95io.dll")
    If CallFunction(0, "out", $295, $27)
        result = CallFunction(0, "inpb", $296)
        debug result
    Else
        MessageRequester("Error...", "Error!", 0)
    EndIf
EndIf
repeat
until forever
guess what? i get a crash, he he... i'm sure somethings wrong, but i've never attempted anything like reading hardware before, any ideas?

--Kale

New to PureBasic and falling in Love! :)
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.

What's your OS?


Regards,

Berikco

http://www.benny.zeb.be
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 Kale.

im using WinXP Pro, ABit KX7-333 mobo

--Kale

New to PureBasic and falling in Love! :)
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.

Looks like and old WinIO release, only for win9x.
Check here http://www.internals.com/


Regards,

Berikco

http://www.benny.zeb.be
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.

Looks like WinIO likes the winio.sys driver with the app.
Other IO soft i use have .sys driver in system32\drivers.
I put the winio.dll and winio.sys in purebasic\compilers.
Works fine now....Thx Rings.:)

Regards,

Berikco

http://www.benny.zeb.be
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 Kale.

right i've got this working now using this code:

Code: Select all

If OpenLibrary(0, "WinIo.dll")

    CallFunction(0, "InitializeWinIo")
    
    ;System Temperature
    CallFunction(0, "SetPortVal", $295, $27, 1)
    CallFunction(0, "GetPortVal", $296, @systemTemp, 1)
    Debug systemTemp
    ;MessageRequester("Result...", "System Temperature: "+StrU(systemTemp, #byte)+"ºC", 0)
    CallFunction(0, "ShutdownWinIo")

EndIf
this reports the system temperature (i assume) i checked this value using another piece of monitoring software. but how do i get the other values? surely voltages will be returned as floats? or do i have to perform some calculation of the returned value? in this piece of code:

Code: Select all

CallFunction(0, "SetPortVal", $295, $27, 1)
the register $27 is written to the address $295 to return the sys temp, so what other registers can you write? is there somewhere i can see a ref on this chip online?

and thanks for your help so far :)

--Kale

New to PureBasic and falling in Love! :)
Post Reply