Interrupt is called only 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
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Interrupt is called only once

Post 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.
User avatar
iansjack
Member
Member
Posts: 4938
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Interrupt is called only once

Post by iansjack »

You won't get any further keyboard interrupts until you read the keystroke from the keyboard port.
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: Interrupt is called only once

Post 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.
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: Interrupt is called only once

Post by mrjbom »

iansjack wrote:You won't get any further keyboard interrupts until you read the keystroke from the keyboard port.
Thanks.
Post Reply