From 7c8b87380fe93acfce958a8ddc6e83a79196d1b7 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Mon, 16 Jun 2003 16:36:58 +0000 Subject: [PATCH] Simple extended keyboard detection using 40:96 git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@608 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/console.asm | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/kernel/console.asm b/kernel/console.asm index 546ab06..c50a8e2 100644 --- a/kernel/console.asm +++ b/kernel/console.asm @@ -56,30 +56,13 @@ uScanCode db 0 ; Scan code for con: device kbdType db 0 ; 00 for 84key, 10h for 102key -; -; (taken from nansi.sys) -; global ConInit ConInit: - ; Jam special test code into keyboard buffer - mov ah,5 - mov cx,0ffffh - int 16h - ; Try to read special test code from keyboard buffer - mov cx, 10h -kbdLoop: - ; Get keystroke using extended keyboard read - mov ah, 10h - int 16h - ; Is it our special test code? - cmp ax, 0ffffh - ; Yes; Set flag saying that the extended keyboard BIOS is supported - je kbdExtended - loop kbdLoop - jmp short kbdSimple -kbdExtended: - mov byte[cs:kbdType],10h -kbdSimple: + mov ax,40h + mov ds,ax + mov al,[96h] + and al,10h + mov byte[cs:kbdType],al ; enhanced keyboard if bit 4 set jmp _IOExit ;