ps2: don't wait forever on machines with no controller

This commit is contained in:
Matheus
2026-05-12 22:18:42 -03:00
parent 62f8b8cddc
commit 3fda97332f
3 changed files with 23 additions and 2 deletions
+7 -1
View File
@@ -132,7 +132,13 @@ bool ps2_init_device(int port, bool *mouse) {
void arch_ps2_init() {
// XXX actually check if the controller is there
ps2_write_command(PS2_CTLR_CMD_DISABLEP1);
bool t;
ps2_write_command_timeout(PS2_CTLR_CMD_DISABLEP1, 10, &t);
if (t) {
printf("ps2: no controller on this machine\n");
return;
}
ps2_write_command(PS2_CTLR_CMD_DISABLEP2);
// just to make sure