Hopefully I can answer all of your questions.
Peter:
The card uses the Port I/O space. The system has an INI file the applications use and in there you tell the applications which hardware interface you are using and the port address.
The hardware design is 1980s vintage. They first released it in 1989 and it’s still in production. They are slowly updating the hardware designs, but it has been slow. It’s a small company and they drop all development work when they have a new system to build, which the last few years has been almost constant.
The parallel interface was first designed when the 80386 was the hottest thing on the market and the software was designed for Windows 1.0. Most of my job has been rewriting the Windows code, but I support the drivers too. (My original background was in embedded firmware development, so this isn’t alien territory for me.)
Tim:
The system has worked in the past with the I/O addresses under 0x400 (almost always using the typical addresses for LPT1 or LPT2). When the company builds a new system, they get a legacy PCI to parallel card that supports the old port addresses.
This problem cropped up when a user had a PC failure and replaced it with a new computer with some PCI to parallel card they picked up. The new card appears to only support port addresses like 0x3000. For some reason they can’t get communication between any of the software programs and the external hardware and they think it is the driver. The troubleshooter has worked with these systems since the mid-90s so he knows them well and he said it looks like the driver was where the problem was.
I’m flying a little blind here because the guy from the company troubleshooting the problem is in California, I’m in Washington State, and the system he was troubleshooting was in Singapore. Due to a hardware failure with the development hardware that I had, I currently have no hardware to test anything on (which isn’t a huge problem for the user mode parts of the project, but does make it more difficult for the hardware part).
I don’t think the driver is modifying the permission map. The driver writes with an IOCTL_WRITE_PORT_UCHAR and reads with IOCTL_READ_PORT_UCHAR. From the ap this is done with a call to DeviceIoControl. The driver’s hwinterfaceDeviceControl function parses the call and calls READ_PORT_UCHAR(address) or WRITE_PORT_UCHAR(address, data). The macros
#define IOCTL_READ_PORT_UCHAR CTL_CODE(40000, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_WRITE_PORT_UCHAR CTL_CODE(40000, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS)
In any case, would the system be claiming ports in the 0x3000 range, but not in the 0x378 or 0x278 blocks? It works fine when the ports are in that range.
Don:
This is a PCI to parallel. USB to parallel won’t work. I have a beta USB driver for this system (direct USB communication, no parallel), but they haven’t finished the hardware.
The total data load is very low, but the 125us sub-frame timing killed the system with only one byte per 125us. I had to restructure how the program sent data down the hardware pipe to get acceptable transfer timing. But that’s a completely different issue.
Bill