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