Ceci est une ancienne révision du document !
bit | 8042 Status Register |
---|---|
0 | output register (60h) has data for system |
1 | input register (60h/64h) has data for 8042 |
2 | system flag (set to 0 after power on reset) |
3 | data in input register is command (1) or data (0) |
4 | 1=keyboard enabled 0=keyboard disabled (via switch) |
5 | 1=transmit timeout (data transmit not complete) |
6 | 1=receive timeout (data transmit not complete) |
7 | 1=even parity rec'd 0=odd parity rec'd (should be odd) |
Port | Mode | name | Description |
---|---|---|---|
64h | read | status register. | Can be read at any time. See table above for more information. |
64h | write | command register. | Writing this port sets Bit 3 of the status register to 1 and the byte is treated as a controller command. Devices attached to the 8042 should be disabled before issuing commands that return data since data in the output register will be overwritten. |
60h | read | output register | (should only be read if Bit 0 of status port is set to 1) |
60h | write | data register. | Data should only be written if Bit 1 of the status register is zero (register is empty). When this port is written Bit 3 of the status register is set to zero and the byte is treated as a data. The 8042 uses this byte if it's expecting data for a previous command, otherwise the data is written directly to the keyboard.See <A HREF=“keyboard_commands.html”>KEYBOARD COMMANDS</A> for information on programming the actual keyboard hardware. |
Command | Description |
---|---|
20h | Read Command Byte: current 8042 command byte is placed in port 60h. |
60h | Write 8042 Command Byte: next data byte written to port 60h is placed in 8042 command register. Format (see table 1) |
A4h | Password Installed Test: returned data can be read from port 60h; FA=password installed F1=no password |
A5h | Load Security: bytes written to port 60h will be read until a null (0) is found. |
A6h | Enable Security: works only if a password is already loaded |
A7h | Disable Auxiliary Interface: sets Bit 5 of command register stopping auxiliary I/O by driving the clock line low |
A8h | Enable Auxiliary Interface: clears Bit 5 of command register |
A9h | Auxiliary Interface Test: clock and data lines are tested; results placed at port 60h are listed below 00 no error 01 keyboard clock line is stuck low 02 keyboard clock line is stuck high 03 keyboard data line is stuck low 04 keyboard data line is stuck high |
AAh | Self Test: diagnostic result placed at port 60h, 55h=OK |
ABh | Keyboard Interface Test:clock and data lines are tested; results placed at port 60h are listed above with command A9h |
ACh | Diagnostic Dump: sends 16 bytes of 8042's RAM, current input port state, current output port state and 8042 program status word to port 60h in scan-code format. |
ADh | Disable Keyboard Interface: sets Bit 4 of command register stopping keyboard I/O by driving the clock line low |
AEh | Enable Keyboard Interface: clears Bit 4 of command register enabling keyboard interface. |
C0h | Read Input Port: data is read from its input port (which is inaccessible to the data bus) and written to output register at port 60h; output register should be empty before call. (see Table 2) |
C1h | Poll Input Port Low Bits: Bits 0-3 of port 1 placed in status Bits 4-7 |
C2h | Poll Input Port High Bits: Bits 4-7 of port 1 placed in status Bits 4-7 |
D0h | Read Output Port: data is read from 8042 output port (which is inaccessible to the data bus) and placed in output register; the output register should be empty. (see command D1 below) |
D1h | Write Output Port: next byte written to port 60h is placed in the 8042 output port (which is inaccessible to the data bus) (see Table 3) |
D2h | Write Keyboard Output Register: on PS/2 systems the next data byte written to port 60h input register is written to port 60h output register as if initiated by a device; invokes interrupt if enabled |
D3h | Write Auxiliary Output Register: on PS/2 systems the next data byte written to port 60h input register is written to port 60h output register as if initiated by a device; invokes interrupt if enabled |
D4h | Write Auxiliary Device: on PS/2 systems the next data byte written to input register a port at 60h is sent to the auxiliary device |
E0h | Read Test Inputs: 8042 reads its T0 and T1 inputs; data is placed in output register; Bit 0 is T0, Bit 1 is T1: (See Table 4) |
Fxh | Pulse Output Port: Bits 0-3 of the 8042 output port can be pulsed low for 6 æs; Bits 0-3 of command indicate which Bits should be pulsed; 0=pulse, 1=don't pulse; pulsing Bit 0 results in CPU reset since it is connected to system reset line. |
bit | placed in 8042 command register. |
---|---|
0 | 1=enable output register full interrupt |
1 | should be 0 |
2 | 1=set status register system 0=clear |
3 | 1=override keyboard inhibit 0=allow inhibit |
4 | disable keyboard I/O by driving clock line low |
5 | disable auxiliary device, drives clock line low |
6 | IBM scancode translation: 0=AT 1=PC/XT |
7 | reserved, should be 0 |