Subject: Re: console polling interrupts?
To: =?UNKNOWN-8BIT?Q?Jarom=EDr_Dolecek?= <>
From: David Querbach <>
List: tech-kern
Date: 06/18/2001 10:24:41
> Bill Sommerfeld wrote:
> > Is there some way that you could
> > disable/enable *just* the keyboard controller interrupt in cnpollc()?
> > either at the keyboard controller or the interrupt controller?
> > 
> > I know this is possible with the 8259 as used in a "normal" PC..  not
> > being familiar difference between "normal" PC and PS/2 interrupt
> > controller usage, I can't say for sure that it would work for the PS/2
> > but it seems cleaner..
> Yeah, this should work (the kbc in PS/2 should be pretty standard
> 8259 or very similar). I don't have docs for the 8259 and the source
> doesn't seem to reveal any hints on disabling it's interrups (I searched
> the code on the very start). How it can be done?

The 8259 is the interrupt controller, not the keyboard controller.  If
memory serves, the AT keyboard controller was a mask-programmed single-chip
micro of some kind.  I'm not sure where to find docs for it.

If at all possible, please mask the keyboard interrupt at the keyboard
controller rather than at the interrupt controller, since there is not (to
my knowledge) a machine-independent API for manipulating interrupt masks at
the interupt controller other than the ipl mechanism.

The closest we currently have would be to intr_disestablish() the keyboard
handler when enabling polling, then to intr_establish() it when disabling
polling.  In fact, this seems the most appropriate method to temporarily
disable interrupts from a given device if the device itself does not have a
local disable bit.  This method avoids interfering with the MD code's
possible use of the interrupt controller's mask bits to implement the ipl


David Querbach
Real-Time Systems Inc.