#include #include #include #include #include "bioslib.h" #define kVendorID 0x494F int main(void) { char text[255]; unsigned short DevID=0, CardIndex=0; TPCICommonConfig config; int result, i; byte bn,hm; word iv; clrscr(); printf("\nEnter the Device ID (in hex) of the card to read: "); gets(text); sscanf(text, "%x", &DevID); printf("\nIf there is more than one card with the Device ID %x installed,\n",DevID); printf("enter the card number to read, or press Enter for card number 1. "); gets(text); if (strlen(text)>0) sscanf(text, "%d", &CardIndex); else CardIndex = 1; CardIndex--; if (result = pci_bios_present(&hm,&iv,&bn) == SUCCESSFUL) result = read_pci_config(DevID, kVendorID, CardIndex, &config); if (result == SUCCESSFUL) { puts(""); printf("Device ID: %x\n",config.DeviceID); printf("Vendor ID: %x\n",config.VendorID); for (i=0;i<6;i++) printf("Base Address %d: %x\n",i,config.BaseAddresses[i]&0xfff8); printf("IRQ: %d\n",config.InterruptLine); } else { puts("\nAn error occurred."); } puts("\nPress any key to exit."); getch(); return 0; }