"8042" PS/2 Controller: Difference between revisions

m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
No edit summary
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
(7 intermediate revisions by 6 users not shown)
Line 382:
* Wait for the device to send "ACK" back (0xFA)
* Wait for the device to send up to 2 bytes of reply, with a time-out to determine when it's finished (e.g. in case it only sends 1 byte)
* Send the "enable scanning" command 0xF4 to the device
 
A partial list of responses includes:
Line 387 ⟶ 388:
{| {{wikitable}}
|-
! Bytes (Normal)
! Byte/s
! Bytes (Translated*)
! Device Type
|-
| None
| None
| Ancient AT keyboard with translation enabled in the PS/Controller (not possible for the second PS/2 port)
| MF2Ancient AT keyboard
|-
| 0x00
| n/a
| Standard PS/2 mouse
|-
| 0x03
| n/a
| Mouse with scroll wheel
|-
| 0x04
| n/a
| 5-button mouse
|-
| 0xAB, 0x41 or 0xAB, 0xC1
| MF2 keyboard with translation enabled in the PS/Controller (not possible for the second PS/2 port)
|-
| 0xAB, 0x83
| 0xAB, 0x41 or 0xAB, 0xC1
| MF2 keyboard
| rowspan="2" | MF2 keybaord
|-
| 0xAB, 0xC1
| 0xAB, 0xC1
|-
| 0xAB, 0x84
| 0xAB, 0x54
| IBM ThinkPads, Spacesaver keyboards, many other "short" keyboards
|-
| rowspan="2" | 0xAB, 0x85
| rowspan="2" | 0xAB, 0x85
| NCD N-97 keyboard
|-
| 122-Key Host Connect(ed) Keyboard
|-
| 0xAB, 0x86
| 0xAB, 0x86
| 122-key keyboards
|-
| 0xAB, 0x90
| 0xAB, 0x90
| Japanese "G" keyboards
|-
| 0xAB, 0x91
| 0xAB, 0x91
| Japanese "P" keyboards
|-
| 0xAB, 0x92
| 0xAB, 0x92
| Japanese "A" keyboards
|-
| 0xAC, 0xA1
| 0xAC, 0xA1
| NCD Sun layout keyboard
|}
 
<nowiki>*</nowiki> Translation is not possible for the second PS/2 port
Note: If anyone sees any other responses please add to the list above!
 
Notes:
Once your PS/2 Controller driver knows what types of PS/2 devices are present, it can start suitable device drivers for those devices. Don't forget that we've left devices in a "scanning disabled" state.
Note:* If anyone sees any other responses please add to the list above!
* Translated IDs are provided in the table above for completeness, but it's arguably better to disable translation in the controller prior to pulling a device ID to avoid potential confusion.
 
Once your PS/2 Controller driver knows what types of PS/2 devices are present, it can start suitable device drivers for those devices. Don't forget that we've left devices in a "scanning disabled" state.
 
== Hot Plug PS/2 Devices ==
Line 473 ⟶ 513:
== CPU Reset ==
To trigger a CPU Reset, regardless of what state the CPU is in, write the value 0xFE to the Output port.
<sourcesyntaxhighlight lang="asm">
;Wait for a empty Input Buffer
wait1:
Line 483 ⟶ 523:
mov al, 0xFE
out 0x64, al
</syntaxhighlight>
</source>
 
==See Also==
Line 493 ⟶ 533:
*[[Post:69151|PS/2 controller initialisation]]
===External Links===
* [http://web.archive.org/web/20210417040153/http://www.diakom.ru/el/elfirms/datashts/Smsc/42w11.pdf SMS "8042" Datasheet]
 
[[Category:X86]]