阅读:2132回复:5
请问在win2k下如何得到南北桥芯片信息?
rt,在win2k下写访问端口的驱动访问PCI配置空间似乎行不通,不知有没有其它的方法,比如win2k是否提供有专门的API?谢谢各位
[编辑 - 12/8/04 by ichabod] |
|
沙发#
发布于:2004-12-12 09:02
1,在win2k下写端口驱动读写端口时似乎只能用read_port_uchar等函数,用汇编似乎不行,我尝试过但总是失败,哪位热心的朋友可以告知原因?多谢多谢
2,PCI配置空间的索引寄存器和数据寄存器都是32位的,数据手册上明确有说这两个端口需要按双字访问,那就是说读写端口时只能用read_port_ulong函数了,我确实是按双字访问但读出的配置信息总是出错,是不是win2k对端口的访问还有什么保护?都已经写驱动了啊,而且读CMOS信息(按字节访问)是对的啊...大侠们请帮忙解答 |
|
板凳#
发布于:2005-02-01 10:20
hi , 你好, 在线吗?
|
|
|
地板#
发布于:2005-02-01 10:38
我现在一直想做一件事,就是读取 pci 的信息,象
Vendor ID: 168C Device ID: 0013 SubSystem ID: C1111259 Reversion : 01 Description: Atheros AR5002 Anwi Diagnostic Kernel Driver Driver Provider: Atheros 可是我用如下的代码,out and in 不能使用,应该是要用另一段代码取代掉,可我不晓的怎么写,你有什么建议吗 ? #include "stdio.h" #include "windows.h" DWORD DWORD_In(WORD io_Port) { DWORD val; _asm{ mov dx,io_Port //in eax,dx //write_port_ulong(eax,dx) mov val,eax } return val; } DWORD DWORD_Out( WORD io_Port,DWORD val) { _asm{ mov dx,io_Port mov eax,val //out dx,eax //write_port_ulong(dx,eax) } return 0; } int main() { DWORD io_CF8; // port 0xcf8 DWORD io_CFC; // port 0xcfc int i; io_CF8=0x80000000; //because the first bit is enable/disable for(;;) { DWORD_Out(0xcf8,io_CF8); io_CFC = DWORD_In(0xcfc); if(io_CFC != 0xffffffff) //if = 0xffffffff, then is a invalid bu number and device number { printf("\n PCI device has found , the pci config address = %1x\n", io_CF8); printf("its Bus Number is %1x \n",(io_CF8 & 0x0000f800)/0x800); printf("this device's deviceID and vendorID= %1x\n",io_CFC); for(i=0;i<=15;i++) { DWORD_Out(0xcf8,io_CF8 + 4*i); //read DWORD switch (i) { case 0: printf("Status and Command = "); break; case 2: printf("Class Code and Revision ID = "); break; case 3: printf("Bist and Header Type and Latency Timer and Cacne Line Size = "); break; case 4: // PCI Configration has 6 base address case 5: // register case 6: case 7: case 8: case 9: case 10: case 11: case 13: case 14: printf("Reserved = "); break; case 12: printf("Expansion ROM Base Address = "); break; case 15: // attention:the interrupt IRQ = this result & 0xff printf("Max_Lat Min_Gnt Interrupt Pin Interrrupt line = "); break; } printf("%1x\n", DWORD_In(0xcfc)); } getchar(); } io_CF8 =io_CF8 + 0x800 ; if(io_CF8 >= 0x80FFFF00) { break; } } return 0; } |
|
|
地下室#
发布于:2005-02-03 10:24
我只稍微知道一点WIN2K下的驱动编写方法。如果是写驱动的话请注意参数的传递,我也是在参数传递的方面(当然还有类型的问题)浪费了很多时间,至于其他的我也就不是很清楚了
|
|
5楼#
发布于:2005-02-07 12:01
还是看linux辕马,其中还可发现硬件设计也是bug多多
|
|
|