--- Net2/arch/i386/stand/kbd.c 2018/04/24 18:04:01 1.1 +++ Net2/arch/i386/stand/kbd.c 2018/04/24 18:05:13 1.1.1.2 @@ -49,6 +49,7 @@ typedef unsigned char u_char; u_char inb(); +#ifdef notdef u_char action[] = { 0, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 0- 7 */ ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 8-15 */ @@ -127,14 +128,16 @@ struct key { #endif u_char shfts, ctls, alts, caps, num, stp; +#endif #define KBSTATP 0x64 /* kbd status port */ #define KBS_INP_BUF_FUL 0x02 /* kbd char ready */ #define KBDATAP 0x60 /* kbd data port */ #define KBSTATUSPORT 0x61 /* kbd status */ -u_char odt; +u_char odt, bdt; +#ifdef notdef u_char kbd() { u_char dt, brk, act; @@ -193,18 +196,25 @@ loop: } goto loop; } +#endif scankbd() { u_char c; c = inb(0x60); - if (c == 0xaa) { odt = 0x2a; return (0); } - if (c == 0xfa) { odt = 0x7a; return (0); } + if (c == 83) exit(); + /*if (c == 0xaa) return (0); + if (c == 0xfa) return (0);*/ + + if (bdt == 0) { bdt = c&0x7f; return(0); } + + if(odt) return(1); + c &= 0x7f; - if ( (odt&0x7f) == c )return(0); - if(odt == 0) { odt = c; return(0); } - return(kbd()); + if (bdt == c) return(0); + odt = c; + return(1); } kbdreset() @@ -226,8 +236,11 @@ kbdreset() outb(0x64,0xd1); while (inb(0x64)&2); /* wait input ready */ outb(0x60,0xdf); + odt = bdt = 0; + inb(0x60); } +#ifdef notdef; u_char getchar() { u_char c; @@ -237,6 +250,7 @@ u_char getchar() { putchar(c); return(c); } +#endif reset_cpu() {