geekhack
geekhack Community => Keyboards => Topic started by: anmol2701 on Tue, 10 April 2012, 07:44:50
-
Hello to all the mebers,
Pl. welcome me first. It's my first post into this forum.
Now, the question is I have to develop JPOS driver for keyboard having PS/2 interface. Now some of the questions that are making me doubtful are:-
which one ie. poll or interrupt mode should be used ?? Any relevant link would be appreciated.
A friend of mine told me that port 0x60 and 0x64 would not work for modern PS/2. I googled but not found any new port. All are discussing about these only.
I am developing these driver for Ubuntu.
Welcome in case of any further information.
Anmol
-
Poll method, what I know about is firmware/controller type stuff so hopefully this helps.
Explains a keyboard matrix
http://www.dribin.org/dave/keyboard/html/
An example of keyboard firmware
http://geekhack.org/showwiki.php?title=Island:14618
http://www.pjrc.com/teensy/usb_keyboard.html
PS/2 scan codes
http://www.computer-engineering.org/ps2keyboard/scancodes2.html
Not sure what POS stuff you need to do, the card reader may need to be an interrupt though.
-
Why would you use polling over IRQ's ? On a few occasion I have had terrible drivers that used the polling method, which just resulted in a massive waste of CPU time.
I switched hardware very fast after noticing this.
Im far from saying that your driver will chew up CPU time, but IMO, IRQ's are better than polling.
Btw, Polling got replaced by IRQ's for a reason. Im not saying that im sure 100% about using IRQ's over polling for a keyboard driver, because I never made a keyboard driver, but from my point of view, you are going the wrong direction.
-
I'm curious why it has to be so low-level - isn't there a good point in the driver chain to insert new code, that would avoid dealing with the hardware directly?
-
AFAIK keyboard controllers still run at 0x60/0x64, but in Linux you have the "i8042" driver which presents them as an abstract "serio" (serial i/o) device which kernel code can read/write bytes to without dealing directly with the hardware. There is also the "serio_raw" driver, which can make any serio device available as a dev file for userspace access (so it should be possible to write the whole driver in userland).
Finally, how exactly is your keyboad different from an ordinary PC board? It might be easier to adapt the standard "atkbd" driver to work with it.
-
The keyboard controller polls. PC takes interrupts from the keyboard.
-
The keyboard controller polls. PC takes interrupts from the keyboard.
Oh ok, I had misunderstood the OP.
I was like : why dafuq would you make a driver that polls in 2012 ? And for a keyboard.
Never thought he could be talking about the keyboard itself.