[SOLVED] Interrupts only firing once

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
dgriffen
Posts: 4
Joined: Mon Dec 29, 2014 6:37 pm

[SOLVED] Interrupts only firing once

Post 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
Screenshot of the output
problem.png (5.41 KiB) Viewed 2278 times
code is located herehttps://github.com/dgriffen/sigmos/tree ... bdcd601579
Last edited by dgriffen on Mon Dec 29, 2014 9:32 pm, edited 1 time in total.
User avatar
eryjus
Member
Member
Posts: 286
Joined: Fri Oct 21, 2011 9:47 pm
Libera.chat IRC: eryjus
Location: Tustin, CA USA

Re: Interrupts only firing once

Post by eryjus »

You are not sending EOI to the PIC. See 8259 PIC.
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
dgriffen
Posts: 4
Joined: Mon Dec 29, 2014 6:37 pm

Re: Interrupts only firing once

Post 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
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: Interrupts only firing once

Post 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
dgriffen
Posts: 4
Joined: Mon Dec 29, 2014 6:37 pm

Re: Interrupts only firing once

Post 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?
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: Interrupts only firing once

Post 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:

Code: Select all

myLabel:
  pushad
  popad
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
dgriffen
Posts: 4
Joined: Mon Dec 29, 2014 6:37 pm

Re: Interrupts only firing once

Post by dgriffen »

KemyLand wrote: What assembler are you using? GNU AS recognizes this piece of code perfectly:

Code: Select all

myLabel:
  pushad
  popad
I am using GNU AS 2.24 compiled for i686-elf. After some research it looks like it uses pushal and popal.
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: Interrupts only firing once

Post by KemyLand »

dgriffen wrote:
KemyLand wrote: What assembler are you using? GNU AS recognizes this piece of code perfectly:

Code: Select all

myLabel:
  pushad
  popad
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.
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
Post Reply