Mail Archives: djgpp/1998/11/05/02:18:03
Hi,all.
I'm writing a PCI device driver using gcc compiler (DJGPP V2).
In this driver, I use a PCI BIOS function to find my PCI device.
When I try to execute this program under Win95 DOS-BOX, MS-DOS
(CWSDPMI.EXE), This source works fine.
But when under Win98 DOS-BOX, this source does not work.
Why? Does Win98 DOS-BOX differ from Win95 DOS-BOX?
Thanks in advance.
-----<< Source List >>----------------------------------------
#define PCI_FUNCTION_ID 0xb1
#define FIND_PCI_DEVICE 0x02
#define READ_CONFIG_BYTE 0x08
#define READ_CONFIG_WORD 0x09
#define READ_CONFIG_DWORD 0x0a
#define WRITE_CONFIG_BYTE 0x0b
#define WRITE_CONFIG_WORD 0x0c
#define WRITE_CONFIG_DWORD 0x0d
int PCI_find(struct PCI_ID *pci_id, unsigned short int vendor_id,
unsigned short int device_id)
{
union REGS inregs;
union REGS outregs;
int ret_code;
inregs.h.ah = (unsigned char)PCI_FUNCTION_ID;
inregs.h.al = (unsigned char)FIND_PCI_DEVICE;
inregs.w.cx = (unsigned short)device_id;
inregs.w.dx = (unsigned short)vendor_id;
inregs.w.si = (unsigned long int)0;
int86(0x1a, &inregs, &outregs);
ret_code = (int)outregs.h.ah;
if (ret_code == 0) {
pci_id->bus_num = outregs.h.bh;
pci_id->device_num = outregs.h.bl;
} else {
ret_code = 1;
}
return ret_code;
}
--------------------------------- Masayuki Satoh
- Raw text -