problem with read/write PCI Bus port

My x64 port of InpOut32
Post Reply
starca
New User
Posts: 1
Joined: Sun Nov 11, 2012 11:29 pm

problem with read/write PCI Bus port

Post by starca » Sun Nov 11, 2012 11:50 pm

Hi Everyone:

I try use inpout32.dll to read/write PCI bus port to find out SMBUS controler base address, but the result read back is not correct. I can use WinIO to get correct result, but their x64 driver didn't signed.

the code like

// C# scan pci bus
for (io_cf8 = 0x80000000; io_cf8 < 0x80ffff00; io_cf8 += 0x100)
{
DlPortWritePortUlong(cf8, io_cf8) ;
io_cfc = DlPortReadPortUlong(0xcfc);
if ((io_cfc != 0x00000000) && (io_cfc != 0xffffffff) && (io_cfc != io_cfc_bak))
{
DlPortWritePortUlong(0xcf8, io_cf8 + 8 ) ;
UInt32 classcode = DlPortReadPortUlong(0xcfc);
if ((classcode / 0x100) == SMBUS_Classcode)
{
Bus = (io_cf8 - 0x80000000) / 0x10000;
Device = ((((io_cf8 - 0x80000000) & 0xffff) & 0xff00) >> 3) / 0x100;
Func = ((((io_cf8 - 0x80000000) & 0xffff) & 0xff00) & 0x7ff) / 0x100;
........

on Asus M2V motherboard(AMD cpu), to find smbus controller, when io_cf8=2147524608 (0x8000a000),
iocfc read back shold be 1132793858 (0x43851002), should be differernt on other morthboard.
But it always return 65536.

Does anybody know why or have been seen this issue.?

thanks

schnappi
New User
Posts: 1
Joined: Wed Nov 14, 2012 7:46 am

Re: problem with read/write PCI Bus port

Post by schnappi » Wed Nov 14, 2012 8:33 am

Hi,

I can get the correct value sometimes, but I also get incorrect value 0, 65535, 0x0000C000, 0xBB800000...etc sometimes. My CPU is Intel. I try to add delay function, but it's still the same.

http://who-know.com/InpOut32_PCI.png

Post Reply