Page 1 of 1
[SOLVED] Interrupts only firing once
Posted: Mon Dec 29, 2014 6:47 pm
by dgriffen
I've been working on my OS and ran into a problem with the interrupts, interrupts from the pic only seem to fire once. I've made sure to send the reset signal to the PIC in the handler code so I'm not sure what else could be causing it.
The interrupt should be printed as 32 instead of 23, that's a known issue with my screen code and is not related to the problem.
- Screenshot of the output
- problem.png (5.41 KiB) Viewed 2277 times
code is located here
https://github.com/dgriffen/sigmos/tree ... bdcd601579
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 6:57 pm
by eryjus
You are not sending EOI to the PIC. See
8259 PIC.
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 7:19 pm
by dgriffen
eryjus wrote:You are not sending EOI to the PIC. See
8259 PIC.
I send EOI in my interrupt handler code here
https://github.com/dgriffen/sigmos/blob ... /handler.c
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 8:36 pm
by FallenAvatar
dgriffen wrote:...
Looks to me like your kernel is doing EXACTLY what you told it to do, including disabling interrupts the second kmain returns. To be honest, I'm surprised you even get one interrupt in that time.
Also, your isr_wrapper stuff is all sorts of weird. You probably want pushad and popad unless you are writing a real-mode kernel...
- Monk
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 8:42 pm
by dgriffen
tjmonk15 wrote:dgriffen wrote:...
Looks to me like your kernel is doing EXACTLY what you told it to do, including disabling interrupts the second kmain returns. To be honest, I'm surprised you even get one interrupt in that time.
Also, your isr_wrapper stuff is all sorts of weird. You probably want pushad and popad unless you are writing a real-mode kernel...
- Monk
Oh yeah, I forgot I disabled interrupts when I returned from kmain. I tried using pushad and popad, but they were considered invalid commands by the assembler. perhaps gcc got rid of those commands?
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 9:02 pm
by KemyLand
dgriffen wrote:tjmonk15 wrote:dgriffen wrote:...
Looks to me like your kernel is doing EXACTLY what you told it to do, including disabling interrupts the second kmain returns. To be honest, I'm surprised you even get one interrupt in that time.
Also, your isr_wrapper stuff is all sorts of weird. You probably want pushad and popad unless you are writing a real-mode kernel...
- Monk
Oh yeah, I forgot I disabled interrupts when I returned from kmain. I tried using pushad and popad, but they were considered invalid commands by the assembler. perhaps gcc got rid of those commands?
What assembler are you using? GNU AS recognizes this piece of code perfectly:
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 9:08 pm
by dgriffen
KemyLand wrote:
What assembler are you using? GNU AS recognizes this piece of code perfectly:
I am using GNU AS 2.24 compiled for i686-elf. After some research it looks like it uses pushal and popal.
Re: Interrupts only firing once
Posted: Mon Dec 29, 2014 9:26 pm
by KemyLand
dgriffen wrote:KemyLand wrote:
What assembler are you using? GNU AS recognizes this piece of code perfectly:
I am using GNU AS 2.24 compiled for i686-elf. After some research it looks like it uses pushal and popal.
A sorry, sorry! I just wrote the code without thinking
! It's true, now I remember. What happens is simple, the instructions' names are "pusha" and "popa" for Intel. But prefixes specific to assemblers happen to exist. Both 'd' in NASM and 'l' in GAS mean 32-bits.