Page 1 of 1

Interrupt is called only once

Posted: Mon Dec 09, 2019 11:54 am
by mrjbom
Hello.

I recently added interrupts to my kernel and wanted to check if they work correctly, but I came across the fact that the interrupt only works once, that is, in the example with the keyboard: I press a button - a pixel is drawn, but if I press it further, the interrupt does not work.

For debugging, I used the output to the COM port, after which qemu wrote the data to the document. Output to the document occurred only once.

I do not understand why this happens, because the processor is constantly waiting for an interrupt and must perform not only the first interrupt (look bootloader.asm).

Here is irq1_header().
Here is a link to the repository with the system.

Re: Interrupt is called only once

Posted: Mon Dec 09, 2019 12:09 pm
by iansjack
You won't get any further keyboard interrupts until you read the keystroke from the keyboard port.

Re: Interrupt is called only once

Posted: Mon Dec 09, 2019 4:13 pm
by linguofreak
More generally, you don't just need to ensure that the CPU is ready to *receive* the next interrupt, but that the interrupt controller is ready to pass the next interrupt on, and that the device in question is ready to *send* the next interrupt. It doesn't do any good for the CPU to be ready for an interrupt if it never receives it in the first place.

Re: Interrupt is called only once

Posted: Tue Dec 10, 2019 10:06 am
by mrjbom
iansjack wrote:You won't get any further keyboard interrupts until you read the keystroke from the keyboard port.
Thanks.