about summary refs log tree commit diff stats
path: root/baremetal/boot.hex
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-22 16:52:44 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-22 16:52:44 -0800
commitc316a11ffa6fa184c9c62dc6fccbc0a6aa6c8f63 (patch)
tree1d4b6fb215639d5d58fc9d598b5fc4ae6983ee17 /baremetal/boot.hex
parentdbf434f09660263aa989e9fc46789f5aea12618e (diff)
downloadmu-c316a11ffa6fa184c9c62dc6fccbc0a6aa6c8f63.tar.gz
7539 - baremetal: handle unrecognized keys
Diffstat (limited to 'baremetal/boot.hex')
-rw-r--r--baremetal/boot.hex18
1 files changed, 11 insertions, 7 deletions
diff --git a/baremetal/boot.hex b/baremetal/boot.hex
index 1fc316c5..c6f8273b 100644
--- a/baremetal/boot.hex
+++ b/baremetal/boot.hex
@@ -233,7 +233,7 @@ e9 fb ff  # loop forever
   # if (status & 0x1) == 0, return
   24 01  # al <- and 0x1
   3c 00  # compare al, 0
-  74 35  # jump to epilogue if = [label]
+  74 39  # jump to epilogue if = [label]
 # 120:
   # if keyboard buffer is full, return
   31 c9  # ecx <- xor ecx;  11/direct 001/r32/ecx 001/rm32/ecx
@@ -248,7 +248,7 @@ e9 fb ff  # loop forever
   # . if (al != 0) return
   3c 00  # compare al, 0
 # 130:
-  75 23  # jump to epilogue if != [label]
+  75 27  # jump to epilogue if != [label]
   # read keycode into al
   e4 60  # al <- port 0x60
   # if (al & 0x80) a key is being lifted; return
@@ -256,17 +256,21 @@ e9 fb ff  # loop forever
   24 80  # al <- and 0x80
   3c 00  # compare al, 0
   58  # pop to eax (without touching flags)
-  75 19  # jump to epilogue if != [label]
+  75 1d  # jump to epilogue if != [label]
 # 13c:
   # al <- *(keyboard normal map + eax)
   8a  # copy m8 at rm32 to r8
     80  # 10/mod/*+disp32 000/r8/al 000/rm32/eax
     00 80 00 00  # disp32 [label]
+  # if there's no character mapping, return
+  3c 00  # compare al, 0
+  74 13  # jump to epilogue if = [label]
+# 146:
   # store al in keyboard buffer
   88  # copy r8 to m8 at r32
     81  # 10/mod/*+disp32 000/r8/al 001/rm32/ecx
     d0 7d 00 00  # disp32 [label]
-# 148:
+# 14c:
   # increment index
   fe  # increment byte
     05  # 00/mod/indirect 000/subop/increment 101/rm32/use-disp32
@@ -276,15 +280,15 @@ e9 fb ff  # loop forever
     25  # 00/mod/indirect 100/subop/and 101/rm32/use-disp32
     c8 7d 00 00  # disp32 [label]
     0f  # imm8
-# 155:
+# 159:
   # epilogue
   61  # pop all registers
   fb  # enable interrupts
   cf  # iret
 
 # padding
-# 158:
-                        00 00 00 00 00 00 00 00
+# 15c:
+                                    00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00