PS/2 Keyboard: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m Fixed link
mNo edit summary
Line 118: Line 118:


=== CPU Reset ===
=== CPU Reset ===
To trigger a CPU Reset (No matter what state the CPU currently has) you have to write the value 0xFE to the Outputport.
To trigger a CPU Reset (No matter what state the CPU currently has) you have to write the value 0xFE to the Output port.
<source lang="asm">
<source lang="asm">
;Wait for a empty Input Buffer
;Wait for a empty Input Buffer
Line 164: Line 164:
See http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html for hints about how you should interpret what you get from the keyboard.
See http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html for hints about how you should interpret what you get from the keyboard.


Note that if you repeatedly read the port 0x60 without waiting for another IRQ, you'll read the same byte again. That's the 'normal' behaviour of keyboard controller, but if that doesn't suit your needs, you can still "acknowledge" the scancode by quickly disabling and re-enabling the keyboard at the PPI (Programmable Peripheral Interface):
Note that if you repeatedly read the port 0x60 without waiting for another IRQ, you'll read the same byte again. That's the 'normal' behavior of keyboard controller, but if that doesn't suit your needs, you can still "acknowledge" the scancode by quickly disabling and re-enabling the keyboard at the PPI (Programmable Peripheral Interface):
<source lang="c">
<source lang="c">
int temp = inportb(0x61);
int temp = inportb(0x61);
Line 280: Line 280:
=== Non-Printable Characters ===
=== Non-Printable Characters ===


ToDo: think about it. We can however already say that they should follow the same 'datapath' as regular characters: we want cursor displacements, regular keytypes and commands (such as CTRL+S) to be delivered to the application in the same order the user typed them, and the best way to achieve this is to ensure they're delivered through the same data stream.
ToDo: think about it. We can however already say that they should follow the same 'datapath' as regular characters: we want cursor displacements, regular key types and commands (such as CTRL+S) to be delivered to the application in the same order the user typed them, and the best way to achieve this is to ensure they're delivered through the same data stream.