summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i386/i386at/conf.c20
-rw-r--r--i386/i386at/i386at_ds_routines.c5
-rw-r--r--i386/i386at/kd.c213
-rw-r--r--i386/i386at/kd.h15
-rw-r--r--i386/i386at/kd_event.c9
-rw-r--r--i386/i386at/kd_mouse.c24
6 files changed, 183 insertions, 103 deletions
diff --git a/i386/i386at/conf.c b/i386/i386at/conf.c
index 2bd2d2a..7bca47b 100644
--- a/i386/i386at/conf.c
+++ b/i386/i386at/conf.c
@@ -175,13 +175,16 @@ extern int kbdopen(), kbdclose(), kbdread();
extern int kbdgetstat(), kbdsetstat();
#define kbdname "kbd"
-extern int mouseopen(), mouseclose(), mouseread();
+extern int mouseopen(), mouseclose(), mouseread(), mousegetstat();
#define mousename "mouse"
extern int ioplopen(), ioplclose();
extern vm_offset_t ioplmmap();
#define ioplname "iopl"
+extern int kmsgopen(), kmsgclose(), kmsgread(), kmsggetstat();
+#define kmsgname "kmsg"
+
/*
* List of devices - console must be at slot 0
*/
@@ -328,21 +331,19 @@ struct dev_ops dev_name_list[] =
#endif
#endif /* ! LINUX_DEV */
-#if NCOM > 0
+#ifdef MACH_COM
{ comname, comopen, comclose, comread,
comwrite, comgetstat, comsetstat, nomap,
nodev, nulldev, comportdeath, 0,
nodev },
#endif
-#ifndef LINUX_DEV
-#if NLPR > 0
+#ifdef MACH_LPR
{ lprname, lpropen, lprclose, lprread,
lprwrite, lprgetstat, lprsetstat, nomap,
nodev, nulldev, lprportdeath, 0,
nodev },
#endif
-#endif /* ! LINUX_DEV */
#if NBLIT > 0
{ blitname, blitopen, blitclose, nodev,
@@ -352,7 +353,7 @@ struct dev_ops dev_name_list[] =
#endif
{ mousename, mouseopen, mouseclose, mouseread,
- nodev, nulldev, nulldev, nomap,
+ nodev, mousegetstat, nulldev, nomap,
nodev, nulldev, nulldev, 0,
nodev },
@@ -384,6 +385,13 @@ struct dev_ops dev_name_list[] =
#endif NHD > 0
#endif 0 /* Kevin doesn't know why this was here. */
+#ifdef MACH_KMSG
+ { kmsgname, kmsgopen, kmsgclose, kmsgread,
+ nodev, kmsggetstat, nodev, nomap,
+ nodev, nulldev, nulldev, 0,
+ nodev },
+#endif
+
};
int dev_name_count = sizeof(dev_name_list)/sizeof(dev_name_list[0]);
diff --git a/i386/i386at/i386at_ds_routines.c b/i386/i386at/i386at_ds_routines.c
index b67aa9e..be1f58d 100644
--- a/i386/i386at/i386at_ds_routines.c
+++ b/i386/i386at/i386at_ds_routines.c
@@ -35,7 +35,10 @@
#include <i386at/dev_hdr.h>
#include <i386at/device_emul.h>
-#include <i386/device-drivers.h>
+
+#ifdef LINUX_DEV
+#include <i386/linux/device-drivers.h>
+#endif
extern struct device_emulation_ops mach_device_emulation_ops;
#ifdef LINUX_DEV
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 906fdd5..7c87729 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -219,102 +219,120 @@ u_char *esc_spt = (u_char *)0;
* state. The states are ordered: Normal, SHIFT, CTRL, ALT,
* SHIFT/ALT.
*/
+
+/* This new keymap from Tudor Hulubei (tudor@cs.unh.edu) makes the
+ following changes to the keyboard driver:
+
+ - Alt + key (m-key) returns `ESC key' instead of `ESC N key'.
+ - Backspace returns 0x7f instead of 0x08.
+ - Delete returns `ESC [ 9' instead of 0x7f.
+ - Alt + function keys return key sequences that are different
+ from the key sequences returned by the function keys alone.
+ This is done with the idea of alowing a terminal server to
+ implement multiple virtual consoles mapped on Alt+F1, Alt+F2,
+ etc, as in Linux.
+
+ -- Derek Upham 1997/06/25 */
+
unsigned char key_map[NUMKEYS][WIDTH_KMAP] = {
-{NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC},
-{K_ESC,NC,NC, K_ESC,NC,NC, K_ESC,NC,NC, K_ESC,NC,NC, K_ESC,NC,NC},
-{K_ONE,NC,NC, K_BANG,NC,NC, K_ONE,NC,NC, 0x1b,0x4e,0x31,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x1b,0x4e,0x2c, 0x1b,0x4e,0x3c},
-{K_PERIOD,NC,NC, K_GTHN,NC,NC, K_PERIOD,NC,NC,0x1b,0x4e,0x2e,0x1b,0x4e,0x3e},
-{K_SLASH,NC,NC, K_QUES,NC,NC, K_SLASH,NC,NC, 0x1b,0x4e,0x2f, 0x1b,0x4e,0x3f},
-{K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC,
- K_SCAN,K_RSHSC,NC},
-{K_ASTER,NC,NC, K_ASTER,NC,NC, K_ASTER,NC,NC, 0x1b,0x4e,0x2a,0x1b,0x4e,0x2a},
-{K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC,
- K_SCAN,K_ALTSC,NC},
-{K_SPACE,NC,NC, K_SPACE,NC,NC, K_NUL,NC,NC, K_SPACE,NC,NC, K_SPACE,NC,NC},
-{K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC,
- K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC},
-{K_F1, K_F1S, K_F1, K_F1, K_F1S},
-{K_F2, K_F2S, K_F2, K_F2, K_F2S},
-{K_F3, K_F3S, K_F3, K_F3, K_F3S},
-{K_F4, K_F4S, K_F4, K_F4, K_F4S},
-{K_F5, K_F5S, K_F5, K_F5, K_F5S},
-{K_F6, K_F6S, K_F6, K_F6, K_F6S},
-{K_F7, K_F7S, K_F7, K_F7, K_F7S},
-{K_F8, K_F8S, K_F8, K_F8, K_F8S},
-{K_F9, K_F9S, K_F9, K_F9, K_F9S},
-{K_F10, K_F10S, K_F10, K_F10, K_F10S},
-{K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC,
- K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC},
-{K_SCRL, K_NUL,NC,NC, K_SCRL, K_SCRL, K_NUL,NC,NC},
-{K_HOME, K_SEVEN,NC,NC, K_HOME, K_HOME, 0x1b,0x4e,0x37},
-{K_UA, K_EIGHT,NC,NC, K_UA, K_UA, 0x1b,0x4e,0x38},
-{K_PUP, K_NINE,NC,NC, K_PUP, K_PUP, 0x1b,0x4e,0x39},
-{0x1b,0x5b,0x53, K_MINUS,NC,NC, 0x1b,0x5b,0x53,0x1b,0x5b,0x53,0x1b,0x4e,0x2d},
-{K_LA, K_FOUR,NC,NC, K_LA, K_LA, 0x1b,0x4e,0x34},
-{0x1b,0x5b,0x47,K_FIVE,NC,NC,0x1b,0x5b,0x47, 0x1b,0x5b,0x47, 0x1b,0x4e,0x35},
-{K_RA, K_SIX,NC,NC, K_RA, K_RA, 0x1b,0x4e,0x36},
-{0x1b,0x5b,0x54,K_PLUS,NC,NC, 0x1b,0x5b,0x54, 0x1b,0x5b,0x54, 0x1b,0x4e,0x2b},
-{K_END, K_ONE,NC,NC, K_END, K_END, 0x1b,0x4e,0x31},
-{K_DA, K_TWO,NC,NC, K_DA, K_DA, 0x1b,0x4e,0x32},
-{K_PDN, K_THREE,NC,NC, K_PDN, K_PDN, 0x1b,0x4e,0x33},
-{K_INS, K_ZERO,NC,NC, K_INS, K_INS, 0x1b,0x4e,0x30},
-{K_DEL,NC,NC, K_PERIOD,NC,NC, K_DEL,NC,NC, K_DEL,NC,NC, 0x1b,0x4e,0x2e},
-{NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC},
-{NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC},
-{NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC},
-{K_F11, K_F11S, K_F11, K_F11, K_F11S},
-{K_F12, K_F12S, K_F12, K_F12, K_F12S}
+ K_SCAN,K_LSHSC,NC},
+{K_BSLSH,NC,NC, K_PIPE,NC,NC, K_FS,NC,NC, 0x1b,0x5c,NC, 0x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KSC,NC, K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC,
+ K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC},
+{K_F1, K_F1S, K_F1, K_F1A, K_F1S},
+{K_F2, K_F2S, K_F2, K_F2A, K_F2S},
+{K_F3, K_F3S, K_F3, K_F3A, K_F3S},
+{K_F4, K_F4S, K_F4, K_F4A, K_F4S},
+{K_F5, K_F5S, K_F5, K_F5A, K_F5S},
+{K_F6, K_F6S, K_F6, K_F6A, K_F6S},
+{K_F7, K_F7S, K_F7, K_F7A, K_F7S},
+{K_F8, K_F8S, K_F8, K_F8A, K_F8S},
+{K_F9, K_F9S, K_F9, K_F9A, K_F9S},
+{K_F10, K_F10S, K_F10, K_F10A, K_F10S},
+{K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC,
+ K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC},
+{K_SCRL, K_NUL,NC,NC, K_SCRL, K_SCRL, K_NUL,NC,NC},
+{K_HOME, K_SEVEN,NC,NC, K_HOME, K_HOME, 0x1b,0x4e,0x37},
+{K_UA, K_EIGHT,NC,NC, K_UA, K_UA, 0x1b,0x4e,0x38},
+{K_PUP, K_NINE,NC,NC, K_PUP, K_PUP, 0x1b,0x4e,0x39},
+{0x1b,0x5b,0x53, K_MINUS,NC,NC, 0x1b,0x5b,0x53, 0x1b,0x5b,0x53,
+ 0x1b,0x4e,0x2d},
+{K_LA, K_FOUR,NC,NC, K_LA, K_LA, 0x1b,0x4e,0x34},
+{0x1b,0x5b,0x47, K_FIVE,NC,NC, 0x1b,0x5b,0x47, 0x1b,0x5b,0x47,
+ 0x1b,0x4e,0x35},
+{K_RA, K_SIX,NC,NC, K_RA, K_RA, 0x1b,0x4e,0x36},
+{0x1b,0x5b,0x54, K_PLUS,NC,NC, 0x1b,0x5b,0x54, 0x1b,0x5b,0x54,
+ 0x1b,0x4e,0x2b},
+{K_END, K_ONE,NC,NC, K_END, K_END, 0x1b,0x4e,0x31},
+{K_DA, K_TWO,NC,NC, K_DA, K_DA, 0x1b,0x4e,0x32},
+{K_PDN, K_THREE,NC,NC, K_PDN, K_PDN, 0x1b,0x4e,0x33},
+{K_INS, K_ZERO,NC,NC, K_INS, K_INS, 0x1b,0x4e,0x30},
+{0x1b,0x5b,0x39, K_PERIOD,NC,NC, K_DEL,NC,NC, K_DEL,NC,NC, 0x1b,0x4e,0x2e},
+{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
+{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
+{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
+{K_F11, K_F11S, K_F11, K_F11A, K_F11S},
+{K_F12, K_F12S, K_F12, K_F12A, K_F12S}
};
@@ -1065,12 +1083,15 @@ boolean_t extended;
if ((!extended) && state != KS_NORMAL) {
if ((state&(KS_SHIFTED|KS_ALTED)) == (KS_SHIFTED|KS_ALTED))
state_idx = SHIFT_ALT;
+ /* CTRL should have higher priority than SHIFT. That
+ way, CTRL-SHIFT-2 and CTRL-2 produce the same keycode.
+ --Derek Upham 1997/06/25 */
+ else if (state&KS_CTLED)
+ state_idx = CTRL_STATE;
else if (state&KS_SHIFTED)
state_idx = SHIFT_STATE;
else if (state&KS_ALTED)
state_idx = ALT_STATE;
- else if (state&KS_CTLED)
- state_idx = CTRL_STATE;
}
return (CHARIDX(state_idx));
diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
index f2d3f5e..3b1ace3 100644
--- a/i386/i386at/kd.h
+++ b/i386/i386at/kd.h
@@ -509,6 +509,21 @@ typedef u_char Scancode;
#define K_F12 0x1b,0x4f,0x41
#define K_F12S 0x1b,0x4f,0x61
+/* These are the Alt-FxxA #defines. They work with the new keymap
+ -- Derek Upham 1997/06/25 */
+#define K_F1A 0x1b,0x4f,0x30
+#define K_F2A 0x1b,0x4f,0x31
+#define K_F3A 0x1b,0x4f,0x32
+#define K_F4A 0x1b,0x4f,0x33
+#define K_F5A 0x1b,0x4f,0x34
+#define K_F6A 0x1b,0x4f,0x35
+#define K_F7A 0x1b,0x4f,0x36
+#define K_F8A 0x1b,0x4f,0x37
+#define K_F9A 0x1b,0x4f,0x38
+#define K_F10A 0x1b,0x4f,0x39
+#define K_F11A 0x1b,0x4f,0x3a
+#define K_F12A 0x1b,0x4f,0x3b
+
#define K_SCRL 0x1b,0x5b,0x4d
#define K_HOME 0x1b,0x5b,0x48
#define K_UA 0x1b,0x5b,0x41
diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c
index 9ee4374..304bd7f 100644
--- a/i386/i386at/kd_event.c
+++ b/i386/i386at/kd_event.c
@@ -185,6 +185,11 @@ io_return_t kbdgetstat(dev, flavor, data, count)
*data = KB_VANILLAKB;
*count = 1;
break;
+ case DEV_GET_SIZE:
+ data[DEV_GET_SIZE_DEVICE_SIZE] = 0;
+ data[DEV_GET_SIZE_RECORD_SIZE] = sizeof(kd_event);
+ *count = DEV_GET_SIZE_COUNT;
+ break;
default:
return (D_INVALID_OPERATION);
}
@@ -307,6 +312,10 @@ kbdread(dev, ior)
register int err, count;
register spl_t s;
+ /* Check if IO_COUNT is a multiple of the record size. */
+ if (ior->io_count % sizeof(kd_event) != 0)
+ return D_INVALID_SIZE;
+
err = device_read_alloc(ior, (vm_size_t)ior->io_count);
if (err != KERN_SUCCESS)
return (err);
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 8f4e09a..28114d4 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -314,6 +314,26 @@ kd_mouse_close(dev, mouse_pic)
}
#ifdef MACH_KERNEL
+io_return_t mousegetstat(dev, flavor, data, count)
+ dev_t dev;
+ int flavor;
+ int * data; /* pointer to OUT array */
+ unsigned int *count; /* OUT */
+{
+ io_return_t result;
+
+ switch (flavor) {
+ case DEV_GET_SIZE:
+ data[DEV_GET_SIZE_DEVICE_SIZE] = 0;
+ data[DEV_GET_SIZE_RECORD_SIZE] = sizeof(kd_event);
+ *count = DEV_GET_SIZE_COUNT;
+ break;
+ default:
+ return D_INVALID_OPERATION;
+ }
+ return D_SUCCESS;
+}
+
#else MACH_KERNEL
/*
* mouseioctl - handling for asynch & non-blocking I/O.
@@ -390,6 +410,10 @@ mouseread(dev, ior)
register int err, count;
register spl_t s;
+ /* Check if IO_COUNT is a multiple of the record size. */
+ if (ior->io_count % sizeof(kd_event) != 0)
+ return D_INVALID_SIZE;
+
err = device_read_alloc(ior, (vm_size_t)ior->io_count);
if (err != KERN_SUCCESS)
return (err);