*BSD News Article 10386


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA34 ; Wed, 27 Jan 93 13:11:27 EST
Xref: sserve comp.unix.bsd:10439 comp.sys.ibm.pc.hardware:42329
Newsgroups: comp.unix.bsd,comp.sys.ibm.pc.hardware
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!caen!umeecs!quip.eecs.umich.edu!dmuntz
From: dmuntz@quip.eecs.umich.edu (Dan Muntz)
Subject: Programming the 8259 (and a possible 386bsd bug)
Message-ID: <1993Jan26.170934.5461@zip.eecs.umich.edu>
Sender: news@zip.eecs.umich.edu (Mr. News)
Organization: University of Michigan EECS Dept., Ann Arbor, MI
Date: Tue, 26 Jan 1993 17:09:34 GMT
Lines: 23

I'd like to know what people have found to be good (accurate/complete) sources
of information about programming the 8259 as it is used in 386/486 machines.

In isa.c in 386bsd the following sequence is used to initialize the "lower"
8259:

	/* initialize 8259's */
	outb(IO_ICU1, 0x11);            /* reset; program device, four bytes */
	outb(IO_ICU1+1, NRSVIDT);       /* starting at this vector index */
	outb(IO_ICU1+1, 1<<2);          /* slave on line 2 */
	outb(IO_ICU1+1, 1);             /* 8086 mode */
	outb(IO_ICU1+1, 0xff);		/* leave interrupts masked */
	outb(IO_ICU1, 2);		/* default to ISR on read */

According to the meager amount of information I've found, the last line
should be outb(IO_ICU1, 3); to select ISR on read (or the comment should
say IRR instead of ISR).  From other points in the code, it appears that
ISR is expected.  If this line is wrong, the other 8259 is also being
initialized incorrectly.  Can anyone shed some light on this?

  -Dan
   dmuntz@eecs.umich.edu