Index: lab3/Makefile
===================================================================
--- lab3/Makefile	(revision 7)
+++ lab3/Makefile	(revision 8)
@@ -2,7 +2,7 @@
 PROG=lab3
 
 # source code files to be compiled
-SRCS = lab3.c 
+SRCS = lab3.c #timer.c utils.c
 
 # additional compilation flags
 # "-Wall -Wextra -Werror -I . -std=c11 -Wno-unused-parameter" are already set
Index: lab3/lab2.c
===================================================================
--- lab3/lab2.c	(revision 7)
+++ lab3/lab2.c	(revision 8)
@@ -60,11 +60,7 @@
 int(timer_test_int)(uint8_t time) {
   /* To be implemented by the students */
 
-  if(time<0) 
-  {
-    printf("INVALID TIME!");
-  return 1;
-  }
+  if(time<0) return 1;
 
   int ipc_status;
   message msg;
Index: lab3/lab3
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
Index: lab3/lab3.c
===================================================================
--- lab3/lab3.c	(revision 7)
+++ lab3/lab3.c	(revision 8)
@@ -4,6 +4,7 @@
 #include <lcom/lab3.h>
 
 #include <stdbool.h>
+#include "i8254.h"
 #include <stdint.h>
 //#include <timer.c>
 
@@ -48,8 +49,7 @@
   message msg;
   int hook_id = bit_no;
   uint8_t scan_arr[2] = {0, 0};
-  scan_arr[0] = scancode & 0xFF;
-  scan_arr[1] = scancode & 0xFF00;
+
   int flag = 0;
   uint32_t cnt=0;
 
@@ -70,7 +70,8 @@
   //kbc_ih();
   printf("\n");
   while (scancode !=
-         EXIT_CODE) { /* You may want to use a different condition */
+         EXIT_CODE)
+  { /* You may want to use a different condition */
     /* Get a request message. */
     // printf("1\n");
     // printf("cont:%d, time:%d\n\n",cont/60,time);
@@ -131,9 +132,14 @@
 
 int(kbd_test_poll)() {
   /* To be completed by the students */
+  uint32_t key=0;
   uint8_t scan_arr[2] = {0, 0};
   int flag = 0;
   uint32_t cnt=0;
+  sys_outb(0x64,0x20);        //enable interrupts again
+  
+  sys_outb(0x64, 0x60);
+  sys_inb(0x60,&key);
   while(scancode != EXIT_CODE)
   {
     tickdelay(micros_to_ticks(DELAY_US));
@@ -162,16 +168,102 @@
             flag = 0;
           }
         }
-
   }
   kbd_print_no_sysinb(cnt);
-
-  return 1;
+  sys_outb(0x64,0x60);        //enable interrupts again
+  sys_outb(0x60,  key |  BIT(0));      //enable interrupts again
+  return 0;
 }
 
 int(kbd_test_timed_scan)(uint8_t n) {
   /* To be completed by the students */
-  printf("%s is not yet implemented!\n", __func__);
+  uint8_t scan_arr[2] = {0, 0};
+  int flag=0;
+   int ipc_status;
+  message msg;
+  uint8_t r;
+  uint8_t bit_no_timer = 0, bit_no_kbd = 1;
+  int hook_id_kbd=bit_no_kbd, hook_id_timer=bit_no_timer;
+  int cont=0,cnt=0;
+  
+  sys_irqsetpolicy(IRQ_TIMER,IRQ_REENABLE,&hook_id_timer);
+  sys_irqsetpolicy(IRQ_KB, IRQ_REENABLE | IRQ_EXCLUSIVE, &hook_id_kbd);
+  kbc_ih();
+  while( (cont/DEFAULT_FREQ)<n && scancode !=EXIT_CODE) //se não atingir o tempo de espera nem a tecla for ESC
+ { 
+   /* You may want to use a different condition */
+     /* Get a request message. */
+     // printf("1\n");
+     //printf("cont:%d, time:%d\n\n",cont/60,time);
+     if ( (r = driver_receive(ANY, &msg, &ipc_status)) != 0 ) 
+     { 
+        printf("driver_receive failed with: %d", r);
+       continue;
+    }
+    if (is_ipc_notify(ipc_status)) { 
+        switch (_ENDPOINT_P(msg.m_source)) {
+            case HARDWARE: 				
+                if (msg.m_notify.interrupts  & BIT(bit_no_timer)) { 
+                   cont++;
+                   if(cont%DEFAULT_FREQ==0)
+                   timer_print_elapsed_time();
+                   //printf("cont:%d\n",cont);
+               }
+               if (msg.m_notify.interrupts  & BIT(bit_no_kbd)) 
+               { 
+                    
+                  #ifdef LAB3 
+                  cnt++; 
+                 #endif
+                 sys_inb(0x64, &scancode); 
+                 if (scancode & 0x01) { 
+                  #ifdef LAB3 
+                   cnt++; 
+                    #endif
+                   sys_inb(0x60, &scancode); 
+                 if (scancode != 0xe0 && flag == 0) 
+                 {
+                    
+                   scan_arr[0] = scancode;
+                   kbd_print_scancode(!(scancode & 0x80), 1, scan_arr);
+                 }
 
-  return 1;
+                 else if (scancode == 0xe0)
+                  {
+                   scan_arr[0] = scancode;
+                    flag = 1;
+                 }
+
+                 else if (flag == 1) 
+                 {
+                    scan_arr[1] = scancode;
+                     kbd_print_scancode(!(scancode & 0x80), 2, scan_arr);
+                   flag = 0;
+                   }
+                   cont=0;
+               }
+                //printf("msg:%x\n",msg.m_notify.interrupts);
+                break;
+            default:
+                //printf("2\n");
+                break; /* no other notifications expected: do nothing */	
+        }
+    } 
+     // printf("3\n"); /* received a standard message, not a notification */
+        /* no standard messages expected: do nothing */
+    
+ }
+ }
+  kbd_print_no_sysinb(cnt);
+  
+  if(sys_irqrmpolicy(&hook_id_timer)!=0) return 1;
+  if(sys_irqrmpolicy(&hook_id_kbd)!=0) return 1;
+  
+    
+    return 0;
+
+
+  //printf("%s is not yet implemented!\n", __func__);
+
+ 
 }
Index: lab3/output.txt
===================================================================
--- lab3/output.txt	(revision 7)
+++ lab3/output.txt	(revision 8)
@@ -0,0 +1,10 @@
+Breakcode: 0x9c
+Makecode: 0x1f
+Makecode: 0x21
+Breakcode: 0x9f
+Breakcode: 0xa1
+Makecode: 0x1f
+Breakcode: 0x9f
+Makecode: 0x01
+Breakcode: 0x81
+sys_inb_calls: 139
Index: lab3/timer.c
===================================================================
--- lab3/timer.c	(revision 7)
+++ lab3/timer.c	(revision 8)
@@ -58,9 +58,9 @@
  /*  int policy;
   sys_irqrmpolicy(&policy); */
   hook_id=*bit_no;
-  if(sys_irqsetpolicy(IRQ_TIMER,IRQ_REENABLE,&hook_id)!=0) return 1;
+  sys_irqsetpolicy(IRQ_TIMER,IRQ_REENABLE,&hook_id);
 
-  return 0;
+  return 1;
 }
 
 int (timer_unsubscribe_int)() {
@@ -67,9 +67,9 @@
   /* To be implemented by the students */
 // printf("%s is not yet implemented!\n", __func__);
 
-  if(sys_irqrmpolicy(&hook_id)!=0) return 1;
+sys_irqrmpolicy(&hook_id);
 
-  return 0;
+  return 1;
 }
 
 void (timer_int_handler)() {
Index: lab3/trace.txt
===================================================================
--- lab3/trace.txt	(revision 7)
+++ lab3/trace.txt	(revision 8)
@@ -0,0 +1,1264 @@
+@lcflib.a:2019, lcf_start
+  kbd_test_poll()
+  @lab3.c:139, kbd_test_poll
+    sys_outb(0x64, 0x20)
+  > sys_outb(0x64, 0x20 = 0b00100000)
+  @lab3.c:141, kbd_test_poll
+    sys_outb(0x64, 0x60)
+  > sys_outb(0x64, 0x60 = 0b01100000)
+  @lab3.c:142, kbd_test_poll
+    sys_inb(0x60, &key)
+  > sys_inb(0x60, addr: 0xeffff810)
+  < sys_inb(0x60, addr: 0xeffff810 [0x46 = 0b01000110])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x9c = 0b10011100])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Breakcode: 0x9c"
+  < kbd_print_scancode(false, 1, addr: 0xeffff80e [0x9c]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x1f = 0b00011111])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Makecode: 0x1f"
+  < kbd_print_scancode(true, 1, addr: 0xeffff80e [0x1f]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x21 = 0b00100001])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Makecode: 0x21"
+  < kbd_print_scancode(true, 1, addr: 0xeffff80e [0x21]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x9f = 0b10011111])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Breakcode: 0x9f"
+  < kbd_print_scancode(false, 1, addr: 0xeffff80e [0x9f]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0xa1 = 0b10100001])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Breakcode: 0xa1"
+  < kbd_print_scancode(false, 1, addr: 0xeffff80e [0xa1]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x1f = 0b00011111])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Makecode: 0x1f"
+  < kbd_print_scancode(true, 1, addr: 0xeffff80e [0x1f]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x9f = 0b10011111])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Breakcode: 0x9f"
+  < kbd_print_scancode(false, 1, addr: 0xeffff80e [0x9f]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x01 = 0b00000001])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Makecode: 0x01"
+  < kbd_print_scancode(true, 1, addr: 0xeffff80e [0x01]) -> (ret: 0)
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1c = 0b00011100])
+  @lab3.c:145, kbd_test_poll
+    micros_to_ticks(DELAY_US)
+  @lab3.c:145, kbd_test_poll
+    tickdelay(micros_to_ticks(DELAY_US))
+  > tickdelay(1 [16.7 ms])
+  @lab3.c:149, kbd_test_poll
+    sys_inb(0x64, &scancode)
+  > sys_inb(0x64, addr: 0x81978f8)
+  < sys_inb(0x64, addr: 0x81978f8 [0x1d = 0b00011101])
+  @lab3.c:154, kbd_test_poll
+    sys_inb(0x60, &scancode)
+  > sys_inb(0x60, addr: 0x81978f8)
+  < sys_inb(0x60, addr: 0x81978f8 [0x81 = 0b10000001])
+  @lab3.c:157, kbd_test_poll
+    kbd_print_scancode(!(scancode & 0x80), 1, scan_arr)
+    "Breakcode: 0x81"
+  < kbd_print_scancode(false, 1, addr: 0xeffff80e [0x81]) -> (ret: 0)
+  @lab3.c:173, kbd_test_poll
+    kbd_print_no_sysinb(cnt)
+    "sys_inb_calls: 139"
+  @lab3.c:174, kbd_test_poll
+    sys_outb(0x64, 0x60)
+  > sys_outb(0x64, 0x60 = 0b01100000)
+  @lab3.c:175, kbd_test_poll
+    sys_outb(0x60, key | BIT(0))
+  > sys_outb(0x60, 0x47 = 0b01000111)
+< kbd_test_poll() -> (ret: 0)
Index: lab3/utils.c
===================================================================
--- lab3/utils.c	(revision 7)
+++ lab3/utils.c	(revision 8)
@@ -20,7 +20,7 @@
 int (util_sys_inb)(int port, uint8_t *value) {
   /* To be implemented by the students */
   uint32_t b32;
- if(sys_inb(port,&b32)!=0)return 1;
+ sys_inb(port,&b32);
  //printf("%x",b32);
  *value=b32&0xFF;
  //printf("%x\n",*value);
