Keyboard driver resets system when key is pressed.

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.
Tomrs123
Member
Member
Posts: 37
Joined: Mon Aug 19, 2024 11:12 am

Re: Keyboard driver resets system when key is pressed.

Post by Tomrs123 »

Oh, so its the excatly the same as sending normal commands to the controller, except for sending to the data port, neat!
Tomrs123
Member
Member
Posts: 37
Joined: Mon Aug 19, 2024 11:12 am

Re: Keyboard driver resets system when key is pressed.

Post by Tomrs123 »

So I'm back once again... when will this stupid keyboard driver end... :cry:

Anyway so I implmented stole the heap code from https://wiki.osdev.org/User:Pancakes/Si ... ementation, but that doesn't matter for todays post.

So I.. rewrote the keyboard driver. I got it to send a interrupt, BUT it.. stops sending them.

And I also didn't implment the reset code (because i'm pretty sure you need to send it to the keyboards, and I don't really know how to set up the sending commands to keyboards), so that might be the issue; the PS/2 keyboard in a bad state.

I would really appreciate if I can get help with sending commands to the keyboard and the single interrupt issue.
Octocontrabass
Member
Member
Posts: 5512
Joined: Mon Mar 25, 2013 7:01 pm

Re: Keyboard driver resets system when key is pressed.

Post by Octocontrabass »

Tomrs123 wrote: Wed Nov 20, 2024 6:41 pmSo I.. rewrote the keyboard driver. I got it to send a interrupt, BUT it.. stops sending them.
Did you acknowledge the PS/2 controller? Did you acknowledge the interrupt controller? Are you disabling interrupts at some point after returning from the first interrupt? Is a higher-priority interrupt blocking the keyboard interrupt?
Tomrs123 wrote: Wed Nov 20, 2024 6:41 pmAnd I also didn't implment the reset code (because i'm pretty sure you need to send it to the keyboards, and I don't really know how to set up the sending commands to keyboards), so that might be the issue; the PS/2 keyboard in a bad state.
What (if anything) did you do to initialize the PS/2 controller? If you didn't initialize it at all, it's probably in a reasonable state, although you should still check the output buffer so it doesn't get stuck waiting for you to respond to an interrupt that got lost when you initialized the interrupt controllers.

Sending bytes (command or otherwise) to the keyboard works very much like sending commands to the PS/2 controller, except you don't write anything to port 0x64. The keyboard will send a reply after every byte you send. You must wait for each reply before sending the next byte. You receive the reply exactly the same way you receive a scan code byte.
MichaelPetch
Member
Member
Posts: 778
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Keyboard driver resets system when key is pressed.

Post by MichaelPetch »

Tomrs123 wrote: Wed Nov 20, 2024 6:41 pm So I'm back once again... when will this stupid keyboard driver end... :cry:
You could always start by updating your Github repo with the code that you are having issues with.
Post Reply