Revision 35c4d671 hw/ps2.c
b/hw/ps2.c | ||
---|---|---|
44 | 44 |
|
45 | 45 |
/* Keyboard Replies */ |
46 | 46 |
#define KBD_REPLY_POR 0xAA /* Power on reset */ |
47 |
#define KBD_REPLY_ID 0xAB /* Keyboard ID */ |
|
47 | 48 |
#define KBD_REPLY_ACK 0xFA /* Command ACK */ |
48 | 49 |
#define KBD_REPLY_RESEND 0xFE /* Command NACK, send the cmd again */ |
49 | 50 |
|
... | ... | |
133 | 134 |
s->update_irq(s->update_arg, 1); |
134 | 135 |
} |
135 | 136 |
|
136 |
/* keycode is expressed in scancode set 2 */ |
|
137 |
/* |
|
138 |
keycode is expressed as follow: |
|
139 |
bit 7 - 0 key pressed, 1 = key released |
|
140 |
bits 6-0 - translated scancode set 2 |
|
141 |
*/ |
|
137 | 142 |
static void ps2_put_keycode(void *opaque, int keycode) |
138 | 143 |
{ |
139 | 144 |
PS2KbdState *s = opaque; |
... | ... | |
199 | 204 |
case KBD_CMD_GET_ID: |
200 | 205 |
ps2_queue(&s->common, KBD_REPLY_ACK); |
201 | 206 |
/* We emulate a MF2 AT keyboard here */ |
202 |
ps2_put_keycode(s, 0xab); |
|
203 |
ps2_put_keycode(s, 0x83); |
|
207 |
ps2_queue(&s->common, KBD_REPLY_ID); |
|
208 |
if (s->translate) |
|
209 |
ps2_queue(&s->common, 0x41); |
|
210 |
else |
|
211 |
ps2_queue(&s->common, 0x83); |
|
204 | 212 |
break; |
205 | 213 |
case KBD_CMD_ECHO: |
206 | 214 |
ps2_queue(&s->common, KBD_CMD_ECHO); |
Also available in: Unified diff