Outils pour utilisateurs

Outils du site


back2root:ibm-pc-ms-dos:hardware:8042

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
back2root:ibm-pc-ms-dos:hardware:8042 [2022/12/29 16:15] – [Commands System Issues to Keyboard (via 8042 port 60h)] fraterback2root:ibm-pc-ms-dos:hardware:8042 [2023/01/05 03:12] (Version actuelle) – [Keyboard Responses to System (read port 60h)] frater
Ligne 1: Ligne 1:
-====== 8042 - Keyboard Controller  (AT,PS/2) ======+====== 8042 - Keyboard Controller (AT,PS/2) ======
  
-==== 8042 Commands & Responses ====+==== 8042 Commands & Responses - (Port 60h) ====
  
-=== Commands System Issues to Keyboard (via 8042 port 60h) ===+=== Commands System Issues to Keyboard (write port 60h) ===
  
 ^  Command  ^ Description  ^ ^  Command  ^ Description  ^
Ligne 41: Ligne 41:
  
  
-=== Keyboard Responses to System (via 8042 port 60h) ===+=== Keyboard Responses to System (read port 60h) ===
  
 +|  00h   |Key Detection Error or Overrun Error for Scan Code Set 1, replaces last key in the keyboard buffer if the buffer is full. |
 +|  AAh   |BAT Completion Code, keyboard sends this to indicate the keyboard test was successful.|
 +|  EEh   |Echo Response, response to the Echo command.|
 +|  F0h   |Break Code Prefix in Scan Code Sets 2 and 3.|
 +|  FAh   |Acknowledge, keyboard sends this whenever a valid command or data byte is received (except on Echo and Resend commands).|
 +|  FCh   |BAT Failure Code, keyboard sends this to indicate the keyboard test failed and stops scanning until a response or reset is sent.|
 +|  FEh   |Resend, keyboard request resend of data when data sent to it is invalid or arrives with invalid parity.|
 +|  FFh   |Key Detection Error or Overrun Error for Scan Code Set 2 or 3, replaces last key in the keyboard buffer if the buffer is full.|
 +|  idh   |Keyboard ID Response, keyboard sends a two byte ID after ACK'ing the Read ID command. The byte stream contains 83AB in LSB, MSB order. The keyboard then resumes scanning.|
  
- 00  Key Detection Error or Overrun Error for Scan Code Set 1, 
-     replaces last key in the keyboard buffer if the buffer is full.  
- AA  BAT Completion Code, keyboard sends this to indicate the keyboard 
-     test was successful. 
- EE  Echo Response, response to the Echo command. 
- F0  Break Code Prefix in Scan Code Sets 2 and 3. 
- FA  Acknowledge, keyboard sends this whenever a valid command or 
-     data byte is received (except on Echo and Resend commands). 
- FC  BAT Failure Code, keyboard sends this to indicate the keyboard 
-     test failed and stops scanning until a response or reset is sent. 
- FE  Resend, keyboard request resend of data when data sent to it is 
-     invalid or arrives with invalid parity. 
- FF  Key Detection Error or Overrun Error for Scan Code Set 2 or 3, 
-     replaces last key in the keyboard buffer if the buffer is full. 
- id  Keyboard ID Response, keyboard sends a two byte ID after ACK'ing 
-     the Read ID command.  The byte stream contains 83AB in LSB, MSB 
-     order.  The keyboard then resumes scanning. 
  
 +<WRAP round box>
 +command F7h through FDh are NOP's on the AT and are ACK'ed but not acted upon
 +</WRAP>
  
- command F7 through FD are NOP's on the AT and are ACK'ed but not +see [[back2root:ibm-pc-ms-dos:hardware:8042|8042]],  MAKE CODES BREAK CODES INT 16,3
-   acted upon +
- see 8042  MAKE CODES  BREAK CODES  INT 16,3+
  
 +===== 8042 - Speaker Controller & NMI (AT,PS/2) - Port 61h =====
 +
 +This register can be Write and Read
 +
 +^  bit  ^ Description                                                          ^
 +|  0    | PIT Channel 2 enabled (see [[back2root:ibm-pc-ms-dos:hardware:8253|8253]])   |
 +|  1    | Speaker Position\\ <tab>1 : "out" position\\ <tab>0 : "in" position  |
 +|  2    |                                                                      |
 +|  3    |                                                                      |
 +|  4    |                                                                      |
 +|  5    |                                                                      |
 +|  6    |                                                                      |
 +|  7    | Reset Keyboard status (scan code readed)                             |
 +
 +=== Speaker ===
 +The speaker itself has two possible positions, "in" and "out".
 +
 +This position can be set through bit 1 of port 0x61 on the Keyboard Controller. 
 +
 +If this bit is set (=1), the speaker will move to the "out" position, if it is cleared (=0) then the speaker will move to the "in" position.
 +
 +Moving in and out repeatedly produces audible tones if the speed of repetition (the frequency) is within the range the speaker can reproduce and the human ear can hear. Also, a single movement in or out makes a click sound because it's so fast. Thus, a frequency which is too low to be heard as a tone may be heard as a rattle or buzz. (In fact, any frequency produced by this system also produces higher frequencies; look up "square wave harmonics" if you're interested.) 
 ==== 8042 Status Register (port 64h read) ==== ==== 8042 Status Register (port 64h read) ====
  
Ligne 87: Ligne 102:
  
 ^  Command  ^ Description                                                                                                                                                                                                                                                                                                 ^ ^  Command  ^ Description                                                                                                                                                                                                                                                                                                 ^
-|  20h      | Read Command Byte: current 8042 command byte is placed in port 60h.                                                                                                                                                                                                                                         +|  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)                                                                                                                                                                                        +|  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;\\ <tab2>  FA=password installed\\ <tab2> F1=no password                                                                                                                                                                                 +|  A4h      | Password Installed Test:\\ returned data can be read from port 60h;\\ <tab2>  FA=password installed\\ <tab2> F1=no password| 
-|  A5h      | Load Security: bytes written to port 60h will be read until a null (0) is found.                                                                                                                                                                                                                            +|  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                                                                                                                                                                                                                                                 +|  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                                                                                                                                                                                            +|  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                                                                                                                                                                                                                                                |+|  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\\ <tab2>00 no error\\ <tab2>01 keyboard clock line is stuck low\\ <tab2>02 keyboard clock line is stuck high\\ <tab2>03 keyboard data line is stuck low\\ <tab2>04 keyboard data line is stuck high  | |  A9h      | Auxiliary Interface Test: clock and data lines are tested; results placed at port 60h are listed below\\ <tab2>00 no error\\ <tab2>01 keyboard clock line is stuck low\\ <tab2>02 keyboard clock line is stuck high\\ <tab2>03 keyboard data line is stuck low\\ <tab2>04 keyboard data line is stuck high  |
-|  AAh      | Self Test: diagnostic result placed at port 60h, 55h=OK                                                                                                                                                                                                                                                     +|  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                                                                                                                                                                                       +|  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.                                                                                                                                            +|  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                                                                                                                                                                                              +|  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.                                                                                                                                                                                                                    +|  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)                                                                                                         +|  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                                                                                                                                                                                                                                      +|  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                                                                                                                                                                                                                                     +|  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)                                                                                                                     +|  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)                                                                                                                                                                   +|  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                                                                                                      +|  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                                                                                                     +|  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                                                                                                                                                                          +|  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)                                                                                                                                                                              +|  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.                                                           | +|  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.|
  
 == Table 1 == == Table 1 ==
back2root/ibm-pc-ms-dos/hardware/8042.1672326944.txt.gz · Dernière modification : 2022/12/29 16:15 de frater