diff --git a/src/clock.c b/src/clock.c
index e32bf1b..241119e 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -228,6 +228,7 @@ timer_setup(void)
 static void
 handle_1a00(struct bregs *regs)
 {
+    yield();
     u32 ticks = GET_BDA(timer_counter);
     regs->cx = ticks >> 16;
     regs->dx = ticks;
diff --git a/src/config.h b/src/config.h
index 6297a48..9a3a165 100644
--- a/src/config.h
+++ b/src/config.h
@@ -16,9 +16,9 @@
 #define CONFIG_COREBOOT 0
 
 // Control how verbose debug output is.
-#define CONFIG_DEBUG_LEVEL 1
+#define CONFIG_DEBUG_LEVEL 8
 // Send debugging information to serial port
-#define CONFIG_DEBUG_SERIAL 0
+#define CONFIG_DEBUG_SERIAL 1
 // Screen writes are also sent to debug ports.
 #define CONFIG_SCREEN_AND_DEBUG 1
 
diff --git a/src/kbd.c b/src/kbd.c
index 6f3ae15..7e3434a 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -73,6 +73,7 @@ enqueue_key(u8 scan_code, u8 ascii_code)
 static void
 dequeue_key(struct bregs *regs, int incr, int extended)
 {
+    yield();
     u16 buffer_head;
     u16 buffer_tail;
     for (;;) {
@@ -552,9 +553,19 @@ process_key(u8 key)
         // allow for keyboard intercept
         u32 eax = (0x4f << 8) | key;
         u32 flags;
+#if 0
         call16_simpint(0x15, &eax, &flags);
         if (!(flags & F_CF))
             return;
+#else
+        struct bregs br;
+        memset(&br, 0, sizeof(br));
+        br.eax = eax;
+        call16_int(0x15, &br);
+        flags = br.flags;
+        if (!(flags & F_CF))
+            return;
+#endif
         key = eax;
     }
     __process_key(key);
diff --git a/src/mouse.c b/src/mouse.c
index 52e225c..92fb16a 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -305,15 +305,17 @@ process_mouse(u8 data)
         return;
     }
 
-    //BX_DEBUG_INT74("int74_function: make_farcall=1\n");
     u16 status = GET_EBDA2(ebda_seg, mouse_data[0]);
     u16 X      = GET_EBDA2(ebda_seg, mouse_data[1]);
     u16 Y      = GET_EBDA2(ebda_seg, mouse_data[2]);
     SET_EBDA2(ebda_seg, mouse_flag1, 0);
 
     struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
+    dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
+            , status, X, Y, func.seg, func.offset);
 
     asm volatile(
+        "pusha\n"
         "sti\n"
 
         "pushl %0\n"
@@ -326,6 +328,7 @@ process_mouse(u8 data)
 
         "cli\n"
         "cld\n"
+        "popa\n"
         :
         : "r"(func.segoff), "r"(status), "r"(X), "r"(Y)
         : "cc"
diff --git a/src/ps2port.c b/src/ps2port.c
index fb9d24a..759ad37 100644
--- a/src/ps2port.c
+++ b/src/ps2port.c
@@ -226,8 +226,11 @@ ps2_command(int aux, int command, u8 *param)
     if (ret)
         return ret;
 
+    // Flush any interrupts already pending.
+    yield();
+
     if (command == ATKBD_CMD_RESET_BAT) {
-        // Reset is special wrt timeouts.
+        // Reset is special wrt timeouts and bytes received.
 
         // Send command.
         ret = ps2_sendbyte(aux, command, 1000);
@@ -244,6 +247,29 @@ ps2_command(int aux, int command, u8 *param)
             // Some devices only respond with one byte on reset.
             ret = 0;
         param[1] = ret;
+    } else if (command == ATKBD_CMD_GETID) {
+        // Getid is special wrt bytes received.
+
+        // Send command.
+        ret = ps2_sendbyte(aux, command, 200);
+        if (ret)
+            goto fail;
+
+        // Receive parameters.
+        ret = ps2_recvbyte(aux, 0, 500);
+        if (ret < 0)
+            goto fail;
+        param[0] = ret;
+        if (ret == 0xab || ret == 0xac || ret == 0x2b || ret == 0x5d
+            || ret == 0x60 || ret == 0x47) {
+            // These ids (keyboards) return two bytes.
+            ret = ps2_recvbyte(aux, 0, 500);
+            if (ret < 0)
+                goto fail;
+            param[1] = ret;
+        } else {
+            param[1] = 0;
+        }
     } else {
         // Send command.
         ret = ps2_sendbyte(aux, command, 200);
@@ -336,7 +362,8 @@ handle_09(void)
         return;
 
     debug_isr(DEBUG_ISR_09);
-    process_ps2irq();
+//    process_ps2irq();
+    process_ps2byte(inb(PORT_PS2_STATUS), inb(PORT_PS2_DATA));
     eoi_pic1();
 }
 
