Skip to content

Commit

Permalink
Fix: Source error overridden by KB & mouse drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
coderarjob committed Sep 14, 2024
1 parent 891a62f commit 17624d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/kernel/drivers/x86/pc/ps2kb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ bool ps2kb_init()
// Check if PS2 port1 is Keyboard.
PS2DeviceType dtype = ps2_identify_device (&port1);
if (dtype != PS2_DEVICE_TYPE_KEYBOARD) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Set defaults
if (!ps2_write_device_cmd (&port1, true, PS2_DEV_CMD_SET_TO_DEFAULT)) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Interrupt when keys are pressed
if (!ps2_write_device_cmd (&port1, true, PS2_DEV_CMD_ENABLE_SCANNING)) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Setup PS2 configuration to enable interrupts from port 1 and disable translation
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/drivers/x86/pc/ps2mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ bool ps2mouse_init()
// Check if PS2 port2 is Mouse
PS2DeviceType dtype = ps2_identify_device (&port2);
if (dtype != PS2_DEVICE_TYPE_MOUSE) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Set defaults
if (!ps2_write_device_cmd (&port2, true, PS2_DEV_CMD_SET_TO_DEFAULT)) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Interrupt when keys are pressed
if (!ps2_write_device_cmd (&port2, true, PS2_DEV_CMD_ENABLE_SCANNING)) {
RETURN_ERROR (ERR_DEVICE_INIT_FAILED, false);
RETURN_ERROR (ERROR_PASSTHROUGH, false);
}

// Setup PS2 configuration to enable interrupts from port 2
Expand Down

0 comments on commit 17624d5

Please sign in to comment.