There are better ways to control A20 (isn't always connected to KBC).
and btw:
all my BIOS are less than 25 years old, and all boot with A20 ON.
__
wolfgang
------------------------------------
here is what I have in my info-book:
PS/2 KEYBOARD
(only ports 60 and 64 are involved)
INPUT PORT [WRITE 60] command or parameter
OUTPUT PORT [READ 60] ACK, ERROR or SCANcode
STATUS register [READ port 64]:
7 parity ERROR on transmission from keyboard
6 any TIMEOUT
5 ** mouse output buffer FULL
4 ** OVERRIDE keyboard lock
3 port 60 data is for COMMAND(controller)/data(keyboard)
2 SELFTEST OK/power up or reset
1 input buffer FULL (no write allowed until bit clears)
0 output buffer FULL (is cleared after port 60 read)
COMMAND register [WRITE port 64]:
available commands: response:
(+n two byte commands data to/from port 60)
20+00 readback RAM_0 aka I/O control port see below
some brands can access more RAM (up to 255)
but standards for are idx>0 aren't well defined
60 write I/O control port -
I/O control port:
7 0
6 1 IBM COMPATIBLE mode5 DISABLE/enable mouse
4 DISABLE/enable keybord
3 0 reserved (was OVERRIDE KEYLOCK)
2 unused/available
1 ENABLE IRQ_12 (mouse)
0 ENABLE IRQ_01 (keyboard)
--- response:
21..3F+n readback RAM_1..1F any written
61..7F write data -
A7 *disable mouse (set bit 5 in I/O-ctrl) -
A8 *enable mouse -
A9 *test mouse port 00 if OK
AA *test controller 55 if OK
AB *test keyboard 00 if Ok
AC *diagnostic dump (16 or more RAM bytes) varies
AD disable keyboard -
AE enable keyboard -
C0 *read input port any
D0 read output port as below
Output port:
7 keyboard data (output)
6 keyboard clock (output)
5 mouse OBF (to IRQ12 if enabled)
4 keyboard OBF (to IRQ1 if enabled)
3 mouse data (output)
2 mouse clock (output)
1 A20 enable (may be at port 092 instead)
0 0 RESET all and forever if not pulsed!
--- response:
D4 next command goes to mouse instead of KBD -
DD disable A20 (wont work if at port 092) -
DF enable A20 (ditto) -
ED+n same as for INPUT PORT command on some controllers
F0..FF PULSE masked OUTPUT bits 3..0 for 6uSec depends
but only bit0 seem to be common used:
FE RESET, b0 is connected to the RESET-pin we wont see it
*) seem to be obsolete/not required/useless,
I enable/disable the mouse by D4+AE and D4+AD
INPUT PORT Commands [WRITE PORT 60]
ED+n LED-control FA
7..3 = 0
2 CapsLk
1 NumLk
0 ScrlLk
---
EE diagnostic echo EE
(EF+26 [Cherry MF2 G80-1501HAD] 256 bytes)
F0+00 get scancode set 1/2/3
F0+01 select scancode set1 FA
F0+02 select scancode set2 (AT, PS/2, default) FA
F0+03 select scancode set3 FA
F2 GET keyboard ID (read two ID bytes) AB 41/AB 83/FA
F3+n SET typematic rate/delay FA
values for n:
7 0 reserved
6,5 typemativ delay
00=250ms 01=500mS 10=750ms 11=1000ms
4..0 typematic rate 00=30/sec ... 1F=2/Sec
---
F4 enable keyboard FA
F5 disable keyboard set default parameters FA
F6 set default parameters FA
F7 set all keys to typematic (scancode set 3) FA
F8 set all keys to make/release FA
F9 set all keys to make only FA
FA set all keys to typematic/make/release FA
FB+n set specific key n to typematic FA
FC+n set specific key to make/release FA
FD+n set specific key to make only FA
FE resend last scancode previous
FF RESET keyboard and controller AA or error FC/FD
eof