TODO list updates.
[seabios.git] / src / kbd.c
index e976350bf09c71d3dde1edc5dceaf4a03f30e4cb..4c43c317e670a25aa952ee4b48f59ab68f11277f 100644 (file)
--- a/src/kbd.c
+++ b/src/kbd.c
 static void
 keyboard_init()
 {
-    if (CONFIG_COREBOOT)
-        // Coreboot already does low-level keyboard init.
-        goto end;
-
     /* flush incoming keys */
     int ret = i8042_flush();
     if (ret)
@@ -55,7 +51,7 @@ keyboard_init()
     /* ------------------- keyboard side ------------------------*/
     /* reset keyboard and self test  (keyboard side) */
     ret = kbd_command(ATKBD_CMD_RESET_BAT, param);
-    if (ret != 0 && ret != 2)
+    if (ret)
         return;
     if (param[0] != 0xaa) {
         dprintf(1, "keyboard self test failed (got %x not 0xaa)\n", param[0]);
@@ -67,7 +63,12 @@ keyboard_init()
     if (ret)
         return;
 
-end:
+    // Set scancode command (mode 2)
+    param[0] = 0x02;
+    ret = kbd_command(ATKBD_CMD_SSCANSET, param);
+    if (ret)
+        return;
+
     // Keyboard Mode: scan code convert, disable mouse, enable IRQ 1
     SET_EBDA(ps2ctr, I8042_CTR_AUXDIS | I8042_CTR_XLATE | I8042_CTR_KBDINT);
 
@@ -551,9 +552,11 @@ process_key(u8 scancode)
         if (scancode & 0x80)
             // toss key releases
             break;
-        if (scancode == 0x53 && (shift_flags & 0x0c) == 0x0c)
+        if (scancode == 0x53 && (shift_flags & 0x0c) == 0x0c) {
             // Ctrl+alt+del - reset machine.
+            SET_BDA(soft_reset_flag, 0x1234);
             reset_vector();
+        }
         if (scancode > MAX_SCAN_CODE) {
             dprintf(1, "KBD: int09h_handler(): unknown scancode read: 0x%02x!\n"
                     , scancode);