From 32fc6c2ddfc353ff88f3ceca8e4eb7e8607f5edf Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 23 Dec 2020 23:06:54 -0800 Subject: 7395 - boot.hex: recognize '1' press on keyboard https://stackoverflow.com/questions/37618111/keyboard-irq-within-an-x86-kernel is right, no need to mess with the status port at the start. --- apps/boot.hex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/boot.hex b/apps/boot.hex index 181fdcd4..e49dd2d8 100644 --- a/apps/boot.hex +++ b/apps/boot.hex @@ -225,12 +225,16 @@ e9 fb ff ff ff # loop forever b0 20 # al <- 0x20 e6 20 # port 0x20 <- al # read keyboard status (TODO: why bit 0? Doesn't line up with https://web.archive.org/web/20040604041507/http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html) - e4 64 # al <- port 0x64 - a8 01 # set zf if bit 0 (least significant) is not set - 74 00 # if bit 0 is not set, skip to epilogue HERE +#? e4 64 # al <- port 0x64 +#? a8 01 # set zf if bit 0 (least significant) is not set +#? 74 11 # if bit 0 is not set, skip to epilogue # read keycode into eax 31 c0 # eax <- xor eax; 11/direct 000/r32/eax 000/rm32/eax e4 60 # al <- port 0x60 + # map key '1' to ascii; if eax == 2, eax = 0x31 + 3d 02 00 00 00 # compare eax with 0x02 + 75 0b # if not equal, goto epilogue + b8 31 0f 00 00 # eax <- 0x0f31 # print eax to top-left of screen (*0xb8000) 89 # copy r32 to rm32 05 # 00/mod/indirect 000/r32/eax 101/rm32/use-disp32 @@ -242,8 +246,8 @@ e9 fb ff ff ff # loop forever cf # iret # padding -# 149 - 00 00 00 00 00 00 00 +# 14f + 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 -- cgit 1.4.1-2-gfad0