:: commit 4c1782357a825aaa09e53c99296ad75a245f5aae

mintsuki <mintsuki@protonmail.com> — 2021-05-13 00:56

parents: df6a0d3c24

readline: Fix issue where timeouts were not reported properly on BIOS

diff --git a/stage23/lib/sleep.asm b/stage23/lib/sleep.asm
index d1abe6ab..fc1c4dd0 100644
--- a/stage23/lib/sleep.asm
+++ b/stage23/lib/sleep.asm
@@ -119,6 +119,9 @@ _pit_sleep_and_quit_on_keypress:
     mov edx, dword [int_08_callback]
     mov dword [0x08*4], edx
 
+    test eax, eax
+    jz .out
+
     xor edx, edx
     mov dl, ah
     xor ah, ah
@@ -128,6 +131,7 @@ _pit_sleep_and_quit_on_keypress:
     pop edx
     pop edx
 
+  .out:
     ret
 
   .gdt:      dq 0
tab: 248 wrap: offon