r/osdev • • 9d ago

Keyboard interrupts firing when key is pressed but not when key is released

I am returning to my OS project after 4 months (lack of time unfortunately.. sigh) and I am trying to continue from where I left. I recently tested whether keyboard interrupts were working or not and they are partially working.

As the title says, when pressing a key an interrupt is fired and the function that is supposed to handle keyboard interrupts receives it. Even though it should, when releasing the key, no interrupt is triggered.

I have tried to find information online but I only found information regarding keyboard interrupts not being fired at all.

Link to the repo: https://codeberg.org/TheCodingKnight/32-bit-Potato/src/branch/interrupts

src/kernel/int/int_handler/int_handler.c is in charge of calling the function that will handle the interrupt that was just fired. In the case of the irq1 (keyboard interrupt), the function in charge of handling it is handle_irq1 and the code can be found in src/kernel/int/int_handler/ps2.c

Note: Please bear with the fact that the controller does not handle very well scan codes that begin with a prefix. I know I have to fix that part, but I want to make sure the press/release part of the interrupts works well before supporting scan codes with prefixes (That is to say, limit your testing to scan codes without a prefixes like letters).

Of course, if you have any questions please let me know and I will be more than glad to answer asap.

8 Upvotes

6 comments sorted by

2

u/SignedInt32 9d ago

You got discord? easier explaining I suppose.

1

u/The_Coding_Knight 8d ago

I did not think about it. I will ask on the Osdev server and post the solution here. Thanks for pointing that out :D

2

u/SignedInt32 8d ago

would it help you if i showed my kernel codebase, specifically the keyboard mechanics ?

1

u/The_Coding_Knight 8d ago

Probably... I think it would be helpful. Can you post a link to your repo please. And thanks for offering it.

2

u/SignedInt32 8d ago

Yeah sure: https://github.com/TheBarret/Symbiote-active/tree/main/kernel/src/core/dev its a small hobby (esoteric) kernel, but the `/arch/` is pretty solid as starters base, it has the minimum but thats because I am also still learning. lol