summaryrefslogtreecommitdiff
path: root/boot/vesa_setup_16.asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-09-08 12:23:20 +0200
committerMichal Idziorek <m.i@gmx.at>2014-09-08 12:23:20 +0200
commit77357ba0bd02eb9ef76af15697f62f6021c0a4fe (patch)
treee60b2d74357168e423613fed8ec529aed84c564e /boot/vesa_setup_16.asm
parent2a204125c98699aa2baa8f6f91fc5129f6eb7385 (diff)
fixed waiting for keypress in bootloader.
Diffstat (limited to 'boot/vesa_setup_16.asm')
-rw-r--r--boot/vesa_setup_16.asm35
1 files changed, 24 insertions, 11 deletions
diff --git a/boot/vesa_setup_16.asm b/boot/vesa_setup_16.asm
index 62d8d46..25eba22 100644
--- a/boot/vesa_setup_16.asm
+++ b/boot/vesa_setup_16.asm
@@ -51,17 +51,30 @@ VesaSetup:
; call print_nextline
;preempt keyboard buffer
-; next_key:
-;
-; mov al,0
-; mov ah,1 ; block waiting for keyboard scancode
-;
-; int 0x16
-; cmp ax,0
-; jne next_key
-;
-; mov ah,0 ; block waiting for keyboard scancode
-; int 0x16
+
+ next_key:
+
+ mov ah,0x1 ;get scnacode from kb (non-blocking)
+ int 0x16
+ jnz get_key ; nothing to preempt
+
+ jmp wait_key
+
+ get_key:
+ mov ah,0 ;get key from buffer
+ int 0x16
+
+; mov al,ah
+; call print_hex_byte
+; call print_nextline
+
+ jmp next_key
+
+ ;;;;;;;;;;;;;;;;;
+ wait_key:
+ mov ah,0 ; block waiting for keyboard scancode
+ int 0x16
+
;VESA: finally switch to the mode of choice!
mov ax,0x4f02 ;vesa function: Set Mode