OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Oct 30, 2020 8:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: My interrupts won't fire more than once
PostPosted: Fri Apr 24, 2015 6:47 am 
Offline
Member
Member
User avatar

Joined: Thu Apr 16, 2015 7:37 am
Posts: 64
Thanks to previous help on the forum, I managed to get basic interrupts working today, almost. I say almost, because I can get my ISR to run when I press any key on the keyboard, but then, it won't fire any more. I decided to open up the debugger for virtual-box, and get info about the PICs, to see if anything was wrong.

This is the part where I'm stuck, as the display of information about the PIC mostly makes sense, except for one field. I'll include a picture of an info dump of the pics, once before the first key-press, and once after the first key-press.

Image

As you can see, the two dumps are almost identical, except for the LIRR register in the master PIC. It goes from 1, to 3, which means that something happened with bit 1 (for interrupt line 1, the keyboard). However, I don't know what the LIRR is. I know the IRR is for which lines are requesting interrupts, which makes sense (bit 0, or line 0, is that clock thingy that ticks 18 times a second, so I'd expect it to be on), but is this LIRR the same or different? If it is the same, does this mean there is a problem with the way I sent EOI?

I can provide my code if needed, but I'm hoping that I've already provided enough info for somebody to suggest a solution or test I could run to find the problem. If you have any solutions, or even things that you need me to test, let me know, I would greatly appreciate it.

Thanks for providing such a helpful forum,
Mikumiku747


Top
 Profile  
 
 Post subject: Re: My interrupts won't fire more than once
PostPosted: Fri Apr 24, 2015 7:07 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1067
Location: Germany
If you don't get a second interrupt, generally you didn't handle the first one correctly/completely. In the case of the keyboard controller, you have to read out the buffer before a second interrupt will be generated. And don't forget the EOI, of course.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: My interrupts won't fire more than once
PostPosted: Fri Apr 24, 2015 7:14 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9288
Location: On the balcony, where I can actually keep 1½m distance
LIRR is documented as "Last IRR", or rather, it contains the electrical status of the IRQ lines. For legacy, an IRQ is only generated when the IRQ line goes high, not when it is high.

Hence, when IRR is clear while LIRR is not, the PIC thinks a previous interrupt was handled, but the device didn't. For this you'll actually want to read from the keyboard controller rather than merely printing a message on a keypress

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: My interrupts won't fire more than once
PostPosted: Fri Apr 24, 2015 7:37 am 
Offline
Member
Member
User avatar

Joined: Thu Apr 16, 2015 7:37 am
Posts: 64
Ok, thanks for the tip :wink: , I had assumed that the keyboard just sent an interrupt every time a key was pressed, but not so. Also, is there anything else I should take into account? Thanks for the explanation of LIRR as well.

Thanks for the help,
Mikumiku747


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group