Skip to content

Commit

Permalink
Fix bug preventing Linux from detecting mouse
Browse files Browse the repository at this point in the history
Added some commands, fixed a bug where a byte shouldn't have been sent, and added a few undefined commands that the kernel uses but don't appear in documentation anywhere.
  • Loading branch information
nepx committed Mar 18, 2020
1 parent 29f2c75 commit 779b81c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/hardware/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ static void kbd_write(uint32_t port, uint32_t data)
//kbd.command = NO_COMMAND;
break;
case 0xD1 ... 0xD4: // Outport utilities
if(data == 0xD3) kbd_add(KBD_QUEUE, 0xFA);
kbd.status |= STATUS_CMD;
kbd.command = data;
break;
Expand Down Expand Up @@ -470,6 +469,10 @@ static void kbd_write(uint32_t port, uint32_t data)
kbd.mouse_stream_inactive = data & 1;
kbd_add(AUX_QUEUE, 0xFA);
break;
case 0xF6: // Set defaults
kbd_reset_port(1);
kbd_add(AUX_QUEUE, 0xFA);
break;
case 0xFF: // Reset
kbd_reset_port(1);
kbd_add(AUX_QUEUE, 0xFA);
Expand All @@ -478,6 +481,12 @@ static void kbd_write(uint32_t port, uint32_t data)
break;
case 0xBB: // ?? OS/2 Warp 4.5 uses this command
break;
case 0xE1: // ?? TinyCore Linux uses this command
case 0x0A:
case 0x88:
case 0:
kbd_add(AUX_QUEUE, 0xFE);
break;
default:
KBD_FATAL("Unknown mouse command %02x\n", data);
}
Expand Down

0 comments on commit 779b81c

Please sign in to comment.