Read PCI Device Vendor ID
Posted: Thu Apr 11, 2019 7:30 am
I try to use InpOut32 to read the PCI Vendor ID but can't get correct data throught inpOut32.dll
My code please refer below(C#) , Read the RTC Port is ok , But Read/Write the PCI config register get nothing ....
uint Bus_No = 0, Dev = 0, Func1 = 0, VID, DID, count = 0;
uint Val = 0x80000000 + (Bus_No << 16) + (Dev << 11) + ( Func1 << 8 ) ;
uint Rt_Val;
if (IsInpOutDriverOpen_x64() == 1)
{
/* Read PCI Register */
DlPortWritePortUlong_x64(0x0cf8, Val);
Rt_Val = DlPortReadPortUlong_x64(0x0cfc);
Console.WriteLine(Rt_Val.ToString("x")); /* Get 0 */
/* Read RTC Time */
Out32_x64(0x70, 0x00);
uint sec = Inp32_x64(0x71);
Out32_x64(0x70, 0x02);
uint min = Inp32_x64(0x71);
Out32_x64(0x70, 0x04);
uint hour = Inp32_x64(0x71);
Console.WriteLine(hour.ToString("x")+":"+min.ToString("x")+":"+sec.ToString("x"));
}
====Test environment=====
Windows 7 X64 / Win10 X64
Visual Studio Community 2017
My Own Program is 64bit .
====Program exec result===
80000000
0 ->Should read 0x16048086
14:32:23
Thanks you..
My code please refer below(C#) , Read the RTC Port is ok , But Read/Write the PCI config register get nothing ....
uint Bus_No = 0, Dev = 0, Func1 = 0, VID, DID, count = 0;
uint Val = 0x80000000 + (Bus_No << 16) + (Dev << 11) + ( Func1 << 8 ) ;
uint Rt_Val;
if (IsInpOutDriverOpen_x64() == 1)
{
/* Read PCI Register */
DlPortWritePortUlong_x64(0x0cf8, Val);
Rt_Val = DlPortReadPortUlong_x64(0x0cfc);
Console.WriteLine(Rt_Val.ToString("x")); /* Get 0 */
/* Read RTC Time */
Out32_x64(0x70, 0x00);
uint sec = Inp32_x64(0x71);
Out32_x64(0x70, 0x02);
uint min = Inp32_x64(0x71);
Out32_x64(0x70, 0x04);
uint hour = Inp32_x64(0x71);
Console.WriteLine(hour.ToString("x")+":"+min.ToString("x")+":"+sec.ToString("x"));
}
====Test environment=====
Windows 7 X64 / Win10 X64
Visual Studio Community 2017
My Own Program is 64bit .
====Program exec result===
80000000
0 ->Should read 0x16048086
14:32:23
Thanks you..