Re: ISA driver in Win2k

Hello,

Here are my suggestions:

  1. As the card’s ports are 8-bit, you should try using READ_PORT_UCHAR instead of READ_PORT_USHORT for accessing the IO ports
  2. I never used the HalAllocateResource function, despite that I was able to communicate with the hardware. What I used was the translated IO port address (which happens to be the same as the untranslated one). In NT I used the HalTranslateBusAddress routine for getting the translated IO address (you get the PHYSICAL_ADDRESS as a result, and to convert it to a PUCHAR please take (PUCHAR) physicalAddress.LowPart). In Win2K you don’t have to call any function to get the translated resources - you just specify the resources in your driver’s .inf file and then read the assigned hardware configuration when handling IRP_MN_START_DEVICE Irp (this is a PnP Irp).

Regards,
Rafal

----- Original Message -----
From: Yogesh
To: xxxxx@poczta.onet.pl
Sent: Friday, January 10, 2003 2:22 PM
Subject: ISA driver in Win2k

hi Rafal,
i had a problem reading/writing to a ISA bus card (non PnP) from a kernel mode driver. All the registers of the card are 8bit long. i have trouble reading it even after allocating driver resources for the card successfully, using the routine HalAllocateResource. I am using READ_PORT_USHORT as the address of the port is 0x2f4 and i always get 0xffff as the value read.
Any comments/code would be of great help.

thanks in advance,
Yogesh