Discussion Locked

Interrupts in Win95/98 in DOS mode

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I wrote a C routine to handle the IRQ7 printer interrupt (ACK going low) and it works correctly running on a 286 DOS only PC. The program will not run in DOS mode on a PC running Windows 95 even when I reboot the PC in DOS mode only. The following code sets the interrupt. Any help will be greatly appreciated.

void install_lpt1_ack_interrupt(void)
{
int code, temp;

// use DOS to set the interrupt vector for interrupt 0x0F
//which is IRQ7 (LPT1) if a transition of the ACK#
// signal from a high to low occurs
_disable();
old_lpt1_ack_vector = _dos_getvect(0x0F);
_dos_setvect(0x0F,lpt1_ack_int);

// set IRQ bit high in control register to enable printer iRQ
code = inportb(0x37A);
code = code | IRQ_HIGH_MASK;
outportb(0x37A,code); //set IRQ bit high

temp = inp(0x21); // unmask IRQ7 LPT1 interrupt
// IRQ7 located thru port 21
temp &= ~0x80; // bit 7=0 -> enable

outportb(0x21,temp); // 0 = enable

_enable();

}
/////////////////////////////////
The interrupt handler is as follows:
void interrupt lpt1_ack_int(void)
{

++ack_count; // global variable

outportb(0x20,0x20);
}

5 replies

by lat

Have you tried to go into the BIOS of the PC and see if it is set to SPP. In newer PC's there are settings for EPP, ECP, EPP/ECP and these settings are used for newer bi-directional printers on LPT ports. If the program ran on an older hardware platform, then this may be the problem. Also, look for
settings in the PCI/ISA IRQ handling the
requests in the BIOS.
Good luck.
lt

by lat

Have you tried to go into the BIOS of the PC and see if it is set to SPP. In newer PC's there are settings for EPP, ECP, EPP/ECP and these settings are used for newer bi-directional printers on LPT ports. If the program ran on an older hardware platform, then this may be the problem. Also, look for
settings in the PCI/ISA IRQ handling the
requests in the BIOS.
Good luck.
lt

This discussion is closed to new replies.