免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3214 | 回复: 2
打印 上一主题 下一主题

请教如何访问ISA BUS和I/O SPACE [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-29 20:13 |只看该作者 |倒序浏览
我知道通过0CF8和0CFC可以访问PCI DEVICE
        unsigned long AccessPci(unsigned long address)
{
        unsigned long readdata=0;
                __asm{

                mov eax,address
                mov dx,0cf8h
                out dx,eax
                mov dx,0cfch
                in  eax,dx
                mov readdata,eax
        }
                return readdata;
}

          请问如何请教如何访问ISA BUS和I/O SPACE

论坛徽章:
0
2 [报告]
发表于 2007-08-29 22:39 |只看该作者
能不能描述清楚一点

论坛徽章:
0
3 [报告]
发表于 2007-08-30 21:21 |只看该作者
例如我知道USB 的Bus:00 DEV:02  Fun :07 REG:00
就可以通过下列程序得到此USB控制器的32位信息
/******************************************************************************
*countaddress:count the PCI device's address
*Input:
* bust,devt,funt,regt
*Output:
* address
*******************************************************************************/
unsigned long countaddress(unsigned long bust,unsigned long devt,unsigned long funt,unsigned long regt)
{
unsigned long address=0x00000000,bus,dev,fun,reg;
bus=bust<<16;
dev=devt<<11;
fun=funt<<8;
reg=regt<<2;
address=bus+dev+fun+reg;
address=address|0x80000000;
return address;
}
/*******************************************************************************
*accesspci: Access PCI device to Read info of device
*Input:
* address
*Output
* PCI info
********************************************************************************/
unsigned long AccessPci(unsigned long address)
{
unsigned long readdata=0;
  __asm{
  mov eax,address
  mov dx,0cf8h
  out dx,eax
  mov dx,0cfch
  in  eax,dx
  mov readdata,eax
}
  return readdata;
}
那么我应该怎样才能得到ISA BUS上的设备信息,或者我知道此USB controler 的IO SPACE 为0x3020,应该怎样才能得到此usb controler 的设备信息。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP