Keyboard IRQ hits only once, PIT works fine.

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
ExeTwezz
Member
Member
Posts: 104
Joined: Sun Sep 21, 2014 7:16 am
Libera.chat IRC: exetwezz

Keyboard IRQ hits only once, PIT works fine.

Post by ExeTwezz »

Hello,

This is my another attempt to write an OS from scratch. I always stop at writing the IRQ handler. The problem is that the keyboard IRQ hits only once.
I've always read http://wiki.osdev.org/I_Cant_Get_Interrupts_Working. The conclusion was that I didn't send the End Of Interrupt signal to the PIC(s). But it's not so - I wrote a code at the end of the IRQ handler that sends EOI to the PIC(s) and it was steel not working.

Today, when I again tried to write the IRQ handler, I tried to don't disabling all the IRQs (except keyboard). The result was printing the "Interrupt was occurred." string on the screen every <1 second (the PIT's work) [my IRQ handler prints that on every IRQ].

So, I don't know why the PIT IRQ hits every <1 second, but keyboard IRQ only once? (I press a key every second at least.)

You can see the source code at https://github.com/ExeTwezz/Basic_OS:
  • kernel/src/idt.c : has IRQ handler.
    kernel/src/isrs.asm : code in Assembly that calls the IRQ handler.
P.S. I searched only for "Keyboard IRQ not working", since it's my problem.
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Keyboard IRQ hits only once, PIT works fine.

Post by iansjack »

You need to read the keyboard buffer before it will send another interrupt.
ExeTwezz
Member
Member
Posts: 104
Joined: Sun Sep 21, 2014 7:16 am
Libera.chat IRC: exetwezz

Re: Keyboard IRQ hits only once, PIT works fine.

Post by ExeTwezz »

iansjack wrote:You need to read the keyboard buffer before it will send another interrupt.
Oh, Thanks! :)
Post Reply