1993-07-26 21:21:11 +00:00
|
|
|
|
/*-
|
1998-09-15 18:16:39 +00:00
|
|
|
|
* Copyright (c) 1992-1998 S<EFBFBD>ren Schmidt
|
1993-07-26 21:21:11 +00:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
1998-09-15 18:16:39 +00:00
|
|
|
|
* notice, this list of conditions and the following disclaimer,
|
|
|
|
|
* without modification, immediately at the beginning of the file.
|
1993-07-26 21:21:11 +00:00
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
1995-02-22 13:48:07 +00:00
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
1998-09-15 18:16:39 +00:00
|
|
|
|
* derived from this software without specific prior written permission.
|
1993-07-26 21:21:11 +00:00
|
|
|
|
*
|
1995-02-22 13:48:07 +00:00
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1993-07-26 21:21:11 +00:00
|
|
|
|
*
|
1999-01-30 12:17:38 +00:00
|
|
|
|
* $Id: syscons.c,v 1.296 1999/01/28 17:31:58 dillon Exp $
|
1993-07-26 21:21:11 +00:00
|
|
|
|
*/
|
|
|
|
|
|
1994-08-13 03:50:34 +00:00
|
|
|
|
#include "sc.h"
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#include "splash.h"
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1995-02-25 20:09:44 +00:00
|
|
|
|
#include "apm.h"
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1996-01-04 21:13:23 +00:00
|
|
|
|
#include "opt_ddb.h"
|
1998-01-24 02:54:56 +00:00
|
|
|
|
#include "opt_devfs.h"
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1998-09-15 18:16:39 +00:00
|
|
|
|
#include "opt_vesa.h"
|
|
|
|
|
#include "opt_vm86.h"
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1996-09-06 23:35:54 +00:00
|
|
|
|
#include "opt_syscons.h"
|
1996-01-04 21:13:23 +00:00
|
|
|
|
|
1994-08-13 03:50:34 +00:00
|
|
|
|
#if NSC > 0
|
|
|
|
|
#include <sys/param.h>
|
1994-05-25 09:21:21 +00:00
|
|
|
|
#include <sys/systm.h>
|
1998-08-03 11:30:45 +00:00
|
|
|
|
#include <sys/reboot.h>
|
1994-08-13 03:50:34 +00:00
|
|
|
|
#include <sys/conf.h>
|
|
|
|
|
#include <sys/proc.h>
|
1995-12-06 23:52:35 +00:00
|
|
|
|
#include <sys/signalvar.h>
|
1994-08-13 03:50:34 +00:00
|
|
|
|
#include <sys/tty.h>
|
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
|
#include <sys/malloc.h>
|
1995-12-08 11:19:42 +00:00
|
|
|
|
#ifdef DEVFS
|
|
|
|
|
#include <sys/devfsext.h>
|
|
|
|
|
#endif
|
1994-10-23 21:28:03 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
#include <machine/bootinfo.h>
|
1994-10-26 21:51:22 +00:00
|
|
|
|
#include <machine/clock.h>
|
1995-09-10 21:36:12 +00:00
|
|
|
|
#include <machine/cons.h>
|
1994-08-17 19:32:23 +00:00
|
|
|
|
#include <machine/console.h>
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
#include <machine/mouse.h>
|
1996-07-01 20:29:10 +00:00
|
|
|
|
#include <machine/md_var.h>
|
1994-08-17 19:32:23 +00:00
|
|
|
|
#include <machine/psl.h>
|
|
|
|
|
#include <machine/frame.h>
|
|
|
|
|
#include <machine/pc/display.h>
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1998-09-15 18:16:39 +00:00
|
|
|
|
#include <machine/pc/vesa.h>
|
1995-02-25 20:09:44 +00:00
|
|
|
|
#include <machine/apm_bios.h>
|
1995-10-28 16:58:05 +00:00
|
|
|
|
#include <machine/random.h>
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1994-10-23 21:28:03 +00:00
|
|
|
|
|
1995-12-06 23:52:35 +00:00
|
|
|
|
#include <vm/vm.h>
|
1995-12-07 12:48:31 +00:00
|
|
|
|
#include <vm/vm_param.h>
|
|
|
|
|
#include <vm/pmap.h>
|
1995-12-06 23:52:35 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#include <dev/kbd/kbdreg.h>
|
|
|
|
|
#include <dev/fb/fbreg.h>
|
|
|
|
|
#include <dev/fb/vgareg.h>
|
|
|
|
|
#include <dev/fb/splashreg.h>
|
|
|
|
|
#include <dev/syscons/syscons.h>
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifndef __i386__
|
|
|
|
|
#include <isa/isareg.h>
|
|
|
|
|
#else
|
1994-08-13 03:50:34 +00:00
|
|
|
|
#include <i386/isa/isa.h>
|
|
|
|
|
#include <i386/isa/isa_device.h>
|
|
|
|
|
#include <i386/isa/timerreg.h>
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1993-10-28 05:27:36 +00:00
|
|
|
|
|
1995-01-12 11:47:05 +00:00
|
|
|
|
#if !defined(MAXCONS)
|
1995-01-28 22:18:05 +00:00
|
|
|
|
#define MAXCONS 16
|
1994-12-31 17:09:58 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1997-10-23 03:23:50 +00:00
|
|
|
|
#if !defined(SC_MAX_HISTORY_SIZE)
|
|
|
|
|
#define SC_MAX_HISTORY_SIZE (1000 * MAXCONS)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !defined(SC_HISTORY_SIZE)
|
|
|
|
|
#define SC_HISTORY_SIZE (ROW * 4)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if (SC_HISTORY_SIZE * MAXCONS) > SC_MAX_HISTORY_SIZE
|
|
|
|
|
#undef SC_MAX_HISTORY_SIZE
|
|
|
|
|
#define SC_MAX_HISTORY_SIZE (SC_HISTORY_SIZE * MAXCONS)
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-02-11 15:02:40 +00:00
|
|
|
|
#if !defined(SC_MOUSE_CHAR)
|
|
|
|
|
#define SC_MOUSE_CHAR (0xd0)
|
|
|
|
|
#endif
|
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
#define COLD 0
|
|
|
|
|
#define WARM 1
|
1995-12-08 11:19:42 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
#define DEFAULT_BLANKTIME (5*60) /* 5 minutes */
|
1998-08-03 09:15:36 +00:00
|
|
|
|
#define MAX_BLANKTIME (7*24*60*60) /* 7 days!? */
|
|
|
|
|
|
1998-01-20 03:37:27 +00:00
|
|
|
|
/* for backward compatibility */
|
|
|
|
|
#define OLD_CONS_MOUSECTL _IOWR('c', 10, old_mouse_info_t)
|
|
|
|
|
|
|
|
|
|
typedef struct old_mouse_data {
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
int buttons;
|
|
|
|
|
} old_mouse_data_t;
|
|
|
|
|
|
|
|
|
|
typedef struct old_mouse_info {
|
|
|
|
|
int operation;
|
|
|
|
|
union {
|
|
|
|
|
struct old_mouse_data data;
|
|
|
|
|
struct mouse_mode mode;
|
|
|
|
|
} u;
|
|
|
|
|
} old_mouse_info_t;
|
|
|
|
|
|
1993-07-30 02:20:26 +00:00
|
|
|
|
static default_attr user_default = {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(FG_LIGHTGREY | BG_BLACK) << 8,
|
|
|
|
|
(FG_BLACK | BG_LIGHTGREY) << 8
|
1993-07-30 02:20:26 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static default_attr kernel_default = {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(FG_WHITE | BG_BLACK) << 8,
|
|
|
|
|
(FG_BLACK | BG_LIGHTGREY) << 8
|
1993-07-30 02:20:26 +00:00
|
|
|
|
};
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
static scr_stat main_console;
|
|
|
|
|
static scr_stat *console[MAXCONS];
|
1996-06-17 17:21:35 +00:00
|
|
|
|
#ifdef DEVFS
|
1995-12-08 11:19:42 +00:00
|
|
|
|
static void *sc_devfs_token[MAXCONS];
|
1998-01-12 03:28:36 +00:00
|
|
|
|
static void *sc_mouse_devfs_token;
|
|
|
|
|
static void *sc_console_devfs_token;
|
1996-06-17 17:21:35 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scr_stat *cur_console;
|
|
|
|
|
static scr_stat *new_scp, *old_scp;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static term_stat kernel_console;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
static default_attr *current_default;
|
1998-10-01 21:04:52 +00:00
|
|
|
|
static int sc_flags;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
static char init_done = COLD;
|
1996-10-26 20:16:58 +00:00
|
|
|
|
static u_short sc_buffer[ROW*COL];
|
1998-08-03 09:18:58 +00:00
|
|
|
|
static char shutdown_in_progress = FALSE;
|
1998-02-11 15:00:24 +00:00
|
|
|
|
static char font_loading_in_progress = FALSE;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
static char switch_in_progress = FALSE;
|
|
|
|
|
static char write_in_progress = FALSE;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
static char blink_in_progress = FALSE;
|
|
|
|
|
static int blinkrate = 0;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int adapter = -1;
|
|
|
|
|
static int keyboard = -1;
|
|
|
|
|
static keyboard_t *kbd;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
static int delayed_next_scr = FALSE;
|
|
|
|
|
static long scrn_blank_time = 0; /* screen saver timeout value */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int scrn_blanked = FALSE; /* screen saver active flag */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
static long scrn_time_stamp;
|
|
|
|
|
static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
|
|
|
|
|
static int run_scrn_saver = FALSE; /* should run the saver? */
|
|
|
|
|
static int scrn_idle = FALSE; /* about to run the saver */
|
1999-01-28 17:32:05 +00:00
|
|
|
|
#if NSPLASH > 0
|
1999-01-17 14:23:15 +00:00
|
|
|
|
static int scrn_saver_failed;
|
1999-01-28 17:32:05 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
u_char scr_map[256];
|
1996-09-01 18:16:06 +00:00
|
|
|
|
u_char scr_rmap[256];
|
1998-09-15 18:16:39 +00:00
|
|
|
|
static int initial_video_mode; /* initial video mode # */
|
1997-07-25 11:53:30 +00:00
|
|
|
|
int fonts_loaded = 0
|
|
|
|
|
#ifdef STD8X16FONT
|
|
|
|
|
| FONT_16
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char font_8[256*8];
|
|
|
|
|
u_char font_14[256*14];
|
1997-07-26 07:58:29 +00:00
|
|
|
|
#ifdef STD8X16FONT
|
|
|
|
|
extern
|
|
|
|
|
#endif
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char font_16[256*16];
|
|
|
|
|
u_char palette[256*3];
|
1998-09-26 03:38:40 +00:00
|
|
|
|
static u_char *cut_buffer;
|
|
|
|
|
static int cut_buffer_size;
|
|
|
|
|
static int mouse_level; /* sysmouse protocol level */
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
static mousestatus_t mouse_status = { 0, 0, 0, 0, 0, 0 };
|
1996-10-02 22:00:38 +00:00
|
|
|
|
static u_short mouse_and_mask[16] = {
|
|
|
|
|
0xc000, 0xe000, 0xf000, 0xf800,
|
|
|
|
|
0xfc00, 0xfe00, 0xff00, 0xff80,
|
|
|
|
|
0xfe00, 0x1e00, 0x1f00, 0x0f00,
|
|
|
|
|
0x0f00, 0x0000, 0x0000, 0x0000
|
|
|
|
|
};
|
|
|
|
|
static u_short mouse_or_mask[16] = {
|
|
|
|
|
0x0000, 0x4000, 0x6000, 0x7000,
|
|
|
|
|
0x7800, 0x7c00, 0x7e00, 0x6800,
|
|
|
|
|
0x0c00, 0x0c00, 0x0600, 0x0600,
|
|
|
|
|
0x0000, 0x0000, 0x0000, 0x0000
|
|
|
|
|
};
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int sc_history_size = SC_HISTORY_SIZE;
|
|
|
|
|
static int extra_history_size =
|
1997-10-23 03:23:50 +00:00
|
|
|
|
SC_MAX_HISTORY_SIZE - SC_HISTORY_SIZE * MAXCONS;
|
|
|
|
|
|
1996-10-02 22:00:38 +00:00
|
|
|
|
static void none_saver(int blank) { }
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
static void (*current_saver)(int blank) = none_saver;
|
1998-09-26 03:34:10 +00:00
|
|
|
|
d_ioctl_t *sc_user_ioctl;
|
1994-02-04 10:36:15 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
static int sticky_splash = FALSE;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
static struct {
|
|
|
|
|
u_int8_t cursor_start;
|
|
|
|
|
u_int8_t cursor_end;
|
|
|
|
|
u_int8_t shift_state;
|
|
|
|
|
} bios_value;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
|
1994-02-01 06:22:29 +00:00
|
|
|
|
/* OS specific stuff */
|
1995-01-28 22:18:05 +00:00
|
|
|
|
#ifdef not_yet_done
|
1995-02-22 13:48:07 +00:00
|
|
|
|
#define VIRTUAL_TTY(x) (sccons[x] = ttymalloc(sccons[x]))
|
|
|
|
|
struct CONSOLE_TTY (sccons[MAXCONS] = ttymalloc(sccons[MAXCONS]))
|
1996-09-08 21:31:56 +00:00
|
|
|
|
struct MOUSE_TTY (sccons[MAXCONS+1] = ttymalloc(sccons[MAXCONS+1]))
|
|
|
|
|
struct tty *sccons[MAXCONS+2];
|
1994-05-25 09:21:21 +00:00
|
|
|
|
#else
|
1995-02-22 13:48:07 +00:00
|
|
|
|
#define VIRTUAL_TTY(x) &sccons[x]
|
|
|
|
|
#define CONSOLE_TTY &sccons[MAXCONS]
|
1996-09-08 21:31:56 +00:00
|
|
|
|
#define MOUSE_TTY &sccons[MAXCONS+1]
|
|
|
|
|
static struct tty sccons[MAXCONS+2];
|
1994-05-25 09:21:21 +00:00
|
|
|
|
#endif
|
1996-09-08 21:31:56 +00:00
|
|
|
|
#define SC_MOUSE 128
|
|
|
|
|
#define SC_CONSOLE 255
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t Crtat;
|
1996-09-09 19:02:26 +00:00
|
|
|
|
static const int nsccons = MAXCONS+2;
|
1994-02-01 06:22:29 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
#define WRAPHIST(scp, pointer, offset)\
|
1998-09-26 03:38:40 +00:00
|
|
|
|
((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \
|
|
|
|
|
+ (offset)) % (scp)->history_size))
|
1997-03-01 23:53:46 +00:00
|
|
|
|
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* some useful macros */
|
|
|
|
|
#define kbd_read_char(kbd, wait) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait))
|
|
|
|
|
#define kbd_check_char(kbd) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->check_char)((kbd))
|
|
|
|
|
#define kbd_enable(kbd) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->enable)((kbd))
|
|
|
|
|
#define kbd_disable(kbd) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->disable)((kbd))
|
|
|
|
|
#define kbd_lock(kbd, lockf) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf))
|
|
|
|
|
#define kbd_ioctl(kbd, cmd, arg) \
|
|
|
|
|
(((kbd) == NULL) ? \
|
|
|
|
|
ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg)))
|
|
|
|
|
#define kbd_clear_state(kbd) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->clear_state)((kbd))
|
|
|
|
|
#define kbd_get_fkeystr(kbd, fkey, len) \
|
|
|
|
|
(*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len))
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
/* prototypes */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static kbd_callback_func_t sckbdevent;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static int scparam(struct tty *tp, struct termios *t);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int scvidprobe(int unit, int flags, int cons);
|
|
|
|
|
static int sckbdprobe(int unit, int flags, int cons);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void scstart(struct tty *tp);
|
1996-09-10 19:14:49 +00:00
|
|
|
|
static void scmousestart(struct tty *tp);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static void scinit(void);
|
1998-08-03 09:18:58 +00:00
|
|
|
|
static void scshutdown(int howto, void *arg);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static u_int scgetc(keyboard_t *kbd, u_int flags);
|
1996-10-26 20:16:58 +00:00
|
|
|
|
#define SCGETC_CN 1
|
|
|
|
|
#define SCGETC_NONBLOCK 2
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int sccngetch(int flags);
|
1998-02-11 14:58:15 +00:00
|
|
|
|
static void sccnupdate(scr_stat *scp);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static scr_stat *alloc_scp(void);
|
|
|
|
|
static void init_scp(scr_stat *scp);
|
1999-01-19 11:31:22 +00:00
|
|
|
|
static void get_bios_values(void);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static int get_scr_num(void);
|
1997-04-20 16:05:33 +00:00
|
|
|
|
static timeout_t scrn_timer;
|
1998-02-11 14:58:15 +00:00
|
|
|
|
static void scrn_update(scr_stat *scp, int show_cursor);
|
1999-01-13 01:14:26 +00:00
|
|
|
|
#if NSPLASH > 0
|
|
|
|
|
static int scsplash_callback(int);
|
|
|
|
|
static void scsplash_saver(int show);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int add_scrn_saver(void (*this_saver)(int));
|
|
|
|
|
static int remove_scrn_saver(void (*this_saver)(int));
|
|
|
|
|
static int set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border);
|
1999-01-17 14:23:15 +00:00
|
|
|
|
static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
static void stop_scrn_saver(void (*saver)(int));
|
1998-04-04 16:26:53 +00:00
|
|
|
|
static int wait_scrn_saver_stop(void);
|
1999-01-13 01:14:26 +00:00
|
|
|
|
#define scsplash_stick(stick) (sticky_splash = (stick))
|
|
|
|
|
#else /* !NSPLASH */
|
|
|
|
|
#define stop_scrn_saver(saver)
|
|
|
|
|
#define wait_scrn_saver_stop() 0
|
|
|
|
|
#define scsplash_stick(stick)
|
|
|
|
|
#endif /* NSPLASH */
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static int switch_scr(scr_stat *scp, u_int next_scr);
|
|
|
|
|
static void exchange_scr(void);
|
|
|
|
|
static void scan_esc(scr_stat *scp, u_char c);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
static void ansi_put(scr_stat *scp, u_char *buf, int len);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
static void draw_cursor_image(scr_stat *scp);
|
|
|
|
|
static void remove_cursor_image(scr_stat *scp);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
static void move_crsr(scr_stat *scp, int x, int y);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static void history_to_screen(scr_stat *scp);
|
|
|
|
|
static int history_up_line(scr_stat *scp);
|
|
|
|
|
static int history_down_line(scr_stat *scp);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
static int mask2attr(struct term_stat *term);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int save_kbd_state(scr_stat *scp);
|
|
|
|
|
static int update_kbd_state(int state, int mask);
|
|
|
|
|
static int update_kbd_leds(int which);
|
1998-10-01 21:04:52 +00:00
|
|
|
|
static void set_destructive_cursor(scr_stat *scp);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void set_mouse_pos(scr_stat *scp);
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
static int skip_spc_right(scr_stat *scp, u_short *p);
|
|
|
|
|
static int skip_spc_left(scr_stat *scp, u_short *p);
|
|
|
|
|
static void mouse_cut(scr_stat *scp);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void mouse_cut_start(scr_stat *scp);
|
|
|
|
|
static void mouse_cut_end(scr_stat *scp);
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
static void mouse_cut_word(scr_stat *scp);
|
|
|
|
|
static void mouse_cut_line(scr_stat *scp);
|
|
|
|
|
static void mouse_cut_extend(scr_stat *scp);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void mouse_paste(scr_stat *scp);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static void draw_mouse_image(scr_stat *scp);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
static void remove_mouse_image(scr_stat *scp);
|
|
|
|
|
static void draw_cutmarking(scr_stat *scp);
|
|
|
|
|
static void remove_cutmarking(scr_stat *scp);
|
1996-06-23 17:12:05 +00:00
|
|
|
|
static void do_bell(scr_stat *scp, int pitch, int duration);
|
1997-04-20 16:05:33 +00:00
|
|
|
|
static timeout_t blink_screen;
|
1996-06-23 17:12:05 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#define CDEV_MAJOR 12
|
|
|
|
|
|
|
|
|
|
#ifdef __i386__
|
|
|
|
|
|
1999-01-07 14:14:24 +00:00
|
|
|
|
static cn_probe_t sccnprobe;
|
|
|
|
|
static cn_init_t sccninit;
|
|
|
|
|
static cn_getc_t sccngetc;
|
|
|
|
|
static cn_checkc_t sccncheckc;
|
|
|
|
|
static cn_putc_t sccnputc;
|
|
|
|
|
|
|
|
|
|
CONS_DRIVER(sc, sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc);
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#else /* !__i386__ */
|
|
|
|
|
|
|
|
|
|
static cn_getc_t sccngetc;
|
|
|
|
|
static cn_checkc_t sccncheckc;
|
|
|
|
|
static cn_putc_t sccnputc;
|
|
|
|
|
|
|
|
|
|
struct consdev sc_cons = {
|
|
|
|
|
NULL, NULL, sccngetc, sccncheckc, sccnputc,
|
|
|
|
|
NULL, makedev(CDEV_MAJOR, 0), CN_NORMAL,
|
1993-07-30 02:20:26 +00:00
|
|
|
|
};
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif /* __i386__ */
|
|
|
|
|
|
1995-09-10 21:36:12 +00:00
|
|
|
|
static d_open_t scopen;
|
|
|
|
|
static d_close_t scclose;
|
1995-12-10 15:55:34 +00:00
|
|
|
|
static d_read_t scread;
|
|
|
|
|
static d_write_t scwrite;
|
1995-09-10 21:36:12 +00:00
|
|
|
|
static d_ioctl_t scioctl;
|
|
|
|
|
static d_mmap_t scmmap;
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
struct cdevsw sc_cdevsw = {
|
1995-09-10 21:36:12 +00:00
|
|
|
|
scopen, scclose, scread, scwrite,
|
|
|
|
|
scioctl, nullstop, noreset, scdevtotty,
|
1998-08-23 08:26:42 +00:00
|
|
|
|
ttpoll, scmmap, nostrategy, "sc",
|
|
|
|
|
NULL, -1, nodump, nopsize,
|
|
|
|
|
D_TTY,
|
|
|
|
|
};
|
1995-09-10 21:36:12 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
|
|
|
|
|
|
|
|
|
#define fillw_io(p, b, c) fillw((p), (void *)(b), (c))
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __alpha__
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
fillw(int pat, void *base, size_t cnt)
|
|
|
|
|
{
|
|
|
|
|
u_short *sp = base;
|
|
|
|
|
while (cnt--)
|
|
|
|
|
*sp++ = pat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
fillw_io(int pat, u_int32_t base, size_t cnt)
|
|
|
|
|
{
|
|
|
|
|
while (cnt--) {
|
|
|
|
|
writew(base, pat);
|
|
|
|
|
base += 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-02-12 22:05:08 +00:00
|
|
|
|
static void
|
1996-10-02 22:00:38 +00:00
|
|
|
|
draw_cursor_image(scr_stat *scp)
|
1995-11-28 00:17:32 +00:00
|
|
|
|
{
|
1998-09-23 09:59:00 +00:00
|
|
|
|
u_short cursor_image;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t ptr;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
u_short prev_image;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISPIXELSC(scp)) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
sc_bcopy(scp, scp->scr_buf, scp->cursor_pos - scp->scr_buf,
|
1998-02-12 22:05:08 +00:00
|
|
|
|
scp->cursor_pos - scp->scr_buf, 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
ptr = scp->adp->va_window + 2*(scp->cursor_pos - scp->scr_buf);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
1996-10-02 22:00:38 +00:00
|
|
|
|
/* do we have a destructive cursor ? */
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & CHAR_CURSOR) {
|
1997-06-30 13:31:49 +00:00
|
|
|
|
prev_image = scp->cursor_saveunder;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
cursor_image = readw(ptr) & 0x00ff;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
if (cursor_image == DEAD_CHAR)
|
|
|
|
|
cursor_image = prev_image & 0x00ff;
|
|
|
|
|
cursor_image |= *(scp->cursor_pos) & 0xff00;
|
1996-10-02 22:00:38 +00:00
|
|
|
|
scp->cursor_saveunder = cursor_image;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
/* update the cursor bitmap if the char under the cursor has changed */
|
|
|
|
|
if (prev_image != cursor_image)
|
|
|
|
|
set_destructive_cursor(scp);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
/* modify cursor_image */
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
|
1997-06-30 13:31:49 +00:00
|
|
|
|
/*
|
|
|
|
|
* When the mouse pointer is at the same position as the cursor,
|
|
|
|
|
* the cursor bitmap needs to be updated even if the char under
|
|
|
|
|
* the cursor hasn't changed, because the mouse pionter may
|
|
|
|
|
* have moved by a few dots within the cursor cel.
|
|
|
|
|
*/
|
|
|
|
|
if ((prev_image == cursor_image)
|
|
|
|
|
&& (cursor_image != *(scp->cursor_pos)))
|
|
|
|
|
set_destructive_cursor(scp);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
cursor_image &= 0xff00;
|
|
|
|
|
cursor_image |= DEAD_CHAR;
|
|
|
|
|
}
|
1998-02-12 20:52:24 +00:00
|
|
|
|
} else {
|
1999-01-28 01:59:53 +00:00
|
|
|
|
cursor_image = (readw(ptr) & 0x00ff) | (*(scp->cursor_pos) & 0xff00);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
scp->cursor_saveunder = cursor_image;
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
|
1996-10-02 22:00:38 +00:00
|
|
|
|
if ((cursor_image & 0x7000) == 0x7000) {
|
|
|
|
|
cursor_image &= 0x8fff;
|
|
|
|
|
if(!(cursor_image & 0x0700))
|
|
|
|
|
cursor_image |= 0x0700;
|
|
|
|
|
} else {
|
|
|
|
|
cursor_image |= 0x7000;
|
|
|
|
|
if ((cursor_image & 0x0700) == 0x0700)
|
|
|
|
|
cursor_image &= 0xf0ff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writew(ptr, cursor_image);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
}
|
1995-11-28 00:17:32 +00:00
|
|
|
|
|
1998-02-12 22:05:08 +00:00
|
|
|
|
static void
|
1996-10-02 22:00:38 +00:00
|
|
|
|
remove_cursor_image(scr_stat *scp)
|
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISPIXELSC(scp))
|
1998-08-03 11:30:45 +00:00
|
|
|
|
sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
|
1998-09-23 09:59:00 +00:00
|
|
|
|
scp->cursor_oldpos - scp->scr_buf, 0);
|
1998-02-12 22:05:08 +00:00
|
|
|
|
else
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writew(scp->adp->va_window + 2*(scp->cursor_oldpos - scp->scr_buf),
|
|
|
|
|
scp->cursor_saveunder);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
}
|
1995-11-28 00:17:32 +00:00
|
|
|
|
|
1998-02-12 22:05:08 +00:00
|
|
|
|
static void
|
1996-10-02 22:00:38 +00:00
|
|
|
|
move_crsr(scr_stat *scp, int x, int y)
|
|
|
|
|
{
|
|
|
|
|
if (x < 0)
|
|
|
|
|
x = 0;
|
|
|
|
|
if (y < 0)
|
|
|
|
|
y = 0;
|
|
|
|
|
if (x >= scp->xsize)
|
|
|
|
|
x = scp->xsize-1;
|
|
|
|
|
if (y >= scp->ysize)
|
|
|
|
|
y = scp->ysize-1;
|
|
|
|
|
scp->xpos = x;
|
|
|
|
|
scp->ypos = y;
|
|
|
|
|
scp->cursor_pos = scp->scr_buf + scp->ypos * scp->xsize + scp->xpos;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
int
|
|
|
|
|
sc_probe_unit(int unit, int flags)
|
1997-06-22 12:04:36 +00:00
|
|
|
|
{
|
1999-01-19 11:31:22 +00:00
|
|
|
|
if (!scvidprobe(unit, flags, FALSE)) {
|
1997-06-22 12:04:36 +00:00
|
|
|
|
if (bootverbose)
|
1999-01-19 11:31:22 +00:00
|
|
|
|
printf("sc%d: no video adapter is found.\n", unit);
|
|
|
|
|
return ENXIO;
|
1997-06-22 12:04:36 +00:00
|
|
|
|
}
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
return ((sckbdprobe(unit, flags, FALSE)) ? 0 : ENXIO);
|
1997-06-22 12:04:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* probe video adapters, return TRUE if found */
|
|
|
|
|
static int
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scvidprobe(int unit, int flags, int cons)
|
1997-06-22 12:04:36 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
video_adapter_t *adp;
|
1997-06-22 12:04:36 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/*
|
|
|
|
|
* Access the video adapter driver through the back door!
|
|
|
|
|
* Video adapter drivers need to be configured before syscons.
|
|
|
|
|
* However, when syscons is being probed as the low-level console,
|
|
|
|
|
* they have not been initialized yet. We force them to initialize
|
|
|
|
|
* themselves here. XXX
|
|
|
|
|
*/
|
|
|
|
|
vid_configure(cons ? VIO_PROBE_ONLY : 0);
|
1997-06-22 12:04:36 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* allocate a frame buffer */
|
|
|
|
|
if (adapter < 0) {
|
|
|
|
|
adapter = vid_allocate("*", -1, (void *)&adapter);
|
|
|
|
|
if (adapter < 0)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
adp = vid_get_adapter(adapter); /* shouldn't fail */
|
1997-06-22 12:04:36 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
Crtat = adp->va_window;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
initial_video_mode = adp->va_initial_mode;
|
1997-06-22 12:04:36 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* probe the keyboard, return TRUE if found */
|
|
|
|
|
static int
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sckbdprobe(int unit, int flags, int cons)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* access the keyboard driver through the backdoor! */
|
|
|
|
|
kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
|
|
|
|
|
|
|
|
|
|
/* allocate a keyboard and register the keyboard event handler */
|
|
|
|
|
if (keyboard < 0) {
|
|
|
|
|
keyboard = kbd_allocate("*", -1, (void *)&keyboard, sckbdevent, NULL);
|
|
|
|
|
if (keyboard < 0)
|
|
|
|
|
return FALSE;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
kbd = kbd_get_keyboard(keyboard); /* shouldn't fail */
|
1996-11-14 22:19:17 +00:00
|
|
|
|
|
1997-06-22 12:04:36 +00:00
|
|
|
|
return TRUE;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-10-03 00:42:27 +00:00
|
|
|
|
#if NAPM > 0
|
|
|
|
|
static int
|
|
|
|
|
scresume(void *dummy)
|
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (kbd != NULL)
|
|
|
|
|
kbd_clear_state(kbd);
|
|
|
|
|
return 0;
|
1996-10-03 00:42:27 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
int
|
|
|
|
|
sc_attach_unit(int unit, int flags)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1996-09-01 18:16:06 +00:00
|
|
|
|
scr_stat *scp;
|
1998-12-07 21:58:50 +00:00
|
|
|
|
#if defined(VESA) && defined(VM86)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
video_info_t info;
|
1998-12-07 21:58:50 +00:00
|
|
|
|
#endif
|
1996-09-01 18:16:06 +00:00
|
|
|
|
dev_t cdev = makedev(CDEV_MAJOR, 0);
|
1996-03-27 19:11:41 +00:00
|
|
|
|
#ifdef DEVFS
|
1996-09-01 18:16:06 +00:00
|
|
|
|
int vc;
|
1996-03-27 19:11:41 +00:00
|
|
|
|
#endif
|
1995-01-28 22:18:05 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scinit();
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp = console[0];
|
1999-01-19 11:31:22 +00:00
|
|
|
|
sc_flags = flags;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~CHAR_CURSOR;
|
1995-04-04 20:06:26 +00:00
|
|
|
|
|
1996-10-26 20:16:58 +00:00
|
|
|
|
/* copy temporary buffer to final buffer */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp->scr_buf = NULL;
|
|
|
|
|
sc_alloc_scr_buffer(scp, FALSE, FALSE);
|
|
|
|
|
bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
|
1996-10-26 20:16:58 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* cut buffer is available only when the mouse pointer is used */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (ISMOUSEAVAIL(scp->adp->va_flags))
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_alloc_cut_buffer(scp, FALSE);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
/* initialize history buffer & pointers */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_alloc_history_buffer(scp, sc_history_size, 0, FALSE);
|
|
|
|
|
|
|
|
|
|
#if defined(VESA) && defined(VM86)
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if ((sc_flags & VESA800X600)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
&& ((*vidsw[scp->ad]->get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
|
|
|
|
|
#if NSPLASH > 0
|
|
|
|
|
splash_term(scp->adp);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
#endif
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
|
|
|
|
|
sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
|
|
|
|
|
initial_video_mode = M_VESA_800x600;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#if NSPLASH > 0
|
|
|
|
|
/* put up the splash again! */
|
|
|
|
|
splash_init(scp->adp, scsplash_callback);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
#endif
|
1998-09-15 18:16:39 +00:00
|
|
|
|
}
|
|
|
|
|
#endif /* VESA && VM86 */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1995-04-04 20:06:26 +00:00
|
|
|
|
/* initialize cursor stuff */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(scp))
|
1996-10-01 23:24:09 +00:00
|
|
|
|
draw_cursor_image(scp);
|
1995-02-03 21:09:44 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* get screen update going */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scrn_timer((void *)TRUE);
|
1995-02-03 21:09:44 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* set up the keyboard */
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
|
|
|
|
|
update_kbd_state(scp->status, LOCK_MASK);
|
|
|
|
|
|
|
|
|
|
if (bootverbose) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
printf("sc%d:", unit);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (adapter >= 0)
|
|
|
|
|
printf(" fb%d", adapter);
|
|
|
|
|
if (keyboard >= 0)
|
|
|
|
|
printf(" kbd%d", keyboard);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
1999-01-19 11:31:22 +00:00
|
|
|
|
printf("sc%d: ", unit);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
switch(scp->adp->va_type) {
|
1997-06-22 12:04:36 +00:00
|
|
|
|
case KD_VGA:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
printf("VGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
|
1997-06-22 12:04:36 +00:00
|
|
|
|
break;
|
|
|
|
|
case KD_EGA:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
printf("EGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
|
1997-06-22 12:04:36 +00:00
|
|
|
|
break;
|
|
|
|
|
case KD_CGA:
|
|
|
|
|
printf("CGA");
|
|
|
|
|
break;
|
|
|
|
|
case KD_MONO:
|
|
|
|
|
case KD_HERCULES:
|
|
|
|
|
default:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
printf("MDA/Hercules");
|
1997-06-22 12:04:36 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
1998-09-29 02:00:57 +00:00
|
|
|
|
printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, sc_flags);
|
1995-04-04 20:06:26 +00:00
|
|
|
|
|
1995-02-17 02:22:57 +00:00
|
|
|
|
#if NAPM > 0
|
1995-02-25 20:09:44 +00:00
|
|
|
|
scp->r_hook.ah_fun = scresume;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->r_hook.ah_arg = NULL;
|
|
|
|
|
scp->r_hook.ah_name = "system keyboard";
|
|
|
|
|
scp->r_hook.ah_order = APM_MID_ORDER;
|
|
|
|
|
apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
|
|
|
|
|
#endif
|
1995-09-10 21:36:12 +00:00
|
|
|
|
|
1998-08-03 09:18:58 +00:00
|
|
|
|
at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
|
|
|
|
|
|
1998-08-23 08:26:42 +00:00
|
|
|
|
cdevsw_add(&cdev, &sc_cdevsw, NULL);
|
1995-12-14 22:03:12 +00:00
|
|
|
|
|
1996-03-27 19:11:41 +00:00
|
|
|
|
#ifdef DEVFS
|
|
|
|
|
for (vc = 0; vc < MAXCONS; vc++)
|
1998-08-23 08:26:42 +00:00
|
|
|
|
sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
|
1998-07-15 12:18:34 +00:00
|
|
|
|
UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
|
1998-08-23 08:26:42 +00:00
|
|
|
|
sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
|
1998-01-12 03:28:36 +00:00
|
|
|
|
UID_ROOT, GID_WHEEL, 0600, "sysmouse");
|
1998-08-23 08:26:42 +00:00
|
|
|
|
sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
|
1998-01-12 03:28:36 +00:00
|
|
|
|
UID_ROOT, GID_WHEEL, 0600, "consolectl");
|
1996-03-27 19:11:41 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
struct tty
|
1995-02-25 20:09:44 +00:00
|
|
|
|
*scdevtotty(dev_t dev)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
int unit = minor(dev);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
if (init_done == COLD)
|
1996-02-08 06:30:31 +00:00
|
|
|
|
return(NULL);
|
1996-09-08 21:31:56 +00:00
|
|
|
|
if (unit == SC_CONSOLE)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return CONSOLE_TTY;
|
1996-09-08 21:31:56 +00:00
|
|
|
|
if (unit == SC_MOUSE)
|
|
|
|
|
return MOUSE_TTY;
|
|
|
|
|
if (unit >= MAXCONS || unit < 0)
|
|
|
|
|
return(NULL);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return VIRTUAL_TTY(unit);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scopen(dev_t dev, int flag, int mode, struct proc *p)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-25 20:09:44 +00:00
|
|
|
|
struct tty *tp = scdevtotty(dev);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
keyarg_t key;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
if (!tp)
|
|
|
|
|
return(ENXIO);
|
|
|
|
|
|
1996-09-10 19:14:49 +00:00
|
|
|
|
tp->t_oproc = (minor(dev) == SC_MOUSE) ? scmousestart : scstart;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
tp->t_param = scparam;
|
|
|
|
|
tp->t_dev = dev;
|
|
|
|
|
if (!(tp->t_state & TS_ISOPEN)) {
|
|
|
|
|
ttychars(tp);
|
1997-04-03 21:42:42 +00:00
|
|
|
|
/* Use the current setting of the <-- key as default VERASE. */
|
|
|
|
|
/* If the Delete key is preferable, an stty is necessary */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
key.keynum = 0x0e; /* how do we know this magic number... XXX */
|
|
|
|
|
kbd_ioctl(kbd, GIO_KEYMAPENT, (caddr_t)&key);
|
|
|
|
|
tp->t_cc[VERASE] = key.key.map[0];
|
1995-02-22 13:48:07 +00:00
|
|
|
|
tp->t_iflag = TTYDEF_IFLAG;
|
|
|
|
|
tp->t_oflag = TTYDEF_OFLAG;
|
|
|
|
|
tp->t_cflag = TTYDEF_CFLAG;
|
|
|
|
|
tp->t_lflag = TTYDEF_LFLAG;
|
|
|
|
|
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
|
|
|
|
|
scparam(tp, &tp->t_termios);
|
1995-07-31 21:02:00 +00:00
|
|
|
|
(*linesw[tp->t_line].l_modem)(tp, 1);
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
if (minor(dev) == SC_MOUSE)
|
|
|
|
|
mouse_level = 0; /* XXX */
|
1995-05-30 08:16:23 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1999-01-30 12:17:38 +00:00
|
|
|
|
if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return(EBUSY);
|
1996-09-30 23:00:58 +00:00
|
|
|
|
if (minor(dev) < MAXCONS && !console[minor(dev)]) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
console[minor(dev)] = alloc_scp();
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISGRAPHSC(console[minor(dev)]))
|
|
|
|
|
sc_set_pixel_mode(console[minor(dev)], NULL, COL, ROW, 16);
|
1996-10-01 23:24:09 +00:00
|
|
|
|
}
|
1996-10-15 20:27:07 +00:00
|
|
|
|
if (minor(dev)<MAXCONS && !tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
|
|
|
|
|
tp->t_winsize.ws_col = console[minor(dev)]->xsize;
|
|
|
|
|
tp->t_winsize.ws_row = console[minor(dev)]->ysize;
|
|
|
|
|
}
|
1996-10-01 23:24:09 +00:00
|
|
|
|
return ((*linesw[tp->t_line].l_open)(dev, tp));
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scclose(dev_t dev, int flag, int mode, struct proc *p)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-25 20:09:44 +00:00
|
|
|
|
struct tty *tp = scdevtotty(dev);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
struct scr_stat *scp;
|
|
|
|
|
|
|
|
|
|
if (!tp)
|
|
|
|
|
return(ENXIO);
|
|
|
|
|
if (minor(dev) < MAXCONS) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp = sc_get_scr_stat(tp->t_dev);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->status & SWITCH_WAIT_ACQ)
|
|
|
|
|
wakeup((caddr_t)&scp->smode);
|
1995-01-28 22:18:05 +00:00
|
|
|
|
#if not_yet_done
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp == &main_console) {
|
|
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
}
|
|
|
|
|
else {
|
1995-05-30 08:16:23 +00:00
|
|
|
|
free(scp->scr_buf, M_DEVBUF);
|
1997-10-23 03:23:50 +00:00
|
|
|
|
if (scp->history != NULL) {
|
1997-07-07 13:42:42 +00:00
|
|
|
|
free(scp->history, M_DEVBUF);
|
1997-10-23 03:23:50 +00:00
|
|
|
|
if (scp->history_size / scp->xsize
|
1998-09-15 18:16:39 +00:00
|
|
|
|
> imax(sc_history_size, scp->ysize))
|
1997-10-23 03:23:50 +00:00
|
|
|
|
extra_history_size += scp->history_size / scp->xsize
|
1998-09-15 18:16:39 +00:00
|
|
|
|
- imax(sc_history_size, scp->ysize);
|
1997-10-23 03:23:50 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
free(scp, M_DEVBUF);
|
|
|
|
|
console[minor(dev)] = NULL;
|
|
|
|
|
}
|
1995-01-28 22:18:05 +00:00
|
|
|
|
#else
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1996-11-11 22:21:03 +00:00
|
|
|
|
spltty();
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(*linesw[tp->t_line].l_close)(tp, flag);
|
1995-05-30 08:16:23 +00:00
|
|
|
|
ttyclose(tp);
|
1996-11-11 22:21:03 +00:00
|
|
|
|
spl0();
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return(0);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scread(dev_t dev, struct uio *uio, int flag)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-25 20:09:44 +00:00
|
|
|
|
struct tty *tp = scdevtotty(dev);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (!tp)
|
|
|
|
|
return(ENXIO);
|
1999-01-26 09:58:37 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return((*linesw[tp->t_line].l_read)(tp, uio, flag));
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scwrite(dev_t dev, struct uio *uio, int flag)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-25 20:09:44 +00:00
|
|
|
|
struct tty *tp = scdevtotty(dev);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (!tp)
|
|
|
|
|
return(ENXIO);
|
|
|
|
|
return((*linesw[tp->t_line].l_write)(tp, uio, flag));
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
|
|
|
|
sckbdevent(keyboard_t *thiskbd, int event, void *arg)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
static struct tty *cur_tty;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int c;
|
|
|
|
|
size_t len;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
u_char *cp;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* assert(thiskbd == kbd) */
|
|
|
|
|
|
|
|
|
|
switch (event) {
|
|
|
|
|
case KBDIO_KEYINPUT:
|
|
|
|
|
break;
|
|
|
|
|
case KBDIO_UNLOADING:
|
|
|
|
|
kbd = NULL;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
kbd_release(thiskbd, (void *)&keyboard);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
1996-11-04 21:01:08 +00:00
|
|
|
|
/*
|
|
|
|
|
* Loop while there is still input to get from the keyboard.
|
|
|
|
|
* I don't think this is nessesary, and it doesn't fix
|
|
|
|
|
* the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
|
|
|
|
|
*/
|
1999-01-11 03:18:56 +00:00
|
|
|
|
while ((c = scgetc(thiskbd, SCGETC_NONBLOCK)) != NOKEY) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1996-11-04 21:01:08 +00:00
|
|
|
|
cur_tty = VIRTUAL_TTY(get_scr_num());
|
|
|
|
|
if (!(cur_tty->t_state & TS_ISOPEN))
|
|
|
|
|
if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
|
1996-11-11 22:21:03 +00:00
|
|
|
|
continue;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
switch (KEYFLAGS(c)) {
|
1996-11-04 21:01:08 +00:00
|
|
|
|
case 0x0000: /* normal key */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
|
1996-11-04 21:01:08 +00:00
|
|
|
|
break;
|
|
|
|
|
case FKEY: /* function key, return string */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
|
|
|
|
|
if (cp != NULL) {
|
1996-11-04 21:01:08 +00:00
|
|
|
|
while (len-- > 0)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
|
1996-11-04 21:01:08 +00:00
|
|
|
|
}
|
1996-11-11 22:21:03 +00:00
|
|
|
|
break;
|
1996-11-04 21:01:08 +00:00
|
|
|
|
case MKEY: /* meta is active, prepend ESC */
|
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
|
1996-11-04 21:01:08 +00:00
|
|
|
|
break;
|
|
|
|
|
case BKEY: /* backtab fixed sequence (esc [ Z) */
|
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
|
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)('[', cur_tty);
|
|
|
|
|
(*linesw[cur_tty->t_line].l_rint)('Z', cur_tty);
|
|
|
|
|
break;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
}
|
1996-11-04 21:01:08 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (cur_console->status & MOUSE_VISIBLE) {
|
|
|
|
|
remove_mouse_image(cur_console);
|
|
|
|
|
cur_console->status &= ~MOUSE_VISIBLE;
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-12-10 13:40:44 +00:00
|
|
|
|
static int
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scparam(struct tty *tp, struct termios *t)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
tp->t_ispeed = t->c_ispeed;
|
|
|
|
|
tp->t_ospeed = t->c_ospeed;
|
|
|
|
|
tp->t_cflag = t->c_cflag;
|
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1998-06-07 17:13:14 +00:00
|
|
|
|
scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1998-09-26 03:38:40 +00:00
|
|
|
|
u_int delta_ehs;
|
1996-10-15 20:27:07 +00:00
|
|
|
|
int error;
|
1998-09-26 03:38:40 +00:00
|
|
|
|
int i;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
struct tty *tp;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scr_stat *scp;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
int s;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-25 20:09:44 +00:00
|
|
|
|
tp = scdevtotty(dev);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (!tp)
|
|
|
|
|
return ENXIO;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp = sc_get_scr_stat(tp->t_dev);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1996-10-18 18:51:37 +00:00
|
|
|
|
/* If there is a user_ioctl function call that first */
|
|
|
|
|
if (sc_user_ioctl) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
error = (*sc_user_ioctl)(dev, cmd, data, flag, p);
|
|
|
|
|
if (error != ENOIOCTL)
|
1996-10-18 18:51:37 +00:00
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
error = sc_vid_ioctl(tp, cmd, data, flag, p);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
switch (cmd) { /* process console hardware related ioctl's */
|
1994-10-17 22:12:06 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case GIO_ATTR: /* get current attributes */
|
1996-07-30 15:20:08 +00:00
|
|
|
|
*(int*)data = (scp->term.cur_attr >> 8) & 0xFF;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1994-10-17 22:12:06 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case GIO_COLOR: /* is this a color console ? */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
*(int *)data = (scp->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1994-09-15 07:26:40 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
|
1998-08-03 09:15:36 +00:00
|
|
|
|
if (*(int *)data < 0 || *(int *)data > MAX_BLANKTIME)
|
1997-05-15 05:43:59 +00:00
|
|
|
|
return EINVAL;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
s = spltty();
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
scrn_blank_time = *(int *)data;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
run_scrn_saver = (scrn_blank_time != 0);
|
|
|
|
|
splx(s);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1994-09-15 07:26:40 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
|
|
|
|
|
if ((*(int*)data) & 0x01)
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= BLINK_CURSOR;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~BLINK_CURSOR;
|
1995-04-04 20:06:26 +00:00
|
|
|
|
if ((*(int*)data) & 0x02) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1996-09-01 18:16:06 +00:00
|
|
|
|
return ENXIO;
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= CHAR_CURSOR;
|
1995-04-04 20:06:26 +00:00
|
|
|
|
} else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~CHAR_CURSOR;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
/*
|
|
|
|
|
* The cursor shape is global property; all virtual consoles
|
|
|
|
|
* are affected. Update the cursor in the current console...
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(cur_console)) {
|
1998-11-03 02:37:46 +00:00
|
|
|
|
s = spltty();
|
1997-06-30 13:31:49 +00:00
|
|
|
|
remove_cursor_image(cur_console);
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & CHAR_CURSOR)
|
1997-06-30 13:31:49 +00:00
|
|
|
|
set_destructive_cursor(cur_console);
|
|
|
|
|
draw_cursor_image(cur_console);
|
1998-11-03 02:37:46 +00:00
|
|
|
|
splx(s);
|
1997-06-30 13:31:49 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1994-09-15 07:26:40 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_BELLTYPE: /* set bell type sound/visual */
|
1998-08-03 09:09:35 +00:00
|
|
|
|
if ((*(int *)data) & 0x01)
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= VISUAL_BELL;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~VISUAL_BELL;
|
1998-08-03 09:09:35 +00:00
|
|
|
|
if ((*(int *)data) & 0x02)
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= QUIET_BELL;
|
1998-08-03 09:09:35 +00:00
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~QUIET_BELL;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1995-01-12 11:47:05 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_HISTORY: /* set history size */
|
1997-10-23 03:23:50 +00:00
|
|
|
|
if (*(int *)data > 0) {
|
|
|
|
|
int lines; /* buffer size to allocate */
|
|
|
|
|
int lines0; /* current buffer size */
|
|
|
|
|
|
|
|
|
|
lines = imax(*(int *)data, scp->ysize);
|
|
|
|
|
lines0 = (scp->history != NULL) ?
|
|
|
|
|
scp->history_size / scp->xsize : scp->ysize;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (lines0 > imax(sc_history_size, scp->ysize))
|
1998-09-26 03:38:40 +00:00
|
|
|
|
delta_ehs = lines0 - imax(sc_history_size, scp->ysize);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
else
|
1998-09-26 03:38:40 +00:00
|
|
|
|
delta_ehs = 0;
|
1997-10-23 03:23:50 +00:00
|
|
|
|
/*
|
|
|
|
|
* syscons unconditionally allocates buffers upto SC_HISTORY_SIZE
|
|
|
|
|
* lines or scp->ysize lines, whichever is larger. A value
|
|
|
|
|
* greater than that is allowed, subject to extra_history_size.
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (lines > imax(sc_history_size, scp->ysize))
|
|
|
|
|
if (lines - imax(sc_history_size, scp->ysize) >
|
1998-09-26 03:38:40 +00:00
|
|
|
|
extra_history_size + delta_ehs)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return EINVAL;
|
1997-07-09 14:10:19 +00:00
|
|
|
|
if (cur_console->status & BUFFER_SAVED)
|
|
|
|
|
return EBUSY;
|
1998-09-26 03:38:40 +00:00
|
|
|
|
sc_alloc_history_buffer(scp, lines, delta_ehs, TRUE);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return EINVAL;
|
1995-01-12 11:47:05 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_MOUSECTL: /* control mouse arrow */
|
1998-01-20 03:37:27 +00:00
|
|
|
|
case OLD_CONS_MOUSECTL:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
{
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
/* MOUSE_BUTTON?DOWN -> MOUSE_MSC_BUTTON?UP */
|
1998-09-26 03:38:40 +00:00
|
|
|
|
static int butmap[8] = {
|
|
|
|
|
MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
|
|
|
|
|
MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
|
|
|
|
|
MOUSE_MSC_BUTTON3UP,
|
|
|
|
|
MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP,
|
|
|
|
|
MOUSE_MSC_BUTTON2UP,
|
|
|
|
|
MOUSE_MSC_BUTTON1UP,
|
|
|
|
|
0,
|
|
|
|
|
};
|
1995-02-22 13:48:07 +00:00
|
|
|
|
mouse_info_t *mouse = (mouse_info_t*)data;
|
1998-01-20 03:37:27 +00:00
|
|
|
|
mouse_info_t buf;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* FIXME: */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISMOUSEAVAIL(scp->adp->va_flags))
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
return ENODEV;
|
1996-06-26 13:04:53 +00:00
|
|
|
|
|
1998-01-20 03:37:27 +00:00
|
|
|
|
if (cmd == OLD_CONS_MOUSECTL) {
|
1998-09-26 03:38:40 +00:00
|
|
|
|
static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
|
1998-01-20 03:37:27 +00:00
|
|
|
|
old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
|
|
|
|
|
|
|
|
|
|
mouse = &buf;
|
|
|
|
|
mouse->operation = old_mouse->operation;
|
|
|
|
|
switch (mouse->operation) {
|
|
|
|
|
case MOUSE_MODE:
|
|
|
|
|
mouse->u.mode = old_mouse->u.mode;
|
|
|
|
|
break;
|
|
|
|
|
case MOUSE_SHOW:
|
|
|
|
|
case MOUSE_HIDE:
|
|
|
|
|
break;
|
|
|
|
|
case MOUSE_MOVEABS:
|
|
|
|
|
case MOUSE_MOVEREL:
|
|
|
|
|
case MOUSE_ACTION:
|
|
|
|
|
mouse->u.data.x = old_mouse->u.data.x;
|
|
|
|
|
mouse->u.data.y = old_mouse->u.data.y;
|
|
|
|
|
mouse->u.data.z = 0;
|
|
|
|
|
mouse->u.data.buttons = swapb[old_mouse->u.data.buttons & 0x7];
|
|
|
|
|
break;
|
|
|
|
|
case MOUSE_GETINFO:
|
|
|
|
|
old_mouse->u.data.x = scp->mouse_xpos;
|
|
|
|
|
old_mouse->u.data.y = scp->mouse_ypos;
|
|
|
|
|
old_mouse->u.data.buttons = swapb[scp->mouse_buttons & 0x7];
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
switch (mouse->operation) {
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_MODE:
|
1997-03-01 23:53:46 +00:00
|
|
|
|
if (ISSIGVALID(mouse->u.mode.signal)) {
|
1996-06-25 08:54:57 +00:00
|
|
|
|
scp->mouse_signal = mouse->u.mode.signal;
|
|
|
|
|
scp->mouse_proc = p;
|
|
|
|
|
scp->mouse_pid = p->p_pid;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1996-06-25 08:54:57 +00:00
|
|
|
|
else {
|
|
|
|
|
scp->mouse_signal = 0;
|
|
|
|
|
scp->mouse_proc = NULL;
|
|
|
|
|
scp->mouse_pid = 0;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_SHOW:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(scp) && !(scp->status & MOUSE_ENABLED)) {
|
1996-10-18 18:51:37 +00:00
|
|
|
|
scp->status |= (MOUSE_ENABLED | MOUSE_VISIBLE);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
scp->mouse_oldpos = scp->mouse_pos;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
mark_all(scp);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return EINVAL;
|
|
|
|
|
break;
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_HIDE:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(scp) && (scp->status & MOUSE_ENABLED)) {
|
1996-10-18 18:51:37 +00:00
|
|
|
|
scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
mark_all(scp);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return EINVAL;
|
|
|
|
|
break;
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_MOVEABS:
|
|
|
|
|
scp->mouse_xpos = mouse->u.data.x;
|
|
|
|
|
scp->mouse_ypos = mouse->u.data.y;
|
|
|
|
|
set_mouse_pos(scp);
|
1996-06-21 07:19:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_MOVEREL:
|
|
|
|
|
scp->mouse_xpos += mouse->u.data.x;
|
|
|
|
|
scp->mouse_ypos += mouse->u.data.y;
|
|
|
|
|
set_mouse_pos(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1994-10-17 22:12:06 +00:00
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_GETINFO:
|
|
|
|
|
mouse->u.data.x = scp->mouse_xpos;
|
|
|
|
|
mouse->u.data.y = scp->mouse_ypos;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
mouse->u.data.z = 0;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
mouse->u.data.buttons = scp->mouse_buttons;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
1994-10-17 22:12:06 +00:00
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
case MOUSE_ACTION:
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
case MOUSE_MOTION_EVENT:
|
1996-09-30 23:00:58 +00:00
|
|
|
|
/* this should maybe only be settable from /dev/consolectl SOS */
|
|
|
|
|
/* send out mouse event on /dev/sysmouse */
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
|
|
|
|
mouse_status.dx += mouse->u.data.x;
|
|
|
|
|
mouse_status.dy += mouse->u.data.y;
|
|
|
|
|
mouse_status.dz += mouse->u.data.z;
|
|
|
|
|
if (mouse->operation == MOUSE_ACTION)
|
|
|
|
|
mouse_status.button = mouse->u.data.buttons;
|
|
|
|
|
mouse_status.flags |=
|
|
|
|
|
((mouse->u.data.x || mouse->u.data.y || mouse->u.data.z) ?
|
|
|
|
|
MOUSE_POSCHANGED : 0)
|
|
|
|
|
| (mouse_status.obutton ^ mouse_status.button);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (mouse_status.flags == 0)
|
|
|
|
|
return 0;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
|
1996-10-18 18:51:37 +00:00
|
|
|
|
cur_console->status |= MOUSE_VISIBLE;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
1996-09-08 21:31:56 +00:00
|
|
|
|
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
u_char buf[MOUSE_SYS_PACKETSIZE];
|
1997-11-07 09:21:01 +00:00
|
|
|
|
int j;
|
1996-09-08 21:31:56 +00:00
|
|
|
|
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
/* the first five bytes are compatible with MouseSystems' */
|
|
|
|
|
buf[0] = MOUSE_MSC_SYNC
|
|
|
|
|
| butmap[mouse_status.button & MOUSE_STDBUTTONS];
|
|
|
|
|
j = imax(imin(mouse->u.data.x, 255), -256);
|
|
|
|
|
buf[1] = j >> 1;
|
|
|
|
|
buf[3] = j - buf[1];
|
|
|
|
|
j = -imax(imin(mouse->u.data.y, 255), -256);
|
|
|
|
|
buf[2] = j >> 1;
|
|
|
|
|
buf[4] = j - buf[2];
|
|
|
|
|
for (j = 0; j < MOUSE_MSC_PACKETSIZE; j++)
|
|
|
|
|
(*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
|
|
|
|
|
if (mouse_level >= 1) { /* extended part */
|
|
|
|
|
j = imax(imin(mouse->u.data.z, 127), -128);
|
|
|
|
|
buf[5] = (j >> 1) & 0x7f;
|
|
|
|
|
buf[6] = (j - (j >> 1)) & 0x7f;
|
|
|
|
|
/* buttons 4-10 */
|
|
|
|
|
buf[7] = (~mouse_status.button >> 3) & 0x7f;
|
|
|
|
|
for (j = MOUSE_MSC_PACKETSIZE;
|
|
|
|
|
j < MOUSE_SYS_PACKETSIZE; j++)
|
1997-11-07 09:21:01 +00:00
|
|
|
|
(*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[j],MOUSE_TTY);
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
}
|
1996-09-08 21:31:56 +00:00
|
|
|
|
}
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
1996-06-26 13:04:53 +00:00
|
|
|
|
if (cur_console->mouse_signal) {
|
|
|
|
|
cur_console->mouse_buttons = mouse->u.data.buttons;
|
|
|
|
|
/* has controlling process died? */
|
|
|
|
|
if (cur_console->mouse_proc &&
|
|
|
|
|
(cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
|
1996-06-25 08:54:57 +00:00
|
|
|
|
cur_console->mouse_signal = 0;
|
|
|
|
|
cur_console->mouse_proc = NULL;
|
|
|
|
|
cur_console->mouse_pid = 0;
|
|
|
|
|
}
|
1996-06-26 13:04:53 +00:00
|
|
|
|
else
|
|
|
|
|
psignal(cur_console->mouse_proc, cur_console->mouse_signal);
|
|
|
|
|
}
|
1998-08-03 09:17:06 +00:00
|
|
|
|
else if (mouse->operation == MOUSE_ACTION && cut_buffer != NULL) {
|
1996-09-30 23:00:58 +00:00
|
|
|
|
/* process button presses */
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
if ((cur_console->mouse_buttons ^ mouse->u.data.buttons) &&
|
1998-09-15 18:16:39 +00:00
|
|
|
|
ISTEXTSC(cur_console)) {
|
1996-06-26 13:04:53 +00:00
|
|
|
|
cur_console->mouse_buttons = mouse->u.data.buttons;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
if (cur_console->mouse_buttons & MOUSE_BUTTON1DOWN)
|
|
|
|
|
mouse_cut_start(cur_console);
|
|
|
|
|
else
|
|
|
|
|
mouse_cut_end(cur_console);
|
|
|
|
|
if (cur_console->mouse_buttons & MOUSE_BUTTON2DOWN ||
|
|
|
|
|
cur_console->mouse_buttons & MOUSE_BUTTON3DOWN)
|
|
|
|
|
mouse_paste(cur_console);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
}
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
1997-08-09 19:24:03 +00:00
|
|
|
|
if (mouse->u.data.x != 0 || mouse->u.data.y != 0) {
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cur_console->mouse_xpos += mouse->u.data.x;
|
|
|
|
|
cur_console->mouse_ypos += mouse->u.data.y;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
set_mouse_pos(cur_console);
|
1997-08-09 19:24:03 +00:00
|
|
|
|
}
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MOUSE_BUTTON_EVENT:
|
|
|
|
|
if ((mouse->u.event.id & MOUSE_BUTTONS) == 0)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
if (mouse->u.event.value < 0)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
|
|
if (mouse->u.event.value > 0) {
|
|
|
|
|
cur_console->mouse_buttons |= mouse->u.event.id;
|
|
|
|
|
mouse_status.button |= mouse->u.event.id;
|
|
|
|
|
} else {
|
|
|
|
|
cur_console->mouse_buttons &= ~mouse->u.event.id;
|
|
|
|
|
mouse_status.button &= ~mouse->u.event.id;
|
|
|
|
|
}
|
1998-06-24 10:21:30 +00:00
|
|
|
|
mouse_status.flags |= mouse_status.obutton ^ mouse_status.button;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (mouse_status.flags == 0)
|
|
|
|
|
return 0;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cur_console->status |= MOUSE_VISIBLE;
|
|
|
|
|
|
|
|
|
|
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
|
|
|
|
|
u_char buf[8];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
buf[0] = MOUSE_MSC_SYNC
|
|
|
|
|
| butmap[mouse_status.button & MOUSE_STDBUTTONS];
|
|
|
|
|
buf[7] = (~mouse_status.button >> 3) & 0x7f;
|
|
|
|
|
buf[1] = buf[2] = buf[3] = buf[4] = buf[5] = buf[6] = 0;
|
|
|
|
|
for (i = 0;
|
|
|
|
|
i < ((mouse_level >= 1) ? MOUSE_SYS_PACKETSIZE
|
|
|
|
|
: MOUSE_MSC_PACKETSIZE); i++)
|
|
|
|
|
(*linesw[(MOUSE_TTY)->t_line].l_rint)(buf[i],MOUSE_TTY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cur_console->mouse_signal) {
|
|
|
|
|
if (cur_console->mouse_proc &&
|
|
|
|
|
(cur_console->mouse_proc != pfind(cur_console->mouse_pid))){
|
|
|
|
|
cur_console->mouse_signal = 0;
|
|
|
|
|
cur_console->mouse_proc = NULL;
|
|
|
|
|
cur_console->mouse_pid = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
psignal(cur_console->mouse_proc, cur_console->mouse_signal);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISTEXTSC(cur_console) || (cut_buffer == NULL))
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
switch (mouse->u.event.id) {
|
|
|
|
|
case MOUSE_BUTTON1DOWN:
|
|
|
|
|
switch (mouse->u.event.value % 4) {
|
|
|
|
|
case 0: /* up */
|
|
|
|
|
mouse_cut_end(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
mouse_cut_start(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
mouse_cut_word(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
mouse_cut_line(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MOUSE_BUTTON2DOWN:
|
|
|
|
|
switch (mouse->u.event.value) {
|
|
|
|
|
case 0: /* up */
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
mouse_paste(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MOUSE_BUTTON3DOWN:
|
|
|
|
|
switch (mouse->u.event.value) {
|
|
|
|
|
case 0: /* up */
|
|
|
|
|
if (!(cur_console->mouse_buttons & MOUSE_BUTTON1DOWN))
|
|
|
|
|
mouse_cut_end(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
mouse_cut_extend(cur_console);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
/* make screensaver happy */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
/* MOUSE_XXX: /dev/sysmouse ioctls */
|
|
|
|
|
case MOUSE_GETHWINFO: /* get device information */
|
|
|
|
|
{
|
|
|
|
|
mousehw_t *hw = (mousehw_t *)data;
|
|
|
|
|
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
hw->buttons = 10; /* XXX unknown */
|
|
|
|
|
hw->iftype = MOUSE_IF_SYSMOUSE;
|
|
|
|
|
hw->type = MOUSE_MOUSE;
|
|
|
|
|
hw->model = MOUSE_MODEL_GENERIC;
|
|
|
|
|
hw->hwid = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case MOUSE_GETMODE: /* get protocol/mode */
|
|
|
|
|
{
|
|
|
|
|
mousemode_t *mode = (mousemode_t *)data;
|
|
|
|
|
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
mode->level = mouse_level;
|
|
|
|
|
switch (mode->level) {
|
|
|
|
|
case 0:
|
|
|
|
|
/* at this level, sysmouse emulates MouseSystems protocol */
|
|
|
|
|
mode->protocol = MOUSE_PROTO_MSC;
|
|
|
|
|
mode->rate = -1; /* unknown */
|
|
|
|
|
mode->resolution = -1; /* unknown */
|
|
|
|
|
mode->accelfactor = 0; /* disabled */
|
|
|
|
|
mode->packetsize = MOUSE_MSC_PACKETSIZE;
|
|
|
|
|
mode->syncmask[0] = MOUSE_MSC_SYNCMASK;
|
|
|
|
|
mode->syncmask[1] = MOUSE_MSC_SYNC;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
/* at this level, sysmouse uses its own protocol */
|
|
|
|
|
mode->protocol = MOUSE_PROTO_SYSMOUSE;
|
|
|
|
|
mode->rate = -1;
|
|
|
|
|
mode->resolution = -1;
|
|
|
|
|
mode->accelfactor = 0;
|
|
|
|
|
mode->packetsize = MOUSE_SYS_PACKETSIZE;
|
|
|
|
|
mode->syncmask[0] = MOUSE_SYS_SYNCMASK;
|
|
|
|
|
mode->syncmask[1] = MOUSE_SYS_SYNC;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case MOUSE_SETMODE: /* set protocol/mode */
|
|
|
|
|
{
|
|
|
|
|
mousemode_t *mode = (mousemode_t *)data;
|
|
|
|
|
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
if ((mode->level < 0) || (mode->level > 1))
|
|
|
|
|
return EINVAL;
|
|
|
|
|
mouse_level = mode->level;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case MOUSE_GETLEVEL: /* get operation level */
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
*(int *)data = mouse_level;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case MOUSE_SETLEVEL: /* set operation level */
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
if ((*(int *)data < 0) || (*(int *)data > 1))
|
|
|
|
|
return EINVAL;
|
|
|
|
|
mouse_level = *(int *)data;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case MOUSE_GETSTATUS: /* get accumulated mouse events */
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
s = spltty();
|
|
|
|
|
*(mousestatus_t *)data = mouse_status;
|
|
|
|
|
mouse_status.flags = 0;
|
|
|
|
|
mouse_status.obutton = mouse_status.button;
|
|
|
|
|
mouse_status.dx = 0;
|
|
|
|
|
mouse_status.dy = 0;
|
|
|
|
|
mouse_status.dz = 0;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
#if notyet
|
|
|
|
|
case MOUSE_GETVARS: /* get internal mouse variables */
|
|
|
|
|
case MOUSE_SETVARS: /* set internal mouse variables */
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
return ENODEV;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
case MOUSE_READSTATE: /* read status from the device */
|
|
|
|
|
case MOUSE_READDATA: /* read data from the device */
|
|
|
|
|
if (tp != MOUSE_TTY)
|
|
|
|
|
return ENOTTY;
|
|
|
|
|
return ENODEV;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_GETINFO: /* get current (virtual) console info */
|
|
|
|
|
{
|
|
|
|
|
vid_info_t *ptr = (vid_info_t*)data;
|
|
|
|
|
if (ptr->size == sizeof(struct vid_info)) {
|
|
|
|
|
ptr->m_num = get_scr_num();
|
|
|
|
|
ptr->mv_col = scp->xpos;
|
|
|
|
|
ptr->mv_row = scp->ypos;
|
|
|
|
|
ptr->mv_csz = scp->xsize;
|
|
|
|
|
ptr->mv_rsz = scp->ysize;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
ptr->mv_norm.fore = (scp->term.std_color & 0x0f00)>>8;
|
|
|
|
|
ptr->mv_norm.back = (scp->term.std_color & 0xf000)>>12;
|
|
|
|
|
ptr->mv_rev.fore = (scp->term.rev_color & 0x0f00)>>8;
|
|
|
|
|
ptr->mv_rev.back = (scp->term.rev_color & 0xf000)>>12;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
ptr->mv_grfc.fore = 0; /* not supported */
|
|
|
|
|
ptr->mv_grfc.back = 0; /* not supported */
|
|
|
|
|
ptr->mv_ovscan = scp->border;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scp == cur_console)
|
|
|
|
|
save_kbd_state(scp);
|
|
|
|
|
ptr->mk_keylock = scp->status & LOCK_MASK;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case CONS_GETVERS: /* get version number */
|
|
|
|
|
*(int*)data = 0x200; /* version 2.0 */
|
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
case CONS_IDLE: /* see if the screen has been idle */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/*
|
|
|
|
|
* When the screen is in the GRAPHICS_MODE or UNKNOWN_MODE,
|
|
|
|
|
* the user process may have been writing something on the
|
|
|
|
|
* screen and syscons is not aware of it. Declare the screen
|
|
|
|
|
* is NOT idle if it is in one of these modes. But there is
|
|
|
|
|
* an exception to it; if a screen saver is running in the
|
|
|
|
|
* graphics mode in the current screen, we should say that the
|
|
|
|
|
* screen has been idle.
|
|
|
|
|
*/
|
|
|
|
|
*(int *)data = scrn_idle
|
|
|
|
|
&& (!ISGRAPHSC(cur_console)
|
|
|
|
|
|| (cur_console->status & SAVER_RUNNING));
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case CONS_SAVERMODE: /* set saver mode */
|
|
|
|
|
switch(*(int *)data) {
|
|
|
|
|
case CONS_USR_SAVER:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* if a LKM screen saver is running, stop it first. */
|
|
|
|
|
scsplash_stick(FALSE);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
saver_mode = *(int *)data;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
s = spltty();
|
|
|
|
|
if ((error = wait_scrn_saver_stop())) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
scp->status |= SAVER_RUNNING;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scsplash_stick(TRUE);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
splx(s);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
break;
|
|
|
|
|
case CONS_LKM_SAVER:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
s = spltty();
|
|
|
|
|
if ((saver_mode == CONS_USR_SAVER) && (scp->status & SAVER_RUNNING))
|
|
|
|
|
scp->status &= ~SAVER_RUNNING;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
saver_mode = *(int *)data;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
splx(s);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case CONS_SAVERSTART: /* immediately start/stop the screen saver */
|
|
|
|
|
/*
|
|
|
|
|
* Note that this ioctl does not guarantee the screen saver
|
|
|
|
|
* actually starts or stops. It merely attempts to do so...
|
|
|
|
|
*/
|
|
|
|
|
s = spltty();
|
|
|
|
|
run_scrn_saver = (*(int *)data != 0);
|
|
|
|
|
if (run_scrn_saver)
|
|
|
|
|
scrn_time_stamp -= scrn_blank_time;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_SETMODE: /* set screen switcher mode */
|
1997-03-01 23:53:46 +00:00
|
|
|
|
{
|
|
|
|
|
struct vt_mode *mode;
|
|
|
|
|
|
|
|
|
|
mode = (struct vt_mode *)data;
|
|
|
|
|
if (ISSIGVALID(mode->relsig) && ISSIGVALID(mode->acqsig) &&
|
|
|
|
|
ISSIGVALID(mode->frsig)) {
|
|
|
|
|
bcopy(data, &scp->smode, sizeof(struct vt_mode));
|
|
|
|
|
if (scp->smode.mode == VT_PROCESS) {
|
|
|
|
|
scp->proc = p;
|
|
|
|
|
scp->pid = scp->proc->p_pid;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
} else
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_GETMODE: /* get screen switcher mode */
|
|
|
|
|
bcopy(&scp->smode, data, sizeof(struct vt_mode));
|
|
|
|
|
return 0;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_RELDISP: /* screen switcher ioctl */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
switch(*(int *)data) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_FALSE: /* user refuses to release screen, abort */
|
|
|
|
|
if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
|
|
|
|
|
old_scp->status &= ~SWITCH_WAIT_REL;
|
|
|
|
|
switch_in_progress = FALSE;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
|
|
case VT_TRUE: /* user has released screen, go on */
|
|
|
|
|
if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
|
|
|
|
|
scp->status &= ~SWITCH_WAIT_REL;
|
|
|
|
|
exchange_scr();
|
|
|
|
|
if (new_scp->smode.mode == VT_PROCESS) {
|
|
|
|
|
new_scp->status |= SWITCH_WAIT_ACQ;
|
|
|
|
|
psignal(new_scp->proc, new_scp->smode.acqsig);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
else
|
1995-02-22 13:48:07 +00:00
|
|
|
|
switch_in_progress = FALSE;
|
1993-10-28 05:27:36 +00:00
|
|
|
|
return 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
1993-10-28 05:27:36 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_ACKACQ: /* acquire acknowledged, switch completed */
|
|
|
|
|
if (scp == new_scp && (scp->status & SWITCH_WAIT_ACQ)) {
|
|
|
|
|
scp->status &= ~SWITCH_WAIT_ACQ;
|
|
|
|
|
switch_in_progress = FALSE;
|
1995-02-01 21:56:32 +00:00
|
|
|
|
return 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
/* NOT REACHED */
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_OPENQRY: /* return free virtual console */
|
|
|
|
|
for (i = 0; i < MAXCONS; i++) {
|
|
|
|
|
tp = VIRTUAL_TTY(i);
|
|
|
|
|
if (!(tp->t_state & TS_ISOPEN)) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
*(int *)data = i + 1;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
return 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
|
|
case VT_ACTIVATE: /* switch to screen *data */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
s = spltty();
|
|
|
|
|
sc_clean_up(cur_console);
|
|
|
|
|
splx(s);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return switch_scr(scp, *(int *)data - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
case VT_WAITACTIVE: /* wait for switch to occur */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (*(int *)data > MAXCONS || *(int *)data < 0)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return EINVAL;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
s = spltty();
|
|
|
|
|
error = sc_clean_up(cur_console);
|
|
|
|
|
splx(s);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (minor(dev) == *(int *)data - 1)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (*(int *)data == 0) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp == cur_console)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
return 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
else
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp = console[*(int *)data - 1];
|
1995-05-30 08:16:23 +00:00
|
|
|
|
while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
"waitvt", 0)) == ERESTART) ;
|
|
|
|
|
return error;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case VT_GETACTIVE:
|
1998-09-15 18:16:39 +00:00
|
|
|
|
*(int *)data = get_scr_num()+1;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDENABIO: /* allow io operations */
|
1995-10-14 07:08:09 +00:00
|
|
|
|
error = suser(p->p_ucred, &p->p_acflag);
|
|
|
|
|
if (error != 0)
|
|
|
|
|
return error;
|
1996-11-11 22:21:03 +00:00
|
|
|
|
if (securelevel > 0)
|
|
|
|
|
return EPERM;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1997-05-07 20:02:38 +00:00
|
|
|
|
p->p_md.md_regs->tf_eflags |= PSL_IOPL;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1995-05-30 08:16:23 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDDISABIO: /* disallow io operations (default) */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1997-05-07 20:02:38 +00:00
|
|
|
|
p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
case KDSKBSTATE: /* set keyboard state (locks) */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (*(int *)data & ~LOCK_MASK)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return EINVAL;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->status &= ~LOCK_MASK;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp->status |= *(int *)data;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
if (scp == cur_console)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
update_kbd_state(scp->status, LOCK_MASK);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDGKBSTATE: /* get keyboard state (locks) */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scp == cur_console)
|
|
|
|
|
save_kbd_state(scp);
|
|
|
|
|
*(int *)data = scp->status & LOCK_MASK;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDSETRAD: /* set keyboard repeat & delay rates */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (*(int *)data & ~0x7f)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return EINVAL;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
error = kbd_ioctl(kbd, KDSETRAD, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDSKBMODE: /* set keyboard mode */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
switch (*(int *)data) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case K_XLATE: /* switch to XLT ascii mode */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case K_RAW: /* switch to RAW scancode mode */
|
1997-10-01 20:46:29 +00:00
|
|
|
|
case K_CODE: /* switch to CODE mode */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->kbd_mode = *(int *)data;
|
|
|
|
|
if (scp == cur_console)
|
|
|
|
|
kbd_ioctl(kbd, cmd, data);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
/* NOT REACHED */
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDGKBMODE: /* get keyboard mode */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
*(int *)data = scp->kbd_mode;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case KDGKBINFO:
|
|
|
|
|
error = kbd_ioctl(kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KDMKTONE: /* sound the bell */
|
|
|
|
|
if (*(int*)data)
|
|
|
|
|
do_bell(scp, (*(int*)data)&0xffff,
|
|
|
|
|
(((*(int*)data)>>16)&0xffff)*hz/1000);
|
|
|
|
|
else
|
|
|
|
|
do_bell(scp, scp->bell_pitch, scp->bell_duration);
|
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case KIOCSOUND: /* make tone (*data) hz */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp == cur_console) {
|
|
|
|
|
if (*(int*)data) {
|
1996-10-26 20:16:58 +00:00
|
|
|
|
int pitch = timer_freq / *(int*)data;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* set command for counter 2, 2 byte write */
|
|
|
|
|
if (acquire_timer2(TIMER_16BIT|TIMER_SQWAVE))
|
|
|
|
|
return EBUSY;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* set pitch */
|
|
|
|
|
outb(TIMER_CNTR2, pitch);
|
|
|
|
|
outb(TIMER_CNTR2, (pitch>>8));
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* enable counter 2 output to speaker */
|
|
|
|
|
outb(IO_PPI, inb(IO_PPI) | 3);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* disable counter 2 output to speaker */
|
|
|
|
|
outb(IO_PPI, inb(IO_PPI) & 0xFC);
|
|
|
|
|
release_timer2();
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif /* __i386__ */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case KDGKBTYPE: /* get keyboard type */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
error = kbd_ioctl(kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL) {
|
|
|
|
|
/* always return something? XXX */
|
|
|
|
|
*(int *)data = 0;
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case KDSETLED: /* set keyboard LED status */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return EINVAL;
|
|
|
|
|
scp->status &= ~LED_MASK;
|
|
|
|
|
scp->status |= *(int *)data;
|
|
|
|
|
if (scp == cur_console)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
update_kbd_leds(scp->status);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
case KDGETLED: /* get keyboard LED status */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scp == cur_console)
|
|
|
|
|
save_kbd_state(scp);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
*(int *)data = scp->status & LED_MASK;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case CONS_SETKBD: /* set the new keyboard */
|
|
|
|
|
{
|
|
|
|
|
keyboard_t *newkbd;
|
|
|
|
|
|
|
|
|
|
s = spltty();
|
|
|
|
|
newkbd = kbd_get_keyboard(*(int *)data);
|
|
|
|
|
if (newkbd == NULL) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
error = 0;
|
|
|
|
|
if (kbd != newkbd) {
|
|
|
|
|
i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
|
|
|
|
|
(void *)&keyboard, sckbdevent, NULL);
|
|
|
|
|
/* i == newkbd->kb_index */
|
|
|
|
|
if (i >= 0) {
|
|
|
|
|
if (kbd != NULL) {
|
|
|
|
|
save_kbd_state(cur_console);
|
|
|
|
|
kbd_release(kbd, (void *)&keyboard);
|
|
|
|
|
}
|
|
|
|
|
kbd = kbd_get_keyboard(i); /* kbd == newkbd */
|
|
|
|
|
keyboard = i;
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
|
|
|
|
|
update_kbd_state(cur_console->status, LOCK_MASK);
|
|
|
|
|
} else {
|
|
|
|
|
error = EPERM; /* XXX */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case CONS_RELKBD: /* release the current keyboard */
|
|
|
|
|
s = spltty();
|
|
|
|
|
error = 0;
|
|
|
|
|
if (kbd != NULL) {
|
|
|
|
|
save_kbd_state(cur_console);
|
|
|
|
|
error = kbd_release(kbd, (void *)&keyboard);
|
|
|
|
|
if (error == 0) {
|
|
|
|
|
kbd = NULL;
|
|
|
|
|
keyboard = -1;
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
case GIO_SCRNMAP: /* get output translation table */
|
|
|
|
|
bcopy(&scr_map, data, sizeof(scr_map));
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case PIO_SCRNMAP: /* set output translation table */
|
|
|
|
|
bcopy(data, &scr_map, sizeof(scr_map));
|
1996-09-01 18:16:06 +00:00
|
|
|
|
for (i=0; i<sizeof(scr_map); i++)
|
|
|
|
|
scr_rmap[scr_map[i]] = i;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case GIO_KEYMAP: /* get keyboard translation table */
|
|
|
|
|
case PIO_KEYMAP: /* set keyboard translation table */
|
|
|
|
|
case GIO_DEADKEYMAP: /* get accent key translation table */
|
|
|
|
|
case PIO_DEADKEYMAP: /* set accent key translation table */
|
|
|
|
|
case GETFKEY: /* get function key string */
|
|
|
|
|
case SETFKEY: /* set function key string */
|
|
|
|
|
error = kbd_ioctl(kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1998-01-07 08:40:34 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case PIO_FONT8x8: /* set 8x8 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, font_8, 8*256);
|
|
|
|
|
fonts_loaded |= FONT_8;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x8.
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(cur_console) && (cur_console->font_size < 14))
|
|
|
|
|
copy_font(cur_console, LOAD, 8, font_8);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case GIO_FONT8x8: /* get 8x8 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
if (fonts_loaded & FONT_8) {
|
|
|
|
|
bcopy(font_8, data, 8*256);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return ENXIO;
|
|
|
|
|
|
|
|
|
|
case PIO_FONT8x14: /* set 8x14 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, font_14, 14*256);
|
|
|
|
|
fonts_loaded |= FONT_14;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x14.
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(cur_console)
|
|
|
|
|
&& (cur_console->font_size >= 14) && (cur_console->font_size < 16))
|
|
|
|
|
copy_font(cur_console, LOAD, 14, font_14);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case GIO_FONT8x14: /* get 8x14 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
if (fonts_loaded & FONT_14) {
|
|
|
|
|
bcopy(font_14, data, 14*256);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return ENXIO;
|
|
|
|
|
|
|
|
|
|
case PIO_FONT8x16: /* set 8x16 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, font_16, 16*256);
|
|
|
|
|
fonts_loaded |= FONT_16;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x16.
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(cur_console) && (cur_console->font_size >= 16))
|
|
|
|
|
copy_font(cur_console, LOAD, 16, font_16);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case GIO_FONT8x16: /* get 8x16 dot font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags))
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return ENXIO;
|
|
|
|
|
if (fonts_loaded & FONT_16) {
|
|
|
|
|
bcopy(font_16, data, 16*256);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return ENXIO;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
|
1997-12-06 13:25:01 +00:00
|
|
|
|
if (error != ENOIOCTL)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return(error);
|
|
|
|
|
error = ttioctl(tp, cmd, data, flag);
|
1997-12-06 13:25:01 +00:00
|
|
|
|
if (error != ENOIOCTL)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return(error);
|
|
|
|
|
return(ENOTTY);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-12-10 13:40:44 +00:00
|
|
|
|
static void
|
1995-01-20 08:35:32 +00:00
|
|
|
|
scstart(struct tty *tp)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
struct clist *rbp;
|
1995-11-20 12:13:32 +00:00
|
|
|
|
int s, len;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
u_char buf[PCBURST];
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scr_stat *scp = sc_get_scr_stat(tp->t_dev);
|
1993-10-28 05:27:36 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->status & SLKED || blink_in_progress)
|
1996-09-08 21:31:56 +00:00
|
|
|
|
return; /* XXX who repeats the call when the above flags are cleared? */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
s = spltty();
|
1995-07-11 18:34:30 +00:00
|
|
|
|
if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
tp->t_state |= TS_BUSY;
|
|
|
|
|
rbp = &tp->t_outq;
|
|
|
|
|
while (rbp->c_cc) {
|
|
|
|
|
len = q_to_b(rbp, buf, PCBURST);
|
1995-07-11 18:34:30 +00:00
|
|
|
|
splx(s);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
ansi_put(scp, buf, len);
|
1995-07-11 18:34:30 +00:00
|
|
|
|
s = spltty();
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
tp->t_state &= ~TS_BUSY;
|
1995-07-22 01:30:45 +00:00
|
|
|
|
ttwwakeup(tp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
}
|
|
|
|
|
|
1996-09-10 19:14:49 +00:00
|
|
|
|
static void
|
|
|
|
|
scmousestart(struct tty *tp)
|
|
|
|
|
{
|
|
|
|
|
struct clist *rbp;
|
|
|
|
|
int s;
|
|
|
|
|
u_char buf[PCBURST];
|
|
|
|
|
|
|
|
|
|
s = spltty();
|
|
|
|
|
if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) {
|
|
|
|
|
tp->t_state |= TS_BUSY;
|
|
|
|
|
rbp = &tp->t_outq;
|
|
|
|
|
while (rbp->c_cc) {
|
|
|
|
|
q_to_b(rbp, buf, PCBURST);
|
|
|
|
|
}
|
|
|
|
|
tp->t_state &= ~TS_BUSY;
|
|
|
|
|
ttwwakeup(tp);
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#if __i386__
|
|
|
|
|
|
|
|
|
|
/* XXX kludge! */
|
|
|
|
|
extern struct isa_driver scdriver;
|
|
|
|
|
|
1999-01-07 14:14:24 +00:00
|
|
|
|
static void
|
1995-09-10 21:36:12 +00:00
|
|
|
|
sccnprobe(struct consdev *cp)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-09-10 21:36:12 +00:00
|
|
|
|
struct isa_device *dvp;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-09-10 21:36:12 +00:00
|
|
|
|
/*
|
|
|
|
|
* Take control if we are the highest priority enabled display device.
|
|
|
|
|
*/
|
|
|
|
|
dvp = find_display();
|
1996-10-09 15:24:21 +00:00
|
|
|
|
if (dvp == NULL || dvp->id_driver != &scdriver) {
|
1995-09-10 21:36:12 +00:00
|
|
|
|
cp->cn_pri = CN_DEAD;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!scvidprobe(dvp->id_unit, dvp->id_flags, TRUE)) {
|
1997-06-22 12:04:36 +00:00
|
|
|
|
cp->cn_pri = CN_DEAD;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sckbdprobe(dvp->id_unit, dvp->id_flags, TRUE);
|
1997-06-22 12:04:36 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* initialize required fields */
|
1996-09-08 21:31:56 +00:00
|
|
|
|
cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cp->cn_pri = CN_INTERNAL;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-07 14:14:24 +00:00
|
|
|
|
static void
|
1995-09-10 21:36:12 +00:00
|
|
|
|
sccninit(struct consdev *cp)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scinit();
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#else /* !__i386__ */
|
|
|
|
|
|
|
|
|
|
extern struct consdev *cn_tab;
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sccnattach(void)
|
|
|
|
|
{
|
|
|
|
|
if (!scvidprobe(0, 0, TRUE) || !sckbdprobe(0, 0, TRUE)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scinit();
|
|
|
|
|
cn_tab = &sc_cons;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* __i386__ */
|
|
|
|
|
|
1999-01-07 14:14:24 +00:00
|
|
|
|
static void
|
1995-09-10 21:36:12 +00:00
|
|
|
|
sccnputc(dev_t dev, int c)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-04-23 10:15:42 +00:00
|
|
|
|
u_char buf[1];
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scr_stat *scp = console[0];
|
|
|
|
|
term_stat save = scp->term;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
u_short *p;
|
|
|
|
|
int s;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (scp == cur_console && scp->status & SLKED) {
|
|
|
|
|
scp->status &= ~SLKED;
|
|
|
|
|
update_kbd_state(scp->status, SLKED);
|
|
|
|
|
if (cur_console->status & BUFFER_SAVED) {
|
|
|
|
|
p = cur_console->history_save;
|
|
|
|
|
for (i = 0; i < cur_console->ysize; ++i) {
|
|
|
|
|
bcopy(p, cur_console->scr_buf + (cur_console->xsize*i),
|
|
|
|
|
cur_console->xsize*sizeof(u_short));
|
|
|
|
|
p += cur_console->xsize;
|
|
|
|
|
if (p + cur_console->xsize
|
|
|
|
|
> cur_console->history + cur_console->history_size)
|
|
|
|
|
p = cur_console->history;
|
|
|
|
|
}
|
|
|
|
|
cur_console->status &= ~BUFFER_SAVED;
|
|
|
|
|
cur_console->history_head = cur_console->history_save;
|
|
|
|
|
cur_console->status |= CURSOR_ENABLED;
|
|
|
|
|
mark_all(cur_console);
|
|
|
|
|
}
|
|
|
|
|
#if 1 /* XXX */
|
|
|
|
|
scstart(VIRTUAL_TTY(get_scr_num()));
|
|
|
|
|
#endif
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
scp->term = kernel_console;
|
|
|
|
|
current_default = &kernel_default;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (scp == cur_console && !ISGRAPHSC(scp))
|
1996-09-01 18:16:06 +00:00
|
|
|
|
remove_cursor_image(scp);
|
1995-06-14 05:16:12 +00:00
|
|
|
|
buf[0] = c;
|
|
|
|
|
ansi_put(scp, buf, 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
kernel_console = scp->term;
|
|
|
|
|
current_default = &user_default;
|
|
|
|
|
scp->term = save;
|
1998-02-11 14:58:15 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
s = spltty(); /* block sckbdevent and scrn_timer */
|
1998-02-11 14:58:15 +00:00
|
|
|
|
sccnupdate(scp);
|
1996-05-01 03:58:21 +00:00
|
|
|
|
splx(s);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-07 14:14:24 +00:00
|
|
|
|
static int
|
1995-09-10 21:36:12 +00:00
|
|
|
|
sccngetc(dev_t dev)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
return sccngetch(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
sccncheckc(dev_t dev)
|
|
|
|
|
{
|
|
|
|
|
return sccngetch(SCGETC_NONBLOCK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
sccngetch(int flags)
|
|
|
|
|
{
|
|
|
|
|
int cur_mode;
|
|
|
|
|
int s = spltty(); /* block sckbdevent and scrn_timer while we poll */
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
/*
|
1998-02-11 14:58:15 +00:00
|
|
|
|
* Stop the screen saver and update the screen if necessary.
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
* What if we have been running in the screen saver code... XXX
|
|
|
|
|
*/
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1998-02-11 14:58:15 +00:00
|
|
|
|
sccnupdate(cur_console);
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (kbd == NULL) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/*
|
|
|
|
|
* Make sure the keyboard is accessible even when the kbd device
|
|
|
|
|
* driver is disabled.
|
|
|
|
|
*/
|
|
|
|
|
kbd_enable(kbd);
|
1996-09-14 04:27:46 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* we shall always use the keyboard in the XLATE mode here */
|
|
|
|
|
cur_mode = cur_console->kbd_mode;
|
|
|
|
|
cur_console->kbd_mode = K_XLATE;
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
c = scgetc(kbd, SCGETC_CN | flags);
|
|
|
|
|
|
|
|
|
|
cur_console->kbd_mode = cur_mode;
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
|
|
|
|
|
kbd_disable(kbd);
|
1996-09-14 04:27:46 +00:00
|
|
|
|
splx(s);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
|
|
|
|
switch (KEYFLAGS(c)) {
|
|
|
|
|
case 0: /* normal char */
|
|
|
|
|
return KEYCHAR(c);
|
|
|
|
|
case FKEY: /* function key */
|
|
|
|
|
return c; /* XXX */
|
|
|
|
|
case NOKEY:
|
|
|
|
|
case ERRKEY:
|
|
|
|
|
default:
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
/* NOT REACHED */
|
1994-02-01 10:43:02 +00:00
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-02-11 14:58:15 +00:00
|
|
|
|
static void
|
|
|
|
|
sccnupdate(scr_stat *scp)
|
|
|
|
|
{
|
1998-08-03 11:30:45 +00:00
|
|
|
|
/* this is a cut-down version of scrn_timer()... */
|
|
|
|
|
|
|
|
|
|
if (font_loading_in_progress)
|
|
|
|
|
return;
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (panicstr || shutdown_in_progress) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1998-09-15 18:16:39 +00:00
|
|
|
|
} else if (scp != cur_console) {
|
|
|
|
|
return;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
}
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (!run_scrn_saver)
|
|
|
|
|
scrn_idle = FALSE;
|
|
|
|
|
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
|
1999-01-17 14:23:15 +00:00
|
|
|
|
if (scrn_blanked)
|
1998-02-11 14:58:15 +00:00
|
|
|
|
stop_scrn_saver(current_saver);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
|
|
|
|
|
if (scp != cur_console || blink_in_progress || switch_in_progress)
|
|
|
|
|
return;
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scrn_update(scp, TRUE);
|
1998-02-11 14:58:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scr_stat
|
|
|
|
|
*sc_get_scr_stat(dev_t dev)
|
1996-10-02 22:00:38 +00:00
|
|
|
|
{
|
|
|
|
|
int unit = minor(dev);
|
|
|
|
|
|
|
|
|
|
if (unit == SC_CONSOLE)
|
|
|
|
|
return console[0];
|
|
|
|
|
if (unit >= MAXCONS || unit < 0)
|
|
|
|
|
return(NULL);
|
|
|
|
|
return console[unit];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
get_scr_num()
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
while ((i < MAXCONS) && (cur_console != console[i]))
|
|
|
|
|
i++;
|
|
|
|
|
return i < MAXCONS ? i : 0;
|
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static void
|
1997-04-20 16:05:33 +00:00
|
|
|
|
scrn_timer(void *arg)
|
o Restore removed hardware cursor support and make it _default_
case, software cursor now optional case. Driver must provide
raw things (what hardware do for us, exactly) as default case,
all driver features must be _optional_. Modern VGAs have internal
configuration utilities to set cursor shape/blinking which stored
into cards ROM, and syscons nuke out such features completely
by forcing software cursor. Moreover, software cursor is hard
to distinguish on standouted (or near standouted) fields and
tends to disappearse from the screen.
Set "flags 0x4" to enable software cursor now.
o Cleanup screen savers.
o Don't draw cursor if saver or blinker is active.
o Duplicated code moved to functons.
o Add more checks for blinker in progress, character lost otherwise
when blinker restore old contents.
o Reduce blinking counter to 3, too slow in old variant.
o Fix timeout code in scrn_timer(), old variant can reenter iself,
if action takes too long time.
o Disable visual bell for scroll lock mode, saved screen
becomes overwritted otherwise.
1995-01-26 04:56:25 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int kbd_interval = 0;
|
1998-04-04 13:26:20 +00:00
|
|
|
|
struct timeval tv;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scr_stat *scp;
|
1998-02-11 15:00:24 +00:00
|
|
|
|
int s;
|
|
|
|
|
|
|
|
|
|
/* don't do anything when we are touching font */
|
|
|
|
|
if (font_loading_in_progress) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (arg)
|
|
|
|
|
timeout(scrn_timer, (void *)TRUE, hz / 10);
|
1998-02-11 15:00:24 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
s = spltty();
|
o Restore removed hardware cursor support and make it _default_
case, software cursor now optional case. Driver must provide
raw things (what hardware do for us, exactly) as default case,
all driver features must be _optional_. Modern VGAs have internal
configuration utilities to set cursor shape/blinking which stored
into cards ROM, and syscons nuke out such features completely
by forcing software cursor. Moreover, software cursor is hard
to distinguish on standouted (or near standouted) fields and
tends to disappearse from the screen.
Set "flags 0x4" to enable software cursor now.
o Cleanup screen savers.
o Don't draw cursor if saver or blinker is active.
o Duplicated code moved to functons.
o Add more checks for blinker in progress, character lost otherwise
when blinker restore old contents.
o Reduce blinking counter to 3, too slow in old variant.
o Fix timeout code in scrn_timer(), old variant can reenter iself,
if action takes too long time.
o Disable visual bell for scroll lock mode, saved screen
becomes overwritted otherwise.
1995-01-26 04:56:25 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if ((kbd == NULL) && (sc_flags & AUTODETECT_KBD)) {
|
|
|
|
|
/* try to allocate a keyboard automatically */
|
|
|
|
|
if (++kbd_interval >= 25) {
|
|
|
|
|
keyboard = kbd_allocate("*", -1, (void *)&keyboard,
|
|
|
|
|
sckbdevent, NULL);
|
|
|
|
|
if (keyboard >= 0) {
|
|
|
|
|
kbd = kbd_get_keyboard(keyboard);
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
|
|
|
|
|
update_kbd_state(cur_console->status, LOCK_MASK);
|
|
|
|
|
}
|
|
|
|
|
kbd_interval = 0;
|
|
|
|
|
}
|
1997-01-15 18:16:32 +00:00
|
|
|
|
}
|
1996-11-04 21:01:08 +00:00
|
|
|
|
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
/* should we stop the screen saver? */
|
1998-05-17 11:53:46 +00:00
|
|
|
|
getmicrouptime(&tv);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (panicstr || shutdown_in_progress)
|
|
|
|
|
sc_touch_scrn_saver();
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (run_scrn_saver) {
|
|
|
|
|
scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
|
|
|
|
|
} else {
|
|
|
|
|
scrn_time_stamp = tv.tv_sec;
|
|
|
|
|
scrn_idle = FALSE;
|
|
|
|
|
if (scrn_blank_time > 0)
|
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
}
|
|
|
|
|
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
|
1999-01-17 14:23:15 +00:00
|
|
|
|
if (scrn_blanked)
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
stop_scrn_saver(current_saver);
|
1998-04-16 09:41:55 +00:00
|
|
|
|
|
|
|
|
|
/* should we just return ? */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (blink_in_progress || switch_in_progress) {
|
|
|
|
|
if (arg)
|
|
|
|
|
timeout(scrn_timer, (void *)TRUE, hz / 10);
|
1998-04-16 09:41:55 +00:00
|
|
|
|
splx(s);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update the screen */
|
1999-01-17 14:23:15 +00:00
|
|
|
|
scp = cur_console;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
|
1998-02-11 14:58:15 +00:00
|
|
|
|
scrn_update(scp, TRUE);
|
1998-04-16 09:41:55 +00:00
|
|
|
|
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
/* should we activate the screen saver? */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
|
1999-01-17 14:23:15 +00:00
|
|
|
|
if (!ISGRAPHSC(scp) || scrn_blanked)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*current_saver)(TRUE);
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (arg)
|
|
|
|
|
timeout(scrn_timer, (void *)TRUE, hz / 25);
|
1996-10-01 23:24:09 +00:00
|
|
|
|
splx(s);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1998-02-11 14:58:15 +00:00
|
|
|
|
static void
|
|
|
|
|
scrn_update(scr_stat *scp, int show_cursor)
|
|
|
|
|
{
|
|
|
|
|
/* update screen image */
|
1998-02-12 22:05:08 +00:00
|
|
|
|
if (scp->start <= scp->end)
|
1998-08-03 11:30:45 +00:00
|
|
|
|
sc_bcopy(scp, scp->scr_buf, scp->start, scp->end, 0);
|
1998-02-11 14:58:15 +00:00
|
|
|
|
|
|
|
|
|
/* we are not to show the cursor and the mouse pointer... */
|
|
|
|
|
if (!show_cursor) {
|
|
|
|
|
scp->end = 0;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
scp->start = scp->xsize*scp->ysize - 1;
|
1998-02-11 14:58:15 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* update "pseudo" mouse pointer image */
|
1998-02-11 15:02:40 +00:00
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
1998-02-11 14:58:15 +00:00
|
|
|
|
/* did mouse move since last time ? */
|
|
|
|
|
if (scp->status & MOUSE_MOVED) {
|
|
|
|
|
/* do we need to remove old mouse pointer image ? */
|
|
|
|
|
if (scp->mouse_cut_start != NULL ||
|
|
|
|
|
(scp->mouse_pos-scp->scr_buf) <= scp->start ||
|
|
|
|
|
(scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->end) {
|
|
|
|
|
remove_mouse_image(scp);
|
|
|
|
|
}
|
|
|
|
|
scp->status &= ~MOUSE_MOVED;
|
|
|
|
|
draw_mouse_image(scp);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* mouse didn't move, has it been overwritten ? */
|
|
|
|
|
if ((scp->mouse_pos+scp->xsize + 1 - scp->scr_buf) >= scp->start &&
|
|
|
|
|
(scp->mouse_pos - scp->scr_buf) <= scp->end) {
|
|
|
|
|
draw_mouse_image(scp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* update cursor image */
|
|
|
|
|
if (scp->status & CURSOR_ENABLED) {
|
|
|
|
|
/* did cursor move since last time ? */
|
|
|
|
|
if (scp->cursor_pos != scp->cursor_oldpos) {
|
|
|
|
|
/* do we need to remove old cursor image ? */
|
|
|
|
|
if ((scp->cursor_oldpos - scp->scr_buf) < scp->start ||
|
|
|
|
|
((scp->cursor_oldpos - scp->scr_buf) > scp->end)) {
|
|
|
|
|
remove_cursor_image(scp);
|
|
|
|
|
}
|
|
|
|
|
scp->cursor_oldpos = scp->cursor_pos;
|
|
|
|
|
draw_cursor_image(scp);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* cursor didn't move, has it been overwritten ? */
|
|
|
|
|
if (scp->cursor_pos - scp->scr_buf >= scp->start &&
|
|
|
|
|
scp->cursor_pos - scp->scr_buf <= scp->end) {
|
|
|
|
|
draw_cursor_image(scp);
|
|
|
|
|
} else {
|
|
|
|
|
/* if its a blinking cursor, we may have to update it */
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & BLINK_CURSOR)
|
1998-02-11 14:58:15 +00:00
|
|
|
|
draw_cursor_image(scp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
blinkrate++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (scp->mouse_cut_start != NULL)
|
|
|
|
|
draw_cutmarking(scp);
|
|
|
|
|
|
|
|
|
|
scp->end = 0;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
scp->start = scp->xsize*scp->ysize - 1;
|
1998-02-11 14:58:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#if NSPLASH > 0
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
scsplash_callback(int event)
|
|
|
|
|
{
|
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
switch (event) {
|
|
|
|
|
case SPLASH_INIT:
|
1999-01-17 14:23:15 +00:00
|
|
|
|
scrn_saver_failed = FALSE;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (add_scrn_saver(scsplash_saver) == 0) {
|
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
if (cold && !(boothowto & (RB_VERBOSE | RB_CONFIG))) {
|
|
|
|
|
scsplash_stick(TRUE);
|
|
|
|
|
(*current_saver)(TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case SPLASH_TERM:
|
|
|
|
|
if (current_saver == scsplash_saver) {
|
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
error = remove_scrn_saver(scsplash_saver);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scsplash_saver(int show)
|
|
|
|
|
{
|
|
|
|
|
static int busy = FALSE;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
|
|
|
|
|
if (busy)
|
|
|
|
|
return;
|
|
|
|
|
busy = TRUE;
|
|
|
|
|
|
|
|
|
|
scp = cur_console;
|
|
|
|
|
if (show) {
|
1999-01-17 14:23:15 +00:00
|
|
|
|
if (!scrn_saver_failed) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!scrn_blanked)
|
|
|
|
|
set_scrn_saver_mode(scp, -1, NULL, 0);
|
1999-01-17 14:23:15 +00:00
|
|
|
|
switch (splash(scp->adp, TRUE)) {
|
|
|
|
|
case 0: /* succeeded */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scrn_blanked = TRUE;
|
1999-01-17 14:23:15 +00:00
|
|
|
|
break;
|
|
|
|
|
case EAGAIN: /* try later */
|
|
|
|
|
restore_scrn_saver_mode(scp, FALSE);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
scrn_saver_failed = TRUE;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
printf("scsplash_saver(): failed to put up the image\n");
|
1999-01-17 14:23:15 +00:00
|
|
|
|
restore_scrn_saver_mode(scp, TRUE);
|
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (!sticky_splash) {
|
|
|
|
|
if (scrn_blanked && (splash(scp->adp, FALSE) == 0)) {
|
1999-01-17 14:23:15 +00:00
|
|
|
|
restore_scrn_saver_mode(scp, TRUE);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scrn_blanked = FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
busy = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
add_scrn_saver(void (*this_saver)(int))
|
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
if (current_saver != none_saver) {
|
|
|
|
|
error = remove_scrn_saver(current_saver);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
run_scrn_saver = FALSE;
|
1998-08-03 11:30:45 +00:00
|
|
|
|
saver_mode = CONS_LKM_SAVER;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
current_saver = this_saver;
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
remove_scrn_saver(void (*this_saver)(int))
|
|
|
|
|
{
|
|
|
|
|
if (current_saver != this_saver)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* In order to prevent `current_saver' from being called by
|
|
|
|
|
* the timeout routine `scrn_timer()' while we manipulate
|
|
|
|
|
* the saver list, we shall set `current_saver' to `none_saver'
|
|
|
|
|
* before stopping the current saver, rather than blocking by `splXX()'.
|
|
|
|
|
*/
|
|
|
|
|
current_saver = none_saver;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scrn_blanked)
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
stop_scrn_saver(this_saver);
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
return (scrn_blanked ? EBUSY : 0);
|
|
|
|
|
}
|
1998-08-03 11:30:45 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
|
|
|
|
set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
|
|
|
|
|
{
|
|
|
|
|
int s;
|
|
|
|
|
|
|
|
|
|
/* assert(scp == cur_console) */
|
|
|
|
|
s = spltty();
|
|
|
|
|
scp->splash_save_mode = scp->mode;
|
|
|
|
|
scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
|
1999-01-17 14:23:15 +00:00
|
|
|
|
scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
|
|
|
|
|
splx(s);
|
|
|
|
|
if (mode < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
scp->mode = mode;
|
|
|
|
|
if (set_mode(scp) == 0) {
|
|
|
|
|
if (scp->adp->va_mode_flags & V_INFO_GRAPHICS)
|
|
|
|
|
scp->status |= GRAPHICS_MODE;
|
|
|
|
|
if (pal != NULL)
|
|
|
|
|
load_palette(scp->adp, pal);
|
|
|
|
|
set_border(scp, border);
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
s = spltty();
|
|
|
|
|
scp->mode = scp->splash_save_mode;
|
|
|
|
|
scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
|
|
|
|
|
scp->status |= scp->splash_save_status;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
1999-01-17 14:23:15 +00:00
|
|
|
|
restore_scrn_saver_mode(scr_stat *scp, int changemode)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int mode;
|
|
|
|
|
int status;
|
|
|
|
|
int s;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* assert(scp == cur_console) */
|
|
|
|
|
s = spltty();
|
|
|
|
|
mode = scp->mode;
|
|
|
|
|
status = scp->status;
|
|
|
|
|
scp->mode = scp->splash_save_mode;
|
1999-01-17 14:23:15 +00:00
|
|
|
|
scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->status |= scp->splash_save_status;
|
1999-01-17 14:23:15 +00:00
|
|
|
|
if (!changemode) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (set_mode(scp) == 0) {
|
|
|
|
|
load_palette(scp->adp, palette);
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
scp->mode = mode;
|
|
|
|
|
scp->status = status;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
1998-09-15 18:16:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
static void
|
|
|
|
|
stop_scrn_saver(void (*saver)(int))
|
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*saver)(FALSE);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
/* the screen saver may have chosen not to stop after all... */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scrn_blanked)
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return;
|
|
|
|
|
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
mark_all(cur_console);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (delayed_next_scr)
|
|
|
|
|
switch_scr(cur_console, delayed_next_scr - 1);
|
1998-04-04 16:26:53 +00:00
|
|
|
|
wakeup((caddr_t)&scrn_blanked);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
wait_scrn_saver_stop(void)
|
|
|
|
|
{
|
|
|
|
|
int error = 0;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
while (scrn_blanked) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
run_scrn_saver = FALSE;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
run_scrn_saver = FALSE;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
if (error != ERESTART)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return error;
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#endif /* NSPLASH */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_touch_scrn_saver(void)
|
|
|
|
|
{
|
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
void
|
|
|
|
|
sc_clear_screen(scr_stat *scp)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
move_crsr(scp, 0, 0);
|
1996-09-04 22:24:19 +00:00
|
|
|
|
scp->cursor_oldpos = scp->cursor_pos;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize * scp->ysize);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
remove_cutmarking(scp);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static int
|
1995-01-12 11:47:05 +00:00
|
|
|
|
switch_scr(scr_stat *scp, u_int next_scr)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1998-08-03 11:30:45 +00:00
|
|
|
|
/* delay switch if actively updating screen */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scrn_blanked || write_in_progress || blink_in_progress) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
delayed_next_scr = next_scr+1;
|
1999-01-17 14:23:15 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1998-08-03 11:30:45 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid)))
|
|
|
|
|
switch_in_progress = FALSE;
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
if (next_scr >= MAXCONS || switch_in_progress ||
|
1998-09-15 18:16:39 +00:00
|
|
|
|
(cur_console->smode.mode == VT_AUTO && ISGRAPHSC(cur_console))) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
do_bell(scp, BELL_PITCH, BELL_DURATION);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
1994-02-01 06:22:29 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* is the wanted virtual console open ? */
|
|
|
|
|
if (next_scr) {
|
|
|
|
|
struct tty *tp = VIRTUAL_TTY(next_scr);
|
|
|
|
|
if (!(tp->t_state & TS_ISOPEN)) {
|
|
|
|
|
do_bell(scp, BELL_PITCH, BELL_DURATION);
|
|
|
|
|
return EINVAL;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1998-04-17 10:03:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
switch_in_progress = TRUE;
|
|
|
|
|
old_scp = cur_console;
|
|
|
|
|
new_scp = console[next_scr];
|
|
|
|
|
wakeup((caddr_t)&new_scp->smode);
|
|
|
|
|
if (new_scp == old_scp) {
|
|
|
|
|
switch_in_progress = FALSE;
|
|
|
|
|
delayed_next_scr = FALSE;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* has controlling process died? */
|
|
|
|
|
if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid)))
|
|
|
|
|
old_scp->smode.mode = VT_AUTO;
|
|
|
|
|
if (new_scp->proc && (new_scp->proc != pfind(new_scp->pid)))
|
|
|
|
|
new_scp->smode.mode = VT_AUTO;
|
|
|
|
|
|
1996-12-19 00:26:22 +00:00
|
|
|
|
/* check the modes and switch appropriately */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (old_scp->smode.mode == VT_PROCESS) {
|
|
|
|
|
old_scp->status |= SWITCH_WAIT_REL;
|
|
|
|
|
psignal(old_scp->proc, old_scp->smode.relsig);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
exchange_scr();
|
|
|
|
|
if (new_scp->smode.mode == VT_PROCESS) {
|
|
|
|
|
new_scp->status |= SWITCH_WAIT_ACQ;
|
|
|
|
|
psignal(new_scp->proc, new_scp->smode.acqsig);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
switch_in_progress = FALSE;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static void
|
|
|
|
|
exchange_scr(void)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* save the current state of video and keyboard */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (old_scp->kbd_mode == K_XLATE)
|
|
|
|
|
save_kbd_state(old_scp);
|
|
|
|
|
|
|
|
|
|
/* set up the video for the new screen */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console = new_scp;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
|
|
|
|
|
set_mode(new_scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
move_crsr(new_scp, new_scp->xpos, new_scp->ypos);
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
|
1997-06-30 13:31:49 +00:00
|
|
|
|
set_destructive_cursor(new_scp);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISGRAPHSC(old_scp))
|
1999-01-11 03:18:56 +00:00
|
|
|
|
load_palette(new_scp->adp, palette);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
set_border(new_scp, new_scp->border);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
|
|
|
|
/* set up the keyboard for the new screen */
|
|
|
|
|
if (old_scp->kbd_mode != new_scp->kbd_mode)
|
|
|
|
|
kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&new_scp->kbd_mode);
|
|
|
|
|
update_kbd_state(new_scp->status, LOCK_MASK);
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
delayed_next_scr = FALSE;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
mark_all(new_scp);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static void
|
1994-08-17 08:51:59 +00:00
|
|
|
|
scan_esc(scr_stat *scp, u_char c)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static u_char ansi_col[16] =
|
1995-02-22 13:48:07 +00:00
|
|
|
|
{0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15};
|
|
|
|
|
int i, n;
|
|
|
|
|
u_short *src, *dst, count;
|
|
|
|
|
|
1997-09-26 15:27:55 +00:00
|
|
|
|
if (scp->term.esc == 1) { /* seen ESC */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
switch (c) {
|
|
|
|
|
|
1997-01-23 20:00:45 +00:00
|
|
|
|
case '7': /* Save cursor position */
|
|
|
|
|
scp->saved_xpos = scp->xpos;
|
|
|
|
|
scp->saved_ypos = scp->ypos;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '8': /* Restore saved cursor position */
|
|
|
|
|
if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
|
|
|
|
|
move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case '[': /* Start ESC [ sequence */
|
|
|
|
|
scp->term.esc = 2;
|
|
|
|
|
scp->term.last_param = -1;
|
|
|
|
|
for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
|
|
|
|
|
scp->term.param[i] = 1;
|
|
|
|
|
scp->term.num_param = 0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 'M': /* Move cursor up 1 line, scroll if at top */
|
|
|
|
|
if (scp->ypos > 0)
|
|
|
|
|
move_crsr(scp, scp->xpos, scp->ypos - 1);
|
|
|
|
|
else {
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->scr_buf, scp->scr_buf + scp->xsize,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(scp->ysize - 1) * scp->xsize * sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->scr_buf, scp->xsize);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
#if notyet
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case 'Q':
|
|
|
|
|
scp->term.esc = 4;
|
1997-09-26 15:27:55 +00:00
|
|
|
|
return;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case 'c': /* Clear screen & home */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_clear_screen(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1997-09-26 15:27:55 +00:00
|
|
|
|
|
|
|
|
|
case '(': /* iso-2022: designate 94 character set to G0 */
|
|
|
|
|
scp->term.esc = 5;
|
|
|
|
|
return;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1997-09-26 15:27:55 +00:00
|
|
|
|
else if (scp->term.esc == 2) { /* seen ESC [ */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (c >= '0' && c <= '9') {
|
|
|
|
|
if (scp->term.num_param < MAX_ESC_PAR) {
|
|
|
|
|
if (scp->term.last_param != scp->term.num_param) {
|
|
|
|
|
scp->term.last_param = scp->term.num_param;
|
|
|
|
|
scp->term.param[scp->term.num_param] = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
scp->term.param[scp->term.num_param] *= 10;
|
|
|
|
|
scp->term.param[scp->term.num_param] += c - '0';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scp->term.num_param = scp->term.last_param + 1;
|
|
|
|
|
switch (c) {
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case ';':
|
|
|
|
|
if (scp->term.num_param < MAX_ESC_PAR)
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '=':
|
|
|
|
|
scp->term.esc = 3;
|
|
|
|
|
scp->term.last_param = -1;
|
|
|
|
|
for (i = scp->term.num_param; i < MAX_ESC_PAR; i++)
|
|
|
|
|
scp->term.param[i] = 1;
|
|
|
|
|
scp->term.num_param = 0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 'A': /* up n rows */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos, scp->ypos - n);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'B': /* down n rows */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos, scp->ypos + n);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'C': /* right n columns */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos + n, scp->ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'D': /* left n columns */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos - n, scp->ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E': /* cursor to start of line n lines down */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, 0, scp->ypos + n);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'F': /* cursor to start of line n lines up */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, 0, scp->ypos - n);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'f': /* Cursor move */
|
|
|
|
|
case 'H':
|
1995-05-30 08:16:23 +00:00
|
|
|
|
if (scp->term.num_param == 0)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
move_crsr(scp, 0, 0);
|
|
|
|
|
else if (scp->term.num_param == 2)
|
|
|
|
|
move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'J': /* Clear all or part of display */
|
|
|
|
|
if (scp->term.num_param == 0)
|
|
|
|
|
n = 0;
|
|
|
|
|
else
|
|
|
|
|
n = scp->term.param[0];
|
|
|
|
|
switch (n) {
|
|
|
|
|
case 0: /* clear form cursor to end of display */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->cursor_pos,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
mark_for_update(scp, scp->xsize * scp->ysize - 1);
|
1997-01-23 20:00:45 +00:00
|
|
|
|
remove_cutmarking(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 1: /* clear from beginning of display to cursor */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->scr_buf,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->cursor_pos - scp->scr_buf);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, 0);
|
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1997-01-23 20:00:45 +00:00
|
|
|
|
remove_cutmarking(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2: /* clear entire display */
|
1997-01-23 20:00:45 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], scp->scr_buf,
|
|
|
|
|
scp->xsize * scp->ysize);
|
|
|
|
|
mark_all(scp);
|
|
|
|
|
remove_cutmarking(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'K': /* Clear all or part of line */
|
|
|
|
|
if (scp->term.num_param == 0)
|
|
|
|
|
n = 0;
|
|
|
|
|
else
|
|
|
|
|
n = scp->term.param[0];
|
|
|
|
|
switch (n) {
|
|
|
|
|
case 0: /* clear form cursor to end of line */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->cursor_pos,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize - scp->xpos);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf +
|
1998-09-23 09:59:00 +00:00
|
|
|
|
scp->xsize - 1 - scp->xpos);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 1: /* clear from beginning of line to cursor */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1996-05-02 21:47:50 +00:00
|
|
|
|
scp->cursor_pos - scp->xpos,
|
|
|
|
|
scp->xpos + 1);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->ypos * scp->xsize);
|
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2: /* clear entire line */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1996-05-02 21:47:50 +00:00
|
|
|
|
scp->cursor_pos - scp->xpos,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->ypos * scp->xsize);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'L': /* Insert n lines */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->ysize - scp->ypos)
|
|
|
|
|
n = scp->ysize - scp->ypos;
|
|
|
|
|
src = scp->scr_buf + scp->ypos * scp->xsize;
|
|
|
|
|
dst = src + n * scp->xsize;
|
|
|
|
|
count = scp->ysize - (scp->ypos + n);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], src,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
n * scp->xsize);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->ypos * scp->xsize);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
mark_for_update(scp, scp->xsize * scp->ysize - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'M': /* Delete n lines */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->ysize - scp->ypos)
|
|
|
|
|
n = scp->ysize - scp->ypos;
|
|
|
|
|
dst = scp->scr_buf + scp->ypos * scp->xsize;
|
|
|
|
|
src = dst + n * scp->xsize;
|
|
|
|
|
count = scp->ysize - (scp->ypos + n);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(src, dst, count * scp->xsize * sizeof(u_short));
|
1995-02-22 13:48:07 +00:00
|
|
|
|
src = dst + count * scp->xsize;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], src,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
n * scp->xsize);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->ypos * scp->xsize);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
mark_for_update(scp, scp->xsize * scp->ysize - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'P': /* Delete n chars */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->xsize - scp->xpos)
|
|
|
|
|
n = scp->xsize - scp->xpos;
|
|
|
|
|
dst = scp->cursor_pos;
|
|
|
|
|
src = dst + n;
|
|
|
|
|
count = scp->xsize - (scp->xpos + n);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(src, dst, count * sizeof(u_short));
|
1995-02-22 13:48:07 +00:00
|
|
|
|
src = dst + count;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], src, n);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '@': /* Insert n chars */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->xsize - scp->xpos)
|
|
|
|
|
n = scp->xsize - scp->xpos;
|
|
|
|
|
src = scp->cursor_pos;
|
|
|
|
|
dst = src + n;
|
|
|
|
|
count = scp->xsize - (scp->xpos + n);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(src, dst, count * sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20], src, n);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'S': /* scroll up n lines */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->ysize)
|
|
|
|
|
n = scp->ysize;
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->scr_buf + (scp->xsize * n),
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->scr_buf,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize * (scp->ysize - n) * sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->scr_buf + scp->xsize * (scp->ysize - n),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize * n);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'T': /* scroll down n lines */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->ysize)
|
|
|
|
|
n = scp->ysize;
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->scr_buf,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->scr_buf + (scp->xsize * n),
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->xsize * (scp->ysize - n) *
|
1995-02-22 13:48:07 +00:00
|
|
|
|
sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->scr_buf, scp->xsize * n);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
1995-04-01 19:57:36 +00:00
|
|
|
|
case 'X': /* erase n characters in line */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if (n > scp->xsize - scp->xpos)
|
|
|
|
|
n = scp->xsize - scp->xpos;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1996-06-21 07:19:18 +00:00
|
|
|
|
scp->cursor_pos, n);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n - 1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'Z': /* move n tabs backwards */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
if ((i = scp->xpos & 0xf8) == scp->xpos)
|
|
|
|
|
i -= 8*n;
|
1995-05-30 08:16:23 +00:00
|
|
|
|
else
|
|
|
|
|
i -= 8*(n-1);
|
|
|
|
|
if (i < 0)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
i = 0;
|
|
|
|
|
move_crsr(scp, i, scp->ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '`': /* move cursor to column n */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, n - 1, scp->ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'a': /* move cursor n columns to the right */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos + n, scp->ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'd': /* move cursor to row n */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos, n - 1);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'e': /* move cursor n rows down */
|
|
|
|
|
n = scp->term.param[0]; if (n < 1) n = 1;
|
|
|
|
|
move_crsr(scp, scp->xpos, scp->ypos + n);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'm': /* change attribute */
|
|
|
|
|
if (scp->term.num_param == 0) {
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask = NORMAL_ATTR;
|
|
|
|
|
scp->term.cur_attr =
|
|
|
|
|
scp->term.cur_color = scp->term.std_color;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < scp->term.num_param; i++) {
|
|
|
|
|
switch (n = scp->term.param[i]) {
|
|
|
|
|
case 0: /* back to normal */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask = NORMAL_ATTR;
|
|
|
|
|
scp->term.cur_attr =
|
|
|
|
|
scp->term.cur_color = scp->term.std_color;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
case 1: /* bold */
|
|
|
|
|
scp->term.attr_mask |= BOLD_ATTR;
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
case 4: /* underline */
|
|
|
|
|
scp->term.attr_mask |= UNDERLINE_ATTR;
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 5: /* blink */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask |= BLINK_ATTR;
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 7: /* reverse video */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask |= REVERSE_ATTR;
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 30: case 31: /* set fg color */
|
1995-05-30 08:16:23 +00:00
|
|
|
|
case 32: case 33: case 34:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case 35: case 36: case 37:
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask |= FOREGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color =
|
|
|
|
|
(scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 40: case 41: /* set bg color */
|
1995-05-30 08:16:23 +00:00
|
|
|
|
case 42: case 43: case 44:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case 45: case 46: case 47:
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask |= BACKGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color =
|
|
|
|
|
(scp->term.cur_color&0x0F00) | (ansi_col[(n-40)&7]<<12);
|
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
1997-01-23 20:00:45 +00:00
|
|
|
|
case 's': /* Save cursor position */
|
|
|
|
|
scp->saved_xpos = scp->xpos;
|
|
|
|
|
scp->saved_ypos = scp->ypos;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'u': /* Restore saved cursor position */
|
|
|
|
|
if (scp->saved_xpos >= 0 && scp->saved_ypos >= 0)
|
|
|
|
|
move_crsr(scp, scp->saved_xpos, scp->saved_ypos);
|
|
|
|
|
break;
|
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case 'x':
|
|
|
|
|
if (scp->term.num_param == 0)
|
|
|
|
|
n = 0;
|
|
|
|
|
else
|
|
|
|
|
n = scp->term.param[0];
|
|
|
|
|
switch (n) {
|
|
|
|
|
case 0: /* reset attributes */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask = NORMAL_ATTR;
|
|
|
|
|
scp->term.cur_attr =
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
current_default->std_color;
|
|
|
|
|
scp->term.rev_color = current_default->rev_color;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 1: /* set ansi background */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask &= ~BACKGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
(scp->term.std_color & 0x0F00) |
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(ansi_col[(scp->term.param[1])&0x0F]<<12);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2: /* set ansi foreground */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask &= ~FOREGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
(scp->term.std_color & 0xF000) |
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(ansi_col[(scp->term.param[1])&0x0F]<<8);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3: /* set ansi attribute directly */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask &= ~(FOREGROUND_CHANGED|BACKGROUND_CHANGED);
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(scp->term.param[1]&0xFF)<<8;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 5: /* set ansi reverse video background */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.rev_color =
|
|
|
|
|
(scp->term.rev_color & 0x0F00) |
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(ansi_col[(scp->term.param[1])&0x0F]<<12);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 6: /* set ansi reverse video foreground */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.rev_color =
|
|
|
|
|
(scp->term.rev_color & 0xF000) |
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(ansi_col[(scp->term.param[1])&0x0F]<<8);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case 7: /* set ansi reverse video directly */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.rev_color =
|
1995-02-22 13:48:07 +00:00
|
|
|
|
(scp->term.param[1]&0xFF)<<8;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'z': /* switch to (virtual) console n */
|
|
|
|
|
if (scp->term.num_param == 1)
|
|
|
|
|
switch_scr(scp, scp->term.param[0]);
|
|
|
|
|
break;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1997-09-26 15:27:55 +00:00
|
|
|
|
else if (scp->term.esc == 3) { /* seen ESC [0-9]+ = */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (c >= '0' && c <= '9') {
|
|
|
|
|
if (scp->term.num_param < MAX_ESC_PAR) {
|
|
|
|
|
if (scp->term.last_param != scp->term.num_param) {
|
|
|
|
|
scp->term.last_param = scp->term.num_param;
|
|
|
|
|
scp->term.param[scp->term.num_param] = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
scp->term.param[scp->term.num_param] *= 10;
|
|
|
|
|
scp->term.param[scp->term.num_param] += c - '0';
|
|
|
|
|
return;
|
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->term.num_param = scp->term.last_param + 1;
|
|
|
|
|
switch (c) {
|
|
|
|
|
|
|
|
|
|
case ';':
|
|
|
|
|
if (scp->term.num_param < MAX_ESC_PAR)
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'A': /* set display border color */
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
if (scp->term.num_param == 1) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->border=scp->term.param[0] & 0xff;
|
|
|
|
|
if (scp == cur_console)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
set_border(cur_console, scp->border);
|
1997-05-15 05:43:59 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'B': /* set bell pitch and duration */
|
|
|
|
|
if (scp->term.num_param == 2) {
|
|
|
|
|
scp->bell_pitch = scp->term.param[0];
|
1998-08-03 09:09:35 +00:00
|
|
|
|
scp->bell_duration = scp->term.param[1];
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'C': /* set cursor type & shape */
|
|
|
|
|
if (scp->term.num_param == 1) {
|
|
|
|
|
if (scp->term.param[0] & 0x01)
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= BLINK_CURSOR;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~BLINK_CURSOR;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if ((scp->term.param[0] & 0x02)
|
1999-01-11 03:18:56 +00:00
|
|
|
|
&& ISFONTAVAIL(scp->adp->va_flags))
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags |= CHAR_CURSOR;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
sc_flags &= ~CHAR_CURSOR;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
else if (scp->term.num_param == 2) {
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->cursor_start = scp->term.param[0] & 0x1F;
|
|
|
|
|
scp->cursor_end = scp->term.param[1] & 0x1F;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* The cursor shape is global property; all virtual consoles
|
|
|
|
|
* are affected. Update the cursor in the current console...
|
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(cur_console)) {
|
1998-11-03 02:37:46 +00:00
|
|
|
|
i = spltty();
|
1997-06-30 13:31:49 +00:00
|
|
|
|
remove_cursor_image(cur_console);
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & CHAR_CURSOR)
|
1997-06-30 13:31:49 +00:00
|
|
|
|
set_destructive_cursor(cur_console);
|
|
|
|
|
draw_cursor_image(cur_console);
|
1998-11-03 02:37:46 +00:00
|
|
|
|
splx(i);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'F': /* set ansi foreground */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
if (scp->term.num_param == 1) {
|
|
|
|
|
scp->term.attr_mask &= ~FOREGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
(scp->term.std_color & 0xF000)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
| ((scp->term.param[0] & 0x0F) << 8);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'G': /* set ansi background */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
if (scp->term.num_param == 1) {
|
|
|
|
|
scp->term.attr_mask &= ~BACKGROUND_CHANGED;
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
(scp->term.std_color & 0x0F00)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
| ((scp->term.param[0] & 0x0F) << 12);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'H': /* set ansi reverse video foreground */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
if (scp->term.num_param == 1) {
|
|
|
|
|
scp->term.rev_color =
|
|
|
|
|
(scp->term.rev_color & 0xF000)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
| ((scp->term.param[0] & 0x0F) << 8);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'I': /* set ansi reverse video background */
|
1995-11-28 00:17:32 +00:00
|
|
|
|
if (scp->term.num_param == 1) {
|
|
|
|
|
scp->term.rev_color =
|
|
|
|
|
(scp->term.rev_color & 0x0F00)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
| ((scp->term.param[0] & 0x0F) << 12);
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.cur_attr = mask2attr(&scp->term);
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-09-26 15:27:55 +00:00
|
|
|
|
#if notyet
|
|
|
|
|
else if (scp->term.esc == 4) { /* seen ESC Q */
|
|
|
|
|
/* to be filled */
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
else if (scp->term.esc == 5) { /* seen ESC ( */
|
|
|
|
|
switch (c) {
|
|
|
|
|
case 'B': /* iso-2022: desginate ASCII into G0 */
|
|
|
|
|
break;
|
|
|
|
|
/* other items to be filled */
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->term.esc = 0;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static void
|
1995-01-20 08:35:32 +00:00
|
|
|
|
ansi_put(scr_stat *scp, u_char *buf, int len)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
u_char *ptr = buf;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* make screensaver happy */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (!sticky_splash && scp == cur_console)
|
|
|
|
|
run_scrn_saver = FALSE;
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
write_in_progress++;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
outloop:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->term.esc) {
|
|
|
|
|
scan_esc(scp, *ptr++);
|
|
|
|
|
len--;
|
|
|
|
|
}
|
|
|
|
|
else if (PRINTABLE(*ptr)) { /* Print only printables */
|
1995-03-03 08:37:52 +00:00
|
|
|
|
int cnt = len <= (scp->xsize-scp->xpos) ? len : (scp->xsize-scp->xpos);
|
|
|
|
|
u_short cur_attr = scp->term.cur_attr;
|
|
|
|
|
u_short *cursor_pos = scp->cursor_pos;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
do {
|
1995-07-11 17:59:22 +00:00
|
|
|
|
/*
|
|
|
|
|
* gcc-2.6.3 generates poor (un)sign extension code. Casting the
|
|
|
|
|
* pointers in the following to volatile should have no effect,
|
|
|
|
|
* but in fact speeds up this inner loop from 26 to 18 cycles
|
|
|
|
|
* (+ cache misses) on i486's.
|
|
|
|
|
*/
|
|
|
|
|
#define UCVP(ucp) ((u_char volatile *)(ucp))
|
|
|
|
|
*cursor_pos++ = UCVP(scr_map)[*UCVP(ptr)] | cur_attr;
|
|
|
|
|
ptr++;
|
1995-03-03 08:37:52 +00:00
|
|
|
|
cnt--;
|
|
|
|
|
} while (cnt && PRINTABLE(*ptr));
|
|
|
|
|
len -= (cursor_pos - scp->cursor_pos);
|
|
|
|
|
scp->xpos += (cursor_pos - scp->cursor_pos);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
|
|
|
|
mark_for_update(scp, cursor_pos - scp->scr_buf);
|
1995-03-03 08:37:52 +00:00
|
|
|
|
scp->cursor_pos = cursor_pos;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->xpos >= scp->xsize) {
|
|
|
|
|
scp->xpos = 0;
|
|
|
|
|
scp->ypos++;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
switch(*ptr) {
|
|
|
|
|
case 0x07:
|
|
|
|
|
do_bell(scp, scp->bell_pitch, scp->bell_duration);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x08: /* non-destructive backspace */
|
|
|
|
|
if (scp->cursor_pos > scp->scr_buf) {
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->cursor_pos--;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->xpos > 0)
|
|
|
|
|
scp->xpos--;
|
|
|
|
|
else {
|
|
|
|
|
scp->xpos += scp->xsize - 1;
|
|
|
|
|
scp->ypos--;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x09: /* non-destructive tab */
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
|
|
|
|
scp->cursor_pos += (8 - scp->xpos % 8u);
|
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
|
|
|
|
if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) {
|
|
|
|
|
scp->xpos = 0;
|
|
|
|
|
scp->ypos++;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0a: /* newline, same pos */
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->cursor_pos += scp->xsize;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->ypos++;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0c: /* form feed, clears screen */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_clear_screen(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0d: /* return, return to pos 0 */
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->cursor_pos -= scp->xpos;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_for_update(scp, scp->cursor_pos - scp->scr_buf);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xpos = 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x1b: /* start escape sequence */
|
|
|
|
|
scp->term.esc = 1;
|
|
|
|
|
scp->term.num_param = 0;
|
|
|
|
|
break;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
ptr++; len--;
|
|
|
|
|
}
|
|
|
|
|
/* do we have to scroll ?? */
|
|
|
|
|
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
|
1996-09-01 18:16:06 +00:00
|
|
|
|
remove_cutmarking(scp);
|
1998-09-26 03:38:40 +00:00
|
|
|
|
if (scp->history != NULL) {
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->scr_buf, scp->history_head,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize * sizeof(u_short));
|
|
|
|
|
scp->history_head += scp->xsize;
|
|
|
|
|
if (scp->history_head + scp->xsize >
|
|
|
|
|
scp->history + scp->history_size)
|
|
|
|
|
scp->history_head = scp->history;
|
|
|
|
|
}
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize * (scp->ysize - 1) * sizeof(u_short));
|
1995-11-28 00:17:32 +00:00
|
|
|
|
fillw(scp->term.cur_color | scr_map[0x20],
|
1995-05-30 08:16:23 +00:00
|
|
|
|
scp->scr_buf + scp->xsize * (scp->ysize - 1),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->xsize);
|
|
|
|
|
scp->cursor_pos -= scp->xsize;
|
|
|
|
|
scp->ypos--;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
if (len)
|
|
|
|
|
goto outloop;
|
|
|
|
|
write_in_progress--;
|
|
|
|
|
if (delayed_next_scr)
|
|
|
|
|
switch_scr(scp, delayed_next_scr - 1);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static void
|
1994-08-17 08:51:59 +00:00
|
|
|
|
scinit(void)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
video_adapter_t *adp;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int col;
|
|
|
|
|
int row;
|
1996-10-15 20:27:07 +00:00
|
|
|
|
u_int i;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
if (init_done != COLD)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
init_done = WARM;
|
1995-09-10 21:36:12 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
get_bios_values();
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* extract the hardware cursor location and hide the cursor for now */
|
|
|
|
|
adp = vid_get_adapter(adapter);
|
|
|
|
|
(*vidsw[adapter]->read_hw_cursor)(adp, &col, &row);
|
|
|
|
|
(*vidsw[adapter]->set_hw_cursor)(adp, -1, -1);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1997-06-22 12:04:36 +00:00
|
|
|
|
/* set up the first console */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
current_default = &user_default;
|
|
|
|
|
console[0] = &main_console;
|
|
|
|
|
init_scp(console[0]);
|
1997-01-17 15:49:13 +00:00
|
|
|
|
cur_console = console[0];
|
1996-10-26 20:16:58 +00:00
|
|
|
|
|
|
|
|
|
/* copy screen to temporary buffer */
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(console[0]))
|
1999-01-19 11:31:22 +00:00
|
|
|
|
bcopy_fromio(console[0]->adp->va_window, sc_buffer,
|
|
|
|
|
console[0]->xsize * console[0]->ysize * sizeof(u_short));
|
1996-10-26 20:16:58 +00:00
|
|
|
|
|
1998-02-11 15:02:40 +00:00
|
|
|
|
console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
|
|
|
|
|
= sc_buffer;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (col >= console[0]->xsize)
|
|
|
|
|
col = 0;
|
|
|
|
|
if (row >= console[0]->ysize)
|
|
|
|
|
row = console[0]->ysize - 1;
|
|
|
|
|
console[0]->xpos = col;
|
|
|
|
|
console[0]->ypos = row;
|
|
|
|
|
console[0]->cursor_pos = console[0]->cursor_oldpos =
|
|
|
|
|
sc_buffer + row*console[0]->xsize + col;
|
1997-06-30 13:31:49 +00:00
|
|
|
|
console[0]->cursor_saveunder = *console[0]->cursor_pos;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
for (i=1; i<MAXCONS; i++)
|
|
|
|
|
console[i] = NULL;
|
|
|
|
|
kernel_console.esc = 0;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
kernel_console.attr_mask = NORMAL_ATTR;
|
|
|
|
|
kernel_console.cur_attr =
|
|
|
|
|
kernel_console.cur_color = kernel_console.std_color =
|
|
|
|
|
kernel_default.std_color;
|
|
|
|
|
kernel_console.rev_color = kernel_default.rev_color;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
/* initialize mapscrn arrays to a one to one map */
|
|
|
|
|
for (i=0; i<sizeof(scr_map); i++) {
|
|
|
|
|
scr_map[i] = scr_rmap[i] = i;
|
|
|
|
|
}
|
1996-10-01 23:24:09 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* Save font and palette */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (ISFONTAVAIL(cur_console->adp->va_flags)) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (fonts_loaded & FONT_16) {
|
|
|
|
|
copy_font(cur_console, LOAD, 16, font_16);
|
|
|
|
|
} else {
|
|
|
|
|
copy_font(cur_console, SAVE, 16, font_16);
|
|
|
|
|
fonts_loaded = FONT_16;
|
|
|
|
|
set_destructive_cursor(cur_console);
|
1997-07-25 11:53:30 +00:00
|
|
|
|
}
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
*/
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[cur_console->ad]->show_font)(cur_console->adp, 0);
|
1997-01-19 17:34:14 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
save_palette(cur_console->adp, palette);
|
1997-01-19 17:34:14 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#if NSPLASH > 0
|
|
|
|
|
/* we are ready to put up the splash image! */
|
|
|
|
|
splash_init(cur_console->adp, scsplash_callback);
|
1996-10-01 23:24:09 +00:00
|
|
|
|
#endif
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-08-03 09:18:58 +00:00
|
|
|
|
static void
|
|
|
|
|
scshutdown(int howto, void *arg)
|
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1998-08-03 09:18:58 +00:00
|
|
|
|
if (!cold && cur_console->smode.mode == VT_AUTO
|
|
|
|
|
&& console[0]->smode.mode == VT_AUTO)
|
|
|
|
|
switch_scr(cur_console, 0);
|
|
|
|
|
shutdown_in_progress = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int
|
|
|
|
|
sc_clean_up(scr_stat *scp)
|
1997-11-21 11:37:07 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int error;
|
1997-11-21 11:37:07 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
sc_touch_scrn_saver();
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if ((error = wait_scrn_saver_stop()))
|
|
|
|
|
return error;
|
|
|
|
|
scp->status &= ~MOUSE_VISIBLE;
|
|
|
|
|
remove_cutmarking(scp);
|
|
|
|
|
return 0;
|
1997-11-21 11:37:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
void
|
|
|
|
|
sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear)
|
1997-11-21 11:37:07 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (scp->scr_buf)
|
|
|
|
|
free(scp->scr_buf, M_DEVBUF);
|
|
|
|
|
scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
|
|
|
|
|
M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
|
1997-11-21 11:37:07 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (clear) {
|
|
|
|
|
/* clear the screen and move the text cursor to the top-left position */
|
|
|
|
|
sc_clear_screen(scp);
|
|
|
|
|
} else {
|
|
|
|
|
/* retain the current cursor position, but adjust pointers */
|
|
|
|
|
move_crsr(scp, scp->xpos, scp->ypos);
|
|
|
|
|
scp->cursor_oldpos = scp->cursor_pos;
|
1997-11-21 11:37:07 +00:00
|
|
|
|
}
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
|
|
|
|
/* move the mouse cursor at the center of the screen */
|
|
|
|
|
sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
|
1997-11-21 11:37:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
void
|
|
|
|
|
sc_alloc_cut_buffer(scr_stat *scp, int wait)
|
1997-11-21 11:37:07 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if ((cut_buffer == NULL)
|
|
|
|
|
|| (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
|
|
|
|
|
if (cut_buffer != NULL)
|
|
|
|
|
free(cut_buffer, M_DEVBUF);
|
|
|
|
|
cut_buffer_size = scp->xsize * scp->ysize + 1;
|
|
|
|
|
cut_buffer = (u_char *)malloc(cut_buffer_size,
|
|
|
|
|
M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
|
|
|
|
|
if (cut_buffer != NULL)
|
|
|
|
|
cut_buffer[0] = '\0';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait)
|
|
|
|
|
{
|
|
|
|
|
u_short *usp;
|
|
|
|
|
|
|
|
|
|
if (lines < scp->ysize)
|
|
|
|
|
lines = scp->ysize;
|
|
|
|
|
|
|
|
|
|
usp = scp->history;
|
|
|
|
|
scp->history = NULL;
|
|
|
|
|
if (usp != NULL) {
|
|
|
|
|
free(usp, M_DEVBUF);
|
|
|
|
|
if (extra > 0)
|
|
|
|
|
extra_history_size += extra;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scp->history_size = lines * scp->xsize;
|
|
|
|
|
if (lines > imax(sc_history_size, scp->ysize))
|
|
|
|
|
extra_history_size -= lines - imax(sc_history_size, scp->ysize);
|
|
|
|
|
usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
|
|
|
|
|
M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
|
|
|
|
|
if (usp != NULL)
|
|
|
|
|
bzero(usp, scp->history_size * sizeof(u_short));
|
|
|
|
|
scp->history_head = scp->history_pos = usp;
|
|
|
|
|
scp->history = usp;
|
1997-11-21 11:37:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
static scr_stat
|
1995-01-12 11:47:05 +00:00
|
|
|
|
*alloc_scp()
|
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scr_stat *scp;
|
|
|
|
|
|
1995-08-08 05:14:40 +00:00
|
|
|
|
scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
init_scp(scp);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_alloc_scr_buffer(scp, TRUE, TRUE);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (ISMOUSEAVAIL(scp->adp->va_flags))
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_alloc_cut_buffer(scp, TRUE);
|
|
|
|
|
sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
/* SOS
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scp->adp->va_flags & V_ADP_MODECHANGE)
|
1995-02-22 13:48:07 +00:00
|
|
|
|
set_mode(scp);
|
1996-10-02 22:00:38 +00:00
|
|
|
|
*/
|
1998-09-15 18:16:39 +00:00
|
|
|
|
sc_clear_screen(scp);
|
1997-06-30 13:31:49 +00:00
|
|
|
|
scp->cursor_saveunder = *scp->cursor_pos;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
return scp;
|
1995-01-12 11:47:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
init_scp(scr_stat *scp)
|
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
video_info_t info;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->ad = adapter;
|
|
|
|
|
scp->adp = vid_get_adapter(scp->ad);
|
|
|
|
|
(*vidsw[scp->ad]->get_info)(scp->adp, initial_video_mode, &info);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
|
|
|
|
scp->status = 0;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->mode = initial_video_mode;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp->scr_buf = NULL;
|
|
|
|
|
if (info.vi_flags & V_INFO_GRAPHICS) {
|
|
|
|
|
scp->status |= GRAPHICS_MODE;
|
|
|
|
|
scp->xpixel = info.vi_width;
|
|
|
|
|
scp->ypixel = info.vi_height;
|
|
|
|
|
scp->xsize = info.vi_width/8;
|
|
|
|
|
scp->ysize = info.vi_height/info.vi_cheight;
|
|
|
|
|
scp->font_size = FONT_NONE;
|
|
|
|
|
} else {
|
|
|
|
|
scp->xsize = info.vi_width;
|
|
|
|
|
scp->ysize = info.vi_height;
|
|
|
|
|
scp->xpixel = scp->xsize*8;
|
|
|
|
|
scp->ypixel = scp->ysize*info.vi_cheight;
|
|
|
|
|
scp->font_size = info.vi_cheight;
|
1998-04-04 16:26:53 +00:00
|
|
|
|
}
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp->xoff = scp->yoff = 0;
|
1997-01-23 20:00:45 +00:00
|
|
|
|
scp->xpos = scp->ypos = 0;
|
|
|
|
|
scp->saved_xpos = scp->saved_ypos = -1;
|
1996-10-18 18:51:37 +00:00
|
|
|
|
scp->start = scp->xsize * scp->ysize;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
scp->end = 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->term.esc = 0;
|
1995-11-28 00:17:32 +00:00
|
|
|
|
scp->term.attr_mask = NORMAL_ATTR;
|
|
|
|
|
scp->term.cur_attr =
|
|
|
|
|
scp->term.cur_color = scp->term.std_color =
|
|
|
|
|
current_default->std_color;
|
|
|
|
|
scp->term.rev_color = current_default->rev_color;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->border = BG_BLACK;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
scp->cursor_start = bios_value.cursor_start;
|
|
|
|
|
scp->cursor_end = bios_value.cursor_end;
|
1996-10-18 18:51:37 +00:00
|
|
|
|
scp->mouse_xpos = scp->xsize*8/2;
|
|
|
|
|
scp->mouse_ypos = scp->ysize*scp->font_size/2;
|
1996-06-21 07:19:18 +00:00
|
|
|
|
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
scp->mouse_signal = 0;
|
|
|
|
|
scp->mouse_pid = 0;
|
|
|
|
|
scp->mouse_proc = NULL;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scp->kbd_mode = K_XLATE;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->bell_pitch = BELL_PITCH;
|
|
|
|
|
scp->bell_duration = BELL_DURATION;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
scp->status |= (bios_value.shift_state & 0x20) ? NLKED : 0;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->status |= CURSOR_ENABLED;
|
|
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
scp->history_head = scp->history_pos = scp->history = NULL;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
static void
|
|
|
|
|
get_bios_values(void)
|
|
|
|
|
{
|
|
|
|
|
bios_value.cursor_start = *(u_int8_t *)pa_to_va(0x461);
|
|
|
|
|
bios_value.cursor_end = *(u_int8_t *)pa_to_va(0x460);
|
|
|
|
|
bios_value.shift_state = *(u_int8_t *)pa_to_va(0x417);
|
|
|
|
|
}
|
|
|
|
|
|
1995-01-28 22:18:05 +00:00
|
|
|
|
static void
|
|
|
|
|
history_to_screen(scr_stat *scp)
|
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<scp->ysize; i++)
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(scp->history + (((scp->history_pos - scp->history) +
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scp->history_size-((i+1)*scp->xsize))%scp->history_size),
|
|
|
|
|
scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)),
|
|
|
|
|
scp->xsize * sizeof(u_short));
|
1995-03-29 20:55:03 +00:00
|
|
|
|
mark_all(scp);
|
1995-01-28 22:18:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
history_up_line(scr_stat *scp)
|
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (WRAPHIST(scp, scp->history_pos, -(scp->xsize*scp->ysize)) !=
|
|
|
|
|
scp->history_head) {
|
|
|
|
|
scp->history_pos = WRAPHIST(scp, scp->history_pos, -scp->xsize);
|
|
|
|
|
history_to_screen(scp);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return -1;
|
1995-01-28 22:18:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
history_down_line(scr_stat *scp)
|
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (scp->history_pos != scp->history_head) {
|
|
|
|
|
scp->history_pos = WRAPHIST(scp, scp->history_pos, scp->xsize);
|
|
|
|
|
history_to_screen(scp);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return -1;
|
1995-01-28 22:18:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
1993-07-26 21:21:11 +00:00
|
|
|
|
/*
|
1996-10-26 20:16:58 +00:00
|
|
|
|
* scgetc(flags) - get character from keyboard.
|
|
|
|
|
* If flags & SCGETC_CN, then avoid harmful side effects.
|
|
|
|
|
* If flags & SCGETC_NONBLOCK, then wait until a key is pressed, else
|
|
|
|
|
* return NOKEY if there is nothing there.
|
1993-07-26 21:21:11 +00:00
|
|
|
|
*/
|
1996-10-02 22:00:38 +00:00
|
|
|
|
static u_int
|
1999-01-11 03:18:56 +00:00
|
|
|
|
scgetc(keyboard_t *kbd, u_int flags)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
u_int c;
|
|
|
|
|
int this_scr;
|
|
|
|
|
int f;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (kbd == NULL)
|
|
|
|
|
return NOKEY;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
|
|
|
|
next_code:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* I don't like this, but... XXX */
|
|
|
|
|
if (flags & SCGETC_CN)
|
|
|
|
|
sccnupdate(cur_console);
|
1996-11-14 22:19:17 +00:00
|
|
|
|
/* first see if there is something in the keyboard port */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
for (;;) {
|
|
|
|
|
c = kbd_read_char(kbd, !(flags & SCGETC_NONBLOCK));
|
|
|
|
|
if (c == ERRKEY) {
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
|
|
|
|
} else if (c == NOKEY)
|
|
|
|
|
return c;
|
|
|
|
|
else
|
|
|
|
|
break;
|
1996-11-04 21:01:08 +00:00
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-02-11 14:56:02 +00:00
|
|
|
|
/* make screensaver happy */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(c & RELKEY))
|
|
|
|
|
sc_touch_scrn_saver();
|
1998-02-11 14:56:02 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#ifdef __i386__
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(flags & SCGETC_CN))
|
1998-02-11 14:56:02 +00:00
|
|
|
|
/* do the /dev/random device a favour */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
add_keyboard_randomness(c);
|
1999-01-19 11:31:22 +00:00
|
|
|
|
#endif
|
1995-10-28 16:58:05 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (cur_console->kbd_mode != K_XLATE)
|
|
|
|
|
return KEYCHAR(c);
|
1997-10-01 20:46:29 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* if scroll-lock pressed allow history browsing */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISGRAPHSC(cur_console) && cur_console->history
|
|
|
|
|
&& cur_console->status & SLKED) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
cur_console->status &= ~CURSOR_ENABLED;
|
|
|
|
|
if (!(cur_console->status & BUFFER_SAVED)) {
|
|
|
|
|
cur_console->status |= BUFFER_SAVED;
|
|
|
|
|
cur_console->history_save = cur_console->history_head;
|
|
|
|
|
|
|
|
|
|
/* copy screen into top of history buffer */
|
|
|
|
|
for (i=0; i<cur_console->ysize; i++) {
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(cur_console->scr_buf + (cur_console->xsize * i),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->history_head,
|
|
|
|
|
cur_console->xsize * sizeof(u_short));
|
|
|
|
|
cur_console->history_head += cur_console->xsize;
|
|
|
|
|
if (cur_console->history_head + cur_console->xsize >
|
|
|
|
|
cur_console->history + cur_console->history_size)
|
|
|
|
|
cur_console->history_head=cur_console->history;
|
|
|
|
|
}
|
|
|
|
|
cur_console->history_pos = cur_console->history_head;
|
|
|
|
|
history_to_screen(cur_console);
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
switch (c) {
|
|
|
|
|
/* FIXME: key codes */
|
|
|
|
|
case SPCLKEY | FKEY | F(49): /* home key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->history_pos = cur_console->history_head;
|
|
|
|
|
history_to_screen(cur_console);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SPCLKEY | FKEY | F(57): /* end key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->history_pos =
|
1995-05-30 08:16:23 +00:00
|
|
|
|
WRAPHIST(cur_console, cur_console->history_head,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->xsize*cur_console->ysize);
|
|
|
|
|
history_to_screen(cur_console);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SPCLKEY | FKEY | F(50): /* up arrow key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (history_up_line(cur_console))
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
goto next_code;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SPCLKEY | FKEY | F(58): /* down arrow key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (history_down_line(cur_console))
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
goto next_code;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SPCLKEY | FKEY | F(51): /* page up key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
for (i=0; i<cur_console->ysize; i++)
|
|
|
|
|
if (history_up_line(cur_console)) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
1993-07-30 02:20:26 +00:00
|
|
|
|
break;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SPCLKEY | FKEY | F(59): /* page down key */
|
|
|
|
|
remove_cutmarking(cur_console);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
for (i=0; i<cur_console->ysize; i++)
|
|
|
|
|
if (history_down_line(cur_console)) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
do_bell(cur_console, BELL_PITCH, BELL_DURATION);
|
1993-07-30 02:20:26 +00:00
|
|
|
|
break;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
goto next_code;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/*
|
|
|
|
|
* Process and consume special keys here. Return a plain char code
|
|
|
|
|
* or a char code with the META flag or a function key code.
|
|
|
|
|
*/
|
|
|
|
|
if (c & RELKEY) {
|
|
|
|
|
/* key released */
|
|
|
|
|
/* goto next_code */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
} else {
|
|
|
|
|
/* key pressed */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (c & SPCLKEY) {
|
|
|
|
|
c &= ~SPCLKEY;
|
|
|
|
|
switch (KEYCHAR(c)) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* LOCKING KEYS */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case NLK: case CLK: case ALK:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
case SLK:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&f);
|
|
|
|
|
if (f & SLKED) {
|
|
|
|
|
cur_console->status |= SLKED;
|
|
|
|
|
} else {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (cur_console->status & SLKED) {
|
|
|
|
|
cur_console->status &= ~SLKED;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (cur_console->status & BUFFER_SAVED) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
int i;
|
|
|
|
|
u_short *ptr = cur_console->history_save;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<cur_console->ysize; i++) {
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(ptr,
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->scr_buf +
|
|
|
|
|
(cur_console->xsize*i),
|
|
|
|
|
cur_console->xsize * sizeof(u_short));
|
|
|
|
|
ptr += cur_console->xsize;
|
1997-07-08 13:38:58 +00:00
|
|
|
|
if (ptr + cur_console->xsize >
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->history +
|
|
|
|
|
cur_console->history_size)
|
|
|
|
|
ptr = cur_console->history;
|
|
|
|
|
}
|
1995-03-29 20:55:03 +00:00
|
|
|
|
cur_console->status &= ~BUFFER_SAVED;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
cur_console->history_head=cur_console->history_save;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
cur_console->status |= CURSOR_ENABLED;
|
1995-04-25 10:22:28 +00:00
|
|
|
|
mark_all(cur_console);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
scstart(VIRTUAL_TTY(get_scr_num()));
|
1995-05-30 08:16:23 +00:00
|
|
|
|
}
|
1993-07-30 02:20:26 +00:00
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* NON-LOCKING KEYS */
|
|
|
|
|
case NOP:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case LSH: case RSH: case LCTR: case RCTR:
|
|
|
|
|
case LALT: case RALT: case ASH: case META:
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
|
|
|
|
case BTAB:
|
|
|
|
|
return c;
|
|
|
|
|
|
1996-09-30 23:00:58 +00:00
|
|
|
|
case SPSC:
|
1998-08-03 11:30:45 +00:00
|
|
|
|
/* force activatation/deactivation of the screen saver */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!scrn_blanked) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
scrn_time_stamp -= scrn_blank_time;
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#if NSPLASH > 0
|
1998-08-03 11:30:45 +00:00
|
|
|
|
if (cold) {
|
|
|
|
|
/*
|
|
|
|
|
* While devices are being probed, the screen saver need
|
|
|
|
|
* to be invoked explictly. XXX
|
|
|
|
|
*/
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (scrn_blanked) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
stop_scrn_saver(current_saver);
|
|
|
|
|
} else {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISGRAPHSC(cur_console)) {
|
1998-08-03 11:30:45 +00:00
|
|
|
|
scsplash_stick(TRUE);
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*current_saver)(TRUE);
|
1998-08-03 11:30:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#endif /* NSPLASH */
|
1996-09-30 23:00:58 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case RBT:
|
1998-02-11 14:56:02 +00:00
|
|
|
|
#ifndef SC_DISABLE_REBOOT
|
1995-02-22 13:48:07 +00:00
|
|
|
|
shutdown_nice();
|
1998-02-11 14:56:02 +00:00
|
|
|
|
#endif
|
1995-05-30 08:16:23 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
#if NAPM > 0
|
1999-01-11 03:18:56 +00:00
|
|
|
|
case SUSP:
|
1998-07-06 06:29:07 +00:00
|
|
|
|
apm_suspend(PMST_SUSPEND);
|
|
|
|
|
break;
|
|
|
|
|
case STBY:
|
|
|
|
|
apm_suspend(PMST_STANDBY);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#else
|
|
|
|
|
case SUSP:
|
|
|
|
|
case STBY:
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
|
|
|
|
case DBG:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
#ifdef DDB /* try to switch to console 0 */
|
1998-08-03 11:30:45 +00:00
|
|
|
|
/*
|
|
|
|
|
* TRY to make sure the screen saver is stopped,
|
|
|
|
|
* and the screen is updated before switching to
|
|
|
|
|
* the vty0.
|
|
|
|
|
*/
|
|
|
|
|
scrn_timer((void *)FALSE);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (cur_console->smode.mode == VT_AUTO &&
|
|
|
|
|
console[0]->smode.mode == VT_AUTO)
|
1995-05-30 08:16:23 +00:00
|
|
|
|
switch_scr(cur_console, 0);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
Debugger("manual escape to debugger");
|
1993-10-28 05:27:36 +00:00
|
|
|
|
#else
|
1995-02-22 13:48:07 +00:00
|
|
|
|
printf("No debugger in kernel\n");
|
1993-10-28 05:27:36 +00:00
|
|
|
|
#endif
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
case NEXT:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
this_scr = get_scr_num();
|
|
|
|
|
for (i = this_scr + 1; i != this_scr; i = (i + 1)%MAXCONS) {
|
|
|
|
|
struct tty *tp = VIRTUAL_TTY(i);
|
1997-01-30 15:12:17 +00:00
|
|
|
|
if (tp->t_state & TS_ISOPEN) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
switch_scr(cur_console, i);
|
1997-01-30 15:12:17 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-02-22 13:48:07 +00:00
|
|
|
|
break;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
default:
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (KEYCHAR(c) >= F_SCR && KEYCHAR(c) <= L_SCR) {
|
|
|
|
|
switch_scr(cur_console, KEYCHAR(c) - F_SCR);
|
1998-01-07 08:40:34 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* assert(c & FKEY) */
|
|
|
|
|
return c;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
/* goto next_code */
|
|
|
|
|
} else {
|
|
|
|
|
/* regular keys (maybe MKEY is set) */
|
|
|
|
|
return c;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
goto next_code;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-30 08:16:23 +00:00
|
|
|
|
int
|
1998-11-08 12:39:07 +00:00
|
|
|
|
scmmap(dev_t dev, vm_offset_t offset, int nprot)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
struct tty *tp;
|
|
|
|
|
struct scr_stat *scp;
|
|
|
|
|
|
|
|
|
|
tp = scdevtotty(dev);
|
|
|
|
|
if (!tp)
|
|
|
|
|
return ENXIO;
|
|
|
|
|
scp = sc_get_scr_stat(tp->t_dev);
|
|
|
|
|
return (*vidsw[scp->ad]->mmap)(scp->adp, offset);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-10-02 22:00:38 +00:00
|
|
|
|
/*
|
|
|
|
|
* Calculate hardware attributes word using logical attributes mask and
|
|
|
|
|
* hardware colors
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
mask2attr(struct term_stat *term)
|
|
|
|
|
{
|
|
|
|
|
int attr, mask = term->attr_mask;
|
|
|
|
|
|
|
|
|
|
if (mask & REVERSE_ATTR) {
|
|
|
|
|
attr = ((mask & FOREGROUND_CHANGED) ?
|
|
|
|
|
((term->cur_color & 0xF000) >> 4) :
|
|
|
|
|
(term->rev_color & 0x0F00)) |
|
|
|
|
|
((mask & BACKGROUND_CHANGED) ?
|
|
|
|
|
((term->cur_color & 0x0F00) << 4) :
|
|
|
|
|
(term->rev_color & 0xF000));
|
|
|
|
|
} else
|
|
|
|
|
attr = term->cur_color;
|
|
|
|
|
|
|
|
|
|
/* XXX: underline mapping for Hercules adapter can be better */
|
|
|
|
|
if (mask & (BOLD_ATTR | UNDERLINE_ATTR))
|
|
|
|
|
attr ^= 0x0800;
|
|
|
|
|
if (mask & BLINK_ATTR)
|
|
|
|
|
attr ^= 0x8000;
|
|
|
|
|
|
|
|
|
|
return attr;
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
|
|
|
|
save_kbd_state(scr_stat *scp)
|
1996-09-30 23:00:58 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int state;
|
|
|
|
|
int error;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
if (error == 0) {
|
|
|
|
|
scp->status &= ~LOCK_MASK;
|
|
|
|
|
scp->status |= state;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
return error;
|
|
|
|
|
}
|
1997-01-15 18:16:32 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
|
|
|
|
update_kbd_state(int new_bits, int mask)
|
|
|
|
|
{
|
|
|
|
|
int state;
|
|
|
|
|
int error;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (mask != LOCK_MASK) {
|
|
|
|
|
error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
|
|
|
|
state &= ~mask;
|
|
|
|
|
state |= new_bits & mask;
|
|
|
|
|
} else {
|
|
|
|
|
state = new_bits & LOCK_MASK;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
}
|
1999-01-11 03:18:56 +00:00
|
|
|
|
error = kbd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1997-01-15 18:16:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
static int
|
|
|
|
|
update_kbd_leds(int which)
|
1997-01-15 18:16:32 +00:00
|
|
|
|
{
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int error;
|
1996-11-14 22:19:17 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
which &= LOCK_MASK;
|
|
|
|
|
error = kbd_ioctl(kbd, KDSETLED, (caddr_t)&which);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1996-09-30 23:00:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int
|
1994-08-17 08:51:59 +00:00
|
|
|
|
set_mode(scr_stat *scp)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
video_info_t info;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* reject unsupported mode */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return 1;
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* if this vty is not currently showing, do nothing */
|
|
|
|
|
if (scp != cur_console)
|
|
|
|
|
return 0;
|
1997-11-21 11:37:07 +00:00
|
|
|
|
|
1995-02-22 13:48:07 +00:00
|
|
|
|
/* setup video hardware for the given mode */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->set_mode)(scp->adp, scp->mode);
|
1999-01-19 11:31:22 +00:00
|
|
|
|
Crtat = scp->adp->va_window;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
|
|
|
|
if (!(scp->status & GRAPHICS_MODE)) {
|
|
|
|
|
/* load appropriate font */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) {
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (scp->font_size < 14) {
|
|
|
|
|
if (fonts_loaded & FONT_8)
|
|
|
|
|
copy_font(scp, LOAD, 8, font_8);
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
|
|
|
|
if (fonts_loaded & FONT_16)
|
|
|
|
|
copy_font(scp, LOAD, 16, font_16);
|
|
|
|
|
} else {
|
|
|
|
|
if (fonts_loaded & FONT_14)
|
|
|
|
|
copy_font(scp, LOAD, 14, font_14);
|
|
|
|
|
}
|
|
|
|
|
/*
|
1999-01-11 03:18:56 +00:00
|
|
|
|
* FONT KLUDGE:
|
|
|
|
|
* This is an interim kludge to display correct font.
|
|
|
|
|
* Always use the font page #0 on the video plane 2.
|
|
|
|
|
* Somehow we cannot show the font in other font pages on
|
|
|
|
|
* some video cards... XXX
|
|
|
|
|
*/
|
|
|
|
|
(*vidsw[scp->ad]->show_font)(scp->adp, 0);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1996-09-30 23:00:58 +00:00
|
|
|
|
mark_all(scp);
|
Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver. The screen saver calls these
functions to notify syscons of loading/unloading events.
It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.
Now only one screen saver is allowed in memory at a time.
Soeren will be looking into this issue again later. syscons is
becoming too heavy. It's time to cut things down, rather than adding
more...
2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.
There are three exceptions, however.
One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.
The others are sccngetc() and sccncheckc(); they will unblank the
screen too. When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...
(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)
3. Use `mono_time' rather than `time'.
4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.
Changes to the LKM screen saver modules will follow shortly. YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.
Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
|
|
|
|
}
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
|
|
|
|
if (scp->status & PIXEL_MODE)
|
1999-01-19 11:31:22 +00:00
|
|
|
|
bzero_io(scp->adp->va_window, scp->xpixel*scp->ypixel/8);
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
set_border(scp, scp->border);
|
1997-04-27 09:03:10 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/* move hardware cursor out of the way */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
|
1997-04-27 09:03:10 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return 0;
|
1997-04-27 09:03:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-23 09:59:00 +00:00
|
|
|
|
void
|
|
|
|
|
set_border(scr_stat *scp, int color)
|
|
|
|
|
{
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t p;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
int xoff;
|
|
|
|
|
int yoff;
|
|
|
|
|
int xlen;
|
|
|
|
|
int ylen;
|
|
|
|
|
int i;
|
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->set_border)(scp->adp, color);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
|
|
|
|
if (scp->status & PIXEL_MODE) {
|
|
|
|
|
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
|
|
|
|
|
outw(GDCIDX, 0x0003); /* data rotate/function select */
|
|
|
|
|
outw(GDCIDX, 0x0f01); /* set/reset enable */
|
|
|
|
|
outw(GDCIDX, 0xff08); /* bit mask */
|
|
|
|
|
outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
p = scp->adp->va_window;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
xoff = scp->xoff;
|
|
|
|
|
yoff = scp->yoff*scp->font_size;
|
|
|
|
|
xlen = scp->xpixel/8;
|
|
|
|
|
ylen = scp->ysize*scp->font_size;
|
|
|
|
|
if (yoff > 0) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
bzero_io(p, xlen*yoff);
|
|
|
|
|
bzero_io(p + xlen*(yoff + ylen),
|
|
|
|
|
xlen*scp->ypixel - xlen*(yoff + ylen));
|
1998-09-23 09:59:00 +00:00
|
|
|
|
}
|
|
|
|
|
if (xoff > 0) {
|
|
|
|
|
for (i = 0; i < ylen; ++i) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
bzero_io(p + xlen*(yoff + i), xoff);
|
|
|
|
|
bzero_io(p + xlen*(yoff + i) + xoff + scp->xsize,
|
|
|
|
|
xlen - xoff - scp->xsize);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
outw(GDCIDX, 0x0000); /* set/reset */
|
|
|
|
|
outw(GDCIDX, 0x0001); /* set/reset enable */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
void
|
|
|
|
|
copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE:
|
|
|
|
|
* This is an interim kludge to display correct font.
|
|
|
|
|
* Always use the font page #0 on the video plane 2.
|
|
|
|
|
* Somehow we cannot show the font in other font pages on
|
|
|
|
|
* some video cards... XXX
|
|
|
|
|
*/
|
1998-02-11 15:00:24 +00:00
|
|
|
|
font_loading_in_progress = TRUE;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (operation == LOAD) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, buf, 0, 256);
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & CHAR_CURSOR)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
set_destructive_cursor(scp);
|
|
|
|
|
} else if (operation == SAVE) {
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->save_font)(scp->adp, 0, font_size, buf, 0, 256);
|
1996-12-07 22:33:05 +00:00
|
|
|
|
}
|
1998-02-11 15:00:24 +00:00
|
|
|
|
font_loading_in_progress = FALSE;
|
1995-01-20 08:35:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 11:39:18 +00:00
|
|
|
|
static void
|
1996-09-01 18:16:06 +00:00
|
|
|
|
set_destructive_cursor(scr_stat *scp)
|
1995-03-29 20:55:03 +00:00
|
|
|
|
{
|
|
|
|
|
u_char cursor[32];
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char *font_buffer;
|
|
|
|
|
int font_size;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int crtc_addr;
|
1996-06-26 13:04:53 +00:00
|
|
|
|
int i;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
|
1999-01-11 03:18:56 +00:00
|
|
|
|
if (!ISFONTAVAIL(scp->adp->va_flags)
|
1998-10-01 11:39:18 +00:00
|
|
|
|
|| (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
|
1998-09-15 18:16:39 +00:00
|
|
|
|
return;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
|
1997-05-15 05:43:59 +00:00
|
|
|
|
if (scp->font_size < 14) {
|
1995-03-30 14:32:31 +00:00
|
|
|
|
font_buffer = font_8;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 8;
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
1995-03-30 14:32:31 +00:00
|
|
|
|
font_buffer = font_16;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 16;
|
|
|
|
|
} else {
|
1996-09-01 18:16:06 +00:00
|
|
|
|
font_buffer = font_14;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 14;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-10-18 18:51:37 +00:00
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
1998-02-11 15:02:40 +00:00
|
|
|
|
if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR)
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(&scp->mouse_cursor[0], cursor, scp->font_size);
|
1998-02-11 15:02:40 +00:00
|
|
|
|
else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 1)
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(&scp->mouse_cursor[32], cursor, scp->font_size);
|
1998-02-11 15:02:40 +00:00
|
|
|
|
else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 2)
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(&scp->mouse_cursor[64], cursor, scp->font_size);
|
1998-02-11 15:02:40 +00:00
|
|
|
|
else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 3)
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(&scp->mouse_cursor[96], cursor, scp->font_size);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
else
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size),
|
1996-06-26 13:04:53 +00:00
|
|
|
|
cursor, scp->font_size);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer + ((scp->cursor_saveunder & 0xff) * scp->font_size),
|
1996-06-26 13:04:53 +00:00
|
|
|
|
cursor, scp->font_size);
|
1995-03-29 20:55:03 +00:00
|
|
|
|
for (i=0; i<32; i++)
|
1995-05-30 08:16:23 +00:00
|
|
|
|
if ((i >= scp->cursor_start && i <= scp->cursor_end) ||
|
1996-06-26 13:04:53 +00:00
|
|
|
|
(scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
|
1995-03-30 14:32:31 +00:00
|
|
|
|
cursor[i] |= 0xff;
|
1997-01-19 17:34:14 +00:00
|
|
|
|
#if 1
|
1999-01-11 03:18:56 +00:00
|
|
|
|
crtc_addr = scp->adp->va_crtc_addr;
|
1997-01-19 17:34:14 +00:00
|
|
|
|
while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
|
|
|
|
|
#endif
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_loading_in_progress = TRUE;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_loading_in_progress = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_move_mouse(scr_stat *scp, int x, int y)
|
|
|
|
|
{
|
|
|
|
|
scp->mouse_xpos = x;
|
|
|
|
|
scp->mouse_ypos = y;
|
|
|
|
|
scp->mouse_pos = scp->mouse_oldpos =
|
|
|
|
|
scp->scr_buf + (y / scp->font_size) * scp->xsize + x / 8;
|
1995-03-29 20:55:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void
|
|
|
|
|
set_mouse_pos(scr_stat *scp)
|
|
|
|
|
{
|
1996-09-01 18:16:06 +00:00
|
|
|
|
static int last_xpos = -1, last_ypos = -1;
|
1997-08-09 19:24:03 +00:00
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
if (scp->mouse_xpos < 0)
|
|
|
|
|
scp->mouse_xpos = 0;
|
|
|
|
|
if (scp->mouse_ypos < 0)
|
|
|
|
|
scp->mouse_ypos = 0;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISTEXTSC(scp)) {
|
1997-08-09 19:24:03 +00:00
|
|
|
|
if (scp->mouse_xpos > scp->xpixel-1)
|
1997-08-08 22:52:30 +00:00
|
|
|
|
scp->mouse_xpos = scp->xpixel-1;
|
1997-08-09 19:24:03 +00:00
|
|
|
|
if (scp->mouse_ypos > scp->ypixel-1)
|
1997-08-08 22:52:30 +00:00
|
|
|
|
scp->mouse_ypos = scp->ypixel-1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1997-08-09 19:24:03 +00:00
|
|
|
|
if (scp->mouse_xpos > (scp->xsize*8)-1)
|
|
|
|
|
scp->mouse_xpos = (scp->xsize*8)-1;
|
|
|
|
|
if (scp->mouse_ypos > (scp->ysize*scp->font_size)-1)
|
|
|
|
|
scp->mouse_ypos = (scp->ysize*scp->font_size)-1;
|
1996-06-26 13:04:53 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
if (scp->mouse_xpos != last_xpos || scp->mouse_ypos != last_ypos) {
|
|
|
|
|
scp->status |= MOUSE_MOVED;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
scp->mouse_pos = scp->scr_buf +
|
|
|
|
|
((scp->mouse_ypos/scp->font_size)*scp->xsize + scp->mouse_xpos/8);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
if ((scp->status & MOUSE_VISIBLE) && (scp->status & MOUSE_CUTTING))
|
|
|
|
|
mouse_cut(scp);
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
#define isspace(c) (((c) & 0xff) == ' ')
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
skip_spc_right(scr_stat *scp, u_short *p)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
|
|
|
|
|
if (!isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
++p;
|
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
skip_spc_left(scr_stat *scp, u_short *p)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = (p-- - scp->scr_buf) % scp->xsize - 1; i >= 0; --i) {
|
|
|
|
|
if (!isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
--p;
|
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
mouse_cut(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
u_short *end;
|
|
|
|
|
u_short *p;
|
|
|
|
|
int i = 0;
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
|
|
scp->mouse_cut_end = (scp->mouse_pos >= scp->mouse_cut_start) ?
|
|
|
|
|
scp->mouse_pos + 1 : scp->mouse_pos;
|
|
|
|
|
end = (scp->mouse_cut_start > scp->mouse_cut_end) ?
|
|
|
|
|
scp->mouse_cut_start : scp->mouse_cut_end;
|
|
|
|
|
for (p = (scp->mouse_cut_start > scp->mouse_cut_end) ?
|
|
|
|
|
scp->mouse_cut_end : scp->mouse_cut_start; p < end; ++p) {
|
|
|
|
|
cut_buffer[i] = *p & 0xff;
|
|
|
|
|
/* remember the position of the last non-space char */
|
|
|
|
|
if (!isspace(cut_buffer[i++]))
|
|
|
|
|
j = i;
|
|
|
|
|
/* trim trailing blank when crossing lines */
|
|
|
|
|
if (((p - scp->scr_buf) % scp->xsize) == (scp->xsize - 1)) {
|
1998-08-18 07:36:47 +00:00
|
|
|
|
cut_buffer[j++] = '\r';
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
i = j;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cut_buffer[i] = '\0';
|
|
|
|
|
|
|
|
|
|
/* scan towards the end of the last line */
|
|
|
|
|
--p;
|
|
|
|
|
for (i = (p - scp->scr_buf) % scp->xsize; i < scp->xsize; ++i) {
|
|
|
|
|
if (!isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
++p;
|
|
|
|
|
}
|
|
|
|
|
/* if there is nothing but blank chars, trim them, but mark towards eol */
|
|
|
|
|
if (i >= scp->xsize) {
|
|
|
|
|
if (scp->mouse_cut_start > scp->mouse_cut_end)
|
|
|
|
|
scp->mouse_cut_start = p;
|
|
|
|
|
else
|
|
|
|
|
scp->mouse_cut_end = p;
|
1998-08-14 06:32:03 +00:00
|
|
|
|
cut_buffer[j++] = '\r';
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cut_buffer[j] = '\0';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mark_for_update(scp, scp->mouse_cut_start - scp->scr_buf);
|
|
|
|
|
mark_for_update(scp, scp->mouse_cut_end - scp->scr_buf);
|
|
|
|
|
}
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void
|
|
|
|
|
mouse_cut_start(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
1996-10-18 18:51:37 +00:00
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
1996-06-25 08:54:57 +00:00
|
|
|
|
if (scp->mouse_pos == scp->mouse_cut_start &&
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
scp->mouse_cut_start == scp->mouse_cut_end - 1) {
|
|
|
|
|
cut_buffer[0] = '\0';
|
1996-09-01 18:16:06 +00:00
|
|
|
|
remove_cutmarking(scp);
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
} else if (skip_spc_right(scp, scp->mouse_pos) >= scp->xsize) {
|
|
|
|
|
/* if the pointer is on trailing blank chars, mark towards eol */
|
|
|
|
|
i = skip_spc_left(scp, scp->mouse_pos) + 1;
|
|
|
|
|
scp->mouse_cut_start = scp->scr_buf +
|
|
|
|
|
((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize + i;
|
|
|
|
|
scp->mouse_cut_end = scp->scr_buf +
|
|
|
|
|
((scp->mouse_pos - scp->scr_buf) / scp->xsize + 1) * scp->xsize;
|
1998-08-14 06:32:03 +00:00
|
|
|
|
cut_buffer[0] = '\r';
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cut_buffer[1] = '\0';
|
|
|
|
|
scp->status |= MOUSE_CUTTING;
|
|
|
|
|
} else {
|
|
|
|
|
scp->mouse_cut_start = scp->mouse_pos;
|
|
|
|
|
scp->mouse_cut_end = scp->mouse_cut_start + 1;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
cut_buffer[0] = *scp->mouse_cut_start & 0xff;
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cut_buffer[1] = '\0';
|
1996-06-25 08:54:57 +00:00
|
|
|
|
scp->status |= MOUSE_CUTTING;
|
|
|
|
|
}
|
1996-09-01 18:16:06 +00:00
|
|
|
|
mark_all(scp);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
/* delete all other screens cut markings */
|
|
|
|
|
for (i=0; i<MAXCONS; i++) {
|
|
|
|
|
if (console[i] == NULL || console[i] == scp)
|
|
|
|
|
continue;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
remove_cutmarking(console[i]);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
mouse_cut_end(scr_stat *scp)
|
|
|
|
|
{
|
1996-10-18 18:51:37 +00:00
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
1996-06-25 08:54:57 +00:00
|
|
|
|
scp->status &= ~MOUSE_CUTTING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
static void
|
|
|
|
|
mouse_cut_word(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
u_short *p;
|
|
|
|
|
u_short *sol;
|
|
|
|
|
u_short *eol;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Because we don't have locale information in the kernel,
|
|
|
|
|
* we only distinguish space char and non-space chars. Punctuation
|
|
|
|
|
* chars, symbols and other regular chars are all treated alike.
|
|
|
|
|
*/
|
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
|
|
|
|
sol = scp->scr_buf
|
|
|
|
|
+ ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
|
|
|
|
|
eol = sol + scp->xsize;
|
|
|
|
|
if (isspace(*scp->mouse_pos)) {
|
|
|
|
|
for (p = scp->mouse_pos; p >= sol; --p)
|
|
|
|
|
if (!isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
scp->mouse_cut_start = ++p;
|
|
|
|
|
for (p = scp->mouse_pos; p < eol; ++p)
|
|
|
|
|
if (!isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
scp->mouse_cut_end = p;
|
|
|
|
|
} else {
|
|
|
|
|
for (p = scp->mouse_pos; p >= sol; --p)
|
|
|
|
|
if (isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
scp->mouse_cut_start = ++p;
|
|
|
|
|
for (p = scp->mouse_pos; p < eol; ++p)
|
|
|
|
|
if (isspace(*p))
|
|
|
|
|
break;
|
|
|
|
|
scp->mouse_cut_end = p;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
|
|
|
|
|
cut_buffer[i++] = *p & 0xff;
|
|
|
|
|
cut_buffer[i] = '\0';
|
|
|
|
|
scp->status |= MOUSE_CUTTING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
mouse_cut_line(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
u_short *p;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
|
|
|
|
scp->mouse_cut_start = scp->scr_buf
|
|
|
|
|
+ ((scp->mouse_pos - scp->scr_buf) / scp->xsize) * scp->xsize;
|
|
|
|
|
scp->mouse_cut_end = scp->mouse_cut_start + scp->xsize;
|
|
|
|
|
for (i = 0, p = scp->mouse_cut_start; p < scp->mouse_cut_end; ++p)
|
|
|
|
|
cut_buffer[i++] = *p & 0xff;
|
1998-08-14 06:32:03 +00:00
|
|
|
|
cut_buffer[i++] = '\r';
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
cut_buffer[i] = '\0';
|
|
|
|
|
scp->status |= MOUSE_CUTTING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
mouse_cut_extend(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
if ((scp->status & MOUSE_VISIBLE) && !(scp->status & MOUSE_CUTTING)
|
|
|
|
|
&& (scp->mouse_cut_start != NULL)) {
|
|
|
|
|
mouse_cut(scp);
|
|
|
|
|
scp->status |= MOUSE_CUTTING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1996-06-25 08:54:57 +00:00
|
|
|
|
static void
|
|
|
|
|
mouse_paste(scr_stat *scp)
|
|
|
|
|
{
|
1996-10-18 18:51:37 +00:00
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
1996-06-25 08:54:57 +00:00
|
|
|
|
struct tty *tp;
|
1996-06-26 13:04:53 +00:00
|
|
|
|
u_char *ptr = cut_buffer;
|
1996-06-25 08:54:57 +00:00
|
|
|
|
|
|
|
|
|
tp = VIRTUAL_TTY(get_scr_num());
|
|
|
|
|
while (*ptr)
|
1996-09-01 18:16:06 +00:00
|
|
|
|
(*linesw[tp->t_line].l_rint)(scr_rmap[*ptr++], tp);
|
1996-06-25 08:54:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1995-01-20 08:35:32 +00:00
|
|
|
|
static void
|
|
|
|
|
draw_mouse_image(scr_stat *scp)
|
|
|
|
|
{
|
1995-02-22 13:48:07 +00:00
|
|
|
|
u_short buffer[32];
|
|
|
|
|
u_short xoffset, yoffset;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t crt_pos = scp->adp->va_window + 2*(scp->mouse_pos - scp->scr_buf);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char *font_buffer;
|
|
|
|
|
int font_size;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
int crtc_addr;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int i;
|
1995-02-22 13:48:07 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (scp->font_size < 14) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
font_buffer = font_8;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 8;
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
font_buffer = font_16;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 16;
|
|
|
|
|
} else {
|
1996-09-01 18:16:06 +00:00
|
|
|
|
font_buffer = font_14;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_size = 14;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
}
|
1998-04-04 16:26:53 +00:00
|
|
|
|
|
1996-09-01 18:16:06 +00:00
|
|
|
|
xoffset = scp->mouse_xpos % 8;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
yoffset = scp->mouse_ypos % scp->font_size;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
|
|
|
|
|
/* prepare mousepointer char's bitmaps */
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
&scp->mouse_cursor[0], font_size);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer + ((*(scp->mouse_pos+1) & 0xff) * font_size),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
&scp->mouse_cursor[32], font_size);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize) & 0xff) * font_size),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
&scp->mouse_cursor[64], font_size);
|
1997-05-07 10:42:06 +00:00
|
|
|
|
bcopy(font_buffer + ((*(scp->mouse_pos+scp->xsize+1) & 0xff) * font_size),
|
1995-02-22 13:48:07 +00:00
|
|
|
|
&scp->mouse_cursor[96], font_size);
|
|
|
|
|
for (i=0; i<font_size; i++) {
|
|
|
|
|
buffer[i] = scp->mouse_cursor[i]<<8 | scp->mouse_cursor[i+32];
|
|
|
|
|
buffer[i+font_size]=scp->mouse_cursor[i+64]<<8|scp->mouse_cursor[i+96];
|
|
|
|
|
}
|
1996-09-01 18:16:06 +00:00
|
|
|
|
|
|
|
|
|
/* now and-or in the mousepointer image */
|
1995-02-22 13:48:07 +00:00
|
|
|
|
for (i=0; i<16; i++) {
|
|
|
|
|
buffer[i+yoffset] =
|
|
|
|
|
( buffer[i+yoffset] & ~(mouse_and_mask[i] >> xoffset))
|
|
|
|
|
| (mouse_or_mask[i] >> xoffset);
|
|
|
|
|
}
|
|
|
|
|
for (i=0; i<font_size; i++) {
|
|
|
|
|
scp->mouse_cursor[i] = (buffer[i] & 0xff00) >> 8;
|
|
|
|
|
scp->mouse_cursor[i+32] = buffer[i] & 0xff;
|
|
|
|
|
scp->mouse_cursor[i+64] = (buffer[i+font_size] & 0xff00) >> 8;
|
|
|
|
|
scp->mouse_cursor[i+96] = buffer[i+font_size] & 0xff;
|
|
|
|
|
}
|
1996-09-01 18:16:06 +00:00
|
|
|
|
|
|
|
|
|
scp->mouse_oldpos = scp->mouse_pos;
|
|
|
|
|
|
1997-01-19 17:34:14 +00:00
|
|
|
|
#if 1
|
1997-11-21 11:37:07 +00:00
|
|
|
|
/* wait for vertical retrace to avoid jitter on some videocards */
|
1999-01-11 03:18:56 +00:00
|
|
|
|
crtc_addr = scp->adp->va_crtc_addr;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
|
1997-01-19 17:34:14 +00:00
|
|
|
|
#endif
|
1998-09-15 18:16:39 +00:00
|
|
|
|
font_loading_in_progress = TRUE;
|
1999-01-11 03:18:56 +00:00
|
|
|
|
(*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor,
|
1998-09-15 18:16:39 +00:00
|
|
|
|
SC_MOUSE_CHAR, 4);
|
|
|
|
|
font_loading_in_progress = FALSE;
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writew(crt_pos, (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR);
|
|
|
|
|
writew(crt_pos+2*scp->xsize,
|
|
|
|
|
(*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2));
|
1996-06-21 07:19:18 +00:00
|
|
|
|
if (scp->mouse_xpos < (scp->xsize-1)*8) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writew(crt_pos + 2, (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1));
|
|
|
|
|
writew(crt_pos+2*scp->xsize + 2,
|
|
|
|
|
(*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3));
|
1996-06-21 07:19:18 +00:00
|
|
|
|
}
|
1996-10-02 22:00:38 +00:00
|
|
|
|
mark_for_update(scp, scp->mouse_pos - scp->scr_buf);
|
|
|
|
|
mark_for_update(scp, scp->mouse_pos + scp->xsize + 1 - scp->scr_buf);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
remove_mouse_image(scr_stat *scp)
|
|
|
|
|
{
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t crt_pos;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISTEXTSC(scp))
|
|
|
|
|
return;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
crt_pos = scp->adp->va_window + 2*(scp->mouse_oldpos - scp->scr_buf);
|
|
|
|
|
writew(crt_pos, *(scp->mouse_oldpos));
|
|
|
|
|
writew(crt_pos+2, *(scp->mouse_oldpos+1));
|
|
|
|
|
writew(crt_pos+2*scp->xsize, *(scp->mouse_oldpos+scp->xsize));
|
|
|
|
|
writew(crt_pos+2*scp->xsize+2, *(scp->mouse_oldpos+scp->xsize+1));
|
1996-10-02 22:00:38 +00:00
|
|
|
|
mark_for_update(scp, scp->mouse_oldpos - scp->scr_buf);
|
|
|
|
|
mark_for_update(scp, scp->mouse_oldpos + scp->xsize + 1 - scp->scr_buf);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
draw_cutmarking(scr_stat *scp)
|
|
|
|
|
{
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t crt_pos;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
u_short *ptr;
|
|
|
|
|
u_short och, nch;
|
|
|
|
|
|
1999-01-19 11:31:22 +00:00
|
|
|
|
crt_pos = scp->adp->va_window;
|
1996-09-01 18:16:06 +00:00
|
|
|
|
for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
nch = och = readw(crt_pos + 2*(ptr - scp->scr_buf));
|
1996-09-01 18:16:06 +00:00
|
|
|
|
/* are we outside the selected area ? */
|
|
|
|
|
if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
|
|
|
|
|
scp->mouse_cut_end : scp->mouse_cut_start) ||
|
- Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
MieMouse, Logitech MouseMan+, FirstMouse+
- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.
- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.
- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.
- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.
/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.
/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON. Use button bits
defined in `mouse.h' instead.
/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones. Most important
of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
While the output level remains zero, the output from the `psm' driver is
in the standard PS/2 mouse format (three bytes long). When the level
is set to one, the `psm' driver will send data in the extended format.
At the level two the driver uses the format which is native to the
connected mouse is used. (Meaning that the output from the device is
passed to the caller as is, unmodified.) The `psm' driver will pass
such extended data format as is to the caller if the output level is
two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
(PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
Acceleration ratio is now specified by the kernel configuration flags
stated above. Sync check logic is refined and now standard.
The sync check can be turned off by the new kernel configuration flags
PSM_CONFIG_NOCHECKSYNC (0x100). PSM_EMULATION has been of little use.
- Summer clean up :-) Removed unused code and obsolete comments.
/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
Most importantly, the MOUSE_SETLEVEL ioctl will change the
output format from the 5 byte format to the new, extended format
so that the caller can take advantage of Z axis movement and additional
buttons.
- Use constants defined in `mouse.h' rather than magic numbers.
/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
ioctls defined in `mouse.h'. Most importantly, the MOUSE_SETLEVEL
ioctl will change the `sysmouse' output format from the MouseSystems
5 byte format to the new, extended format so that the caller can
take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
single click action of the right button in the virtual console. The
left button double click will select a word under the mouse pointer.
The triple click will select a line and the single click of the right
button will extend the selected region to the current position of
the mouse pointer. This will make the cut/paste support more compatible
with xterm.
/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
|
|
|
|
ptr >= (scp->mouse_cut_start > scp->mouse_cut_end ?
|
1996-09-01 18:16:06 +00:00
|
|
|
|
scp->mouse_cut_start : scp->mouse_cut_end)) {
|
|
|
|
|
if (ptr != scp->cursor_pos)
|
|
|
|
|
nch = (och & 0xff) | (*ptr & 0xff00);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* are we clear of the cursor image ? */
|
|
|
|
|
if (ptr != scp->cursor_pos)
|
|
|
|
|
nch = (och & 0x88ff) | (*ptr & 0x7000)>>4 | (*ptr & 0x0700)<<4;
|
|
|
|
|
else {
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & CHAR_CURSOR)
|
1996-09-01 18:16:06 +00:00
|
|
|
|
nch = (och & 0x88ff)|(*ptr & 0x7000)>>4|(*ptr & 0x0700)<<4;
|
|
|
|
|
else
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (!(sc_flags & BLINK_CURSOR))
|
1996-09-01 18:16:06 +00:00
|
|
|
|
nch = (och & 0xff) | (*ptr & 0xff00);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (nch != och)
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writew(crt_pos + 2*(ptr - scp->scr_buf), nch);
|
1996-09-01 18:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
remove_cutmarking(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
|
|
|
|
|
scp->status &= ~MOUSE_CUTTING;
|
|
|
|
|
mark_all(scp);
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-01-12 11:47:05 +00:00
|
|
|
|
static void
|
|
|
|
|
do_bell(scr_stat *scp, int pitch, int duration)
|
1993-07-26 21:21:11 +00:00
|
|
|
|
{
|
1998-08-03 09:18:58 +00:00
|
|
|
|
if (cold || shutdown_in_progress)
|
1998-02-11 14:56:02 +00:00
|
|
|
|
return;
|
|
|
|
|
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (scp != cur_console && (sc_flags & QUIET_BELL))
|
1998-08-03 09:09:35 +00:00
|
|
|
|
return;
|
|
|
|
|
|
1998-09-29 02:00:57 +00:00
|
|
|
|
if (sc_flags & VISUAL_BELL) {
|
1996-02-05 14:08:39 +00:00
|
|
|
|
if (blink_in_progress)
|
|
|
|
|
return;
|
|
|
|
|
blink_in_progress = 4;
|
|
|
|
|
if (scp != cur_console)
|
|
|
|
|
blink_in_progress += 2;
|
|
|
|
|
blink_screen(cur_console);
|
|
|
|
|
} else {
|
|
|
|
|
if (scp != cur_console)
|
|
|
|
|
pitch *= 2;
|
|
|
|
|
sysbeep(pitch, duration);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1995-01-12 11:47:05 +00:00
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
|
1995-01-12 11:47:05 +00:00
|
|
|
|
static void
|
1997-04-20 16:05:33 +00:00
|
|
|
|
blink_screen(void *arg)
|
1995-01-12 11:47:05 +00:00
|
|
|
|
{
|
1997-04-20 16:05:33 +00:00
|
|
|
|
scr_stat *scp = arg;
|
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (!ISTEXTSC(scp) || (blink_in_progress <= 1)) {
|
1997-05-15 05:43:59 +00:00
|
|
|
|
blink_in_progress = FALSE;
|
|
|
|
|
mark_all(scp);
|
|
|
|
|
if (delayed_next_scr)
|
|
|
|
|
switch_scr(scp, delayed_next_scr - 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
1995-02-22 13:48:07 +00:00
|
|
|
|
if (blink_in_progress & 1)
|
1999-01-19 11:31:22 +00:00
|
|
|
|
fillw_io(kernel_default.std_color | scr_map[0x20],
|
|
|
|
|
scp->adp->va_window,
|
|
|
|
|
scp->xsize * scp->ysize);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
else
|
1999-01-19 11:31:22 +00:00
|
|
|
|
fillw_io(kernel_default.rev_color | scr_map[0x20],
|
|
|
|
|
scp->adp->va_window,
|
|
|
|
|
scp->xsize * scp->ysize);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
blink_in_progress--;
|
1997-04-20 16:05:33 +00:00
|
|
|
|
timeout(blink_screen, scp, hz / 10);
|
1995-02-22 13:48:07 +00:00
|
|
|
|
}
|
1993-07-26 21:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-02-12 22:05:08 +00:00
|
|
|
|
void
|
1998-08-03 11:30:45 +00:00
|
|
|
|
sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
|
1998-02-12 22:05:08 +00:00
|
|
|
|
{
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char *font;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
vm_offset_t d;
|
|
|
|
|
vm_offset_t e;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
u_char *f;
|
|
|
|
|
int font_size;
|
|
|
|
|
int line_length;
|
|
|
|
|
int xsize;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
u_short bg;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
int i, j;
|
1998-09-23 09:59:00 +00:00
|
|
|
|
u_char c;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if (ISTEXTSC(scp)) {
|
1999-01-19 11:31:22 +00:00
|
|
|
|
bcopy_toio(p + from, scp->adp->va_window + 2*from,
|
|
|
|
|
(to - from + 1)*sizeof(u_short));
|
1998-09-15 18:16:39 +00:00
|
|
|
|
} else /* if ISPIXELSC(scp) */ {
|
1998-02-13 11:31:34 +00:00
|
|
|
|
if (mark)
|
1998-09-15 18:16:39 +00:00
|
|
|
|
mark = 255;
|
|
|
|
|
font_size = scp->font_size;
|
|
|
|
|
if (font_size < 14)
|
|
|
|
|
font = font_8;
|
|
|
|
|
else if (font_size >= 16)
|
|
|
|
|
font = font_16;
|
|
|
|
|
else
|
|
|
|
|
font = font_14;
|
|
|
|
|
line_length = scp->xpixel/8;
|
|
|
|
|
xsize = scp->xsize;
|
1999-01-19 11:31:22 +00:00
|
|
|
|
d = scp->adp->va_window
|
1998-09-15 18:16:39 +00:00
|
|
|
|
+ scp->xoff + scp->yoff*font_size*line_length
|
|
|
|
|
+ (from%xsize) + font_size*line_length*(from/xsize);
|
1998-09-23 09:59:00 +00:00
|
|
|
|
|
|
|
|
|
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
|
|
|
|
|
outw(GDCIDX, 0x0003); /* data rotate/function select */
|
|
|
|
|
outw(GDCIDX, 0x0f01); /* set/reset enable */
|
|
|
|
|
bg = -1;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
for (i = from ; i <= to ; i++) {
|
1998-09-23 09:59:00 +00:00
|
|
|
|
/* set background color in EGA/VGA latch */
|
|
|
|
|
if (bg != (p[i] & 0xf000)) {
|
|
|
|
|
bg = (p[i] & 0xf000);
|
|
|
|
|
outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
|
|
|
|
|
outw(GDCIDX, 0xff08); /* bit mask */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writeb(d, 0);
|
|
|
|
|
c = readb(d); /* set the background color in the latch */
|
1998-09-23 09:59:00 +00:00
|
|
|
|
}
|
|
|
|
|
/* foreground color */
|
|
|
|
|
outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
e = d;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
f = &font[(p[i] & 0x00ff)*font_size];
|
|
|
|
|
for (j = 0 ; j < font_size; j++, f++) {
|
1998-09-23 09:59:00 +00:00
|
|
|
|
outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
|
1999-01-19 11:31:22 +00:00
|
|
|
|
writeb(e, 0);
|
1998-09-15 18:16:39 +00:00
|
|
|
|
e += line_length;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
}
|
1998-02-13 11:31:34 +00:00
|
|
|
|
d++;
|
1998-09-15 18:16:39 +00:00
|
|
|
|
if ((i % xsize) == xsize - 1)
|
|
|
|
|
d += scp->xoff*2 + (font_size - 1)*line_length;
|
1998-02-12 22:05:08 +00:00
|
|
|
|
}
|
1998-09-23 09:59:00 +00:00
|
|
|
|
outw(GDCIDX, 0x0000); /* set/reset */
|
|
|
|
|
outw(GDCIDX, 0x0001); /* set/reset enable */
|
|
|
|
|
outw(GDCIDX, 0xff08); /* bit mask */
|
|
|
|
|
|
|
|
|
|
#if 0 /* VGA only */
|
|
|
|
|
outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
|
|
|
|
|
outw(GDCIDX, 0x0003); /* data rotate/function select */
|
|
|
|
|
outw(GDCIDX, 0x0f01); /* set/reset enable */
|
|
|
|
|
outw(GDCIDX, 0xff08); /* bit mask */
|
|
|
|
|
bg = -1;
|
|
|
|
|
for (i = from ; i <= to ; i++) {
|
|
|
|
|
/* set background color in EGA/VGA latch */
|
|
|
|
|
if (bg != (p[i] & 0xf000)) {
|
|
|
|
|
bg = (p[i] & 0xf000);
|
|
|
|
|
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
|
|
|
|
|
outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
|
|
|
|
|
*d = 0;
|
|
|
|
|
c = *d; /* set the background color in the latch */
|
|
|
|
|
outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
|
|
|
|
|
}
|
|
|
|
|
/* foreground color */
|
|
|
|
|
outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
|
|
|
|
|
e = (u_char *)d;
|
|
|
|
|
f = &font[(p[i] & 0x00ff)*font_size];
|
|
|
|
|
for (j = 0 ; j < font_size; j++, f++) {
|
|
|
|
|
*e = *f^mark;
|
|
|
|
|
e += line_length;
|
|
|
|
|
}
|
|
|
|
|
d++;
|
|
|
|
|
if ((i % xsize) == xsize - 1)
|
|
|
|
|
d += scp->xoff*2 + (font_size - 1)*line_length;
|
|
|
|
|
}
|
|
|
|
|
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
|
|
|
|
|
outw(GDCIDX, 0x0000); /* set/reset */
|
|
|
|
|
outw(GDCIDX, 0x0001); /* set/reset enable */
|
|
|
|
|
#endif /* 0 */
|
1998-02-12 22:05:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1993-07-26 21:21:11 +00:00
|
|
|
|
#endif /* NSC */
|