Unmasking IRQs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Larry

Unmasking IRQs

Post by Larry »

to unmask an IRQ I use
outbyte(MASTER + 1, IRQ & 0xFF);
That means that I set the bit for the IRQ I want to unmask to '1'. But the FAQ says that
outb(0x21,0xfd);
unmaskes the keyboard..here all bits are set to 1, except for the one I?d like to unmask? Should I set a bit to 1 och 0 if I wanna mask/unmask the IRQ?

And how do I unmask an IRQ on the slave? And how do I mask the IRQs
pkd

Re:Unmasking IRQs

Post by pkd »

hi,

to unmask an irq you set the bit to zero

and to use the slave irqs you unmask bit 2 (cascade) and then unmask the irq on the slave (port 0xa1);

bye
pkd
Larry

Re:Unmasking IRQs

Post by Larry »

Do I have to rewrite the entire mask-byte? If it?s something like this:

11101010

and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
DennisCGc

Re:Unmasking IRQs

Post by DennisCGc »

Larry wrote: Do I have to rewrite the entire mask-byte? If it?s something like this:

11101010

and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
Yes...
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Unmasking IRQs

Post by Brendan »

Hi,
Larry wrote: Do I have to rewrite the entire mask-byte? If it?s something like this:

11101010

and I wanna change the first bit.. do I have to read the bit, OR it with 0x1 and the rewrite it?
IO port access is slow. It's possible to cache the PIC mask value in RAM, e.g.:

Code: Select all

  mov al,[currentPIC1maskValue]
  or al,1
  mov [currentPIC1maskValue],al
  out PIC1+1,al
Instead of:

Code: Select all

  in al,PIC1+1
  or al,1
  out PIC1+1,al

Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply