|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Driver Kit Version 1.1.0 ! 3: * Copyright (c) 1982, 1990 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * Keyboard/display driver. ! 8: * Coherent, IBM PC/XT/AT. ! 9: */ ! 10: #include <sys/coherent.h> ! 11: #include <sys/i8086.h> ! 12: #include <sys/con.h> ! 13: #include <sys/devices.h> ! 14: #include <errno.h> ! 15: #include <sys/stat.h> ! 16: #include <sys/tty.h> ! 17: #include <sys/uproc.h> ! 18: #include <signal.h> ! 19: #include <sys/sched.h> ! 20: ! 21: #define SPC 0376 /* Special encoding */ ! 22: #define XXX 0377 /* Non-character */ ! 23: #define KBDATA 0x60 /* Keyboard data */ ! 24: #define KBCTRL 0x61 /* Keyboard control */ ! 25: #define KBFLAG 0x80 /* Keyboard reset flag */ ! 26: #define LEDCMD 0xED /* status indicator command */ ! 27: #define KBACK 0xFA /* status indicator acknowledge */ ! 28: #define EXTENDED1 0xE1 /* extended key seq initiator */ ! 29: ! 30: #define KEYUP 0x80 /* Key up change */ ! 31: #define KEYSC 0x7F /* Key scan code mask */ ! 32: #define LSHIFT 0x2A-1 /* Left shift key */ ! 33: #define LSHIFTA 0x2B-1 /* Alternate left-shift key */ ! 34: #define RSHIFT 0x36-1 /* Right shift key */ ! 35: #define CTRL 0x1D-1 /* Control key */ ! 36: /*-- #define CAPLOCK 0x1D-1 --*/ /* Control key */ ! 37: #define ALT 0x38-1 /* Alt key */ ! 38: #define CAPLOCK 0x3A-1 /* Caps lock key */ ! 39: /*-- #define CTRL 0x3A-1 --*/ /* Caps lock key */ ! 40: #define NUMLOCK 0x45-1 /* Numeric lock key */ ! 41: #define DELETE 0x53-1 /* Del, as in CTRL-ALT-DEL */ ! 42: #define BACKSP 0x0E-1 /* Back space */ ! 43: #define SCRLOCK 0x46-1 /* Scroll lock */ ! 44: ! 45: /* Shift flags */ ! 46: #define SRS 0x01 /* Right shift key on */ ! 47: #define SLS 0x02 /* Left shift key on */ ! 48: #define CTS 0x04 /* Ctrl key on */ ! 49: #define ALS 0x08 /* Alt key on */ ! 50: #define CPLS 0x10 /* Caps lock on */ ! 51: #define NMLS 0x20 /* Num lock on */ ! 52: #define AKPS 0x40 /* Alternate keypad shift */ ! 53: #define SHFT 0x80 /* Shift key flag */ ! 54: ! 55: /* Function key information */ ! 56: #define NFKEY 20 /* Number of settable functions */ ! 57: #define NFCHAR 150 /* Number of characters settable */ ! 58: #define NFBUF (NFKEY*2+NFCHAR+1) /* Size of buffer */ ! 59: ! 60: /* ! 61: * Functions. ! 62: */ ! 63: int isrint(); ! 64: int istime(); ! 65: void isbatch(); ! 66: int mmstart(); ! 67: int isopen(); ! 68: int isclose(); ! 69: int isread(); ! 70: int mmwrite(); ! 71: int isioctl(); ! 72: void mmwatch(); ! 73: int isload(); ! 74: int isuload(); ! 75: int ispoll(); ! 76: int nulldev(); ! 77: int nonedev(); ! 78: ! 79: /* ! 80: * Configuration table. ! 81: */ ! 82: CON iscon ={ ! 83: DFCHR|DFPOL, /* Flags */ ! 84: KB_MAJOR, /* Major index */ ! 85: isopen, /* Open */ ! 86: isclose, /* Close */ ! 87: nulldev, /* Block */ ! 88: isread, /* Read */ ! 89: mmwrite, /* Write */ ! 90: isioctl, /* Ioctl */ ! 91: nulldev, /* Powerfail */ ! 92: mmwatch, /* Timeout */ ! 93: isload, /* Load */ ! 94: isuload, /* Unload */ ! 95: ispoll /* Poll */ ! 96: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.