Page 1 of 1

Keyboard IRQ hits only once, PIT works fine.

Posted: Sun Sep 21, 2014 7:35 am
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.

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

Posted: Sun Sep 21, 2014 8:02 am
by iansjack
You need to read the keyboard buffer before it will send another interrupt.

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

Posted: Sun Sep 21, 2014 8:06 am
by ExeTwezz
iansjack wrote:You need to read the keyboard buffer before it will send another interrupt.
Oh, Thanks! :)