Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!caen!hellgate.utah.edu!peruvian.utah.edu!msmith From: msmith%peruvian.utah.edu@cs.utah.edu (Matthew Smith) Newsgroups: comp.os.msdos.programmer Subject: Re: Programming interrupts on an AT Keywords: interrupt,irq Message-ID: <1991Jun19.125302.4455@hellgate.utah.edu> Date: 19 Jun 91 18:53:01 GMT References: <1991Jun18.235514.9294@metro.ucc.su.OZ.AU> Sender: Matt Smith - msmith@peruvian.utah.edu Organization: University of Utah CS Dept Lines: 45 In article <1991Jun18.235514.9294@metro.ucc.su.OZ.AU> lawson@suphys.physics.su.OZ.AU (Peter Lawson) writes: >I have been writing code for DMA data acquisition based on an article >which appeared in Jan. 1990's "Dr. Dobb's Journal". The MS C example that >he gives shows how to program an interrupt service routine for a PC, >which only has one 8259A Programmable Interrupt Controller and therefore >only supports interrupts 0 through 7. > >I would like to know how to program interrupts on an AT, and I would be >very grateful for good references. The AT has two 8259A chips, which are >set up in a master-slave configuration; the slave chip appears as only >one other interrupt line to the master chip (usually interrupt line 2). >I would like to use interrupt level 11, but don't know how to approach it. >The programming of the two chips is a bit more complicated. I have all the >addresses for the chips, from my cryptic computer manual, but I'm not >sure how the masks are to be set up. I assume that "Dr. Dobb's" has had >articles on the subject, but this university doesn't subscribe to it. >Any help would be greatly appreciated. > >Peter. > >Astronomy Department. Sydney University >NSW 2006 Australia. Hi there. Actually, it's not too difficult to set up the chips for whatever interrupt programming you want to do. The mask is very simple, bits 0 through 7 on the first 8259 correspond to IRQ's 0-7 (interrupts 8-15), and the same bits on the second 8952 correspond to IRQ's 8-15 (interrupts 16-23). If a 0 is in the n-th bit, then the n-th IRQ is enabled, if a 1 is in the spot, then the IRQ is disabled. To write a particular mask to the chip, you use the addresses you found, and do an outport(addr,mask), where addr is the address of the chip you want to change, and the mask is the bitmask to place in the chip. I remember that the address of the first chip is 0x20, but I don't recall the second address. What is it?? After that, writing programs for a particular interrupt use the functions getvector() and setvector() to modify the interrupt table to point to your function when an interrupt occurs. I hope this helps... Matt Smith msmith@peruvian.utah.edu