| plan 9 kernel history: overview | file list | diff list |
1991/0730/pc/kbd.c (diff list | history)
| 1991/0719/sys/src/9/pc/kbd.c:11,23 – 1991/0730/sys/src/9/pc/kbd.c:11,25 (short | long | prev | next) | ||
| 1991/0702 | Status= 0x64, /* status port */ Inready= 0x01, /* input character ready */ Outbusy= 0x02, /* output busy */ | |
| 1991/0730 | Sysflag= 0x04, /* system flag */ | |
| 1991/0702 | Cmddata= 0x08, /* cmd==0, data==1 */ | |
| 1991/0730 | Inhibit= 0x10, /* keyboard/mouse inhibited */ Minready= 0x20, /* mouse character ready */ Rtimeout= 0x40, /* general timeout */ Parity= 0x80, /* 1 == error */ | |
| 1991/0702 | ||
| 1991/0730 | Cmd= 0x64, /* command port (write only) */ | |
| 1991/0703 | Spec= 0x80, PF= Spec|0x20, /* num pad function key */ | |
| 1991/0719/sys/src/9/pc/kbd.c:237,244 – 1991/0730/sys/src/9/pc/kbd.c:239,273 | ||
| 1991/0703 | void kbdinit(void) { | |
| 1991/0730 | uchar c; | |
| 1991/0703 | initq(&kbdq); | |
| 1991/0716 | setvec(Kbdvec, kbdintr); | |
| 1991/0730 | /* wait for a quiescent controller */ while((c = inb(Status)) & (Outbusy | Inready)) if(c & Inready) inb(Data); /* read controller command byte */ outb(Cmd, 0x20); while(!(inb(Status) & Inready)) ; c = inb(Data); print("input completed\n"); delay(5000); /* enable mouse and mouse interupts */ c = (c&~0x20) | 0x02; outb(Cmd, 0x60); while(inb(Status) & Outbusy) ; outb(Data, c); print("mouse enabled\n"); delay(5000); initq(&mouseq); setvec(Mousevec, kbdintr); | |
| 1991/0703 | } /* | |
| 1991/0719/sys/src/9/pc/kbd.c:247,253 – 1991/0730/sys/src/9/pc/kbd.c:276,282 | ||
| 1991/0703 | void | |
| 1991/0706 | kbdintr(Ureg *ur) | |
| 1991/0703 | { | |
| 1991/0730 | int s, c, nc; | |
| 1991/0703 | static int esc1, esc2; static int shift; static int caps; | |
| 1991/0719/sys/src/9/pc/kbd.c:257,265 – 1991/0730/sys/src/9/pc/kbd.c:286,304 | ||
| 1991/0703 | int keyup; | |
| 1991/0702 | ||
| 1991/0703 | /* | |
| 1991/0719 |
| |
| 1991/0730 | * get status and character | |
| 1991/0703 | */ | |
| 1991/0730 | s = inb(Status); | |
| 1991/0703 | c = inb(Data); | |
| 1991/0730 | /* * if it's the mouse... */ if(s & Minready){ print("mousechar\n"); mouseputc(&mouseq, c); return; } | |
| 1991/0703 | keyup = c&0x80; c &= 0x7f; | |