Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
PCIS_INT.CPP
Package: PCIAccess.rar [view]
Upload User: whzhdz
Upload Date: 2007-03-07
Package Size: 6k
Code Size: 1k
Category:
Embeded-SCM Develop
Development Platform:
DOS
- #include <stdio.h>
- #include <conio.h>
- #include <dos.h>
- void main(void)
- {
- int bus, device, func, regindex;
- union REGS regs, outregs;
- unsigned long lo, hi, ovalue;
- unsigned long BaseAddr;
- clrscr();
- func = 0;
- regindex = 0;
- for(bus=0; bus<5; bus++)
- {
- for(device=0; device<32; device++)
- {
- regs.h.bh = bus;
- regs.h.bl = (device<<3) | (func & 0x07);
- regindex = 0;
- regs.x.di = regindex;
- regs.x.ax = 0xB109;
- int86(0x1A,®s,&outregs);
- lo = outregs.x.cx;
- regs.x.di = regindex + 2;
- int86(0x1A,®s,&outregs);
- hi = outregs.x.cx;
- ovalue = hi*65536l+lo;
- if (lo != 0xffff)
- {
- printf("nBus = 0x%xn", bus);
- printf("Device = 0x%xn", device);
- printf("ID = %lxn", ovalue);
- for(BaseAddr=0; BaseAddr<=5; BaseAddr++)
- {
- regindex = 0x10 + BaseAddr*4;
- regs.x.di = regindex;
- int86(0x1A,®s,&outregs);
- lo = outregs.x.cx;
- regs.x.di = regindex + 2;
- int86(0x1A,®s,&outregs);
- hi = outregs.x.cx;
- ovalue = hi*65536l+lo;
- printf("Base%d: Low = 0x%xtHi = 0x%xn", BaseAddr, lo, hi);
- }
- regindex = 0x3c;
- regs.x.di = regindex;
- int86(0x1A,®s,&outregs);
- lo = outregs.x.cx;
- printf("IRQ# = %dn", lo & 0xff);
- getch();
- }
- }
- }
- }