[comp.os.msdos.programmer] AT PIC, interrupts different?

mh2o+@andrew.cmu.edu (Michael Lorenz Holling) (06/25/91)

I'm having a problem after moving hardware from an XT to an AT.  The hardware
in question is a MIDI card which is supposed to generate interrupts for a
variety of reasons.  It worked fine on the XT, however on the AT only one
interrupt occurs.  I'm guessing it's a problem manipulating the PIC.  On the
XT I would write 0x20 to port 0x20 to reset the interrupt.  Is there something
different I need to do on the AT?  I'm using IRQ 2, is there any hardware which
might be using this line?

Thanks,
- Mike

jdstovin@cs.man.ac.uk (John Stovin (RNZ ra)) (06/26/91)

In article <4cNX5sO00VpOQ4c0M1@andrew.cmu.edu> mh2o+@andrew.cmu.edu (Michael Lorenz Holling) writes:
>I'm having a problem after moving hardware from an XT to an AT.  The hardware
>in question is a MIDI card which is supposed to generate interrupts for a
>variety of reasons.  It worked fine on the XT, however on the AT only one
>interrupt occurs.  I'm guessing it's a problem manipulating the PIC.  On the
>XT I would write 0x20 to port 0x20 to reset the interrupt.  Is there something
>different I need to do on the AT?  I'm using IRQ 2, is there any hardware which
>might be using this line?
>
>Thanks,
>- Mike

Your problem is that the AT has 2 PICs, with the second chained from the
IRQ2 input of the first. You have to reset the interrupts on the chained
PIC as well (I can't remember the port address, but any good reference
should tell you.)




--
==================================================================
 John Stovin, DSP Group, Rm 2.19, Department of Computer Science,
 University of Manchester, Oxford Road, Manchester, M13 9PL, U.K.
 Internet: jdstovin%cs.man.ac.uk@nfsnet-relay.ac.uk  
 Janet: jdstovin@uk.ac.man.cs             |Tel: (+44) 61-275 6210
 UUCP: ...!uunet!mcsun!ukc!man.cs!jdstovin|Fax: (+44) 61-275 6236
==================================================================
"Diane, I am holding in my hand a box of chocolate bunnies."

mir@opera.chorus.fr (Adam Mirowski) (06/27/91)

In article <2796@m1.cs.man.ac.uk>, jdstovin@cs.man.ac.uk (John Stovin (RNZ ra)) writes:
%% In article <4cNX5sO00VpOQ4c0M1@andrew.cmu.edu> mh2o+@andrew.cmu.edu (Michael Lorenz Holling) writes:
%% >I'm having a problem after moving hardware from an XT to an AT.  The hardware
%% >in question is a MIDI card which is supposed to generate interrupts for a
%% >variety of reasons.  It worked fine on the XT, however on the AT only one
%% >interrupt occurs.  I'm guessing it's a problem manipulating the PIC.  On the
%% >XT I would write 0x20 to port 0x20 to reset the interrupt.  Is there something
%% >different I need to do on the AT?  I'm using IRQ 2, is there any hardware
%% >which might be using this line?
%%
%% Your problem is that the AT has 2 PICs, with the second chained from the
%% IRQ2 input of the first. You have to reset the interrupts on the chained
%% PIC as well (I can't remember the port address, but any good reference
%% should tell you.)

	[I would say the opposite: the first interrupt controller number 2]
	[input - you cannot really call it IRQ2 here - is fed from the INTR]
	[output of the second one. The complete version is:]

The IRQ2 line on your 8 bit MIDI card goes into the IRQ9 line on the AT
bus. The true IRQ2 line is not accessible on the AT bus.

The IRQ9 is said "not used" by the system, at least in Compaq TR.

When an interrupt occurs on the IRQ9 line, a BIOS routine is called by
default (int 71h), and it acknowledges the second interrupt controller
(out 0A0h, 20h), then calls the 0Ah software interrupt, which is asso-
ciated with IRQ2 on an XT. You could disassemble this very small handler
on your machine to see if it really acts in this way.

So, in principle, it is not necessary to change a driver for IRQ2 when
putting it, along with the hardware, on an AT.

But acking the interrupt on the very beginning of the routine is not
necessarily what your MIDI card likes. Some peripherals prefer that
you first read a status register, put something into a command register,
etc., before letting them issue another interrupt.

Sorry, I don't have any advice... :-)
-- 
Adam Mirowski,  mir@chorus.fr (FRANCE),  tel. +33 (1) 30-64-82-00 or 74
Chorus systemes, 6, av.Gustave Eiffel, 78182 Saint-Quentin-en-Yvelines CEDEX