keyboard issues
keyboard issues
i am sorry if i am asking silly question. i want my kernel to scan keyboard codes.I have setup idt and remapped pit and the software interrupts are working how to proceed now. I have searched over the internet but they were confusing
- DavidCooper
- Member

- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: keyboard issues
Two clicks took me to this page in the wiki: http://wiki.osdev.org/PS2_Keyboard. Have you read it yet? If so, please explain the point you're getting stuck at. It all looks complicated when you're new to it and it looks easy once you've got your head round it, so it's hard for anyone to know how to help you unless you're very specific about where the difficulty is.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
Re: keyboard issues
i have already read those tutorials the problem is i am confused what to do to scan the codes from keyboard i have a keyboard handler which can scan appropriate code. Should i have to enable the keyboard controller or anything else.In my kernel i have software interrupts working when i call through int opcode any suggestions how to link these irq with the keyboard
Re: keyboard issues
Did you really read it? If so, re-read it.
To me that's pretty clear. You set up the keyboard interrupt (IRQ 1) to fire whenever a key is pressed. Inside the keyboard interrupt handler you use the ports described to read out the scan code. You could then print the scan code directly to screen for testing or try and convert it to an ASCII char first with a key map.Brokenthorn Keyboard tutorial wrote:Keyboard Interfacing: Interrupt Request (IRQ)
Remember from the PIC tutorial that the keyboard controller can be configured to use an interrupt line? We can configure the keyboard controller to issue IRQ 1 whenever a key has been pressed or released. This is the most common way to interface with the keyboard.
Whenever IRQ 1 is fired, you should always test to see if a scan code has actually been sent to the keyboard controller. This is done by polling the keyboard controller to get the last scan code.
Re: keyboard issues
Hi,
You'd probably want to start at the PS/2 protocol, then read about the "8042" PS/2 controller used in 80x86 machines and write a driver for the controller, and then read about the PS/2 keyboard itself.
Cheers,
Brendan
I've been rewriting those pages in the last few days, so I'm not sure which version you've read (the old version, the new version, or something in between).raj wrote:i have already read those tutorials the problem is i am confused what to do to scan the codes from keyboard i have a keyboard handler which can scan appropriate code. Should i have to enable the keyboard controller or anything else.In my kernel i have software interrupts working when i call through int opcode any suggestions how to link these irq with the keyboard
You'd probably want to start at the PS/2 protocol, then read about the "8042" PS/2 controller used in 80x86 machines and write a driver for the controller, and then read about the PS/2 keyboard itself.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: keyboard issues
Thank you very much for the suggestions 
I now got where i went wrong i used oxFF to mask the interrupts
I thought 1's instead of 0's
I now got where i went wrong i used oxFF to mask the interrupts
I thought 1's instead of 0's
Re: keyboard issues
Damn details, they can really halt you for good. But then, you will always remember this detail after hours of smoking cigarettes, cursing, and furious debuggingraj wrote:Thank you very much for the suggestions
I now got where i went wrong i used oxFF to mask the interrupts
I thought 1's instead of 0's
