Page 5 of 5
Re: Keyboard driver resets system when key is pressed.
Posted: Tue Sep 24, 2024 10:50 am
by Octocontrabass
Re: Keyboard driver resets system when key is pressed.
Posted: Tue Sep 24, 2024 12:49 pm
by Tomrs123
Oh, so its the excatly the same as sending normal commands to the controller, except for sending to the data port, neat!
Re: Keyboard driver resets system when key is pressed.
Posted: Wed Nov 20, 2024 6:41 pm
by Tomrs123
So I'm back once again... when will this stupid keyboard driver end...
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.
Re: Keyboard driver resets system when key is pressed.
Posted: Wed Nov 20, 2024 7:59 pm
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.
Re: Keyboard driver resets system when key is pressed.
Posted: Wed Nov 20, 2024 8:03 pm
by MichaelPetch
Tomrs123 wrote: ↑Wed Nov 20, 2024 6:41 pm
So I'm back once again... when will this stupid keyboard driver end...
You could always start by updating your Github repo with the code that you are having issues with.