1993-07-26 17:21:11 -04:00
|
|
|
/*-
|
2017-11-27 09:52:40 -05:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
*
|
2012-01-15 08:23:18 -05:00
|
|
|
* Copyright (c) 1992-1998 Søren Schmidt
|
1993-07-26 17:21:11 -04:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
Add VESA mode support for syscons, which enables the support of 15, 16,
24, and 32 bit modes. To use that, syscons(4) must be built with
the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a.
vesa.ko) must be either loaded, or be compiled into the kernel.
Do not return EINVAL when the mouse state is changed to what it already is,
which seems to cause problems when you have two mice attached, and
applications are not likely obtain useful information through the EINVAL
caused by showing the mouse pointer twice.
Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is
the video mode number from the vidcontrol -i mode output. Also, revert the
video mode if something fails.
Obtained from: DragonFlyBSD
Discussed at: current@ with patch attached [1]
PR: kern/71142 [2]
Submitted by: Xuefeng DENG <dsnofe at msn com> [1],
Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2]
2005-05-29 04:43:44 -04:00
|
|
|
* This code is derived from software contributed to The DragonFly Project
|
|
|
|
|
* by Sascha Wildner <saw@online.de>
|
|
|
|
|
*
|
1993-07-26 17:21:11 -04:00
|
|
|
* 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 14:16:39 -04:00
|
|
|
* notice, this list of conditions and the following disclaimer,
|
|
|
|
|
* without modification, immediately at the beginning of the file.
|
1993-07-26 17:21:11 -04: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 08:48:07 -05:00
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
1998-09-15 14:16:39 -04:00
|
|
|
* derived from this software without specific prior written permission.
|
1993-07-26 17:21:11 -04:00
|
|
|
*
|
1995-02-22 08:48:07 -05: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 17:21:11 -04:00
|
|
|
*/
|
|
|
|
|
|
2003-08-24 14:17:24 -04:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#include "opt_syscons.h"
|
2001-08-02 09:22:33 -04:00
|
|
|
#include "opt_splash.h"
|
1996-01-04 16:13:23 -05:00
|
|
|
#include "opt_ddb.h"
|
|
|
|
|
|
1994-08-12 23:50:34 -04:00
|
|
|
#include <sys/param.h>
|
1994-05-25 05:21:21 -04:00
|
|
|
#include <sys/systm.h>
|
2009-09-11 20:12:47 -04:00
|
|
|
#include <sys/bus.h>
|
1994-08-12 23:50:34 -04:00
|
|
|
#include <sys/conf.h>
|
2001-05-01 04:13:21 -04:00
|
|
|
#include <sys/cons.h>
|
|
|
|
|
#include <sys/consio.h>
|
2004-07-10 18:29:41 -04:00
|
|
|
#include <sys/kdb.h>
|
2001-05-01 04:13:21 -04:00
|
|
|
#include <sys/eventhandler.h>
|
|
|
|
|
#include <sys/fbio.h>
|
|
|
|
|
#include <sys/kbio.h>
|
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
|
#include <sys/lock.h>
|
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
|
#include <sys/mutex.h>
|
2017-03-04 01:19:12 -05:00
|
|
|
#include <sys/pcpu.h>
|
2006-11-06 08:42:10 -05:00
|
|
|
#include <sys/priv.h>
|
1994-08-12 23:50:34 -04:00
|
|
|
#include <sys/proc.h>
|
2001-05-01 04:13:21 -04:00
|
|
|
#include <sys/random.h>
|
|
|
|
|
#include <sys/reboot.h>
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
#include <sys/serial.h>
|
1995-12-06 18:52:35 -05:00
|
|
|
#include <sys/signalvar.h>
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
#include <sys/smp.h>
|
1999-12-09 23:30:58 -05:00
|
|
|
#include <sys/sysctl.h>
|
1994-08-12 23:50:34 -04:00
|
|
|
#include <sys/tty.h>
|
2001-11-01 11:34:07 -05:00
|
|
|
#include <sys/power.h>
|
1994-10-23 17:28:03 -04:00
|
|
|
|
1994-10-26 17:51:22 -04:00
|
|
|
#include <machine/clock.h>
|
2020-02-03 12:35:11 -05:00
|
|
|
#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
|
2003-08-23 20:44:00 -04:00
|
|
|
#include <machine/sc_machdep.h>
|
|
|
|
|
#else
|
1994-08-17 15:32:23 -04:00
|
|
|
#include <machine/pc/display.h>
|
2003-08-23 20:44:00 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
#if defined(__i386__) || defined(__amd64__)
|
2001-10-06 09:34:30 -04:00
|
|
|
#include <machine/psl.h>
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#include <machine/frame.h>
|
1999-01-19 06:31:22 -05:00
|
|
|
#endif
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
#include <machine/stdarg.h>
|
1994-10-23 17:28:03 -04:00
|
|
|
|
2017-08-25 06:57:17 -04:00
|
|
|
#if defined(__amd64__) || defined(__i386__)
|
|
|
|
|
#include <machine/vmparam.h>
|
|
|
|
|
|
|
|
|
|
#include <vm/vm.h>
|
|
|
|
|
#include <vm/pmap.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
#include <dev/kbd/kbdreg.h>
|
|
|
|
|
#include <dev/fb/fbreg.h>
|
|
|
|
|
#include <dev/fb/splashreg.h>
|
|
|
|
|
#include <dev/syscons/syscons.h>
|
|
|
|
|
|
1996-09-01 14:16:06 -04:00
|
|
|
#define COLD 0
|
|
|
|
|
#define WARM 1
|
1995-12-08 06:19:42 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
#define DEFAULT_BLANKTIME (5 * 60) /* 5 minutes */
|
|
|
|
|
#define MAX_BLANKTIME (7 * 24 * 60 * 60) /* 7 days!? */
|
1998-08-03 05:15:36 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
#define KEYCODE_BS 0x0e /* "<-- Backspace" key, XXX */
|
1998-01-19 22:37:27 -05:00
|
|
|
|
2012-03-29 11:47:29 -04:00
|
|
|
/* NULL-safe version of "tty_opened()" */
|
2019-12-02 21:30:52 -05:00
|
|
|
#define tty_opened_ns(tp) ((tp) != NULL && tty_opened(tp))
|
2012-03-29 11:47:29 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static u_char sc_kattrtab[MAXCPU];
|
2017-03-04 01:19:12 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static int sc_console_unit = -1;
|
|
|
|
|
static int sc_saver_keyb_only = 1;
|
|
|
|
|
static scr_stat *sc_console;
|
|
|
|
|
static struct consdev *sc_consptr;
|
|
|
|
|
static void *sc_kts[MAXCPU];
|
|
|
|
|
static struct sc_term_sw *sc_ktsw;
|
|
|
|
|
static scr_stat main_console;
|
|
|
|
|
static struct tty *main_devs[MAXCONS];
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static char init_done = COLD;
|
|
|
|
|
static int shutdown_in_progress = FALSE;
|
|
|
|
|
static int suspend_in_progress = FALSE;
|
|
|
|
|
static char sc_malloc = FALSE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static int saver_mode = CONS_NO_SAVER; /* LKM/user saver */
|
|
|
|
|
static int run_scrn_saver = FALSE; /* should run the saver? */
|
|
|
|
|
static int enable_bell = TRUE; /* enable beeper */
|
2006-01-14 12:57:17 -05:00
|
|
|
|
|
|
|
|
#ifndef SC_DISABLE_REBOOT
|
2019-12-02 21:30:52 -05:00
|
|
|
static int enable_reboot = TRUE; /* enable keyboard reboot */
|
2006-01-14 12:57:17 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SC_DISABLE_KDBKEY
|
2019-12-02 21:30:52 -05:00
|
|
|
static int enable_kdbkey = TRUE; /* enable keyboard debug */
|
2006-01-14 12:57:17 -05:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static long scrn_blank_time = 0; /* screen saver timeout value */
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
static int scrn_blanked; /* # of blanked screen */
|
|
|
|
|
static int sticky_splash = FALSE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static void
|
|
|
|
|
none_saver(sc_softc_t *sc, int blank)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
static void (*current_saver)(sc_softc_t *, int) = none_saver;
|
1999-07-01 16:43:03 -04:00
|
|
|
#endif
|
1997-07-25 07:53:30 -04:00
|
|
|
|
2011-05-09 14:46:49 -04:00
|
|
|
#ifdef SC_NO_SUSPEND_VTYSWITCH
|
2019-12-02 21:30:52 -05:00
|
|
|
static int sc_no_suspend_vtswitch = 1;
|
2011-05-09 14:46:49 -04:00
|
|
|
#else
|
2019-12-02 21:30:52 -05:00
|
|
|
static int sc_no_suspend_vtswitch = 0;
|
2011-05-09 14:46:49 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
static int sc_susp_scr;
|
2011-05-09 14:46:49 -04:00
|
|
|
|
2020-02-26 09:26:36 -05:00
|
|
|
static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
|
|
|
|
"syscons");
|
|
|
|
|
static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver,
|
|
|
|
|
CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
|
|
|
|
"saver");
|
2002-04-05 12:53:25 -05:00
|
|
|
SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW,
|
|
|
|
|
&sc_saver_keyb_only, 0, "screen saver interrupted by input only");
|
2019-12-02 21:30:52 -05:00
|
|
|
SYSCTL_INT(
|
|
|
|
|
_hw_syscons, OID_AUTO, bell, CTLFLAG_RW, &enable_bell, 0, "enable bell");
|
2006-01-14 12:57:17 -05:00
|
|
|
#ifndef SC_DISABLE_REBOOT
|
2019-12-02 21:30:52 -05:00
|
|
|
SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_reboot, CTLFLAG_RW | CTLFLAG_SECURE,
|
|
|
|
|
&enable_reboot, 0, "enable keyboard reboot");
|
2006-01-14 12:57:17 -05:00
|
|
|
#endif
|
|
|
|
|
#ifndef SC_DISABLE_KDBKEY
|
2019-12-02 21:30:52 -05:00
|
|
|
SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_debug, CTLFLAG_RW | CTLFLAG_SECURE,
|
|
|
|
|
&enable_kdbkey, 0, "enable keyboard debug");
|
2006-01-14 12:57:17 -05:00
|
|
|
#endif
|
2014-06-27 23:56:17 -04:00
|
|
|
SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RWTUN,
|
2011-05-09 14:46:49 -04:00
|
|
|
&sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend.");
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT)
|
|
|
|
|
#include "font.h"
|
1997-07-26 03:58:29 -04:00
|
|
|
#endif
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
tsw_ioctl_t *sc_user_ioctl;
|
1994-02-04 05:36:15 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static bios_values_t bios_value;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static int enable_panic_key;
|
1999-12-09 23:30:58 -05:00
|
|
|
SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key,
|
2019-12-02 21:30:52 -05:00
|
|
|
0, "Enable panic via keypress specified in kbdmap(5)");
|
1999-12-09 23:30:58 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
#define SC_CONSOLECTL 255
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2008-03-20 00:10:52 -04:00
|
|
|
#define VTY_WCHAN(sc, vty) (&SC_DEV(sc, vty))
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
1996-06-25 04:54:57 -04:00
|
|
|
/* prototypes */
|
2006-02-28 18:46:23 -05:00
|
|
|
static int sc_allocate_keyboard(sc_softc_t *sc, int unit);
|
1999-01-10 22:18:56 -05:00
|
|
|
static int scvidprobe(int unit, int flags, int cons);
|
|
|
|
|
static int sckbdprobe(int unit, int flags, int cons);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void scmeminit(void *arg);
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
static int scdevtounit(struct tty *tp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static kbd_callback_func_t sckbdevent;
|
|
|
|
|
static void scinit(int unit, int flags);
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
static scr_stat *sc_get_stat(struct tty *tp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void scterm(int unit, int flags);
|
2011-05-09 14:46:49 -04:00
|
|
|
static void scshutdown(void *, int);
|
|
|
|
|
static void scsuspend(void *);
|
|
|
|
|
static void scresume(void *);
|
2016-08-24 13:26:11 -04:00
|
|
|
static u_int scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp);
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
static void sc_puts(scr_stat *scp, u_char *buf, int len);
|
2019-12-02 21:30:52 -05:00
|
|
|
#define SCGETC_CN 1
|
|
|
|
|
#define SCGETC_NONBLOCK 2
|
1998-02-11 09:58:15 -05:00
|
|
|
static void sccnupdate(scr_stat *scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static scr_stat *alloc_scp(sc_softc_t *sc, int vty);
|
|
|
|
|
static void init_scp(sc_softc_t *sc, int vty, scr_stat *scp);
|
2019-12-10 17:06:53 -05:00
|
|
|
static callout_func_t scrn_timer;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static int and_region(int *s1, int *e1, int s2, int e2);
|
1998-02-11 09:58:15 -05:00
|
|
|
static void scrn_update(scr_stat *scp, int show_cursor);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static int scsplash_callback(int event, void *arg);
|
|
|
|
|
static void scsplash_saver(sc_softc_t *sc, int show);
|
|
|
|
|
static int add_scrn_saver(void (*this_saver)(sc_softc_t *, int));
|
|
|
|
|
static int remove_scrn_saver(void (*this_saver)(sc_softc_t *, int));
|
2019-12-02 21:30:52 -05:00
|
|
|
static int set_scrn_saver_mode(
|
|
|
|
|
scr_stat *scp, int mode, u_char *pal, int border);
|
1999-01-17 09:23:15 -05:00
|
|
|
static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void stop_scrn_saver(sc_softc_t *sc, void (*saver)(sc_softc_t *, int));
|
|
|
|
|
static int wait_scrn_saver_stop(sc_softc_t *sc);
|
2019-12-02 21:30:52 -05:00
|
|
|
#define scsplash_stick(stick) (sticky_splash = (stick))
|
2001-08-02 09:22:33 -04:00
|
|
|
#else /* !DEV_SPLASH */
|
1999-01-12 20:14:26 -05:00
|
|
|
#define scsplash_stick(stick)
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif /* DEV_SPLASH */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
static int do_switch_scr(sc_softc_t *sc, int s);
|
|
|
|
|
static int vt_proc_alive(scr_stat *scp);
|
|
|
|
|
static int signal_vt_rel(scr_stat *scp);
|
|
|
|
|
static int signal_vt_acq(scr_stat *scp);
|
2001-07-20 09:10:59 -04:00
|
|
|
static int finish_vt_rel(scr_stat *scp, int release, int *s);
|
|
|
|
|
static int finish_vt_acq(scr_stat *scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void exchange_scr(sc_softc_t *sc);
|
|
|
|
|
static void update_cursor_image(scr_stat *scp);
|
2001-08-02 04:30:40 -04:00
|
|
|
static void change_cursor_shape(scr_stat *scp, int flags, int base, int height);
|
2013-07-17 19:29:56 -04:00
|
|
|
static void update_font(scr_stat *);
|
1999-01-10 22:18:56 -05:00
|
|
|
static int save_kbd_state(scr_stat *scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static int update_kbd_state(scr_stat *scp, int state, int mask);
|
|
|
|
|
static int update_kbd_leds(scr_stat *scp, int which);
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
static int sc_kattr(void);
|
2019-12-10 17:06:53 -05:00
|
|
|
static callout_func_t blink_screen;
|
2009-05-15 10:30:37 -04:00
|
|
|
static struct tty *sc_alloc_tty(int, int);
|
1996-06-23 13:12:05 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static cn_probe_t sc_cnprobe;
|
|
|
|
|
static cn_init_t sc_cninit;
|
|
|
|
|
static cn_term_t sc_cnterm;
|
|
|
|
|
static cn_getc_t sc_cngetc;
|
|
|
|
|
static cn_putc_t sc_cnputc;
|
|
|
|
|
static cn_grab_t sc_cngrab;
|
|
|
|
|
static cn_ungrab_t sc_cnungrab;
|
1999-01-07 09:14:24 -05:00
|
|
|
|
2006-05-26 09:54:27 -04:00
|
|
|
CONSOLE_DRIVER(sc);
|
1999-01-19 06:31:22 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static tsw_open_t sctty_open;
|
|
|
|
|
static tsw_close_t sctty_close;
|
|
|
|
|
static tsw_outwakeup_t sctty_outwakeup;
|
|
|
|
|
static tsw_ioctl_t sctty_ioctl;
|
|
|
|
|
static tsw_mmap_t sctty_mmap;
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
|
|
|
|
|
static struct ttydevsw sc_ttydevsw = {
|
2019-12-02 21:30:52 -05:00
|
|
|
.tsw_open = sctty_open,
|
|
|
|
|
.tsw_close = sctty_close,
|
|
|
|
|
.tsw_outwakeup = sctty_outwakeup,
|
|
|
|
|
.tsw_ioctl = sctty_ioctl,
|
|
|
|
|
.tsw_mmap = sctty_mmap,
|
1998-08-23 04:26:42 -04:00
|
|
|
};
|
1995-09-10 17:36:12 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static d_ioctl_t consolectl_ioctl;
|
|
|
|
|
static d_close_t consolectl_close;
|
2009-05-15 10:30:37 -04:00
|
|
|
|
|
|
|
|
static struct cdevsw consolectl_devsw = {
|
2019-12-02 21:30:52 -05:00
|
|
|
.d_version = D_VERSION,
|
|
|
|
|
.d_flags = D_NEEDGIANT | D_TRACKCLOSE,
|
|
|
|
|
.d_ioctl = consolectl_ioctl,
|
|
|
|
|
.d_close = consolectl_close,
|
|
|
|
|
.d_name = "consolectl",
|
2009-05-15 10:30:37 -04:00
|
|
|
};
|
|
|
|
|
|
2017-03-04 03:47:31 -05:00
|
|
|
/* ec -- emergency console. */
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static u_int ec_scroffset;
|
2017-03-04 03:47:31 -05:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ec_putc(int c)
|
|
|
|
|
{
|
2017-03-16 03:40:33 -04:00
|
|
|
uintptr_t fb;
|
2017-03-04 03:47:31 -05:00
|
|
|
u_short *scrptr;
|
|
|
|
|
u_int ind;
|
|
|
|
|
int attr, column, mysize, width, xsize, yborder, ysize;
|
|
|
|
|
|
2017-03-16 03:40:33 -04:00
|
|
|
if (c < 0 || c > 0xff || c == '\a')
|
|
|
|
|
return;
|
|
|
|
|
if (sc_console == NULL) {
|
|
|
|
|
#if !defined(__amd64__) && !defined(__i386__)
|
2017-03-04 03:47:31 -05:00
|
|
|
return;
|
2017-08-25 06:57:17 -04:00
|
|
|
#else
|
2017-03-16 03:40:33 -04:00
|
|
|
/*
|
|
|
|
|
* This is enough for ec_putc() to work very early on x86
|
|
|
|
|
* if the kernel starts in normal color text mode.
|
|
|
|
|
*/
|
i386 4/4G split.
The change makes the user and kernel address spaces on i386
independent, giving each almost the full 4G of usable virtual addresses
except for one PDE at top used for trampoline and per-CPU trampoline
stacks, and system structures that must be always mapped, namely IDT,
GDT, common TSS and LDT, and process-private TSS and LDT if allocated.
By using 1:1 mapping for the kernel text and data, it appeared
possible to eliminate assembler part of the locore.S which bootstraps
initial page table and KPTmap. The code is rewritten in C and moved
into the pmap_cold(). The comment in vmparam.h explains the KVA
layout.
There is no PCID mechanism available in protected mode, so each
kernel/user switch forth and back completely flushes the TLB, except
for the trampoline PTD region. The TLB invalidations for userspace
becomes trivial, because IPI handlers switch page tables. On the other
hand, context switches no longer need to reload %cr3.
copyout(9) was rewritten to use vm_fault_quick_hold(). An issue for
new copyout(9) is compatibility with wiring user buffers around sysctl
handlers. This explains two kind of locks for copyout ptes and
accounting of the vslock() calls. The vm_fault_quick_hold() AKA slow
path, is only tried after the 'fast path' failed, which temporary
changes mapping to the userspace and copies the data to/from small
per-cpu buffer in the trampoline. If a page fault occurs during the
copy, it is short-circuit by exception.s to not even reach C code.
The change was motivated by the need to implement the Meltdown
mitigation, but instead of KPTI the full split is done. The i386
architecture already shows the sizing problems, in particular, it is
impossible to link clang and lld with debugging. I expect that the
issues due to the virtual address space limits would only exaggerate
and the split gives more liveness to the platform.
Tested by: pho
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D14633
2018-04-13 16:30:49 -04:00
|
|
|
#ifdef __amd64__
|
2017-08-25 06:57:17 -04:00
|
|
|
fb = KERNBASE + 0xb8000;
|
i386 4/4G split.
The change makes the user and kernel address spaces on i386
independent, giving each almost the full 4G of usable virtual addresses
except for one PDE at top used for trampoline and per-CPU trampoline
stacks, and system structures that must be always mapped, namely IDT,
GDT, common TSS and LDT, and process-private TSS and LDT if allocated.
By using 1:1 mapping for the kernel text and data, it appeared
possible to eliminate assembler part of the locore.S which bootstraps
initial page table and KPTmap. The code is rewritten in C and moved
into the pmap_cold(). The comment in vmparam.h explains the KVA
layout.
There is no PCID mechanism available in protected mode, so each
kernel/user switch forth and back completely flushes the TLB, except
for the trampoline PTD region. The TLB invalidations for userspace
becomes trivial, because IPI handlers switch page tables. On the other
hand, context switches no longer need to reload %cr3.
copyout(9) was rewritten to use vm_fault_quick_hold(). An issue for
new copyout(9) is compatibility with wiring user buffers around sysctl
handlers. This explains two kind of locks for copyout ptes and
accounting of the vslock() calls. The vm_fault_quick_hold() AKA slow
path, is only tried after the 'fast path' failed, which temporary
changes mapping to the userspace and copies the data to/from small
per-cpu buffer in the trampoline. If a page fault occurs during the
copy, it is short-circuit by exception.s to not even reach C code.
The change was motivated by the need to implement the Meltdown
mitigation, but instead of KPTI the full split is done. The i386
architecture already shows the sizing problems, in particular, it is
impossible to link clang and lld with debugging. I expect that the
issues due to the virtual address space limits would only exaggerate
and the split gives more liveness to the platform.
Tested by: pho
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D14633
2018-04-13 16:30:49 -04:00
|
|
|
#else /* __i386__ */
|
i386: Merge PAE and non-PAE pmaps into same kernel.
Effectively all i386 kernels now have two pmaps compiled in: one
managing PAE pagetables, and another non-PAE. The implementation is
selected at cold time depending on the CPU features. The vm_paddr_t is
always 64bit now. As result, nx bit can be used on all capable CPUs.
Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE
configs, for drivers compatibility. Kernel layout, esp. max kernel
address, low memory PDEs and max user address (same as trampoline
start) are now same for PAE and for non-PAE regardless of the type of
page tables used.
Non-PAE kernel (when using PAE pagetables) can handle physical memory
up to 24G now, larger memory requires re-tuning the KVA consumers and
instead the code caps the maximum at 24G. Unfortunately, a lot of
drivers do not use busdma(9) properly so by default even 4G barrier is
not easy. There are two tunables added: hw.above4g_allow and
hw.above24g_allow, the first one is kept enabled for now to evaluate
the status on HEAD, second is only for dev use.
i386 now creates three freelists if there is any memory above 4G, to
allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed
from 3 to 1.
The PAE_TABLES kernel config option is retired.
In collaboarion with: pho
Discussed with: emaste
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D18894
2019-01-29 21:07:13 -05:00
|
|
|
fb = pmap_get_map_low() + 0xb8000;
|
i386 4/4G split.
The change makes the user and kernel address spaces on i386
independent, giving each almost the full 4G of usable virtual addresses
except for one PDE at top used for trampoline and per-CPU trampoline
stacks, and system structures that must be always mapped, namely IDT,
GDT, common TSS and LDT, and process-private TSS and LDT if allocated.
By using 1:1 mapping for the kernel text and data, it appeared
possible to eliminate assembler part of the locore.S which bootstraps
initial page table and KPTmap. The code is rewritten in C and moved
into the pmap_cold(). The comment in vmparam.h explains the KVA
layout.
There is no PCID mechanism available in protected mode, so each
kernel/user switch forth and back completely flushes the TLB, except
for the trampoline PTD region. The TLB invalidations for userspace
becomes trivial, because IPI handlers switch page tables. On the other
hand, context switches no longer need to reload %cr3.
copyout(9) was rewritten to use vm_fault_quick_hold(). An issue for
new copyout(9) is compatibility with wiring user buffers around sysctl
handlers. This explains two kind of locks for copyout ptes and
accounting of the vslock() calls. The vm_fault_quick_hold() AKA slow
path, is only tried after the 'fast path' failed, which temporary
changes mapping to the userspace and copies the data to/from small
per-cpu buffer in the trampoline. If a page fault occurs during the
copy, it is short-circuit by exception.s to not even reach C code.
The change was motivated by the need to implement the Meltdown
mitigation, but instead of KPTI the full split is done. The i386
architecture already shows the sizing problems, in particular, it is
impossible to link clang and lld with debugging. I expect that the
issues due to the virtual address space limits would only exaggerate
and the split gives more liveness to the platform.
Tested by: pho
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D14633
2018-04-13 16:30:49 -04:00
|
|
|
#endif
|
2017-03-16 03:40:33 -04:00
|
|
|
xsize = 80;
|
|
|
|
|
ysize = 25;
|
2017-08-25 06:57:17 -04:00
|
|
|
#endif
|
2017-03-16 03:40:33 -04:00
|
|
|
} else {
|
2017-08-25 06:57:17 -04:00
|
|
|
if (!ISTEXTSC(&main_console))
|
2017-03-16 03:40:33 -04:00
|
|
|
return;
|
|
|
|
|
fb = main_console.sc->adp->va_window;
|
|
|
|
|
xsize = main_console.xsize;
|
|
|
|
|
ysize = main_console.ysize;
|
|
|
|
|
}
|
2017-03-04 03:47:31 -05:00
|
|
|
yborder = ysize / 5;
|
2017-03-16 03:40:33 -04:00
|
|
|
scrptr = (u_short *)(void *)fb + xsize * yborder;
|
2017-03-04 03:47:31 -05:00
|
|
|
mysize = xsize * (ysize - 2 * yborder);
|
|
|
|
|
do {
|
|
|
|
|
ind = ec_scroffset;
|
|
|
|
|
column = ind % xsize;
|
2019-12-02 21:30:52 -05:00
|
|
|
width = (c == '\b' ?
|
|
|
|
|
-1 :
|
|
|
|
|
c == '\t' ?
|
|
|
|
|
(column + 8) & ~7 :
|
|
|
|
|
c == '\r' ? -column : c == '\n' ? xsize - column : 1);
|
2017-03-04 03:47:31 -05:00
|
|
|
if (width == 0 || (width < 0 && ind < -width))
|
|
|
|
|
return;
|
|
|
|
|
} while (atomic_cmpset_rel_int(&ec_scroffset, ind, ind + width) == 0);
|
|
|
|
|
if (c == '\b' || c == '\r')
|
|
|
|
|
return;
|
|
|
|
|
if (c == '\n')
|
2019-12-02 21:30:52 -05:00
|
|
|
ind += xsize; /* XXX clearing from new pos is not atomic */
|
2017-03-04 03:47:31 -05:00
|
|
|
|
|
|
|
|
attr = sc_kattr();
|
|
|
|
|
if (c == '\t' || c == '\n')
|
|
|
|
|
c = ' ';
|
|
|
|
|
do
|
|
|
|
|
scrptr[ind++ % mysize] = (attr << 8) | c;
|
|
|
|
|
while (--width != 0);
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 06:31:22 -05:00
|
|
|
int
|
|
|
|
|
sc_probe_unit(int unit, int flags)
|
1997-06-22 08:04:36 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!vty_enabled(VTY_SC))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
if (!scvidprobe(unit, flags, FALSE)) {
|
|
|
|
|
if (bootverbose)
|
|
|
|
|
printf("%s%d: no video adapter found.\n",
|
|
|
|
|
SC_DRIVER_NAME, unit);
|
|
|
|
|
return ENXIO;
|
|
|
|
|
}
|
1998-09-23 05:59:00 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* syscons will be attached even when there is no keyboard */
|
|
|
|
|
sckbdprobe(unit, flags, FALSE);
|
1999-07-18 02:16:53 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1997-06-22 08:04:36 -04:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* probe video adapters, return TRUE if found */
|
1997-06-22 08:04:36 -04:00
|
|
|
static int
|
1999-01-10 22:18:56 -05:00
|
|
|
scvidprobe(int unit, int flags, int cons)
|
1997-06-22 08:04:36 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05: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 08:04:36 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return (vid_find_adapter("*", unit) >= 0);
|
1997-06-22 08:04:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* probe the keyboard, return TRUE if found */
|
|
|
|
|
static int
|
1999-01-10 22:18:56 -05:00
|
|
|
sckbdprobe(int unit, int flags, int cons)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/* access the keyboard driver through the backdoor! */
|
|
|
|
|
kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return (kbd_find_keyboard("*", unit) >= 0);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static char *
|
|
|
|
|
adapter_name(video_adapter_t *adp)
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
static struct {
|
|
|
|
|
int type;
|
|
|
|
|
char *name[2];
|
|
|
|
|
} names[] = {
|
|
|
|
|
{ KD_MONO, { "MDA", "MDA" } },
|
|
|
|
|
{ KD_HERCULES, { "Hercules", "Hercules" } },
|
|
|
|
|
{ KD_CGA, { "CGA", "CGA" } },
|
|
|
|
|
{ KD_EGA, { "EGA", "EGA (mono)" } },
|
|
|
|
|
{ KD_VGA, { "VGA", "VGA (mono)" } },
|
|
|
|
|
{ KD_TGA, { "TGA", "TGA" } },
|
|
|
|
|
{ -1, { "Unknown", "Unknown" } },
|
|
|
|
|
};
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; names[i].type != -1; ++i)
|
|
|
|
|
if (names[i].type == adp->va_type)
|
|
|
|
|
break;
|
|
|
|
|
return names[i].name[(adp->va_flags & V_ADP_COLOR) ? 0 : 1];
|
1996-10-02 20:42:27 -04:00
|
|
|
}
|
|
|
|
|
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
static void
|
|
|
|
|
sctty_outwakeup(struct tty *tp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
size_t len;
|
|
|
|
|
u_char buf[PCBURST];
|
|
|
|
|
scr_stat *scp = sc_get_stat(tp);
|
|
|
|
|
|
|
|
|
|
if (scp->status & SLKED ||
|
|
|
|
|
(scp == scp->sc->cur_scp && scp->sc->blink_in_progress))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
len = ttydisc_getc(tp, buf, sizeof buf);
|
|
|
|
|
if (len == 0)
|
|
|
|
|
break;
|
|
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
|
|
|
|
sc_puts(scp, buf, len);
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
|
|
|
|
}
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
}
|
|
|
|
|
|
2004-10-18 17:51:27 -04:00
|
|
|
static struct tty *
|
2009-05-15 10:30:37 -04:00
|
|
|
sc_alloc_tty(int index, int devnum)
|
2004-10-18 17:51:27 -04:00
|
|
|
{
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
struct sc_ttysoftc *stc;
|
2004-10-18 17:51:27 -04:00
|
|
|
struct tty *tp;
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
|
|
|
|
|
/* Allocate TTY object and softc to store unit number. */
|
|
|
|
|
stc = malloc(sizeof(struct sc_ttysoftc), M_DEVBUF, M_WAITOK);
|
|
|
|
|
stc->st_index = index;
|
|
|
|
|
stc->st_stat = NULL;
|
2009-05-29 02:41:23 -04:00
|
|
|
tp = tty_alloc_mutex(&sc_ttydevsw, stc, &Giant);
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
|
|
|
|
|
/* Create device node. */
|
2009-05-15 10:30:37 -04:00
|
|
|
tty_makedev(tp, NULL, "v%r", devnum);
|
2004-10-18 17:51:27 -04:00
|
|
|
|
|
|
|
|
return (tp);
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-23 14:53:21 -04:00
|
|
|
#ifdef SC_PIXEL_MODE
|
2010-02-24 15:13:34 -05:00
|
|
|
static void
|
|
|
|
|
sc_set_vesa_mode(scr_stat *scp, sc_softc_t *sc, int unit)
|
2009-10-23 14:53:21 -04:00
|
|
|
{
|
|
|
|
|
video_info_t info;
|
2010-11-29 17:19:19 -05:00
|
|
|
u_char *font;
|
2010-02-24 15:13:34 -05:00
|
|
|
int depth;
|
2010-11-30 12:34:15 -05:00
|
|
|
int fontsize;
|
2009-10-23 14:53:21 -04:00
|
|
|
int i;
|
2010-02-24 15:13:34 -05:00
|
|
|
int vmode;
|
2009-10-23 14:53:21 -04:00
|
|
|
|
|
|
|
|
vmode = 0;
|
|
|
|
|
(void)resource_int_value("sc", unit, "vesa_mode", &vmode);
|
2010-02-24 15:13:34 -05:00
|
|
|
if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX ||
|
|
|
|
|
vidd_get_info(sc->adp, vmode, &info) != 0 ||
|
|
|
|
|
!sc_support_pixel_mode(&info))
|
|
|
|
|
vmode = 0;
|
2009-10-23 14:53:21 -04:00
|
|
|
|
|
|
|
|
/*
|
2010-02-24 15:13:34 -05:00
|
|
|
* If the mode is unset or unsupported, search for an available
|
2009-10-23 14:53:21 -04:00
|
|
|
* 800x600 graphics mode with the highest color depth.
|
|
|
|
|
*/
|
2010-02-24 15:13:34 -05:00
|
|
|
if (vmode == 0) {
|
|
|
|
|
for (depth = 0, i = M_VESA_BASE; i <= M_VESA_MODE_MAX; i++)
|
|
|
|
|
if (vidd_get_info(sc->adp, i, &info) == 0 &&
|
|
|
|
|
info.vi_width == 800 && info.vi_height == 600 &&
|
|
|
|
|
sc_support_pixel_mode(&info) &&
|
|
|
|
|
info.vi_depth > depth) {
|
|
|
|
|
vmode = i;
|
|
|
|
|
depth = info.vi_depth;
|
|
|
|
|
}
|
|
|
|
|
if (vmode == 0)
|
|
|
|
|
return;
|
|
|
|
|
vidd_get_info(sc->adp, vmode, &info);
|
2009-10-23 14:53:21 -04:00
|
|
|
}
|
|
|
|
|
|
2010-11-29 17:19:19 -05:00
|
|
|
#if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT)
|
2010-11-30 12:34:15 -05:00
|
|
|
fontsize = info.vi_cheight;
|
2010-11-29 17:19:19 -05:00
|
|
|
#else
|
2010-11-30 12:34:15 -05:00
|
|
|
fontsize = scp->font_size;
|
2010-11-29 17:19:19 -05:00
|
|
|
#endif
|
2010-11-30 12:34:15 -05:00
|
|
|
if (fontsize < 14)
|
|
|
|
|
fontsize = 8;
|
|
|
|
|
else if (fontsize >= 16)
|
|
|
|
|
fontsize = 16;
|
2010-11-29 17:19:19 -05:00
|
|
|
else
|
2010-11-30 12:34:15 -05:00
|
|
|
fontsize = 14;
|
2010-02-24 15:13:34 -05:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2010-11-30 12:34:15 -05:00
|
|
|
switch (fontsize) {
|
2010-11-29 17:19:19 -05:00
|
|
|
case 8:
|
|
|
|
|
if ((sc->fonts_loaded & FONT_8) == 0)
|
|
|
|
|
return;
|
|
|
|
|
font = sc->font_8;
|
|
|
|
|
break;
|
|
|
|
|
case 14:
|
|
|
|
|
if ((sc->fonts_loaded & FONT_14) == 0)
|
|
|
|
|
return;
|
|
|
|
|
font = sc->font_14;
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
if ((sc->fonts_loaded & FONT_16) == 0)
|
|
|
|
|
return;
|
|
|
|
|
font = sc->font_16;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
font = NULL;
|
2010-02-24 15:13:34 -05:00
|
|
|
#endif
|
|
|
|
|
#ifdef DEV_SPLASH
|
|
|
|
|
if ((sc->flags & SC_SPLASH_SCRN) != 0)
|
|
|
|
|
splash_term(sc->adp);
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SC_NO_HISTORY
|
|
|
|
|
if (scp->history != NULL) {
|
|
|
|
|
sc_vtb_append(&scp->vtb, 0, scp->history,
|
|
|
|
|
scp->ypos * scp->xsize + scp->xpos);
|
|
|
|
|
scp->history_pos = sc_vtb_tail(scp->history);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
vidd_set_mode(sc->adp, vmode);
|
|
|
|
|
scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN);
|
|
|
|
|
scp->status &= ~(GRAPHICS_MODE | MOUSE_VISIBLE);
|
|
|
|
|
scp->xpixel = info.vi_width;
|
|
|
|
|
scp->ypixel = info.vi_height;
|
|
|
|
|
scp->xsize = scp->xpixel / 8;
|
2010-11-30 12:34:15 -05:00
|
|
|
scp->ysize = scp->ypixel / fontsize;
|
2010-02-24 15:13:34 -05:00
|
|
|
scp->xpos = 0;
|
|
|
|
|
scp->ypos = scp->ysize - 1;
|
|
|
|
|
scp->xoff = scp->yoff = 0;
|
2010-11-29 17:19:19 -05:00
|
|
|
scp->font = font;
|
2010-11-30 12:34:15 -05:00
|
|
|
scp->font_size = fontsize;
|
2010-02-24 15:13:34 -05:00
|
|
|
scp->font_width = 8;
|
|
|
|
|
scp->start = scp->xsize * scp->ysize - 1;
|
|
|
|
|
scp->end = 0;
|
|
|
|
|
scp->cursor_pos = scp->cursor_oldpos = scp->xsize * scp->xsize;
|
|
|
|
|
scp->mode = sc->initial_mode = vmode;
|
|
|
|
|
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
|
|
|
|
|
(void *)sc->adp->va_window, FALSE);
|
|
|
|
|
sc_alloc_scr_buffer(scp, FALSE, FALSE);
|
|
|
|
|
sc_init_emulator(scp, NULL);
|
|
|
|
|
#ifndef SC_NO_CUTPASTE
|
|
|
|
|
sc_alloc_cut_buffer(scp, FALSE);
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SC_NO_HISTORY
|
|
|
|
|
sc_alloc_history_buffer(scp, 0, 0, FALSE);
|
|
|
|
|
#endif
|
|
|
|
|
sc_set_border(scp, scp->border);
|
|
|
|
|
sc_set_cursor_image(scp);
|
|
|
|
|
scp->status &= ~UNKNOWN_MODE;
|
|
|
|
|
#ifdef DEV_SPLASH
|
|
|
|
|
if ((sc->flags & SC_SPLASH_SCRN) != 0)
|
|
|
|
|
splash_init(sc->adp, scsplash_callback, sc);
|
|
|
|
|
#endif
|
2009-10-23 14:53:21 -04:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-01-19 06:31:22 -05:00
|
|
|
int
|
|
|
|
|
sc_attach_unit(int unit, int flags)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
struct cdev *dev;
|
|
|
|
|
void *oldts, *ts;
|
|
|
|
|
int i, vc;
|
1995-01-28 17:18:05 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!vty_enabled(VTY_SC))
|
|
|
|
|
return ENXIO;
|
2014-06-27 13:50:33 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
flags &= ~SC_KERNEL_CONSOLE;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_console_unit == unit) {
|
|
|
|
|
/*
|
|
|
|
|
* If this unit is being used as the system console, we need to
|
|
|
|
|
* adjust some variables and buffers before and after scinit().
|
|
|
|
|
*/
|
|
|
|
|
/* assert(sc_console != NULL) */
|
|
|
|
|
flags |= SC_KERNEL_CONSOLE;
|
|
|
|
|
scmeminit(NULL);
|
|
|
|
|
|
|
|
|
|
scinit(unit, flags);
|
|
|
|
|
|
|
|
|
|
if (sc_console->tsw->te_size > 0) {
|
|
|
|
|
sc_ktsw = sc_console->tsw;
|
|
|
|
|
/* assert(sc_console->ts != NULL); */
|
|
|
|
|
oldts = sc_console->ts;
|
|
|
|
|
for (i = 0; i <= mp_maxid; i++) {
|
|
|
|
|
ts = malloc(sc_console->tsw->te_size, M_DEVBUF,
|
|
|
|
|
M_WAITOK | M_ZERO);
|
|
|
|
|
(*sc_console->tsw->te_init)(
|
|
|
|
|
sc_console, &ts, SC_TE_COLD_INIT);
|
|
|
|
|
sc_console->ts = ts;
|
|
|
|
|
(*sc_console->tsw->te_default_attr)(sc_console,
|
|
|
|
|
sc_kattrtab[i], SC_KERNEL_CONS_REV_ATTR);
|
|
|
|
|
sc_kts[i] = ts;
|
|
|
|
|
}
|
|
|
|
|
sc_console->ts = oldts;
|
|
|
|
|
(*sc_console->tsw->te_default_attr)(
|
|
|
|
|
sc_console, SC_NORM_ATTR, SC_NORM_REV_ATTR);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
scinit(unit, flags);
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE);
|
|
|
|
|
sc->config = flags;
|
|
|
|
|
callout_init(&sc->ctimeout, 0);
|
|
|
|
|
callout_init(&sc->cblink, 0);
|
|
|
|
|
scp = sc_get_stat(sc->dev[0]);
|
|
|
|
|
if (sc_console == NULL) /* sc_console_unit < 0 */
|
|
|
|
|
sc_console = scp;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifdef SC_PIXEL_MODE
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((sc->config & SC_VESAMODE) != 0)
|
|
|
|
|
sc_set_vesa_mode(scp, sc, unit);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* SC_PIXEL_MODE */
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* initialize cursor */
|
|
|
|
|
if (!ISGRAPHSC(scp))
|
|
|
|
|
update_cursor_image(scp);
|
1995-02-03 16:09:44 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* get screen update going */
|
|
|
|
|
scrn_timer(sc);
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* set up the keyboard */
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
|
|
|
|
|
update_kbd_state(scp, scp->status, LOCK_MASK);
|
|
|
|
|
|
|
|
|
|
printf("%s%d: %s <%d virtual consoles, flags=0x%x>\n", SC_DRIVER_NAME,
|
|
|
|
|
unit, adapter_name(sc->adp), sc->vtys, sc->config);
|
|
|
|
|
if (bootverbose) {
|
|
|
|
|
printf("%s%d:", SC_DRIVER_NAME, unit);
|
|
|
|
|
if (sc->adapter >= 0)
|
|
|
|
|
printf(" fb%d", sc->adapter);
|
2019-12-23 16:32:07 -05:00
|
|
|
if (sc->kbd != NULL)
|
|
|
|
|
printf(", kbd%d", sc->kbd->kb_index);
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->tsw)
|
|
|
|
|
printf(", terminal emulator: %s (%s)",
|
|
|
|
|
scp->tsw->te_name, scp->tsw->te_desc);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
1995-09-10 17:36:12 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Register suspend/resume/shutdown callbacks for the kernel console. */
|
|
|
|
|
if (sc_console_unit == unit) {
|
|
|
|
|
EVENTHANDLER_REGISTER(
|
|
|
|
|
power_suspend_early, scsuspend, NULL, EVENTHANDLER_PRI_ANY);
|
|
|
|
|
EVENTHANDLER_REGISTER(
|
|
|
|
|
power_resume, scresume, NULL, EVENTHANDLER_PRI_ANY);
|
|
|
|
|
EVENTHANDLER_REGISTER(
|
|
|
|
|
shutdown_pre_sync, scshutdown, NULL, SHUTDOWN_PRI_DEFAULT);
|
|
|
|
|
}
|
1998-08-03 05:18:58 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
for (vc = 0; vc < sc->vtys; vc++) {
|
|
|
|
|
if (sc->dev[vc] == NULL) {
|
|
|
|
|
sc->dev[vc] = sc_alloc_tty(vc, vc + unit * MAXCONS);
|
|
|
|
|
if (vc == 0 && sc->dev == main_devs)
|
|
|
|
|
SC_STAT(sc->dev[0]) = &main_console;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* The first vty already has struct tty and scr_stat initialized
|
|
|
|
|
* in scinit(). The other vtys will have these structs when
|
|
|
|
|
* first opened.
|
|
|
|
|
*/
|
2004-02-14 12:56:59 -05:00
|
|
|
}
|
1999-09-19 04:58:53 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
dev = make_dev(
|
|
|
|
|
&consolectl_devsw, 0, UID_ROOT, GID_WHEEL, 0600, "consolectl");
|
|
|
|
|
dev->si_drv1 = sc->dev[0];
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scmeminit(void *arg)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!vty_enabled(VTY_SC))
|
|
|
|
|
return;
|
|
|
|
|
if (sc_malloc)
|
|
|
|
|
return;
|
|
|
|
|
sc_malloc = TRUE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* As soon as malloc() becomes functional, we had better allocate
|
|
|
|
|
* various buffers for the kernel console.
|
|
|
|
|
*/
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_console_unit < 0) /* sc_console == NULL */
|
|
|
|
|
return;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* copy the temporary buffer to the final buffer */
|
|
|
|
|
sc_alloc_scr_buffer(sc_console, FALSE, FALSE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifndef SC_NO_CUTPASTE
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_alloc_cut_buffer(sc_console, FALSE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
/* initialize history buffer & pointers */
|
|
|
|
|
sc_alloc_history_buffer(sc_console, 0, 0, FALSE);
|
1996-03-27 14:11:41 -05:00
|
|
|
#endif
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* XXX */
|
|
|
|
|
SYSINIT(sc_mem, SI_SUB_KMEM, SI_ORDER_ANY, scmeminit, NULL);
|
|
|
|
|
|
|
|
|
|
static int
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
scdevtounit(struct tty *tp)
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int vty = SC_VTY(tp);
|
|
|
|
|
|
|
|
|
|
if (vty == SC_CONSOLECTL)
|
|
|
|
|
return ((sc_console != NULL) ? sc_console->sc->unit : -1);
|
|
|
|
|
else if ((vty < 0) || (vty >= MAXCONS * sc_max_unit()))
|
|
|
|
|
return -1;
|
|
|
|
|
else
|
|
|
|
|
return vty / MAXCONS;
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2002-09-28 13:15:38 -04:00
|
|
|
static int
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
sctty_open(struct tty *tp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int unit = scdevtounit(tp);
|
|
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
keyarg_t key;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
DPRINTF(5,
|
|
|
|
|
("scopen: dev:%s, unit:%d, vty:%d\n", devtoname(tp->t_dev), unit,
|
|
|
|
|
SC_VTY(tp)));
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = sc_get_softc(
|
|
|
|
|
unit, (sc_console_unit == unit) ? SC_KERNEL_CONSOLE : 0);
|
|
|
|
|
if (sc == NULL)
|
|
|
|
|
return ENXIO;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!tty_opened(tp)) {
|
|
|
|
|
/* Use the current setting of the <-- key as default VERASE. */
|
|
|
|
|
/* If the Delete key is preferable, an stty is necessary */
|
|
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
key.keynum = KEYCODE_BS;
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key);
|
|
|
|
|
tp->t_termios.c_cc[VERASE] = key.key.map[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-06-29 13:30:33 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp = sc_get_stat(tp);
|
|
|
|
|
if (scp == NULL) {
|
|
|
|
|
scp = SC_STAT(tp) = alloc_scp(sc, SC_VTY(tp));
|
|
|
|
|
if (ISGRAPHSC(scp))
|
|
|
|
|
sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8);
|
|
|
|
|
}
|
|
|
|
|
if (!tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
|
|
|
|
|
tp->t_winsize.ws_col = scp->xsize;
|
|
|
|
|
tp->t_winsize.ws_row = scp->ysize;
|
|
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return (0);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
static void
|
|
|
|
|
sctty_close(struct tty *tp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp;
|
|
|
|
|
int s;
|
|
|
|
|
|
|
|
|
|
if (SC_VTY(tp) != SC_CONSOLECTL) {
|
|
|
|
|
scp = sc_get_stat(tp);
|
|
|
|
|
/* were we in the middle of the VT switching process? */
|
|
|
|
|
DPRINTF(5, ("sc%d: scclose(), ", scp->sc->unit));
|
|
|
|
|
s = spltty();
|
|
|
|
|
if ((scp == scp->sc->cur_scp) &&
|
|
|
|
|
(scp->sc->unit == sc_console_unit))
|
|
|
|
|
cnavailable(sc_consptr, TRUE);
|
|
|
|
|
if (finish_vt_rel(scp, TRUE, &s) == 0) /* force release */
|
|
|
|
|
DPRINTF(5, ("reset WAIT_REL, "));
|
|
|
|
|
if (finish_vt_acq(scp) == 0) /* force acknowledge */
|
|
|
|
|
DPRINTF(5, ("reset WAIT_ACQ, "));
|
2005-12-03 21:12:43 -05:00
|
|
|
#ifdef not_yet_done
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp == &main_console) {
|
|
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
} else {
|
|
|
|
|
sc_vtb_destroy(&scp->vtb);
|
|
|
|
|
sc_vtb_destroy(&scp->scr);
|
|
|
|
|
sc_free_history_buffer(scp, scp->ysize);
|
|
|
|
|
SC_STAT(tp) = NULL;
|
|
|
|
|
free(scp, M_DEVBUF);
|
|
|
|
|
}
|
1995-01-28 17:18:05 -05:00
|
|
|
#else
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
1995-01-20 03:35:32 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->kbd_mode = K_XLATE;
|
|
|
|
|
if (scp == scp->sc->cur_scp)
|
|
|
|
|
(void)kbdd_ioctl(
|
|
|
|
|
scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
|
|
|
|
|
DPRINTF(5, ("done.\n"));
|
|
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
#if 0 /* XXX mpsafetty: fix screensaver. What about outwakeup? */
|
2002-09-28 13:15:38 -04:00
|
|
|
static int
|
2004-06-16 05:47:26 -04:00
|
|
|
scread(struct cdev *dev, struct uio *uio, int flag)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2002-05-04 11:42:38 -04:00
|
|
|
if (!sc_saver_keyb_only)
|
|
|
|
|
sc_touch_scrn_saver();
|
2000-01-15 10:25:43 -05:00
|
|
|
return ttyread(dev, uio, flag);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
#endif
|
1993-07-26 17:21:11 -04:00
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
|
|
|
|
sckbdevent(keyboard_t *thiskbd, int event, void *arg)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
struct tty *cur_tty;
|
|
|
|
|
int c, error = 0;
|
|
|
|
|
size_t len;
|
|
|
|
|
const u_char *cp;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = (sc_softc_t *)arg;
|
|
|
|
|
/* assert(thiskbd == sc->kbd) */
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
mtx_lock(&Giant);
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
switch (event) {
|
|
|
|
|
case KBDIO_KEYINPUT:
|
2009-11-11 03:20:19 -05:00
|
|
|
break;
|
2019-12-02 21:30:52 -05:00
|
|
|
case KBDIO_UNLOADING:
|
|
|
|
|
sc->kbd = NULL;
|
2019-12-23 16:32:07 -05:00
|
|
|
kbd_release(thiskbd, (void *)&sc->kbd);
|
2019-12-02 21:30:52 -05:00
|
|
|
goto done;
|
|
|
|
|
default:
|
|
|
|
|
error = EINVAL;
|
|
|
|
|
goto done;
|
1995-02-22 08:48:07 -05:00
|
|
|
}
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
|
2019-12-02 21:30:52 -05: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
|
|
|
|
|
*/
|
|
|
|
|
while ((c = scgetc(sc, SCGETC_NONBLOCK, NULL)) != NOKEY) {
|
|
|
|
|
cur_tty = SC_DEV(sc, sc->cur_scp->index);
|
|
|
|
|
if (!tty_opened_ns(cur_tty))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if ((*sc->cur_scp->tsw->te_input)(sc->cur_scp, c, cur_tty))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
switch (KEYFLAGS(c)) {
|
|
|
|
|
case 0x0000: /* normal key */
|
|
|
|
|
ttydisc_rint(cur_tty, KEYCHAR(c), 0);
|
|
|
|
|
break;
|
|
|
|
|
case FKEY: /* function key, return string */
|
|
|
|
|
cp = (*sc->cur_scp->tsw->te_fkeystr)(sc->cur_scp, c);
|
|
|
|
|
if (cp != NULL) {
|
|
|
|
|
ttydisc_rint_simple(cur_tty, cp, strlen(cp));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
cp = kbdd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
|
|
|
|
|
if (cp != NULL)
|
|
|
|
|
ttydisc_rint_simple(cur_tty, cp, len);
|
|
|
|
|
break;
|
|
|
|
|
case MKEY: /* meta is active, prepend ESC */
|
|
|
|
|
ttydisc_rint(cur_tty, 0x1b, 0);
|
|
|
|
|
ttydisc_rint(cur_tty, KEYCHAR(c), 0);
|
|
|
|
|
break;
|
|
|
|
|
case BKEY: /* backtab fixed sequence (esc [ Z) */
|
|
|
|
|
ttydisc_rint_simple(cur_tty, "\x1B[Z", 3);
|
|
|
|
|
break;
|
|
|
|
|
}
|
1996-11-04 16:01:08 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
ttydisc_rint_done(cur_tty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sc->cur_scp->status |= MOUSE_HIDDEN;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
done:
|
2019-12-02 21:30:52 -05:00
|
|
|
mtx_unlock(&Giant);
|
|
|
|
|
return (error);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
1995-12-10 08:40:44 -05:00
|
|
|
static int
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
sctty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int error;
|
|
|
|
|
int i;
|
|
|
|
|
struct cursor_attr *cap;
|
|
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
int s;
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
int ival;
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* If there is a user_ioctl function call that first */
|
|
|
|
|
if (sc_user_ioctl) {
|
|
|
|
|
error = (*sc_user_ioctl)(tp, cmd, data, td);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
|
|
|
|
}
|
1996-10-18 14:51:37 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
error = sc_vid_ioctl(tp, cmd, data, td);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
1998-09-15 14:16:39 -04:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
error = sc_hist_ioctl(tp, cmd, data, td);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SC_NO_SYSMOUSE
|
2019-12-02 21:30:52 -05:00
|
|
|
error = sc_mouse_ioctl(tp, cmd, data, td);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp = sc_get_stat(tp);
|
|
|
|
|
/* assert(scp != NULL) */
|
|
|
|
|
/* scp is sc_console, if SC_VTY(dev) == SC_CONSOLECTL. */
|
|
|
|
|
sc = scp->sc;
|
|
|
|
|
|
|
|
|
|
if (scp->tsw) {
|
|
|
|
|
error = (*scp->tsw->te_ioctl)(scp, tp, cmd, data, td);
|
|
|
|
|
if (error != ENOIOCTL)
|
|
|
|
|
return error;
|
|
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
switch (cmd) { /* process console hardware related ioctl's */
|
1994-10-17 18:12:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_ATTR: /* get current attributes */
|
|
|
|
|
/* this ioctl is not processed here, but in the terminal
|
|
|
|
|
* emulator */
|
|
|
|
|
return ENOTTY;
|
1994-10-17 18:12:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_COLOR: /* is this a color console ? */
|
|
|
|
|
*(int *)data = (sc->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
|
|
|
|
|
return 0;
|
1994-09-15 03:26:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
|
|
|
|
|
if (*(int *)data < 0 || *(int *)data > MAX_BLANKTIME)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
s = spltty();
|
|
|
|
|
scrn_blank_time = *(int *)data;
|
|
|
|
|
run_scrn_saver = (scrn_blank_time != 0);
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
1994-09-15 03:26:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_CURSORTYPE: /* set cursor type (old interface + HIDDEN) */
|
|
|
|
|
s = spltty();
|
|
|
|
|
*(int *)data &= CONS_CURSOR_ATTRS;
|
|
|
|
|
sc_change_cursor_shape(scp, *(int *)data, -1, -1);
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
2001-08-02 04:30:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_GETCURSORSHAPE: /* get cursor shape (new interface) */
|
|
|
|
|
switch (((int *)data)[0] &
|
|
|
|
|
(CONS_DEFAULT_CURSOR | CONS_LOCAL_CURSOR)) {
|
|
|
|
|
case 0:
|
|
|
|
|
cap = &sc->curs_attr;
|
|
|
|
|
break;
|
|
|
|
|
case CONS_LOCAL_CURSOR:
|
|
|
|
|
cap = &scp->base_curs_attr;
|
|
|
|
|
break;
|
|
|
|
|
case CONS_DEFAULT_CURSOR:
|
|
|
|
|
cap = &sc->dflt_curs_attr;
|
|
|
|
|
break;
|
|
|
|
|
case CONS_DEFAULT_CURSOR | CONS_LOCAL_CURSOR:
|
|
|
|
|
cap = &scp->dflt_curs_attr;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (((int *)data)[0] & CONS_CHARCURSOR_COLORS) {
|
|
|
|
|
((int *)data)[1] = cap->bg[0];
|
|
|
|
|
((int *)data)[2] = cap->bg[1];
|
|
|
|
|
} else if (((int *)data)[0] & CONS_MOUSECURSOR_COLORS) {
|
|
|
|
|
((int *)data)[1] = cap->mouse_ba;
|
|
|
|
|
((int *)data)[2] = cap->mouse_ia;
|
|
|
|
|
} else {
|
|
|
|
|
((int *)data)[1] = cap->base;
|
|
|
|
|
((int *)data)[2] = cap->height;
|
|
|
|
|
}
|
|
|
|
|
((int *)data)[0] = cap->flags;
|
|
|
|
|
return 0;
|
2001-08-02 04:30:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_SETCURSORSHAPE: /* set cursor shape (new interface) */
|
|
|
|
|
s = spltty();
|
|
|
|
|
sc_change_cursor_shape(
|
|
|
|
|
scp, ((int *)data)[0], ((int *)data)[1], ((int *)data)[2]);
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
1994-09-15 03:26:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_BELLTYPE: /* set bell type sound/visual */
|
|
|
|
|
if ((*(int *)data) & CONS_VISUAL_BELL)
|
|
|
|
|
sc->flags |= SC_VISUAL_BELL;
|
|
|
|
|
else
|
|
|
|
|
sc->flags &= ~SC_VISUAL_BELL;
|
|
|
|
|
if ((*(int *)data) & CONS_QUIET_BELL)
|
|
|
|
|
sc->flags |= SC_QUIET_BELL;
|
|
|
|
|
else
|
|
|
|
|
sc->flags &= ~SC_QUIET_BELL;
|
|
|
|
|
return 0;
|
1995-01-12 06:47:05 -05:00
|
|
|
|
2019-12-02 21:30:52 -05: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 = sc->cur_scp->index;
|
|
|
|
|
ptr->font_size = scp->font_size;
|
|
|
|
|
ptr->mv_col = scp->xpos;
|
|
|
|
|
ptr->mv_row = scp->ypos;
|
|
|
|
|
ptr->mv_csz = scp->xsize;
|
|
|
|
|
ptr->mv_rsz = scp->ysize;
|
|
|
|
|
ptr->mv_hsz =
|
|
|
|
|
(scp->history != NULL) ? scp->history->vtb_rows : 0;
|
|
|
|
|
/*
|
|
|
|
|
* The following fields are filled by the terminal
|
|
|
|
|
* emulator. XXX
|
|
|
|
|
*
|
|
|
|
|
* ptr->mv_norm.fore
|
|
|
|
|
* ptr->mv_norm.back
|
|
|
|
|
* ptr->mv_rev.fore
|
|
|
|
|
* ptr->mv_rev.back
|
|
|
|
|
*/
|
|
|
|
|
ptr->mv_grfc.fore = 0; /* not supported */
|
|
|
|
|
ptr->mv_grfc.back = 0; /* not supported */
|
|
|
|
|
ptr->mv_ovscan = scp->border;
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
save_kbd_state(scp);
|
|
|
|
|
ptr->mk_keylock = scp->status & LOCK_MASK;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
1998-01-19 22:37:27 -05:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_GETVERS: /* get version number */
|
|
|
|
|
*(int *)data = 0x200; /* version 2.0 */
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_IDLE: /* see if the screen has been idle */
|
|
|
|
|
/*
|
|
|
|
|
* 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 = (sc->flags & SC_SCRN_IDLE) &&
|
|
|
|
|
(!ISGRAPHSC(sc->cur_scp) ||
|
|
|
|
|
(sc->cur_scp->status & SAVER_RUNNING));
|
|
|
|
|
return 0;
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_SAVERMODE: /* set saver mode */
|
|
|
|
|
switch (*(int *)data) {
|
|
|
|
|
case CONS_NO_SAVER:
|
|
|
|
|
case CONS_USR_SAVER:
|
|
|
|
|
/* if a LKM screen saver is running, stop it first. */
|
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
saver_mode = *(int *)data;
|
|
|
|
|
s = spltty();
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((error = wait_scrn_saver_stop(NULL))) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
|
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
if (saver_mode == CONS_USR_SAVER)
|
|
|
|
|
scp->status |= SAVER_RUNNING;
|
|
|
|
|
else
|
|
|
|
|
scp->status &= ~SAVER_RUNNING;
|
|
|
|
|
scsplash_stick(TRUE);
|
|
|
|
|
splx(s);
|
|
|
|
|
break;
|
|
|
|
|
case CONS_LKM_SAVER:
|
|
|
|
|
s = spltty();
|
|
|
|
|
if ((saver_mode == CONS_USR_SAVER) &&
|
|
|
|
|
(scp->status & SAVER_RUNNING))
|
|
|
|
|
scp->status &= ~SAVER_RUNNING;
|
|
|
|
|
saver_mode = *(int *)data;
|
|
|
|
|
splx(s);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
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)
|
|
|
|
|
sc->scrn_time_stamp -= scrn_blank_time;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
2002-08-19 12:32:09 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_SCRSHOT: /* get a screen shot */
|
|
|
|
|
{
|
|
|
|
|
int retval, hist_rsz;
|
|
|
|
|
size_t lsize, csize;
|
|
|
|
|
vm_offset_t frbp, hstp;
|
|
|
|
|
unsigned lnum;
|
|
|
|
|
scrshot_t *ptr = (scrshot_t *)data;
|
|
|
|
|
void *outp = ptr->buf;
|
|
|
|
|
|
|
|
|
|
if (ptr->x < 0 || ptr->y < 0 || ptr->xsize < 0 ||
|
|
|
|
|
ptr->ysize < 0)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
s = spltty();
|
|
|
|
|
if (ISGRAPHSC(scp)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EOPNOTSUPP;
|
|
|
|
|
}
|
|
|
|
|
hist_rsz = (scp->history != NULL) ? scp->history->vtb_rows : 0;
|
|
|
|
|
if (((u_int)ptr->x + ptr->xsize) > scp->xsize ||
|
|
|
|
|
((u_int)ptr->y + ptr->ysize) > (scp->ysize + hist_rsz)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
2002-08-19 12:32:09 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
lsize = scp->xsize * sizeof(u_int16_t);
|
|
|
|
|
csize = ptr->xsize * sizeof(u_int16_t);
|
|
|
|
|
/* Pointer to the last line of framebuffer */
|
|
|
|
|
frbp = scp->vtb.vtb_buffer + scp->ysize * lsize +
|
|
|
|
|
ptr->x * sizeof(u_int16_t);
|
|
|
|
|
/* Pointer to the last line of target buffer */
|
|
|
|
|
outp = (char *)outp + ptr->ysize * csize;
|
|
|
|
|
/* Pointer to the last line of history buffer */
|
|
|
|
|
if (scp->history != NULL)
|
|
|
|
|
hstp = scp->history->vtb_buffer +
|
|
|
|
|
sc_vtb_tail(scp->history) * sizeof(u_int16_t) +
|
|
|
|
|
ptr->x * sizeof(u_int16_t);
|
|
|
|
|
else
|
|
|
|
|
hstp = 0;
|
|
|
|
|
|
|
|
|
|
retval = 0;
|
|
|
|
|
for (lnum = 0; lnum < (ptr->y + ptr->ysize); lnum++) {
|
|
|
|
|
if (lnum < scp->ysize) {
|
|
|
|
|
frbp -= lsize;
|
|
|
|
|
} else {
|
|
|
|
|
hstp -= lsize;
|
|
|
|
|
if (hstp < scp->history->vtb_buffer)
|
|
|
|
|
hstp += scp->history->vtb_rows * lsize;
|
|
|
|
|
frbp = hstp;
|
|
|
|
|
}
|
|
|
|
|
if (lnum < ptr->y)
|
|
|
|
|
continue;
|
|
|
|
|
outp = (char *)outp - csize;
|
|
|
|
|
retval = copyout((void *)frbp, outp, csize);
|
|
|
|
|
if (retval != 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
return retval;
|
2002-08-19 12:32:09 -04:00
|
|
|
}
|
2001-05-18 04:52:56 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_SETMODE: /* set screen switcher mode */
|
|
|
|
|
{
|
|
|
|
|
struct vt_mode *mode;
|
|
|
|
|
struct proc *p1;
|
|
|
|
|
|
|
|
|
|
mode = (struct vt_mode *)data;
|
|
|
|
|
DPRINTF(5, ("%s%d: VT_SETMODE ", SC_DRIVER_NAME, sc->unit));
|
|
|
|
|
if (scp->smode.mode == VT_PROCESS) {
|
|
|
|
|
p1 = pfind(scp->pid);
|
|
|
|
|
if (scp->proc == p1 && scp->proc != td->td_proc) {
|
|
|
|
|
if (p1)
|
|
|
|
|
PROC_UNLOCK(p1);
|
|
|
|
|
DPRINTF(5, ("error EPERM\n"));
|
|
|
|
|
return EPERM;
|
|
|
|
|
}
|
|
|
|
|
if (p1)
|
|
|
|
|
PROC_UNLOCK(p1);
|
|
|
|
|
}
|
|
|
|
|
s = spltty();
|
|
|
|
|
if (mode->mode == VT_AUTO) {
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->pid = 0;
|
|
|
|
|
DPRINTF(5, ("VT_AUTO, "));
|
|
|
|
|
if ((scp == sc->cur_scp) &&
|
|
|
|
|
(sc->unit == sc_console_unit))
|
|
|
|
|
cnavailable(sc_consptr, TRUE);
|
|
|
|
|
/* were we in the middle of the vty switching process?
|
|
|
|
|
*/
|
|
|
|
|
if (finish_vt_rel(scp, TRUE, &s) == 0)
|
|
|
|
|
DPRINTF(5, ("reset WAIT_REL, "));
|
|
|
|
|
if (finish_vt_acq(scp) == 0)
|
|
|
|
|
DPRINTF(5, ("reset WAIT_ACQ, "));
|
|
|
|
|
} else {
|
|
|
|
|
if (!ISSIGVALID(mode->relsig) ||
|
|
|
|
|
!ISSIGVALID(mode->acqsig) ||
|
|
|
|
|
!ISSIGVALID(mode->frsig)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
DPRINTF(5, ("error EINVAL\n"));
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
DPRINTF(5, ("VT_PROCESS %d, ", td->td_proc->p_pid));
|
|
|
|
|
bcopy(data, &scp->smode, sizeof(struct vt_mode));
|
|
|
|
|
scp->proc = td->td_proc;
|
|
|
|
|
scp->pid = scp->proc->p_pid;
|
|
|
|
|
if ((scp == sc->cur_scp) &&
|
|
|
|
|
(sc->unit == sc_console_unit))
|
|
|
|
|
cnavailable(sc_consptr, FALSE);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
splx(s);
|
2019-12-02 21:30:52 -05:00
|
|
|
DPRINTF(5, ("\n"));
|
|
|
|
|
return 0;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
1995-05-30 04:16:23 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_GETMODE: /* get screen switcher mode */
|
|
|
|
|
bcopy(&scp->smode, data, sizeof(struct vt_mode));
|
|
|
|
|
return 0;
|
1995-05-30 04:16:23 -04:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('v', 4):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_RELDISP: /* screen switcher ioctl */
|
|
|
|
|
s = spltty();
|
|
|
|
|
/*
|
|
|
|
|
* This must be the current vty which is in the VT_PROCESS
|
|
|
|
|
* switching mode...
|
|
|
|
|
*/
|
|
|
|
|
if ((scp != sc->cur_scp) || (scp->smode.mode != VT_PROCESS)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
/* ...and this process is controlling it. */
|
|
|
|
|
if (scp->proc != td->td_proc) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EPERM;
|
|
|
|
|
}
|
|
|
|
|
error = EINVAL;
|
|
|
|
|
switch (*(int *)data) {
|
|
|
|
|
case VT_FALSE: /* user refuses to release screen, abort */
|
|
|
|
|
if ((error = finish_vt_rel(scp, FALSE, &s)) == 0)
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("%s%d: VT_FALSE\n", SC_DRIVER_NAME,
|
|
|
|
|
sc->unit));
|
|
|
|
|
break;
|
|
|
|
|
case VT_TRUE: /* user has released screen, go on */
|
|
|
|
|
if ((error = finish_vt_rel(scp, TRUE, &s)) == 0)
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("%s%d: VT_TRUE\n", SC_DRIVER_NAME,
|
|
|
|
|
sc->unit));
|
|
|
|
|
break;
|
|
|
|
|
case VT_ACKACQ: /* acquire acknowledged, switch completed */
|
|
|
|
|
if ((error = finish_vt_acq(scp)) == 0)
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("%s%d: VT_ACKACQ\n", SC_DRIVER_NAME,
|
|
|
|
|
sc->unit));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_OPENQRY: /* return free virtual console */
|
|
|
|
|
for (i = sc->first_vty; i < sc->first_vty + sc->vtys; i++) {
|
|
|
|
|
tp = SC_DEV(sc, i);
|
|
|
|
|
if (!tty_opened_ns(tp)) {
|
|
|
|
|
*(int *)data = i + 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('v', 5):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_ACTIVATE: /* switch to screen *data */
|
|
|
|
|
i = (*(int *)data == 0) ? scp->index : (*(int *)data - 1);
|
|
|
|
|
s = spltty();
|
|
|
|
|
error = sc_clean_up(sc->cur_scp);
|
|
|
|
|
splx(s);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
|
|
|
|
error = sc_switch_scr(sc, i);
|
|
|
|
|
return (error);
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('v', 6):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_WAITACTIVE: /* wait for switch to occur */
|
|
|
|
|
i = (*(int *)data == 0) ? scp->index : (*(int *)data - 1);
|
|
|
|
|
if ((i < sc->first_vty) || (i >= sc->first_vty + sc->vtys))
|
|
|
|
|
return EINVAL;
|
|
|
|
|
if (i == sc->cur_scp->index)
|
|
|
|
|
return 0;
|
|
|
|
|
error =
|
|
|
|
|
tsleep(VTY_WCHAN(sc, i), (PZERO + 1) | PCATCH, "waitvt", 0);
|
|
|
|
|
return error;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_GETACTIVE: /* get active vty # */
|
|
|
|
|
*(int *)data = sc->cur_scp->index + 1;
|
|
|
|
|
return 0;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_GETINDEX: /* get this vty # */
|
|
|
|
|
*(int *)data = scp->index + 1;
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case VT_LOCKSWITCH: /* prevent vty switching */
|
|
|
|
|
if ((*(int *)data) & 0x01)
|
|
|
|
|
sc->flags |= SC_SCRN_VTYLOCK;
|
|
|
|
|
else
|
|
|
|
|
sc->flags &= ~SC_SCRN_VTYLOCK;
|
|
|
|
|
return 0;
|
2002-07-09 23:29:38 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDENABIO: /* allow io operations */
|
|
|
|
|
error = priv_check(td, PRIV_IO);
|
|
|
|
|
if (error != 0)
|
|
|
|
|
return error;
|
|
|
|
|
error = securelevel_gt(td->td_ucred, 0);
|
|
|
|
|
if (error != 0)
|
|
|
|
|
return error;
|
1999-01-19 06:31:22 -05:00
|
|
|
#ifdef __i386__
|
2019-12-02 21:30:52 -05:00
|
|
|
td->td_frame->tf_eflags |= PSL_IOPL;
|
2004-09-23 21:19:11 -04:00
|
|
|
#elif defined(__amd64__)
|
2019-12-02 21:30:52 -05:00
|
|
|
td->td_frame->tf_rflags |= PSL_IOPL;
|
1999-01-19 06:31:22 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDDISABIO: /* disallow io operations (default) */
|
1999-01-19 06:31:22 -05:00
|
|
|
#ifdef __i386__
|
2019-12-02 21:30:52 -05:00
|
|
|
td->td_frame->tf_eflags &= ~PSL_IOPL;
|
2004-09-23 21:19:11 -04:00
|
|
|
#elif defined(__amd64__)
|
2019-12-02 21:30:52 -05:00
|
|
|
td->td_frame->tf_rflags &= ~PSL_IOPL;
|
1999-01-19 06:31:22 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 20):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDSKBSTATE: /* set keyboard state (locks) */
|
|
|
|
|
if (*(int *)data & ~LOCK_MASK)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
scp->status &= ~LOCK_MASK;
|
|
|
|
|
scp->status |= *(int *)data;
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
update_kbd_state(scp, scp->status, LOCK_MASK);
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGKBSTATE: /* get keyboard state (locks) */
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
save_kbd_state(scp);
|
|
|
|
|
*(int *)data = scp->status & LOCK_MASK;
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGETREPEAT: /* get keyboard repeat & delay rates */
|
|
|
|
|
case KDSETREPEAT: /* set keyboard repeat & delay rates (new) */
|
|
|
|
|
error = kbdd_ioctl(sc->kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
Keyboard driver update in preparation for the USB keyboard driver.
- Refined internal interface in keyboard drivers so that:
1. the side effect of device probe is kept minimal,
2. polling mode function is added,
3. and new ioctl and configuration options are added (see below).
- Added new ioctl: KDSETREPEAT
Set keyboard typematic rate. There has existed an ioctl command,
KDSETRAD, for the same purpose. However, KDSETRAD is dependent on
the AT keyboard. KDSETREPEAT provides more generic interface.
KDSETRAD will still be supported in the atkbd driver.
- Added new configuration options:
ATKBD_DFLT_KEYMAP
Specify a keymap to be used as the default, built-in keymap.
(There has been undocumented options, DKKEYMAP, UKKEYMAP, GRKEYMAP,
SWKEYMAP, RUKEYMAP, ESKEYMAP, and ISKEYMAP to set the default keymap.
These options are now gone for good. The new option is more general.)
KBD_DISABLE_KEYMAP_LOADING
Don't allow the user to change the keymap.
1999-03-10 05:36:53 -05:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 67):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDSETRAD: /* set keyboard repeat & delay rates (old) */
|
|
|
|
|
if (*(int *)data & ~0x7f)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
error = kbdd_ioctl(sc->kbd, KDSETRAD, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 7):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDSKBMODE: /* set keyboard mode */
|
|
|
|
|
switch (*(int *)data) {
|
|
|
|
|
case K_XLATE: /* switch to XLT ascii mode */
|
|
|
|
|
case K_RAW: /* switch to RAW scancode mode */
|
|
|
|
|
case K_CODE: /* switch to CODE mode */
|
|
|
|
|
scp->kbd_mode = *(int *)data;
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE, data);
|
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
/* NOT REACHED */
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGKBMODE: /* get keyboard mode */
|
|
|
|
|
*(int *)data = scp->kbd_mode;
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGKBINFO:
|
|
|
|
|
error = kbdd_ioctl(sc->kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 8):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDMKTONE: /* sound the bell */
|
|
|
|
|
if (*(int *)data)
|
|
|
|
|
sc_bell(scp, (*(int *)data) & 0xffff,
|
|
|
|
|
(((*(int *)data) >> 16) & 0xffff) * hz / 1000);
|
|
|
|
|
else
|
|
|
|
|
sc_bell(scp, scp->bell_pitch, scp->bell_duration);
|
|
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 63):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KIOCSOUND: /* make tone (*data) hz */
|
|
|
|
|
if (scp == sc->cur_scp) {
|
|
|
|
|
if (*(int *)data)
|
|
|
|
|
return sc_tone(*(int *)data);
|
|
|
|
|
else
|
|
|
|
|
return sc_tone(0);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGKBTYPE: /* get keyboard type */
|
|
|
|
|
error = kbdd_ioctl(sc->kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL) {
|
|
|
|
|
/* always return something? XXX */
|
|
|
|
|
*(int *)data = 0;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('K', 66):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDSETLED: /* set keyboard LED status */
|
|
|
|
|
if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
|
|
|
|
|
return EINVAL;
|
|
|
|
|
scp->status &= ~LED_MASK;
|
|
|
|
|
scp->status |= *(int *)data;
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
update_kbd_leds(scp, scp->status);
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KDGETLED: /* get keyboard LED status */
|
|
|
|
|
if (scp == sc->cur_scp)
|
|
|
|
|
save_kbd_state(scp);
|
|
|
|
|
*(int *)data = scp->status & LED_MASK;
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case KBADDKBD: /* add/remove keyboard to/from mux */
|
|
|
|
|
case KBRELKBD:
|
|
|
|
|
error = kbdd_ioctl(sc->kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
2005-07-13 19:58:57 -04:00
|
|
|
|
2006-09-27 15:57:02 -04:00
|
|
|
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
|
|
|
|
|
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
|
2019-12-02 21:30:52 -05:00
|
|
|
case _IO('c', 110):
|
|
|
|
|
ival = IOCPARM_IVAL(data);
|
|
|
|
|
data = (caddr_t)&ival;
|
|
|
|
|
/* FALLTHROUGH */
|
2006-09-27 15:57:02 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_SETKBD: /* set the new keyboard */
|
1999-01-10 22:18:56 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
keyboard_t *newkbd;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
s = spltty();
|
|
|
|
|
newkbd = kbd_get_keyboard(*(int *)data);
|
|
|
|
|
if (newkbd == NULL) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return EINVAL;
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
error = 0;
|
|
|
|
|
if (sc->kbd != newkbd) {
|
|
|
|
|
i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
|
2019-12-23 16:32:07 -05:00
|
|
|
(void *)&sc->kbd, sckbdevent, sc);
|
2019-12-02 21:30:52 -05:00
|
|
|
/* i == newkbd->kb_index */
|
|
|
|
|
if (i >= 0) {
|
|
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
save_kbd_state(sc->cur_scp);
|
|
|
|
|
kbd_release(
|
2019-12-23 16:32:07 -05:00
|
|
|
sc->kbd, (void *)&sc->kbd);
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
|
|
|
|
sc->kbd =
|
|
|
|
|
kbd_get_keyboard(i); /* sc->kbd == newkbd */
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE,
|
|
|
|
|
(caddr_t)&sc->cur_scp->kbd_mode);
|
|
|
|
|
update_kbd_state(sc->cur_scp,
|
|
|
|
|
sc->cur_scp->status, LOCK_MASK);
|
|
|
|
|
} else {
|
|
|
|
|
error = EPERM; /* XXX */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
1995-02-22 08:48:07 -05:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_RELKBD: /* release the current keyboard */
|
|
|
|
|
s = spltty();
|
|
|
|
|
error = 0;
|
|
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
save_kbd_state(sc->cur_scp);
|
2019-12-23 16:32:07 -05:00
|
|
|
error = kbd_release(sc->kbd, (void *)&sc->kbd);
|
|
|
|
|
if (error == 0)
|
2019-12-02 21:30:52 -05:00
|
|
|
sc->kbd = NULL;
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_GETTERM: /* get the current terminal emulator info */
|
2000-01-15 10:25:43 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_term_sw_t *sw;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (((term_info_t *)data)->ti_index == 0) {
|
|
|
|
|
sw = scp->tsw;
|
|
|
|
|
} else {
|
|
|
|
|
sw = sc_term_match_by_number(
|
|
|
|
|
((term_info_t *)data)->ti_index);
|
|
|
|
|
}
|
|
|
|
|
if (sw != NULL) {
|
|
|
|
|
strncpy(((term_info_t *)data)->ti_name, sw->te_name,
|
|
|
|
|
sizeof(((term_info_t *)data)->ti_name));
|
|
|
|
|
strncpy(((term_info_t *)data)->ti_desc, sw->te_desc,
|
|
|
|
|
sizeof(((term_info_t *)data)->ti_desc));
|
|
|
|
|
((term_info_t *)data)->ti_flags = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
((term_info_t *)data)->ti_name[0] = '\0';
|
|
|
|
|
((term_info_t *)data)->ti_desc[0] = '\0';
|
|
|
|
|
((term_info_t *)data)->ti_flags = 0;
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case CONS_SETTERM: /* set the current terminal emulator */
|
|
|
|
|
s = spltty();
|
|
|
|
|
error = sc_init_emulator(scp, ((term_info_t *)data)->ti_name);
|
|
|
|
|
/* FIXME: what if scp == sc_console! XXX */
|
|
|
|
|
splx(s);
|
|
|
|
|
return error;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_SCRNMAP: /* get output translation table */
|
|
|
|
|
bcopy(&sc->scr_map, data, sizeof(sc->scr_map));
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case PIO_SCRNMAP: /* set output translation table */
|
|
|
|
|
bcopy(data, &sc->scr_map, sizeof(sc->scr_map));
|
|
|
|
|
for (i = 0; i < sizeof(sc->scr_map); i++) {
|
|
|
|
|
sc->scr_rmap[sc->scr_map[i]] = i;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_KEYMAP: /* get keyboard translation table */
|
|
|
|
|
case PIO_KEYMAP: /* set keyboard translation table */
|
|
|
|
|
case OGIO_KEYMAP: /* get keyboard translation table (compat) */
|
|
|
|
|
case OPIO_KEYMAP: /* set keyboard translation table (compat) */
|
|
|
|
|
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 = kbdd_ioctl(sc->kbd, cmd, data);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1998-01-07 03:40:34 -05:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case PIO_FONT8x8: /* set 8x8 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, sc->font_8, 8 * 256);
|
|
|
|
|
sc->fonts_loaded |= FONT_8;
|
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x8.
|
|
|
|
|
*/
|
|
|
|
|
if (ISTEXTSC(sc->cur_scp) && (sc->cur_scp->font_size < 14))
|
|
|
|
|
sc_load_font(sc->cur_scp, 0, 8, 8, sc->font_8, 0, 256);
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_FONT8x8: /* get 8x8 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
if (sc->fonts_loaded & FONT_8) {
|
|
|
|
|
bcopy(sc->font_8, data, 8 * 256);
|
|
|
|
|
return 0;
|
|
|
|
|
} else
|
|
|
|
|
return ENXIO;
|
|
|
|
|
|
|
|
|
|
case PIO_FONT8x14: /* set 8x14 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, sc->font_14, 14 * 256);
|
|
|
|
|
sc->fonts_loaded |= FONT_14;
|
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x14.
|
|
|
|
|
*/
|
|
|
|
|
if (ISTEXTSC(sc->cur_scp) && (sc->cur_scp->font_size >= 14) &&
|
|
|
|
|
(sc->cur_scp->font_size < 16))
|
|
|
|
|
sc_load_font(
|
|
|
|
|
sc->cur_scp, 0, 14, 8, sc->font_14, 0, 256);
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_FONT8x14: /* get 8x14 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
if (sc->fonts_loaded & FONT_14) {
|
|
|
|
|
bcopy(sc->font_14, data, 14 * 256);
|
|
|
|
|
return 0;
|
|
|
|
|
} else
|
|
|
|
|
return ENXIO;
|
|
|
|
|
|
|
|
|
|
case PIO_FONT8x16: /* set 8x16 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
bcopy(data, sc->font_16, 16 * 256);
|
|
|
|
|
sc->fonts_loaded |= FONT_16;
|
|
|
|
|
/*
|
|
|
|
|
* FONT KLUDGE
|
|
|
|
|
* Always use the font page #0. XXX
|
|
|
|
|
* Don't load if the current font size is not 8x16.
|
|
|
|
|
*/
|
|
|
|
|
if (ISTEXTSC(sc->cur_scp) && (sc->cur_scp->font_size >= 16))
|
|
|
|
|
sc_load_font(
|
|
|
|
|
sc->cur_scp, 0, 16, 8, sc->font_16, 0, 256);
|
|
|
|
|
return 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case GIO_FONT8x16: /* get 8x16 dot font */
|
|
|
|
|
if (!ISFONTAVAIL(sc->adp->va_flags))
|
|
|
|
|
return ENXIO;
|
|
|
|
|
if (sc->fonts_loaded & FONT_16) {
|
|
|
|
|
bcopy(sc->font_16, data, 16 * 256);
|
|
|
|
|
return 0;
|
|
|
|
|
} else
|
|
|
|
|
return ENXIO;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#endif /* SC_NO_FONT_LOADING */
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
1995-05-30 04:16:23 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return (ENOIOCTL);
|
1995-02-22 08:48:07 -05:00
|
|
|
}
|
|
|
|
|
|
2009-05-15 10:30:37 -04:00
|
|
|
static int
|
2019-12-02 21:30:52 -05:00
|
|
|
consolectl_ioctl(
|
|
|
|
|
struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
|
2009-05-15 10:30:37 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return sctty_ioctl(dev->si_drv1, cmd, data, td);
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-06 06:16:18 -05:00
|
|
|
static int
|
|
|
|
|
consolectl_close(struct cdev *dev, int flags, int mode, struct thread *td)
|
|
|
|
|
{
|
|
|
|
|
#ifndef SC_NO_SYSMOUSE
|
|
|
|
|
mouse_info_t info;
|
|
|
|
|
memset(&info, 0, sizeof(info));
|
|
|
|
|
info.operation = MOUSE_ACTION;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Make sure all buttons are released when moused and other
|
|
|
|
|
* console daemons exit, so that no buttons are left pressed.
|
|
|
|
|
*/
|
2019-12-02 21:30:52 -05:00
|
|
|
(void)sctty_ioctl(dev->si_drv1, CONS_MOUSECTL, (caddr_t)&info, td);
|
2013-02-06 06:16:18 -05:00
|
|
|
#endif
|
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-07 09:14:24 -05:00
|
|
|
static void
|
2006-05-26 09:54:27 -04:00
|
|
|
sc_cnprobe(struct consdev *cp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int unit;
|
|
|
|
|
int flags;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!vty_enabled(VTY_SC)) {
|
|
|
|
|
cp->cn_pri = CN_DEAD;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-06-18 18:23:10 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
cp->cn_pri = sc_get_cons_priority(&unit, &flags);
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* a video card is always required */
|
|
|
|
|
if (!scvidprobe(unit, flags, TRUE))
|
|
|
|
|
cp->cn_pri = CN_DEAD;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* syscons will become console even when there is no keyboard */
|
|
|
|
|
sckbdprobe(unit, flags, TRUE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (cp->cn_pri == CN_DEAD)
|
|
|
|
|
return;
|
1997-06-22 08:04:36 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* initialize required fields */
|
|
|
|
|
strcpy(cp->cn_name, "ttyv0");
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
1999-01-07 09:14:24 -05:00
|
|
|
static void
|
2006-05-26 09:54:27 -04:00
|
|
|
sc_cninit(struct consdev *cp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int unit;
|
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
|
|
sc_get_cons_priority(&unit, &flags);
|
|
|
|
|
scinit(unit, flags | SC_KERNEL_CONSOLE);
|
|
|
|
|
sc_console_unit = unit;
|
|
|
|
|
sc_console = sc_get_stat(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
|
|
|
|
|
sc_consptr = cp;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2006-05-26 09:54:27 -04:00
|
|
|
sc_cnterm(struct consdev *cp)
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
void *ts;
|
|
|
|
|
int i;
|
2017-03-29 10:46:26 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* we are not the kernel console any more, release everything */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_console_unit < 0)
|
|
|
|
|
return; /* shouldn't happen */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#if 0 /* XXX */
|
|
|
|
|
sc_clear_screen(sc_console);
|
|
|
|
|
sccnupdate(sc_console);
|
|
|
|
|
#endif
|
2004-07-10 18:29:41 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_ktsw != NULL) {
|
|
|
|
|
for (i = 0; i <= mp_maxid; i++) {
|
|
|
|
|
ts = sc_kts[i];
|
|
|
|
|
sc_kts[i] = NULL;
|
|
|
|
|
(*sc_ktsw->te_term)(sc_console, &ts);
|
|
|
|
|
free(ts, M_DEVBUF);
|
|
|
|
|
}
|
|
|
|
|
sc_ktsw = NULL;
|
2017-08-24 22:37:32 -04:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
scterm(sc_console_unit, SC_KERNEL_CONSOLE);
|
|
|
|
|
sc_console_unit = -1;
|
|
|
|
|
sc_console = NULL;
|
1999-01-19 06:31:22 -05:00
|
|
|
}
|
|
|
|
|
|
2016-08-15 15:37:18 -04:00
|
|
|
static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp);
|
2016-08-30 06:57:19 -04:00
|
|
|
static int sc_cngetc_locked(struct sc_cnstate *sp);
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
static void sccnkbdlock(sc_softc_t *sc, struct sc_cnstate *sp);
|
|
|
|
|
static void sccnkbdunlock(sc_softc_t *sc, struct sc_cnstate *sp);
|
2016-08-15 15:37:18 -04:00
|
|
|
static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags);
|
2016-08-29 14:41:06 -04:00
|
|
|
static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp);
|
|
|
|
|
static void sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp);
|
|
|
|
|
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
static void
|
|
|
|
|
sccnkbdlock(sc_softc_t *sc, struct sc_cnstate *sp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* Locking method: hope for the best.
|
|
|
|
|
* The keyboard is supposed to be Giant locked. We can't handle that
|
|
|
|
|
* in general. The kdb_active case here is not safe, and we will
|
|
|
|
|
* proceed without the lock in all cases.
|
|
|
|
|
*/
|
|
|
|
|
sp->kbd_locked = !kdb_active && mtx_trylock(&Giant);
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sccnkbdunlock(sc_softc_t *sc, struct sc_cnstate *sp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sp->kbd_locked)
|
|
|
|
|
mtx_unlock(&Giant);
|
|
|
|
|
sp->kbd_locked = FALSE;
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
}
|
|
|
|
|
|
2016-08-29 14:41:06 -04:00
|
|
|
static void
|
|
|
|
|
sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int retries;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Locking method:
|
|
|
|
|
* - if kdb_active and video_mtx is not owned by anyone, then lock
|
|
|
|
|
* by kdb remaining active
|
|
|
|
|
* - if !kdb_active, try to acquire video_mtx without blocking or
|
|
|
|
|
* recursing; if we get it then it works normally.
|
|
|
|
|
* Note that video_mtx is especially unusable if we already own it,
|
|
|
|
|
* since then it is protecting something and syscons is not reentrant
|
|
|
|
|
* enough to ignore the protection even in the kdb_active case.
|
|
|
|
|
*/
|
|
|
|
|
if (kdb_active) {
|
|
|
|
|
sp->kdb_locked = sc->video_mtx.mtx_lock == MTX_UNOWNED ||
|
|
|
|
|
SCHEDULER_STOPPED();
|
2018-06-02 04:38:59 -04:00
|
|
|
sp->mtx_locked = FALSE;
|
2019-12-02 21:30:52 -05:00
|
|
|
} else {
|
|
|
|
|
sp->kdb_locked = FALSE;
|
|
|
|
|
for (retries = 0; retries < 1000; retries++) {
|
|
|
|
|
sp->mtx_locked = mtx_trylock_spin_flags(
|
|
|
|
|
&sc->video_mtx, MTX_QUIET) != 0;
|
|
|
|
|
if (SCHEDULER_STOPPED()) {
|
|
|
|
|
sp->kdb_locked = TRUE;
|
|
|
|
|
sp->mtx_locked = FALSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (sp->mtx_locked)
|
|
|
|
|
break;
|
|
|
|
|
DELAY(1);
|
|
|
|
|
}
|
2016-09-01 15:18:26 -04:00
|
|
|
}
|
2016-08-29 14:41:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sp->mtx_locked)
|
|
|
|
|
mtx_unlock_spin(&sc->video_mtx);
|
|
|
|
|
sp->mtx_locked = sp->kdb_locked = FALSE;
|
2016-08-29 14:41:06 -04:00
|
|
|
}
|
2016-08-15 15:37:18 -04:00
|
|
|
|
2011-12-17 10:08:43 -05:00
|
|
|
static void
|
2016-08-15 15:37:18 -04:00
|
|
|
sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags)
|
2011-12-17 10:08:43 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int kbd_mode;
|
2011-12-17 10:57:39 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(sc_console_unit >= 0) */
|
2016-08-24 14:59:24 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sp->kbd_opened = FALSE;
|
|
|
|
|
sp->scr_opened = FALSE;
|
|
|
|
|
sp->kbd_locked = FALSE;
|
2016-08-24 14:59:24 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Opening the keyboard is optional. */
|
|
|
|
|
if (!(flags & 1) || sc->kbd == NULL)
|
|
|
|
|
goto over_keyboard;
|
2011-12-17 10:57:39 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sccnkbdlock(sc, sp);
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* Make sure the keyboard is accessible even when the kbd device
|
|
|
|
|
* driver is disabled.
|
|
|
|
|
*/
|
|
|
|
|
kbdd_enable(sc->kbd);
|
|
|
|
|
|
|
|
|
|
/* Switch the keyboard to console mode (K_XLATE, polled) on all scp's.
|
|
|
|
|
*/
|
|
|
|
|
kbd_mode = K_XLATE;
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode);
|
|
|
|
|
sc->kbd_open_level++;
|
|
|
|
|
kbdd_poll(sc->kbd, TRUE);
|
|
|
|
|
|
|
|
|
|
sp->kbd_opened = TRUE;
|
|
|
|
|
over_keyboard:;
|
|
|
|
|
|
|
|
|
|
/* The screen is opened iff locking it succeeds. */
|
|
|
|
|
sccnscrlock(sc, sp);
|
|
|
|
|
if (!sp->kdb_locked && !sp->mtx_locked)
|
|
|
|
|
return;
|
|
|
|
|
sp->scr_opened = TRUE;
|
|
|
|
|
|
|
|
|
|
/* The screen switch is optional. */
|
|
|
|
|
if (!(flags & 2))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* try to switch to the kernel console screen */
|
|
|
|
|
if (!cold && sc->cur_scp->index != sc_console->index &&
|
|
|
|
|
sc->cur_scp->smode.mode == VT_AUTO &&
|
|
|
|
|
sc_console->smode.mode == VT_AUTO)
|
|
|
|
|
sc_switch_scr(sc, sc_console->index);
|
2011-12-17 10:08:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2016-08-15 15:37:18 -04:00
|
|
|
sccnclose(sc_softc_t *sc, struct sc_cnstate *sp)
|
2011-12-17 10:08:43 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sp->scr_opened = FALSE;
|
|
|
|
|
sccnscrunlock(sc, sp);
|
2016-08-24 14:59:24 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!sp->kbd_opened)
|
|
|
|
|
return;
|
2011-12-17 10:57:39 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Restore keyboard mode (for the current, possibly-changed scp). */
|
|
|
|
|
kbdd_poll(sc->kbd, FALSE);
|
|
|
|
|
if (--sc->kbd_open_level == 0)
|
|
|
|
|
(void)kbdd_ioctl(
|
|
|
|
|
sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode);
|
2016-08-15 14:02:37 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
kbdd_disable(sc->kbd);
|
|
|
|
|
sp->kbd_opened = FALSE;
|
|
|
|
|
sccnkbdunlock(sc, sp);
|
2011-12-17 10:08:43 -05:00
|
|
|
}
|
|
|
|
|
|
2016-08-24 14:59:24 -04:00
|
|
|
/*
|
|
|
|
|
* Grabbing switches the screen and keyboard focus to sc_console and the
|
|
|
|
|
* keyboard mode to (K_XLATE, polled). Only switching to polled mode is
|
|
|
|
|
* essential (for preventing the interrupt handler from eating input
|
|
|
|
|
* between polls). Focus is part of the UI, and the other switches are
|
|
|
|
|
* work just was well when they are done on every entry and exit.
|
|
|
|
|
*
|
|
|
|
|
* Screen switches while grabbed are supported, and to maintain focus for
|
|
|
|
|
* this ungrabbing and closing only restore the polling state and then
|
|
|
|
|
* the keyboard mode if on the original screen.
|
|
|
|
|
*/
|
|
|
|
|
|
2016-08-15 15:37:18 -04:00
|
|
|
static void
|
|
|
|
|
sc_cngrab(struct consdev *cp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
int lev;
|
|
|
|
|
|
|
|
|
|
sc = sc_console->sc;
|
|
|
|
|
lev = atomic_fetchadd_int(&sc->grab_level, 1);
|
|
|
|
|
if (lev >= 0 && lev < 2) {
|
|
|
|
|
sccnopen(sc, &sc->grab_state[lev], 1 | 2);
|
|
|
|
|
sccnscrunlock(sc, &sc->grab_state[lev]);
|
|
|
|
|
sccnkbdunlock(sc, &sc->grab_state[lev]);
|
|
|
|
|
}
|
2016-08-15 15:37:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sc_cnungrab(struct consdev *cp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
int lev;
|
|
|
|
|
|
|
|
|
|
sc = sc_console->sc;
|
|
|
|
|
lev = atomic_load_acq_int(&sc->grab_level) - 1;
|
|
|
|
|
if (lev >= 0 && lev < 2) {
|
|
|
|
|
sccnkbdlock(sc, &sc->grab_state[lev]);
|
|
|
|
|
sccnscrlock(sc, &sc->grab_state[lev]);
|
|
|
|
|
sccnclose(sc, &sc->grab_state[lev]);
|
|
|
|
|
}
|
|
|
|
|
atomic_add_int(&sc->grab_level, -1);
|
2016-08-15 15:37:18 -04:00
|
|
|
}
|
|
|
|
|
|
2016-09-01 15:18:26 -04:00
|
|
|
static char sc_cnputc_log[0x1000];
|
|
|
|
|
static u_int sc_cnputc_loghead;
|
|
|
|
|
static u_int sc_cnputc_logtail;
|
|
|
|
|
|
1999-01-07 09:14:24 -05:00
|
|
|
static void
|
2006-05-26 09:54:27 -04:00
|
|
|
sc_cnputc(struct consdev *cd, int c)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
struct sc_cnstate st;
|
|
|
|
|
u_char buf[1];
|
|
|
|
|
scr_stat *scp = sc_console;
|
|
|
|
|
void *oldts, *ts;
|
|
|
|
|
struct sc_term_sw *oldtsw;
|
1999-08-17 18:06:17 -04:00
|
|
|
#ifndef SC_NO_HISTORY
|
2008-08-31 06:17:40 -04:00
|
|
|
#if 0
|
1999-07-18 02:16:53 -04:00
|
|
|
struct tty *tp;
|
2008-08-31 06:17:40 -04:00
|
|
|
#endif
|
1999-08-17 18:06:17 -04:00
|
|
|
#endif /* !SC_NO_HISTORY */
|
2019-12-02 21:30:52 -05:00
|
|
|
u_int head;
|
|
|
|
|
int s;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(sc_console != NULL) */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sccnopen(scp->sc, &st, 0);
|
2016-08-25 09:46:52 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* Log the output.
|
|
|
|
|
*
|
|
|
|
|
* In the unlocked case, the logging is intentionally only
|
|
|
|
|
* perfectly atomic for the indexes.
|
|
|
|
|
*/
|
|
|
|
|
head = atomic_fetchadd_int(&sc_cnputc_loghead, 1);
|
|
|
|
|
sc_cnputc_log[head % sizeof(sc_cnputc_log)] = c;
|
2016-09-01 15:18:26 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* If we couldn't open, do special reentrant output and return to defer
|
|
|
|
|
* normal output.
|
|
|
|
|
*/
|
|
|
|
|
if (!st.scr_opened) {
|
|
|
|
|
ec_putc(c);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-09-01 15:18:26 -04:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp == scp->sc->cur_scp && scp->status & SLKED) {
|
|
|
|
|
scp->status &= ~SLKED;
|
|
|
|
|
update_kbd_state(scp, scp->status, SLKED);
|
|
|
|
|
if (scp->status & BUFFER_SAVED) {
|
|
|
|
|
if (!sc_hist_restore(scp))
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
scp->status &= ~BUFFER_SAVED;
|
|
|
|
|
scp->status |= CURSOR_ENABLED;
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
}
|
2008-08-31 06:17:40 -04:00
|
|
|
#if 0
|
|
|
|
|
/*
|
|
|
|
|
* XXX: Now that TTY's have their own locks, we cannot process
|
|
|
|
|
* any data after disabling scroll lock. cnputs already holds a
|
|
|
|
|
* spinlock.
|
|
|
|
|
*/
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
tp = SC_DEV(scp->sc, scp->index);
|
2012-03-29 10:53:14 -04:00
|
|
|
/* XXX "tp" can be NULL */
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
tty_lock(tp);
|
|
|
|
|
if (tty_opened(tp))
|
|
|
|
|
sctty_outwakeup(tp);
|
|
|
|
|
tty_unlock(tp);
|
2008-08-31 06:17:40 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* !SC_NO_HISTORY */
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Play any output still in the log (our char may already be done). */
|
|
|
|
|
while (sc_cnputc_logtail != atomic_load_acq_int(&sc_cnputc_loghead)) {
|
|
|
|
|
buf[0] =
|
|
|
|
|
sc_cnputc_log[sc_cnputc_logtail++ % sizeof(sc_cnputc_log)];
|
|
|
|
|
if (atomic_load_acq_int(&sc_cnputc_loghead) -
|
|
|
|
|
sc_cnputc_logtail >=
|
|
|
|
|
sizeof(sc_cnputc_log))
|
|
|
|
|
continue;
|
|
|
|
|
/* Console output has a per-CPU "input" state. Switch for it.
|
|
|
|
|
*/
|
|
|
|
|
ts = sc_kts[curcpu];
|
|
|
|
|
if (ts != NULL) {
|
|
|
|
|
oldtsw = scp->tsw;
|
|
|
|
|
oldts = scp->ts;
|
|
|
|
|
scp->tsw = sc_ktsw;
|
|
|
|
|
scp->ts = ts;
|
|
|
|
|
(*scp->tsw->te_sync)(scp);
|
|
|
|
|
} else {
|
|
|
|
|
/* Only 1 tsw early. Switch only its attr. */
|
|
|
|
|
(*scp->tsw->te_default_attr)(
|
|
|
|
|
scp, sc_kattrtab[curcpu], SC_KERNEL_CONS_REV_ATTR);
|
|
|
|
|
}
|
|
|
|
|
sc_puts(scp, buf, 1);
|
|
|
|
|
if (ts != NULL) {
|
|
|
|
|
scp->tsw = oldtsw;
|
|
|
|
|
scp->ts = oldts;
|
|
|
|
|
(*scp->tsw->te_sync)(scp);
|
|
|
|
|
} else {
|
|
|
|
|
(*scp->tsw->te_default_attr)(
|
|
|
|
|
scp, SC_KERNEL_CONS_ATTR, SC_KERNEL_CONS_REV_ATTR);
|
|
|
|
|
}
|
2018-06-02 06:36:30 -04:00
|
|
|
}
|
1998-02-11 09:58:15 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
s = spltty(); /* block sckbdevent and scrn_timer */
|
|
|
|
|
sccnupdate(scp);
|
|
|
|
|
splx(s);
|
|
|
|
|
sccnclose(scp->sc, &st);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
1999-01-07 09:14:24 -05:00
|
|
|
static int
|
2006-05-26 09:54:27 -04:00
|
|
|
sc_cngetc(struct consdev *cd)
|
2016-08-30 06:57:19 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
struct sc_cnstate st;
|
|
|
|
|
int c, s;
|
2016-08-30 06:57:19 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(sc_console != NULL) */
|
|
|
|
|
sccnopen(sc_console->sc, &st, 1);
|
|
|
|
|
s = spltty(); /* block sckbdevent and scrn_timer while we poll */
|
|
|
|
|
if (!st.kbd_opened) {
|
|
|
|
|
splx(s);
|
|
|
|
|
sccnclose(sc_console->sc, &st);
|
|
|
|
|
return -1; /* means no keyboard since we fudged the locking */
|
|
|
|
|
}
|
|
|
|
|
c = sc_cngetc_locked(&st);
|
2016-08-30 06:57:19 -04:00
|
|
|
splx(s);
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
sccnclose(sc_console->sc, &st);
|
2019-12-02 21:30:52 -05:00
|
|
|
return c;
|
2016-08-30 06:57:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
sc_cngetc_locked(struct sc_cnstate *sp)
|
1999-01-10 22:18:56 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
static struct fkeytab fkey;
|
|
|
|
|
static int fkeycp;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
const u_char *p;
|
|
|
|
|
int c;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* Stop the screen saver and update the screen if necessary.
|
|
|
|
|
* What if we have been running in the screen saver code... XXX
|
|
|
|
|
*/
|
|
|
|
|
if (sp->scr_opened)
|
|
|
|
|
sc_touch_scrn_saver();
|
|
|
|
|
scp = sc_console->sc->cur_scp; /* XXX */
|
|
|
|
|
if (sp->scr_opened)
|
|
|
|
|
sccnupdate(scp);
|
|
|
|
|
|
|
|
|
|
if (fkeycp < fkey.len)
|
|
|
|
|
return fkey.str[fkeycp++];
|
|
|
|
|
|
|
|
|
|
c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK, sp);
|
|
|
|
|
|
|
|
|
|
switch (KEYFLAGS(c)) {
|
|
|
|
|
case 0: /* normal char */
|
|
|
|
|
return KEYCHAR(c);
|
|
|
|
|
case FKEY: /* function key */
|
|
|
|
|
p = (*scp->tsw->te_fkeystr)(scp, c);
|
|
|
|
|
if (p != NULL) {
|
|
|
|
|
fkey.len = strlen(p);
|
|
|
|
|
bcopy(p, fkey.str, fkey.len);
|
|
|
|
|
fkeycp = 1;
|
|
|
|
|
return fkey.str[0];
|
|
|
|
|
}
|
|
|
|
|
p = kbdd_get_fkeystr(
|
|
|
|
|
scp->sc->kbd, KEYCHAR(c), (size_t *)&fkeycp);
|
|
|
|
|
fkey.len = fkeycp;
|
|
|
|
|
if ((p != NULL) && (fkey.len > 0)) {
|
|
|
|
|
bcopy(p, fkey.str, fkey.len);
|
|
|
|
|
fkeycp = 1;
|
|
|
|
|
return fkey.str[0];
|
|
|
|
|
}
|
|
|
|
|
return c; /* XXX */
|
|
|
|
|
case NOKEY:
|
|
|
|
|
case ERRKEY:
|
|
|
|
|
default:
|
|
|
|
|
return -1;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
/* NOT REACHED */
|
1994-02-01 05:43:02 -05:00
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
|
1998-02-11 09:58:15 -05:00
|
|
|
static void
|
|
|
|
|
sccnupdate(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/* this is a cut-down version of scrn_timer()... */
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (suspend_in_progress || scp->sc->font_loading_in_progress)
|
|
|
|
|
return;
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2020-01-12 01:07:54 -05:00
|
|
|
if (kdb_active || KERNEL_PANICKED() || shutdown_in_progress) {
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_touch_scrn_saver();
|
|
|
|
|
} else if (scp != scp->sc->cur_scp) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
1998-09-15 14:16:39 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!run_scrn_saver)
|
|
|
|
|
scp->sc->flags &= ~SC_SCRN_IDLE;
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((saver_mode != CONS_LKM_SAVER) || !(scp->sc->flags & SC_SCRN_IDLE))
|
|
|
|
|
if (scp->sc->flags & SC_SCRN_BLANKED)
|
|
|
|
|
stop_scrn_saver(scp->sc, current_saver);
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp != scp->sc->cur_scp || scp->sc->blink_in_progress ||
|
|
|
|
|
scp->sc->switch_in_progress)
|
|
|
|
|
return;
|
|
|
|
|
/*
|
|
|
|
|
* FIXME: unlike scrn_timer(), we call scrn_update() from here even
|
|
|
|
|
* when write_in_progress is non-zero. XXX
|
|
|
|
|
*/
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!ISGRAPHSC(scp) && !(scp->sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
scrn_update(scp, TRUE);
|
1998-02-11 09:58:15 -05:00
|
|
|
}
|
|
|
|
|
|
1995-05-30 04:16:23 -04:00
|
|
|
static void
|
1997-04-20 12:05:33 -04: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-25 23:56:25 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
static time_t kbd_time_stamp = 0;
|
|
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
int again, rate;
|
2019-12-23 16:32:07 -05:00
|
|
|
int kbdidx;
|
2019-12-02 21:30:52 -05:00
|
|
|
|
|
|
|
|
again = (arg != NULL);
|
|
|
|
|
if (arg != NULL)
|
|
|
|
|
sc = (sc_softc_t *)arg;
|
|
|
|
|
else if (sc_console != NULL)
|
|
|
|
|
sc = sc_console->sc;
|
|
|
|
|
else
|
|
|
|
|
return;
|
1998-02-11 10:00:24 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* find the vty to update */
|
|
|
|
|
scp = sc->cur_scp;
|
|
|
|
|
|
|
|
|
|
/* don't do anything when we are performing some I/O operations */
|
|
|
|
|
if (suspend_in_progress || sc->font_loading_in_progress)
|
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
|
|
if ((sc->kbd == NULL) && (sc->config & SC_AUTODETECT_KBD)) {
|
|
|
|
|
/* try to allocate a keyboard automatically */
|
|
|
|
|
if (kbd_time_stamp != time_uptime) {
|
|
|
|
|
kbd_time_stamp = time_uptime;
|
2019-12-23 16:32:07 -05:00
|
|
|
kbdidx = sc_allocate_keyboard(sc, -1);
|
|
|
|
|
if (kbdidx >= 0) {
|
|
|
|
|
sc->kbd = kbd_get_keyboard(kbdidx);
|
2019-12-02 21:30:52 -05:00
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE,
|
|
|
|
|
(caddr_t)&sc->cur_scp->kbd_mode);
|
|
|
|
|
update_kbd_state(sc->cur_scp,
|
|
|
|
|
sc->cur_scp->status, LOCK_MASK);
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
1996-11-04 16:01:08 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* should we stop the screen saver? */
|
2020-01-12 01:07:54 -05:00
|
|
|
if (kdb_active || KERNEL_PANICKED() || shutdown_in_progress)
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_touch_scrn_saver();
|
|
|
|
|
if (run_scrn_saver) {
|
|
|
|
|
if (time_uptime > sc->scrn_time_stamp + scrn_blank_time)
|
|
|
|
|
sc->flags |= SC_SCRN_IDLE;
|
|
|
|
|
else
|
|
|
|
|
sc->flags &= ~SC_SCRN_IDLE;
|
|
|
|
|
} else {
|
|
|
|
|
sc->scrn_time_stamp = time_uptime;
|
|
|
|
|
sc->flags &= ~SC_SCRN_IDLE;
|
|
|
|
|
if (scrn_blank_time > 0)
|
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((saver_mode != CONS_LKM_SAVER) || !(sc->flags & SC_SCRN_IDLE))
|
|
|
|
|
if (sc->flags & SC_SCRN_BLANKED)
|
|
|
|
|
stop_scrn_saver(sc, current_saver);
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
1998-04-16 05:41:55 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* should we just return ? */
|
|
|
|
|
if (sc->blink_in_progress || sc->switch_in_progress ||
|
|
|
|
|
sc->write_in_progress)
|
|
|
|
|
goto done;
|
1998-04-16 05:41:55 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Update the screen */
|
|
|
|
|
scp = sc->cur_scp; /* cur_scp may have changed... */
|
|
|
|
|
if (!ISGRAPHSC(scp) && !(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
scrn_update(scp, TRUE);
|
1998-04-16 05:41:55 -04:00
|
|
|
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
/* should we activate the screen saver? */
|
|
|
|
|
if ((saver_mode == CONS_LKM_SAVER) && (sc->flags & SC_SCRN_IDLE))
|
|
|
|
|
if (!ISGRAPHSC(scp) || (sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
(*current_saver)(sc, TRUE);
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
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 10:43:27 -04:00
|
|
|
|
2013-03-04 09:00:58 -05:00
|
|
|
done:
|
2019-12-02 21:30:52 -05:00
|
|
|
if (again) {
|
|
|
|
|
/*
|
|
|
|
|
* Use reduced "refresh" rate if we are in graphics and that is
|
|
|
|
|
* not a graphical screen saver. In such case we just have
|
|
|
|
|
* nothing to do.
|
|
|
|
|
*/
|
|
|
|
|
if (ISGRAPHSC(scp) && !(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
rate = 2;
|
|
|
|
|
else
|
|
|
|
|
rate = 30;
|
|
|
|
|
callout_reset_sbt(
|
|
|
|
|
&sc->ctimeout, SBT_1S / rate, 0, scrn_timer, sc, C_PREL(1));
|
|
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
1995-02-22 08:48:07 -05:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static int
|
|
|
|
|
and_region(int *s1, int *e1, int s2, int e2)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (*e1 < s2 || e2 < *s1)
|
|
|
|
|
return FALSE;
|
|
|
|
|
*s1 = imax(*s1, s2);
|
|
|
|
|
*e1 = imin(*e1, e2);
|
|
|
|
|
return TRUE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static void
|
1998-02-11 09:58:15 -05:00
|
|
|
scrn_update(scr_stat *scp, int show_cursor)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int start;
|
|
|
|
|
int end;
|
|
|
|
|
int s;
|
|
|
|
|
int e;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp) */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifndef SC_NO_CUTPASTE
|
2019-12-02 21:30:52 -05:00
|
|
|
/* remove the previous mouse pointer image if necessary */
|
|
|
|
|
if (scp->status & MOUSE_VISIBLE) {
|
|
|
|
|
s = scp->mouse_pos;
|
|
|
|
|
e = scp->mouse_pos + scp->xsize + 1;
|
|
|
|
|
if ((scp->status & (MOUSE_MOVED | MOUSE_HIDDEN)) ||
|
|
|
|
|
and_region(&s, &e, scp->start, scp->end) ||
|
|
|
|
|
((scp->status & CURSOR_ENABLED) &&
|
|
|
|
|
(scp->cursor_pos != scp->cursor_oldpos) &&
|
|
|
|
|
(and_region(&s, &e, scp->cursor_pos, scp->cursor_pos) ||
|
|
|
|
|
and_region(&s, &e, scp->cursor_oldpos,
|
|
|
|
|
scp->cursor_oldpos)))) {
|
|
|
|
|
sc_remove_mouse_image(scp);
|
|
|
|
|
if (scp->end >= scp->xsize * scp->ysize)
|
|
|
|
|
scp->end = scp->xsize * scp->ysize - 1;
|
|
|
|
|
}
|
2000-03-31 11:05:46 -05:00
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* !SC_NO_CUTPASTE */
|
|
|
|
|
|
|
|
|
|
#if 1
|
2019-12-02 21:30:52 -05:00
|
|
|
/* debug: XXX */
|
|
|
|
|
if (scp->end >= scp->xsize * scp->ysize) {
|
|
|
|
|
printf("scrn_update(): scp->end %d > size_of_screen!!\n",
|
|
|
|
|
scp->end);
|
|
|
|
|
scp->end = scp->xsize * scp->ysize - 1;
|
|
|
|
|
}
|
|
|
|
|
if (scp->start < 0) {
|
|
|
|
|
printf("scrn_update(): scp->start %d < 0\n", scp->start);
|
|
|
|
|
scp->start = 0;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* update screen image */
|
|
|
|
|
if (scp->start <= scp->end) {
|
|
|
|
|
if (scp->mouse_cut_end >= 0) {
|
|
|
|
|
/* there is a marked region for cut & paste */
|
|
|
|
|
if (scp->mouse_cut_start <= scp->mouse_cut_end) {
|
|
|
|
|
start = scp->mouse_cut_start;
|
|
|
|
|
end = scp->mouse_cut_end;
|
|
|
|
|
} else {
|
|
|
|
|
start = scp->mouse_cut_end;
|
|
|
|
|
end = scp->mouse_cut_start - 1;
|
|
|
|
|
}
|
|
|
|
|
s = start;
|
|
|
|
|
e = end;
|
|
|
|
|
/* does the cut-mark region overlap with the update
|
|
|
|
|
* region? */
|
|
|
|
|
if (and_region(&s, &e, scp->start, scp->end)) {
|
|
|
|
|
(*scp->rndr->draw)(scp, s, e - s + 1, TRUE);
|
|
|
|
|
s = 0;
|
|
|
|
|
e = start - 1;
|
|
|
|
|
if (and_region(&s, &e, scp->start, scp->end))
|
|
|
|
|
(*scp->rndr->draw)(
|
|
|
|
|
scp, s, e - s + 1, FALSE);
|
|
|
|
|
s = end + 1;
|
|
|
|
|
e = scp->xsize * scp->ysize - 1;
|
|
|
|
|
if (and_region(&s, &e, scp->start, scp->end))
|
|
|
|
|
(*scp->rndr->draw)(
|
|
|
|
|
scp, s, e - s + 1, FALSE);
|
|
|
|
|
} else {
|
|
|
|
|
(*scp->rndr->draw)(scp, scp->start,
|
|
|
|
|
scp->end - scp->start + 1, FALSE);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
(*scp->rndr->draw)(
|
|
|
|
|
scp, scp->start, scp->end - scp->start + 1, FALSE);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
1998-02-11 09:58:15 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* we are not to show the cursor and the mouse pointer... */
|
|
|
|
|
if (!show_cursor) {
|
|
|
|
|
scp->end = 0;
|
|
|
|
|
scp->start = scp->xsize * scp->ysize - 1;
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
|
|
|
|
return;
|
|
|
|
|
}
|
1998-02-11 09:58:15 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* update cursor image */
|
|
|
|
|
if (scp->status & CURSOR_ENABLED) {
|
|
|
|
|
s = scp->start;
|
|
|
|
|
e = scp->end;
|
|
|
|
|
/* did cursor move since last time ? */
|
|
|
|
|
if (scp->cursor_pos != scp->cursor_oldpos) {
|
|
|
|
|
/* do we need to remove old cursor image ? */
|
|
|
|
|
if (!and_region(
|
|
|
|
|
&s, &e, scp->cursor_oldpos, scp->cursor_oldpos))
|
|
|
|
|
sc_remove_cursor_image(scp);
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
} else {
|
|
|
|
|
if (and_region(
|
|
|
|
|
&s, &e, scp->cursor_pos, scp->cursor_pos))
|
|
|
|
|
/* cursor didn't move, but has been overwritten
|
|
|
|
|
*/
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
else if (scp->curs_attr.flags & CONS_BLINK_CURSOR)
|
|
|
|
|
/* if it's a blinking cursor, update it */
|
|
|
|
|
(*scp->rndr->blink_cursor)(scp, scp->cursor_pos,
|
|
|
|
|
sc_inside_cutmark(scp, scp->cursor_pos));
|
|
|
|
|
}
|
|
|
|
|
}
|
1998-02-11 09:58:15 -05:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_CUTPASTE
|
2019-12-02 21:30:52 -05:00
|
|
|
/* update "pseudo" mouse pointer image */
|
|
|
|
|
if (scp->sc->flags & SC_MOUSE_ENABLED) {
|
|
|
|
|
if (!(scp->status & (MOUSE_VISIBLE | MOUSE_HIDDEN))) {
|
|
|
|
|
scp->status &= ~MOUSE_MOVED;
|
|
|
|
|
sc_draw_mouse_image(scp);
|
|
|
|
|
}
|
2000-03-31 11:05:46 -05:00
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* SC_NO_CUTPASTE */
|
1998-02-11 09:58:15 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->end = 0;
|
|
|
|
|
scp->start = scp->xsize * scp->ysize - 1;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
1998-02-11 09:58:15 -05:00
|
|
|
}
|
|
|
|
|
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
scsplash_callback(int event, void *arg)
|
1999-01-10 22:18:56 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
int error;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = (sc_softc_t *)arg;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
switch (event) {
|
|
|
|
|
case SPLASH_INIT:
|
|
|
|
|
if (add_scrn_saver(scsplash_saver) == 0) {
|
|
|
|
|
sc->flags &= ~SC_SAVER_FAILED;
|
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
if (cold && !(boothowto & RB_VERBOSE)) {
|
|
|
|
|
scsplash_stick(TRUE);
|
|
|
|
|
(*current_saver)(sc, TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
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;
|
|
|
|
|
}
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
scsplash_saver(sc_softc_t *sc, int show)
|
1999-01-10 22:18:56 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
static int busy = FALSE;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
|
|
|
|
|
if (busy)
|
|
|
|
|
return;
|
|
|
|
|
busy = TRUE;
|
|
|
|
|
|
|
|
|
|
scp = sc->cur_scp;
|
|
|
|
|
if (show) {
|
|
|
|
|
if (!(sc->flags & SC_SAVER_FAILED)) {
|
|
|
|
|
if (!(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
set_scrn_saver_mode(scp, -1, NULL, 0);
|
|
|
|
|
switch (splash(sc->adp, TRUE)) {
|
|
|
|
|
case 0: /* succeeded */
|
|
|
|
|
break;
|
|
|
|
|
case EAGAIN: /* try later */
|
|
|
|
|
restore_scrn_saver_mode(scp, FALSE);
|
|
|
|
|
sc_touch_scrn_saver(); /* XXX */
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
sc->flags |= SC_SAVER_FAILED;
|
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
restore_scrn_saver_mode(scp, TRUE);
|
|
|
|
|
printf(
|
|
|
|
|
"scsplash_saver(): failed to put up the image\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (!sticky_splash) {
|
|
|
|
|
if ((sc->flags & SC_SCRN_BLANKED) &&
|
|
|
|
|
(splash(sc->adp, FALSE) == 0))
|
|
|
|
|
restore_scrn_saver_mode(scp, TRUE);
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
busy = FALSE;
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
add_scrn_saver(void (*this_saver)(sc_softc_t *, 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 10:43:27 -04:00
|
|
|
{
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#if 0
|
1999-01-10 22:18:56 -05:00
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
if (current_saver != none_saver) {
|
|
|
|
|
error = remove_scrn_saver(current_saver);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
1998-08-03 07:30:45 -04:00
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
if (current_saver != none_saver)
|
|
|
|
|
return EBUSY;
|
1998-08-03 07:30:45 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
saver_mode = CONS_LKM_SAVER;
|
|
|
|
|
current_saver = this_saver;
|
|
|
|
|
return 0;
|
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 10:43:27 -04:00
|
|
|
}
|
|
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
remove_scrn_saver(void (*this_saver)(sc_softc_t *, 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 10:43:27 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (current_saver != this_saver)
|
|
|
|
|
return EINVAL;
|
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 10:43:27 -04:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#if 0
|
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 10:43:27 -04:00
|
|
|
/*
|
|
|
|
|
* 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-10 22:18:56 -05: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 10:43:27 -04:00
|
|
|
stop_scrn_saver(this_saver);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* unblank all blanked screens */
|
|
|
|
|
wait_scrn_saver_stop(NULL);
|
|
|
|
|
if (scrn_blanked)
|
|
|
|
|
return EBUSY;
|
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 10:43:27 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
current_saver = none_saver;
|
|
|
|
|
return 0;
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
1998-08-03 07:30:45 -04:00
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
|
|
|
|
set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int s;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp) */
|
1999-01-10 22:18:56 -05:00
|
|
|
s = spltty();
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!ISGRAPHSC(scp))
|
|
|
|
|
sc_remove_cursor_image(scp);
|
|
|
|
|
scp->splash_save_mode = scp->mode;
|
|
|
|
|
scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
|
|
|
|
|
scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
|
|
|
|
|
scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
|
|
|
|
|
scp->sc->flags |= SC_SCRN_BLANKED;
|
|
|
|
|
++scrn_blanked;
|
1999-01-10 22:18:56 -05:00
|
|
|
splx(s);
|
2019-12-02 21:30:52 -05:00
|
|
|
if (mode < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
scp->mode = mode;
|
|
|
|
|
if (set_mode(scp) == 0) {
|
|
|
|
|
if (scp->sc->adp->va_info.vi_flags & V_INFO_GRAPHICS)
|
|
|
|
|
scp->status |= GRAPHICS_MODE;
|
|
|
|
|
#ifndef SC_NO_PALETTE_LOADING
|
|
|
|
|
if (pal != NULL)
|
|
|
|
|
vidd_load_palette(scp->sc->adp, pal);
|
|
|
|
|
#endif
|
|
|
|
|
sc_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 10:43:27 -04:00
|
|
|
}
|
|
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
1999-01-17 09:23:15 -05:00
|
|
|
restore_scrn_saver_mode(scr_stat *scp, int changemode)
|
1998-09-15 14:16:39 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int mode;
|
|
|
|
|
int status;
|
|
|
|
|
int s;
|
|
|
|
|
|
|
|
|
|
/* assert(scp == scp->sc->cur_scp) */
|
|
|
|
|
s = spltty();
|
|
|
|
|
mode = scp->mode;
|
|
|
|
|
status = scp->status;
|
|
|
|
|
scp->mode = scp->splash_save_mode;
|
|
|
|
|
scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
|
|
|
|
|
scp->status |= scp->splash_save_status;
|
|
|
|
|
scp->sc->flags &= ~SC_SCRN_BLANKED;
|
|
|
|
|
if (!changemode) {
|
|
|
|
|
if (!ISGRAPHSC(scp))
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
--scrn_blanked;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if (set_mode(scp) == 0) {
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_PALETTE_LOADING
|
2010-02-23 16:51:14 -05:00
|
|
|
#ifdef SC_PIXEL_MODE
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
|
|
|
|
|
vidd_load_palette(scp->sc->adp, scp->sc->palette2);
|
|
|
|
|
else
|
2010-02-23 16:51:14 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
vidd_load_palette(scp->sc->adp, scp->sc->palette);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
--scrn_blanked;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
scp->mode = mode;
|
|
|
|
|
scp->status = status;
|
|
|
|
|
splx(s);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
1998-09-15 14:16:39 -04: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 10:43:27 -04:00
|
|
|
static void
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
stop_scrn_saver(sc_softc_t *sc, void (*saver)(sc_softc_t *, 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 10:43:27 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
(*saver)(sc, FALSE);
|
|
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
/* the screen saver may have chosen not to stop after all... */
|
|
|
|
|
if (sc->flags & SC_SCRN_BLANKED)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
mark_all(sc->cur_scp);
|
|
|
|
|
if (sc->delayed_next_scr)
|
|
|
|
|
sc_switch_scr(sc, sc->delayed_next_scr - 1);
|
|
|
|
|
if (!kdb_active)
|
|
|
|
|
wakeup(&scrn_blanked);
|
1998-04-04 11:26:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
wait_scrn_saver_stop(sc_softc_t *sc)
|
1998-04-04 11:26:53 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int error = 0;
|
1998-04-04 11:26:53 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
while (scrn_blanked > 0) {
|
|
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
if (sc && !(sc->flags & SC_SCRN_BLANKED)) {
|
|
|
|
|
error = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
error = tsleep(&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
|
|
|
|
|
if ((error != 0) && (error != ERESTART))
|
|
|
|
|
break;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
run_scrn_saver = FALSE;
|
|
|
|
|
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 10:43:27 -04:00
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif /* DEV_SPLASH */
|
1999-01-10 22:18:56 -05:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_touch_scrn_saver(void)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
run_scrn_saver = FALSE;
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
|
|
|
|
|
2000-01-15 10:25:43 -05:00
|
|
|
int
|
|
|
|
|
sc_switch_scr(sc_softc_t *sc, u_int next_scr)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *cur_scp;
|
|
|
|
|
struct tty *tp;
|
|
|
|
|
struct proc *p;
|
|
|
|
|
int s;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
DPRINTF(5, ("sc0: sc_switch_scr() %d ", next_scr + 1));
|
2003-10-29 15:48:13 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->cur_scp == NULL)
|
|
|
|
|
return (0);
|
2002-07-09 23:29:38 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* prevent switch if previously requested */
|
|
|
|
|
if (sc->flags & SC_SCRN_VTYLOCK) {
|
|
|
|
|
sc_bell(sc->cur_scp, sc->cur_scp->bell_pitch,
|
|
|
|
|
sc->cur_scp->bell_duration);
|
|
|
|
|
return EPERM;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* delay switch if the screen is blanked or being updated */
|
|
|
|
|
if ((sc->flags & SC_SCRN_BLANKED) || sc->write_in_progress ||
|
|
|
|
|
sc->blink_in_progress) {
|
|
|
|
|
sc->delayed_next_scr = next_scr + 1;
|
|
|
|
|
sc_touch_scrn_saver();
|
|
|
|
|
DPRINTF(5, ("switch delayed\n"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
sc->delayed_next_scr = 0;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
s = spltty();
|
|
|
|
|
cur_scp = sc->cur_scp;
|
|
|
|
|
|
|
|
|
|
/* we are in the middle of the vty switching process... */
|
|
|
|
|
if (sc->switch_in_progress && (cur_scp->smode.mode == VT_PROCESS) &&
|
|
|
|
|
cur_scp->proc) {
|
|
|
|
|
p = pfind(cur_scp->pid);
|
|
|
|
|
if (cur_scp->proc != p) {
|
|
|
|
|
if (p)
|
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
|
/*
|
|
|
|
|
* The controlling process has died!!. Do some clean
|
|
|
|
|
* up. NOTE:`cur_scp->proc' and `cur_scp->smode.mode'
|
|
|
|
|
* are not reset here yet; they will be cleared later.
|
|
|
|
|
*/
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("cur_scp controlling process %d died, ",
|
|
|
|
|
cur_scp->pid));
|
|
|
|
|
if (cur_scp->status & SWITCH_WAIT_REL) {
|
|
|
|
|
/*
|
|
|
|
|
* Force the previous switch to finish, but
|
|
|
|
|
* return now with error.
|
|
|
|
|
*/
|
|
|
|
|
DPRINTF(5, ("reset WAIT_REL, "));
|
|
|
|
|
finish_vt_rel(cur_scp, TRUE, &s);
|
|
|
|
|
splx(s);
|
|
|
|
|
DPRINTF(5, ("finishing previous switch\n"));
|
|
|
|
|
return EINVAL;
|
|
|
|
|
} else if (cur_scp->status & SWITCH_WAIT_ACQ) {
|
|
|
|
|
/* let's assume screen switch has been
|
|
|
|
|
* completed. */
|
|
|
|
|
DPRINTF(5, ("reset WAIT_ACQ, "));
|
|
|
|
|
finish_vt_acq(cur_scp);
|
|
|
|
|
} else {
|
|
|
|
|
/*
|
|
|
|
|
* We are in between screen release and
|
|
|
|
|
* acquisition, and reached here via scgetc() or
|
|
|
|
|
* scrn_timer() which has interrupted
|
|
|
|
|
* exchange_scr(). Don't do anything stupid.
|
|
|
|
|
*/
|
|
|
|
|
DPRINTF(5, ("waiting nothing, "));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (p)
|
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
|
/*
|
|
|
|
|
* The controlling process is alive, but not
|
|
|
|
|
* responding... It is either buggy or it may be just
|
|
|
|
|
* taking time. The following code is a gross kludge to
|
|
|
|
|
* cope with this problem for which there is no clean
|
|
|
|
|
* solution. XXX
|
|
|
|
|
*/
|
|
|
|
|
if (cur_scp->status & SWITCH_WAIT_REL) {
|
|
|
|
|
switch (sc->switch_in_progress++) {
|
|
|
|
|
case 1:
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
DPRINTF(5, ("sending relsig again, "));
|
|
|
|
|
signal_vt_rel(cur_scp);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
default:
|
|
|
|
|
/*
|
|
|
|
|
* Act as if the controlling program
|
|
|
|
|
* returned VT_FALSE.
|
|
|
|
|
*/
|
|
|
|
|
DPRINTF(5, ("force reset WAIT_REL, "));
|
|
|
|
|
finish_vt_rel(cur_scp, FALSE, &s);
|
|
|
|
|
splx(s);
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("act as if VT_FALSE was seen\n"));
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
} else if (cur_scp->status & SWITCH_WAIT_ACQ) {
|
|
|
|
|
switch (sc->switch_in_progress++) {
|
|
|
|
|
case 1:
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
DPRINTF(5, ("sending acqsig again, "));
|
|
|
|
|
signal_vt_acq(cur_scp);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
default:
|
|
|
|
|
/* clear the flag and finish the
|
|
|
|
|
* previous switch */
|
|
|
|
|
DPRINTF(5, ("force reset WAIT_ACQ, "));
|
|
|
|
|
finish_vt_acq(cur_scp);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1994-02-01 01:22:29 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* Return error if an invalid argument is given, or vty switch
|
|
|
|
|
* is still in progress.
|
|
|
|
|
*/
|
|
|
|
|
if ((next_scr < sc->first_vty) ||
|
|
|
|
|
(next_scr >= sc->first_vty + sc->vtys) || sc->switch_in_progress) {
|
|
|
|
|
splx(s);
|
|
|
|
|
sc_bell(cur_scp, bios_value.bell_pitch, BELL_DURATION);
|
|
|
|
|
DPRINTF(5, ("error 1\n"));
|
|
|
|
|
return EINVAL;
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Don't allow switching away from the graphics mode vty
|
|
|
|
|
* if the switch mode is VT_AUTO, unless the next vty is the same
|
|
|
|
|
* as the current or the current vty has been closed (but showing).
|
|
|
|
|
*/
|
|
|
|
|
tp = SC_DEV(sc, cur_scp->index);
|
|
|
|
|
if ((cur_scp->index != next_scr) && tty_opened_ns(tp) &&
|
|
|
|
|
(cur_scp->smode.mode == VT_AUTO) && ISGRAPHSC(cur_scp)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
sc_bell(cur_scp, bios_value.bell_pitch, BELL_DURATION);
|
|
|
|
|
DPRINTF(5, ("error, graphics mode\n"));
|
|
|
|
|
return EINVAL;
|
2001-06-30 05:10:00 -04:00
|
|
|
}
|
1998-04-17 06:03:11 -04:00
|
|
|
|
2001-08-07 07:51:26 -04:00
|
|
|
/*
|
2019-12-02 21:30:52 -05:00
|
|
|
* Is the wanted vty open? Don't allow switching to a closed vty.
|
|
|
|
|
* If we are in DDB, don't switch to a vty in the VT_PROCESS mode.
|
|
|
|
|
* Note that we always allow the user to switch to the kernel
|
|
|
|
|
* console even if it is closed.
|
2001-08-07 07:51:26 -04:00
|
|
|
*/
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((sc_console == NULL) || (next_scr != sc_console->index)) {
|
|
|
|
|
tp = SC_DEV(sc, next_scr);
|
|
|
|
|
if (!tty_opened_ns(tp)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
sc_bell(cur_scp, bios_value.bell_pitch, BELL_DURATION);
|
|
|
|
|
DPRINTF(5, ("error 2, requested vty isn't open!\n"));
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
if (kdb_active && SC_STAT(tp)->smode.mode == VT_PROCESS) {
|
|
|
|
|
splx(s);
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("error 3, requested vty is in the VT_PROCESS mode\n"));
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* this is the start of vty switching process... */
|
|
|
|
|
++sc->switch_in_progress;
|
|
|
|
|
sc->old_scp = cur_scp;
|
|
|
|
|
sc->new_scp = sc_get_stat(SC_DEV(sc, next_scr));
|
|
|
|
|
if (sc->new_scp == sc->old_scp) {
|
|
|
|
|
sc->switch_in_progress = 0;
|
|
|
|
|
/*
|
|
|
|
|
* XXX wakeup() locks the scheduler lock which will hang if
|
|
|
|
|
* the lock is in an in-between state, e.g., when we stop at
|
|
|
|
|
* a breakpoint at fork_exit. It has always been wrong to call
|
|
|
|
|
* wakeup() when the debugger is active. In RELENG_4, wakeup()
|
|
|
|
|
* is supposed to be locked by splhigh(), but the debugger may
|
|
|
|
|
* be invoked at splhigh().
|
|
|
|
|
*/
|
|
|
|
|
if (!kdb_active)
|
|
|
|
|
wakeup(VTY_WCHAN(sc, next_scr));
|
|
|
|
|
splx(s);
|
|
|
|
|
DPRINTF(5, ("switch done (new == old)\n"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* has controlling process died? */
|
|
|
|
|
vt_proc_alive(sc->old_scp);
|
|
|
|
|
vt_proc_alive(sc->new_scp);
|
1995-05-30 04:16:23 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* wait for the controlling process to release the screen, if necessary
|
|
|
|
|
*/
|
|
|
|
|
if (signal_vt_rel(sc->old_scp)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* go set up the new vty screen */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
splx(s);
|
2019-12-02 21:30:52 -05:00
|
|
|
exchange_scr(sc);
|
|
|
|
|
s = spltty();
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* wake up processes waiting for this vty */
|
|
|
|
|
if (!kdb_active)
|
|
|
|
|
wakeup(VTY_WCHAN(sc, next_scr));
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* wait for the controlling process to acknowledge, if necessary */
|
|
|
|
|
if (signal_vt_acq(sc->cur_scp)) {
|
|
|
|
|
splx(s);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc->switch_in_progress = 0;
|
|
|
|
|
if (sc->unit == sc_console_unit)
|
|
|
|
|
cnavailable(sc_consptr, TRUE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
splx(s);
|
2019-12-02 21:30:52 -05:00
|
|
|
DPRINTF(5, ("switch done\n"));
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static int
|
|
|
|
|
do_switch_scr(sc_softc_t *sc, int s)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
vt_proc_alive(sc->new_scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
splx(s);
|
|
|
|
|
exchange_scr(sc);
|
|
|
|
|
s = spltty();
|
|
|
|
|
/* sc->cur_scp == sc->new_scp */
|
|
|
|
|
wakeup(VTY_WCHAN(sc, sc->cur_scp->index));
|
|
|
|
|
|
|
|
|
|
/* wait for the controlling process to acknowledge, if necessary */
|
|
|
|
|
if (!signal_vt_acq(sc->cur_scp)) {
|
|
|
|
|
sc->switch_in_progress = 0;
|
|
|
|
|
if (sc->unit == sc_console_unit)
|
|
|
|
|
cnavailable(sc_consptr, TRUE);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return s;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
vt_proc_alive(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
struct proc *p;
|
|
|
|
|
|
|
|
|
|
if (scp->proc) {
|
|
|
|
|
if ((p = pfind(scp->pid)) != NULL)
|
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
|
if (scp->proc == p)
|
|
|
|
|
return TRUE;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
DPRINTF(5, ("vt controlling process %d died\n", scp->pid));
|
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
signal_vt_rel(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->smode.mode != VT_PROCESS)
|
|
|
|
|
return FALSE;
|
|
|
|
|
scp->status |= SWITCH_WAIT_REL;
|
|
|
|
|
PROC_LOCK(scp->proc);
|
|
|
|
|
kern_psignal(scp->proc, scp->smode.relsig);
|
|
|
|
|
PROC_UNLOCK(scp->proc);
|
|
|
|
|
DPRINTF(5, ("sending relsig to %d\n", scp->pid));
|
|
|
|
|
return TRUE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
signal_vt_acq(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->smode.mode != VT_PROCESS)
|
|
|
|
|
return FALSE;
|
|
|
|
|
if (scp->sc->unit == sc_console_unit)
|
|
|
|
|
cnavailable(sc_consptr, FALSE);
|
|
|
|
|
scp->status |= SWITCH_WAIT_ACQ;
|
|
|
|
|
PROC_LOCK(scp->proc);
|
|
|
|
|
kern_psignal(scp->proc, scp->smode.acqsig);
|
|
|
|
|
PROC_UNLOCK(scp->proc);
|
|
|
|
|
DPRINTF(5, ("sending acqsig to %d\n", scp->pid));
|
|
|
|
|
return TRUE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
2001-07-20 09:10:59 -04:00
|
|
|
static int
|
|
|
|
|
finish_vt_rel(scr_stat *scp, int release, int *s)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp == scp->sc->old_scp && scp->status & SWITCH_WAIT_REL) {
|
|
|
|
|
scp->status &= ~SWITCH_WAIT_REL;
|
|
|
|
|
if (release)
|
|
|
|
|
*s = do_switch_scr(scp->sc, *s);
|
|
|
|
|
else
|
|
|
|
|
scp->sc->switch_in_progress = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
2001-07-20 09:10:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
finish_vt_acq(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp == scp->sc->new_scp && scp->status & SWITCH_WAIT_ACQ) {
|
|
|
|
|
scp->status &= ~SWITCH_WAIT_ACQ;
|
|
|
|
|
scp->sc->switch_in_progress = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return EINVAL;
|
2001-07-20 09:10:59 -04:00
|
|
|
}
|
|
|
|
|
|
1995-05-30 04:16:23 -04:00
|
|
|
static void
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
exchange_scr(sc_softc_t *sc)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp;
|
|
|
|
|
|
|
|
|
|
/* save the current state of video and keyboard */
|
|
|
|
|
sc_move_cursor(sc->old_scp, sc->old_scp->xpos, sc->old_scp->ypos);
|
|
|
|
|
if (!ISGRAPHSC(sc->old_scp))
|
|
|
|
|
sc_remove_cursor_image(sc->old_scp);
|
|
|
|
|
if (sc->old_scp->kbd_mode == K_XLATE)
|
|
|
|
|
save_kbd_state(sc->old_scp);
|
|
|
|
|
|
|
|
|
|
/* set up the video for the new screen */
|
|
|
|
|
scp = sc->cur_scp = sc->new_scp;
|
|
|
|
|
if (sc->old_scp->mode != scp->mode || ISUNKNOWNSC(sc->old_scp))
|
|
|
|
|
set_mode(scp);
|
|
|
|
|
else
|
|
|
|
|
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
(void *)sc->adp->va_window, FALSE);
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->status |= MOUSE_HIDDEN;
|
|
|
|
|
sc_move_cursor(scp, scp->xpos, scp->ypos);
|
|
|
|
|
if (!ISGRAPHSC(scp))
|
|
|
|
|
sc_set_cursor_image(scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_PALETTE_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
if (ISGRAPHSC(sc->old_scp)) {
|
2010-02-23 16:51:14 -05:00
|
|
|
#ifdef SC_PIXEL_MODE
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
|
|
|
|
|
vidd_load_palette(sc->adp, sc->palette2);
|
|
|
|
|
else
|
2010-02-23 16:51:14 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
vidd_load_palette(sc->adp, sc->palette);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_set_border(scp, scp->border);
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* set up the keyboard for the new screen */
|
|
|
|
|
if (sc->kbd_open_level == 0 && sc->old_scp->kbd_mode != scp->kbd_mode)
|
|
|
|
|
(void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
|
|
|
|
|
update_kbd_state(scp, scp->status, LOCK_MASK);
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
mark_all(scp);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2011-12-11 16:10:11 -05:00
|
|
|
static void
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
sc_puts(scr_stat *scp, u_char *buf, int len)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
/* make screensaver happy */
|
|
|
|
|
if (!sticky_splash && scp == scp->sc->cur_scp && !sc_saver_keyb_only)
|
|
|
|
|
run_scrn_saver = FALSE;
|
1999-07-01 16:43:03 -04:00
|
|
|
#endif
|
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 10:43:27 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->tsw)
|
|
|
|
|
(*scp->tsw->te_puts)(scp, buf, len);
|
|
|
|
|
if (scp->sc->delayed_next_scr)
|
|
|
|
|
sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2000-01-15 10:25:43 -05:00
|
|
|
void
|
|
|
|
|
sc_draw_cursor_image(scr_stat *scp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp); */
|
|
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
|
|
|
|
(*scp->rndr->draw_cursor)(scp, scp->cursor_pos,
|
|
|
|
|
scp->curs_attr.flags & CONS_BLINK_CURSOR, TRUE,
|
|
|
|
|
sc_inside_cutmark(scp, scp->cursor_pos));
|
|
|
|
|
scp->cursor_oldpos = scp->cursor_pos;
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2000-01-15 10:25:43 -05:00
|
|
|
void
|
|
|
|
|
sc_remove_cursor_image(scr_stat *scp)
|
1998-08-03 05:18:58 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp); */
|
|
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
|
|
|
|
(*scp->rndr->draw_cursor)(scp, scp->cursor_oldpos,
|
|
|
|
|
scp->curs_attr.flags & CONS_BLINK_CURSOR, FALSE,
|
|
|
|
|
sc_inside_cutmark(scp, scp->cursor_oldpos));
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
1998-08-03 05:18:58 -04:00
|
|
|
}
|
|
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void
|
|
|
|
|
update_cursor_image(scr_stat *scp)
|
1997-11-21 06:37:07 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp); */
|
|
|
|
|
sc_remove_cursor_image(scp);
|
|
|
|
|
sc_set_cursor_image(scp);
|
|
|
|
|
sc_draw_cursor_image(scp);
|
2001-08-02 04:30:40 -04:00
|
|
|
}
|
1997-11-21 06:37:07 -05:00
|
|
|
|
2001-08-02 04:30:40 -04:00
|
|
|
void
|
|
|
|
|
sc_set_cursor_image(scr_stat *scp)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->curs_attr = scp->base_curs_attr;
|
|
|
|
|
if (scp->curs_attr.flags & CONS_HIDDEN_CURSOR) {
|
|
|
|
|
/* hidden cursor is internally represented as zero-height
|
|
|
|
|
* underline */
|
|
|
|
|
scp->curs_attr.flags = CONS_CHAR_CURSOR;
|
|
|
|
|
scp->curs_attr.base = scp->curs_attr.height = 0;
|
|
|
|
|
} else if (scp->curs_attr.flags & CONS_CHAR_CURSOR) {
|
|
|
|
|
scp->curs_attr.base =
|
|
|
|
|
imin(scp->base_curs_attr.base, scp->font_size - 1);
|
|
|
|
|
scp->curs_attr.height = imin(scp->base_curs_attr.height,
|
|
|
|
|
scp->font_size - scp->curs_attr.base);
|
|
|
|
|
} else { /* block cursor */
|
|
|
|
|
scp->curs_attr.base = 0;
|
|
|
|
|
scp->curs_attr.height = scp->font_size;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(scp == scp->sc->cur_scp); */
|
|
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
|
|
|
|
(*scp->rndr->set_cursor)(scp, scp->curs_attr.base,
|
|
|
|
|
scp->curs_attr.height, scp->curs_attr.flags & CONS_BLINK_CURSOR);
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
1997-11-21 06:37:07 -05:00
|
|
|
}
|
|
|
|
|
|
2017-08-19 17:40:42 -04:00
|
|
|
static void
|
|
|
|
|
sc_adjust_ca(struct cursor_attr *cap, int flags, int base, int height)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (flags & CONS_CHARCURSOR_COLORS) {
|
|
|
|
|
cap->bg[0] = base & 0xff;
|
|
|
|
|
cap->bg[1] = height & 0xff;
|
|
|
|
|
} else if (flags & CONS_MOUSECURSOR_COLORS) {
|
|
|
|
|
cap->mouse_ba = base & 0xff;
|
|
|
|
|
cap->mouse_ia = height & 0xff;
|
|
|
|
|
} else {
|
|
|
|
|
if (base >= 0)
|
|
|
|
|
cap->base = base;
|
|
|
|
|
if (height >= 0)
|
|
|
|
|
cap->height = height;
|
|
|
|
|
if (!(flags & CONS_SHAPEONLY_CURSOR))
|
|
|
|
|
cap->flags = flags & CONS_CURSOR_ATTRS;
|
|
|
|
|
}
|
2017-08-19 17:40:42 -04:00
|
|
|
}
|
|
|
|
|
|
2001-08-02 04:30:40 -04:00
|
|
|
static void
|
|
|
|
|
change_cursor_shape(scr_stat *scp, int flags, int base, int height)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((scp == scp->sc->cur_scp) && !ISGRAPHSC(scp))
|
|
|
|
|
sc_remove_cursor_image(scp);
|
|
|
|
|
|
|
|
|
|
if (flags & CONS_RESET_CURSOR)
|
|
|
|
|
scp->base_curs_attr = scp->dflt_curs_attr;
|
|
|
|
|
else if (flags & CONS_DEFAULT_CURSOR) {
|
|
|
|
|
sc_adjust_ca(&scp->dflt_curs_attr, flags, base, height);
|
|
|
|
|
scp->base_curs_attr = scp->dflt_curs_attr;
|
|
|
|
|
} else
|
|
|
|
|
sc_adjust_ca(&scp->base_curs_attr, flags, base, height);
|
|
|
|
|
|
|
|
|
|
if ((scp == scp->sc->cur_scp) && !ISGRAPHSC(scp)) {
|
|
|
|
|
sc_set_cursor_image(scp);
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
}
|
2001-08-02 04:30:40 -04:00
|
|
|
}
|
|
|
|
|
|
1998-09-15 14:16:39 -04:00
|
|
|
void
|
2001-08-02 04:30:40 -04:00
|
|
|
sc_change_cursor_shape(scr_stat *scp, int flags, int base, int height)
|
1997-11-21 06:37:07 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
struct tty *tp;
|
|
|
|
|
int s;
|
|
|
|
|
int i;
|
2001-08-02 04:30:40 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (flags == -1)
|
|
|
|
|
flags = CONS_SHAPEONLY_CURSOR;
|
2017-08-19 17:40:42 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
s = spltty();
|
|
|
|
|
if (flags & CONS_LOCAL_CURSOR) {
|
|
|
|
|
/* local (per vty) change */
|
|
|
|
|
change_cursor_shape(scp, flags, base, height);
|
|
|
|
|
splx(s);
|
|
|
|
|
return;
|
|
|
|
|
}
|
1998-09-15 14:16:39 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* global change */
|
|
|
|
|
sc = scp->sc;
|
|
|
|
|
if (flags & CONS_RESET_CURSOR)
|
|
|
|
|
sc->curs_attr = sc->dflt_curs_attr;
|
|
|
|
|
else if (flags & CONS_DEFAULT_CURSOR) {
|
|
|
|
|
sc_adjust_ca(&sc->dflt_curs_attr, flags, base, height);
|
|
|
|
|
sc->curs_attr = sc->dflt_curs_attr;
|
|
|
|
|
} else
|
|
|
|
|
sc_adjust_ca(&sc->curs_attr, flags, base, height);
|
|
|
|
|
|
|
|
|
|
for (i = sc->first_vty; i < sc->first_vty + sc->vtys; ++i) {
|
|
|
|
|
if ((tp = SC_DEV(sc, i)) == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
if ((scp = sc_get_stat(tp)) == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
scp->dflt_curs_attr = sc->curs_attr;
|
|
|
|
|
change_cursor_shape(scp, CONS_RESET_CURSOR, -1, -1);
|
|
|
|
|
}
|
|
|
|
|
splx(s);
|
1997-11-21 06:37:07 -05:00
|
|
|
}
|
|
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
static void
|
|
|
|
|
scinit(int unit, int flags)
|
1998-09-15 14:16:39 -04:00
|
|
|
{
|
2004-10-14 04:58:28 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/*
|
|
|
|
|
* When syscons is being initialized as the kernel console, malloc()
|
|
|
|
|
* is not yet functional, because various kernel structures has not been
|
|
|
|
|
* fully initialized yet. Therefore, we need to declare the following
|
|
|
|
|
* static buffers for the console. This is less than ideal,
|
|
|
|
|
* but is necessry evil for the time being. XXX
|
|
|
|
|
*/
|
|
|
|
|
static u_short sc_buffer[ROW * COL]; /* XXX */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
static u_char font_8[256 * 8];
|
|
|
|
|
static u_char font_14[256 * 14];
|
|
|
|
|
static u_char font_16[256 * 16];
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
1998-09-15 14:16:39 -04:00
|
|
|
|
2018-06-02 10:07:27 -04:00
|
|
|
#ifdef SC_KERNEL_CONS_ATTRS
|
2019-12-02 21:30:52 -05:00
|
|
|
static const u_char dflt_kattrtab[] = SC_KERNEL_CONS_ATTRS;
|
2018-06-02 10:07:27 -04:00
|
|
|
#elif SC_KERNEL_CONS_ATTR == FG_WHITE
|
2019-12-02 21:30:52 -05:00
|
|
|
static const u_char dflt_kattrtab[] = {
|
|
|
|
|
FG_WHITE,
|
|
|
|
|
FG_YELLOW,
|
|
|
|
|
FG_LIGHTMAGENTA,
|
|
|
|
|
FG_LIGHTRED,
|
|
|
|
|
FG_LIGHTCYAN,
|
|
|
|
|
FG_LIGHTGREEN,
|
|
|
|
|
FG_LIGHTBLUE,
|
|
|
|
|
FG_GREEN,
|
|
|
|
|
0,
|
|
|
|
|
};
|
2018-06-02 10:07:27 -04:00
|
|
|
#else
|
2019-12-02 21:30:52 -05:00
|
|
|
static const u_char dflt_kattrtab[] = {
|
|
|
|
|
FG_WHITE,
|
|
|
|
|
0,
|
|
|
|
|
};
|
2018-06-02 10:07:27 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
|
|
|
|
video_adapter_t *adp;
|
|
|
|
|
int col;
|
2019-12-23 16:32:07 -05:00
|
|
|
int kbdidx;
|
2019-12-02 21:30:52 -05:00
|
|
|
int row;
|
|
|
|
|
int i;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* one time initialization */
|
|
|
|
|
if (init_done == COLD) {
|
|
|
|
|
sc_get_bios_values(&bios_value);
|
|
|
|
|
for (i = 0; i < nitems(sc_kattrtab); i++)
|
|
|
|
|
sc_kattrtab[i] =
|
|
|
|
|
dflt_kattrtab[i % (nitems(dflt_kattrtab) - 1)];
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
2019-12-02 21:30:52 -05:00
|
|
|
init_done = WARM;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Allocate resources. Even if we are being called for the second
|
|
|
|
|
* time, we must allocate them again, because they might have
|
|
|
|
|
* disappeared...
|
|
|
|
|
*/
|
|
|
|
|
sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE);
|
|
|
|
|
if ((sc->flags & SC_INIT_DONE) == 0)
|
|
|
|
|
SC_VIDEO_LOCKINIT(sc);
|
|
|
|
|
|
|
|
|
|
adp = NULL;
|
|
|
|
|
if (sc->adapter >= 0) {
|
|
|
|
|
vid_release(sc->adp, (void *)&sc->adapter);
|
|
|
|
|
adp = sc->adp;
|
|
|
|
|
sc->adp = NULL;
|
|
|
|
|
}
|
2019-12-23 16:32:07 -05:00
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
DPRINTF(5, ("sc%d: releasing kbd%d\n", unit,
|
|
|
|
|
sc->kbd->kb_index));
|
|
|
|
|
i = kbd_release(sc->kbd, (void *)&sc->kbd);
|
2019-12-02 21:30:52 -05:00
|
|
|
DPRINTF(5, ("sc%d: kbd_release returned %d\n", unit, i));
|
|
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
DPRINTF(5,
|
|
|
|
|
("sc%d: kbd != NULL!, index:%d, unit:%d, flags:0x%x\n",
|
|
|
|
|
unit, sc->kbd->kb_index, sc->kbd->kb_unit,
|
|
|
|
|
sc->kbd->kb_flags));
|
|
|
|
|
}
|
|
|
|
|
sc->kbd = NULL;
|
|
|
|
|
}
|
|
|
|
|
sc->adapter = vid_allocate("*", unit, (void *)&sc->adapter);
|
|
|
|
|
sc->adp = vid_get_adapter(sc->adapter);
|
|
|
|
|
/* assert((sc->adapter >= 0) && (sc->adp != NULL)) */
|
2006-02-28 18:46:23 -05:00
|
|
|
|
2019-12-23 16:32:07 -05:00
|
|
|
kbdidx = sc_allocate_keyboard(sc, unit);
|
|
|
|
|
DPRINTF(1, ("sc%d: keyboard %d\n", unit, kbdidx));
|
2006-02-28 18:46:23 -05:00
|
|
|
|
2019-12-23 16:32:07 -05:00
|
|
|
sc->kbd = kbd_get_keyboard(kbdidx);
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->kbd != NULL) {
|
|
|
|
|
DPRINTF(1,
|
|
|
|
|
("sc%d: kbd index:%d, unit:%d, flags:0x%x\n", unit,
|
|
|
|
|
sc->kbd->kb_index, sc->kbd->kb_unit,
|
|
|
|
|
sc->kbd->kb_flags));
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!(sc->flags & SC_INIT_DONE) || (adp != sc->adp)) {
|
|
|
|
|
sc->initial_mode = sc->adp->va_initial_mode;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
if (flags & SC_KERNEL_CONSOLE) {
|
|
|
|
|
sc->font_8 = font_8;
|
|
|
|
|
sc->font_14 = font_14;
|
|
|
|
|
sc->font_16 = font_16;
|
|
|
|
|
} else if (sc->font_8 == NULL) {
|
|
|
|
|
/* assert(sc_malloc) */
|
|
|
|
|
sc->font_8 = malloc(sizeof(font_8), M_DEVBUF, M_WAITOK);
|
|
|
|
|
sc->font_14 =
|
|
|
|
|
malloc(sizeof(font_14), M_DEVBUF, M_WAITOK);
|
|
|
|
|
sc->font_16 =
|
|
|
|
|
malloc(sizeof(font_16), M_DEVBUF, M_WAITOK);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* extract the hardware cursor location and hide the cursor for
|
|
|
|
|
* now */
|
|
|
|
|
vidd_read_hw_cursor(sc->adp, &col, &row);
|
|
|
|
|
vidd_set_hw_cursor(sc->adp, -1, -1);
|
|
|
|
|
|
|
|
|
|
/* set up the first console */
|
|
|
|
|
sc->first_vty = unit * MAXCONS;
|
|
|
|
|
sc->vtys = MAXCONS; /* XXX: should be configurable */
|
|
|
|
|
if (flags & SC_KERNEL_CONSOLE) {
|
|
|
|
|
/*
|
|
|
|
|
* Set up devs structure but don't use it yet, calling
|
|
|
|
|
* make_dev() might panic kernel. Wait for
|
|
|
|
|
* sc_attach_unit() to actually create the devices.
|
|
|
|
|
*/
|
|
|
|
|
sc->dev = main_devs;
|
|
|
|
|
scp = &main_console;
|
|
|
|
|
init_scp(sc, sc->first_vty, scp);
|
|
|
|
|
sc_vtb_init(&scp->vtb, VTB_MEMORY, scp->xsize,
|
|
|
|
|
scp->ysize, (void *)sc_buffer, FALSE);
|
|
|
|
|
if (sc_init_emulator(scp, SC_DFLT_TERM))
|
|
|
|
|
sc_init_emulator(scp, "*");
|
|
|
|
|
(*scp->tsw->te_default_attr)(
|
|
|
|
|
scp, SC_KERNEL_CONS_ATTR, SC_KERNEL_CONS_REV_ATTR);
|
|
|
|
|
} else {
|
|
|
|
|
/* assert(sc_malloc) */
|
|
|
|
|
sc->dev = malloc(sizeof(struct tty *) * sc->vtys,
|
|
|
|
|
M_DEVBUF, M_WAITOK | M_ZERO);
|
|
|
|
|
sc->dev[0] = sc_alloc_tty(0, unit * MAXCONS);
|
|
|
|
|
scp = alloc_scp(sc, sc->first_vty);
|
|
|
|
|
SC_STAT(sc->dev[0]) = scp;
|
|
|
|
|
}
|
|
|
|
|
sc->cur_scp = scp;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* copy screen to temporary buffer */
|
|
|
|
|
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
(void *)scp->sc->adp->va_window, FALSE);
|
2019-12-02 21:30:52 -05:00
|
|
|
if (ISTEXTSC(scp))
|
|
|
|
|
sc_vtb_copy(&scp->scr, 0, &scp->vtb, 0,
|
|
|
|
|
scp->xsize * scp->ysize);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* Sync h/w cursor position to s/w (sc and teken). */
|
|
|
|
|
if (col >= scp->xsize)
|
|
|
|
|
col = 0;
|
|
|
|
|
if (row >= scp->ysize)
|
|
|
|
|
row = scp->ysize - 1;
|
|
|
|
|
scp->xpos = col;
|
|
|
|
|
scp->ypos = row;
|
|
|
|
|
scp->cursor_pos = scp->cursor_oldpos = row * scp->xsize + col;
|
|
|
|
|
(*scp->tsw->te_sync)(scp);
|
|
|
|
|
|
|
|
|
|
sc->dflt_curs_attr.base = 0;
|
|
|
|
|
sc->dflt_curs_attr.height = howmany(scp->font_size, 8);
|
|
|
|
|
sc->dflt_curs_attr.flags = 0;
|
|
|
|
|
sc->dflt_curs_attr.bg[0] = FG_RED;
|
|
|
|
|
sc->dflt_curs_attr.bg[1] = FG_LIGHTGREY;
|
|
|
|
|
sc->dflt_curs_attr.bg[2] = FG_BLUE;
|
|
|
|
|
sc->dflt_curs_attr.mouse_ba = FG_WHITE;
|
|
|
|
|
sc->dflt_curs_attr.mouse_ia = FG_RED;
|
|
|
|
|
sc->curs_attr = sc->dflt_curs_attr;
|
|
|
|
|
scp->base_curs_attr = scp->dflt_curs_attr = sc->curs_attr;
|
|
|
|
|
scp->curs_attr = scp->base_curs_attr;
|
2001-08-02 04:30:40 -04:00
|
|
|
|
2000-03-31 11:05:46 -05:00
|
|
|
#ifndef SC_NO_SYSMOUSE
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_mouse_move(scp, scp->xpixel / 2, scp->ypixel / 2);
|
2000-03-31 11:05:46 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!ISGRAPHSC(scp)) {
|
|
|
|
|
sc_set_cursor_image(scp);
|
|
|
|
|
sc_draw_cursor_image(scp);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* save font and palette */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
sc->fonts_loaded = 0;
|
|
|
|
|
if (ISFONTAVAIL(sc->adp->va_flags)) {
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifdef SC_DFLT_FONT
|
2019-12-02 21:30:52 -05:00
|
|
|
bcopy(dflt_font_8, sc->font_8, sizeof(dflt_font_8));
|
|
|
|
|
bcopy(dflt_font_14, sc->font_14, sizeof(dflt_font_14));
|
|
|
|
|
bcopy(dflt_font_16, sc->font_16, sizeof(dflt_font_16));
|
|
|
|
|
sc->fonts_loaded = FONT_16 | FONT_14 | FONT_8;
|
|
|
|
|
if (scp->font_size < 14) {
|
|
|
|
|
sc_load_font(scp, 0, 8, 8, sc->font_8, 0, 256);
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
|
|
|
|
sc_load_font(
|
|
|
|
|
scp, 0, 16, 8, sc->font_16, 0, 256);
|
|
|
|
|
} else {
|
|
|
|
|
sc_load_font(
|
|
|
|
|
scp, 0, 14, 8, sc->font_14, 0, 256);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#else /* !SC_DFLT_FONT */
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->font_size < 14) {
|
|
|
|
|
sc_save_font(scp, 0, 8, 8, sc->font_8, 0, 256);
|
|
|
|
|
sc->fonts_loaded = FONT_8;
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
|
|
|
|
sc_save_font(
|
|
|
|
|
scp, 0, 16, 8, sc->font_16, 0, 256);
|
|
|
|
|
sc->fonts_loaded = FONT_16;
|
|
|
|
|
} else {
|
|
|
|
|
sc_save_font(
|
|
|
|
|
scp, 0, 14, 8, sc->font_14, 0, 256);
|
|
|
|
|
sc->fonts_loaded = FONT_14;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* SC_DFLT_FONT */
|
2019-12-02 21:30:52 -05:00
|
|
|
/* FONT KLUDGE: always use the font page #0. XXX */
|
|
|
|
|
sc_show_font(scp, 0);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* !SC_NO_FONT_LOADING */
|
1998-09-15 14:16:39 -04:00
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_PALETTE_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
vidd_save_palette(sc->adp, sc->palette);
|
2010-02-23 16:51:14 -05:00
|
|
|
#ifdef SC_PIXEL_MODE
|
2019-12-02 21:30:52 -05:00
|
|
|
for (i = 0; i < sizeof(sc->palette2); i++)
|
|
|
|
|
sc->palette2[i] = i / 3;
|
2010-02-23 16:51:14 -05:00
|
|
|
#endif
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!(sc->flags & SC_SPLASH_SCRN)) {
|
|
|
|
|
/* we are ready to put up the splash image! */
|
|
|
|
|
splash_init(sc->adp, scsplash_callback, sc);
|
|
|
|
|
sc->flags |= SC_SPLASH_SCRN;
|
|
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* the rest is not necessary, if we have done it once */
|
|
|
|
|
if (sc->flags & SC_INIT_DONE)
|
|
|
|
|
return;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* initialize mapscrn arrays to a one to one map */
|
|
|
|
|
for (i = 0; i < sizeof(sc->scr_map); i++)
|
|
|
|
|
sc->scr_map[i] = sc->scr_rmap[i] = i;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc->flags |= SC_INIT_DONE;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scterm(int unit, int flags)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
|
|
|
|
scr_stat *scp;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE);
|
|
|
|
|
if (sc == NULL)
|
|
|
|
|
return; /* shouldn't happen */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
/* this console is no longer available for the splash screen */
|
|
|
|
|
if (sc->flags & SC_SPLASH_SCRN) {
|
|
|
|
|
splash_term(sc->adp);
|
|
|
|
|
sc->flags &= ~SC_SPLASH_SCRN;
|
|
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#if 0 /* XXX */
|
|
|
|
|
/* move the hardware cursor to the upper-left corner */
|
2007-12-29 18:26:59 -05:00
|
|
|
vidd_set_hw_cursor(sc->adp, 0, 0);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* release the keyboard and the video card */
|
2019-12-23 16:32:07 -05:00
|
|
|
if (sc->kbd != NULL)
|
|
|
|
|
kbd_release(sc->kbd, &sc->kbd);
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->adapter >= 0)
|
|
|
|
|
vid_release(sc->adp, &sc->adapter);
|
|
|
|
|
|
|
|
|
|
/* stop the terminal emulator, if any */
|
|
|
|
|
scp = sc_get_stat(sc->dev[0]);
|
|
|
|
|
if (scp->tsw)
|
|
|
|
|
(*scp->tsw->te_term)(scp, &scp->ts);
|
|
|
|
|
mtx_destroy(&sc->video_mtx);
|
|
|
|
|
|
|
|
|
|
/* clear the structure */
|
|
|
|
|
if (!(flags & SC_KERNEL_CONSOLE)) {
|
|
|
|
|
free(scp->ts, M_DEVBUF);
|
|
|
|
|
/* XXX: We need delete_dev() for this */
|
|
|
|
|
free(sc->dev, M_DEVBUF);
|
1999-08-08 17:35:17 -04:00
|
|
|
#if 0
|
|
|
|
|
/* XXX: We need a ttyunregister for this */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
free(sc->tty, M_DEVBUF);
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
free(sc->font_8, M_DEVBUF);
|
|
|
|
|
free(sc->font_14, M_DEVBUF);
|
|
|
|
|
free(sc->font_16, M_DEVBUF);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
/* XXX vtb, history */
|
|
|
|
|
}
|
|
|
|
|
bzero(sc, sizeof(*sc));
|
|
|
|
|
sc->adapter = -1;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2011-05-09 14:46:49 -04:00
|
|
|
scshutdown(__unused void *arg, __unused int howto)
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
{
|
|
|
|
|
|
2011-05-09 14:46:49 -04:00
|
|
|
KASSERT(sc_console != NULL, ("sc_console != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc->cur_scp != NULL,
|
|
|
|
|
("sc_console->sc->cur_scp != NULL"));
|
|
|
|
|
|
|
|
|
|
sc_touch_scrn_saver();
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!cold && sc_console->sc->cur_scp->index != sc_console->index &&
|
2011-05-09 14:46:49 -04:00
|
|
|
sc_console->sc->cur_scp->smode.mode == VT_AUTO &&
|
|
|
|
|
sc_console->smode.mode == VT_AUTO)
|
|
|
|
|
sc_switch_scr(sc_console->sc, sc_console->index);
|
|
|
|
|
shutdown_in_progress = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scsuspend(__unused void *arg)
|
|
|
|
|
{
|
|
|
|
|
int retry;
|
|
|
|
|
|
|
|
|
|
KASSERT(sc_console != NULL, ("sc_console != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc->cur_scp != NULL,
|
|
|
|
|
("sc_console->sc->cur_scp != NULL"));
|
|
|
|
|
|
|
|
|
|
sc_susp_scr = sc_console->sc->cur_scp->index;
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_no_suspend_vtswitch || sc_susp_scr == sc_console->index) {
|
2011-05-09 14:46:49 -04:00
|
|
|
sc_touch_scrn_saver();
|
|
|
|
|
sc_susp_scr = -1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (retry = 0; retry < 10; retry++) {
|
|
|
|
|
sc_switch_scr(sc_console->sc, sc_console->index);
|
|
|
|
|
if (!sc_console->sc->switch_in_progress)
|
|
|
|
|
break;
|
|
|
|
|
pause("scsuspend", hz);
|
|
|
|
|
}
|
|
|
|
|
suspend_in_progress = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
scresume(__unused void *arg)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
KASSERT(sc_console != NULL, ("sc_console != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL"));
|
|
|
|
|
KASSERT(sc_console->sc->cur_scp != NULL,
|
|
|
|
|
("sc_console->sc->cur_scp != NULL"));
|
|
|
|
|
|
|
|
|
|
suspend_in_progress = FALSE;
|
|
|
|
|
if (sc_susp_scr < 0) {
|
2013-07-17 19:29:56 -04:00
|
|
|
update_font(sc_console->sc->cur_scp);
|
2011-05-09 14:46:49 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
sc_switch_scr(sc_console->sc, sc_susp_scr);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
sc_clean_up(scr_stat *scp)
|
|
|
|
|
{
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
int error;
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->sc->flags & SC_SCRN_BLANKED) {
|
|
|
|
|
sc_touch_scrn_saver();
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
if ((error = wait_scrn_saver_stop(scp->sc)))
|
|
|
|
|
return error;
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
|
|
|
|
scp->status |= MOUSE_HIDDEN;
|
|
|
|
|
sc_remove_mouse_image(scp);
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
return 0;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_alloc_scr_buffer(scr_stat *scp, int wait, int discard)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_vtb_t new;
|
|
|
|
|
sc_vtb_t old;
|
|
|
|
|
|
|
|
|
|
old = scp->vtb;
|
|
|
|
|
sc_vtb_init(&new, VTB_MEMORY, scp->xsize, scp->ysize, NULL, wait);
|
|
|
|
|
if (!discard && (old.vtb_flags & VTB_VALID)) {
|
|
|
|
|
/* retain the current cursor position and buffer contants */
|
|
|
|
|
scp->cursor_oldpos = scp->cursor_pos;
|
|
|
|
|
/*
|
|
|
|
|
* This works only if the old buffer has the same size as or
|
|
|
|
|
* larger than the new one. XXX
|
|
|
|
|
*/
|
|
|
|
|
sc_vtb_copy(&old, 0, &new, 0, scp->xsize * scp->ysize);
|
|
|
|
|
scp->vtb = new;
|
|
|
|
|
} else {
|
|
|
|
|
scp->vtb = new;
|
|
|
|
|
sc_vtb_destroy(&old);
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifndef SC_NO_SYSMOUSE
|
2019-12-02 21:30:52 -05:00
|
|
|
/* move the mouse cursor at the center of the screen */
|
|
|
|
|
sc_mouse_move(scp, scp->xpixel / 2, scp->ypixel / 2);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
1997-11-21 06:37:07 -05:00
|
|
|
}
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
static scr_stat *
|
|
|
|
|
alloc_scp(sc_softc_t *sc, int vty)
|
1995-01-12 06:47:05 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* assert(sc_malloc) */
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
|
|
|
|
|
init_scp(sc, vty, scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_alloc_scr_buffer(scp, TRUE, TRUE);
|
|
|
|
|
if (sc_init_emulator(scp, SC_DFLT_TERM))
|
|
|
|
|
sc_init_emulator(scp, "*");
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
2000-04-03 05:24:16 -04:00
|
|
|
#ifndef SC_NO_CUTPASTE
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_alloc_cut_buffer(scp, TRUE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_alloc_history_buffer(scp, 0, 0, TRUE);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return scp;
|
1995-01-12 06:47:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
init_scp(sc_softc_t *sc, int vty, scr_stat *scp)
|
1995-01-12 06:47:05 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
video_info_t info;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
bzero(scp, sizeof(*scp));
|
|
|
|
|
|
|
|
|
|
scp->index = vty;
|
|
|
|
|
scp->sc = sc;
|
|
|
|
|
scp->status = 0;
|
|
|
|
|
scp->mode = sc->initial_mode;
|
|
|
|
|
vidd_get_info(sc->adp, scp->mode, &info);
|
|
|
|
|
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 / info.vi_cwidth;
|
|
|
|
|
scp->ysize = info.vi_height / info.vi_cheight;
|
|
|
|
|
scp->font_size = 0;
|
|
|
|
|
scp->font = NULL;
|
|
|
|
|
} else {
|
|
|
|
|
scp->xsize = info.vi_width;
|
|
|
|
|
scp->ysize = info.vi_height;
|
|
|
|
|
scp->xpixel = scp->xsize * info.vi_cwidth;
|
|
|
|
|
scp->ypixel = scp->ysize * info.vi_cheight;
|
|
|
|
|
}
|
2009-09-10 22:07:24 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->font_size = info.vi_cheight;
|
|
|
|
|
scp->font_width = info.vi_cwidth;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
if (info.vi_cheight < 14)
|
|
|
|
|
scp->font = sc->font_8;
|
|
|
|
|
else if (info.vi_cheight >= 16)
|
|
|
|
|
scp->font = sc->font_16;
|
|
|
|
|
else
|
|
|
|
|
scp->font = sc->font_14;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#else
|
2019-12-02 21:30:52 -05:00
|
|
|
scp->font = NULL;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2009-09-10 22:07:24 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE);
|
|
|
|
|
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE);
|
|
|
|
|
scp->xoff = scp->yoff = 0;
|
|
|
|
|
scp->xpos = scp->ypos = 0;
|
|
|
|
|
scp->start = scp->xsize * scp->ysize - 1;
|
|
|
|
|
scp->end = 0;
|
|
|
|
|
scp->tsw = NULL;
|
|
|
|
|
scp->ts = NULL;
|
|
|
|
|
scp->rndr = NULL;
|
|
|
|
|
scp->border = (SC_NORM_ATTR >> 4) & 0x0f;
|
|
|
|
|
scp->base_curs_attr = scp->dflt_curs_attr = sc->curs_attr;
|
|
|
|
|
scp->mouse_cut_start = scp->xsize * scp->ysize;
|
|
|
|
|
scp->mouse_cut_end = -1;
|
|
|
|
|
scp->mouse_signal = 0;
|
|
|
|
|
scp->mouse_pid = 0;
|
|
|
|
|
scp->mouse_proc = NULL;
|
|
|
|
|
scp->kbd_mode = K_XLATE;
|
|
|
|
|
scp->bell_pitch = bios_value.bell_pitch;
|
|
|
|
|
scp->bell_duration = BELL_DURATION;
|
|
|
|
|
scp->status |= (bios_value.shift_state & NLKED);
|
|
|
|
|
scp->status |= CURSOR_ENABLED | MOUSE_HIDDEN;
|
|
|
|
|
scp->pid = 0;
|
|
|
|
|
scp->proc = NULL;
|
|
|
|
|
scp->smode.mode = VT_AUTO;
|
|
|
|
|
scp->history = NULL;
|
|
|
|
|
scp->history_pos = 0;
|
|
|
|
|
scp->history_size = 0;
|
2000-01-15 10:25:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
sc_init_emulator(scr_stat *scp, char *name)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_term_sw_t *sw;
|
|
|
|
|
sc_rndr_sw_t *rndr;
|
|
|
|
|
void *p;
|
|
|
|
|
int error;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (name == NULL) /* if no name is given, use the current emulator */
|
|
|
|
|
sw = scp->tsw;
|
|
|
|
|
else /* ...otherwise find the named emulator */
|
|
|
|
|
sw = sc_term_match(name);
|
|
|
|
|
if (sw == NULL)
|
|
|
|
|
return EINVAL;
|
1995-01-28 17:18:05 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
rndr = NULL;
|
|
|
|
|
if (strcmp(sw->te_renderer, "*") != 0) {
|
|
|
|
|
rndr = sc_render_match(scp, sw->te_renderer,
|
|
|
|
|
scp->status & (GRAPHICS_MODE | PIXEL_MODE));
|
|
|
|
|
}
|
|
|
|
|
if (rndr == NULL) {
|
|
|
|
|
rndr = sc_render_match(scp, scp->sc->adp->va_name,
|
|
|
|
|
scp->status & (GRAPHICS_MODE | PIXEL_MODE));
|
|
|
|
|
if (rndr == NULL)
|
|
|
|
|
return ENODEV;
|
|
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sw == scp->tsw) {
|
|
|
|
|
error = (*sw->te_init)(scp, &scp->ts, SC_TE_WARM_INIT);
|
|
|
|
|
scp->rndr = rndr;
|
|
|
|
|
scp->rndr->init(scp);
|
|
|
|
|
sc_clear_screen(scp);
|
|
|
|
|
/* assert(error == 0); */
|
|
|
|
|
return error;
|
|
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_malloc && (sw->te_size > 0))
|
|
|
|
|
p = malloc(sw->te_size, M_DEVBUF, M_NOWAIT);
|
|
|
|
|
else
|
|
|
|
|
p = NULL;
|
|
|
|
|
error = (*sw->te_init)(scp, &p, SC_TE_COLD_INIT);
|
|
|
|
|
if (error)
|
|
|
|
|
return error;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->tsw)
|
|
|
|
|
(*scp->tsw->te_term)(scp, &scp->ts);
|
|
|
|
|
if (scp->ts != NULL)
|
|
|
|
|
free(scp->ts, M_DEVBUF);
|
|
|
|
|
scp->tsw = sw;
|
|
|
|
|
scp->ts = p;
|
|
|
|
|
scp->rndr = rndr;
|
|
|
|
|
scp->rndr->init(scp);
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
(*sw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR);
|
|
|
|
|
sc_clear_screen(scp);
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1995-01-28 17:18:05 -05:00
|
|
|
}
|
|
|
|
|
|
1993-07-26 17:21:11 -04:00
|
|
|
/*
|
1996-10-26 16:16:58 -04: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 17:21:11 -04:00
|
|
|
*/
|
1996-10-02 18:00:38 -04:00
|
|
|
static u_int
|
2016-08-24 13:26:11 -04:00
|
|
|
scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp;
|
1999-08-17 18:06:17 -04:00
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
struct tty *tp;
|
1999-08-17 18:06:17 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
u_int c;
|
|
|
|
|
int this_scr;
|
|
|
|
|
int f;
|
|
|
|
|
int i;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->kbd == NULL)
|
|
|
|
|
return NOKEY;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
|
|
|
|
next_code:
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#if 1
|
2019-12-02 21:30:52 -05:00
|
|
|
/* I don't like this, but... XXX */
|
Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here. Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant. Everything here is a hack, but it often
works. Even if mtx_trylock() succeeds, this might be a LOR.
Keyboard input also needs screen locking, to handle screen updates
and switches. Add this, using the same simplistic screen locking
as for sc_cnputc().
Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant). It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.
Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions. This is correct for the keyboard
parts only.
When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).
The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 07:10:39 -04:00
|
|
|
if (flags & SCGETC_CN)
|
2019-12-02 21:30:52 -05:00
|
|
|
sccnupdate(sc->cur_scp);
|
|
|
|
|
#endif
|
|
|
|
|
scp = sc->cur_scp;
|
|
|
|
|
/* first see if there is something in the keyboard port */
|
|
|
|
|
for (;;) {
|
|
|
|
|
if (flags & SCGETC_CN)
|
|
|
|
|
sccnscrunlock(sc, sp);
|
|
|
|
|
c = kbdd_read_char(sc->kbd, !(flags & SCGETC_NONBLOCK));
|
|
|
|
|
if (flags & SCGETC_CN)
|
|
|
|
|
sccnscrlock(sc, sp);
|
|
|
|
|
if (c == ERRKEY) {
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
sc_bell(
|
|
|
|
|
scp, bios_value.bell_pitch, BELL_DURATION);
|
|
|
|
|
} else if (c == NOKEY)
|
|
|
|
|
return c;
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* make screensaver happy */
|
|
|
|
|
if (!(c & RELKEY))
|
|
|
|
|
sc_touch_scrn_saver();
|
1998-02-11 09:56:02 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
random_harvest_queue(&c, sizeof(c), RANDOM_KEYBOARD);
|
2000-07-09 08:26:38 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc->kbd_open_level == 0 && scp->kbd_mode != K_XLATE)
|
|
|
|
|
return KEYCHAR(c);
|
1997-10-01 16:46:29 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* if scroll-lock pressed allow history browsing */
|
|
|
|
|
if (!ISGRAPHSC(scp) && scp->history && scp->status & SLKED) {
|
|
|
|
|
scp->status &= ~CURSOR_ENABLED;
|
|
|
|
|
sc_remove_cursor_image(scp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
|
|
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!(scp->status & BUFFER_SAVED)) {
|
|
|
|
|
scp->status |= BUFFER_SAVED;
|
|
|
|
|
sc_hist_save(scp);
|
|
|
|
|
}
|
|
|
|
|
switch (c) {
|
|
|
|
|
/* FIXME: key codes */
|
|
|
|
|
case SPCLKEY | FKEY | F(49): /* home key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
sc_hist_home(scp);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
|
|
|
|
case SPCLKEY | FKEY | F(57): /* end key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
sc_hist_end(scp);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
|
|
|
|
case SPCLKEY | FKEY | F(50): /* up arrow key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
if (sc_hist_up_line(scp))
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
sc_bell(scp, bios_value.bell_pitch,
|
|
|
|
|
BELL_DURATION);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
|
|
|
|
case SPCLKEY | FKEY | F(58): /* down arrow key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
if (sc_hist_down_line(scp))
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
sc_bell(scp, bios_value.bell_pitch,
|
|
|
|
|
BELL_DURATION);
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
|
|
|
|
case SPCLKEY | FKEY | F(51): /* page up key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
for (i = 0; i < scp->ysize; i++)
|
|
|
|
|
if (sc_hist_up_line(scp)) {
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
sc_bell(scp,
|
|
|
|
|
bios_value.bell_pitch,
|
|
|
|
|
BELL_DURATION);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
goto next_code;
|
|
|
|
|
|
|
|
|
|
case SPCLKEY | FKEY | F(59): /* page down key */
|
|
|
|
|
sc_remove_cutmarking(scp);
|
|
|
|
|
for (i = 0; i < scp->ysize; i++)
|
|
|
|
|
if (sc_hist_down_line(scp)) {
|
|
|
|
|
if (!(flags & SCGETC_CN))
|
|
|
|
|
sc_bell(scp,
|
|
|
|
|
bios_value.bell_pitch,
|
|
|
|
|
BELL_DURATION);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
goto next_code;
|
|
|
|
|
}
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif /* SC_NO_HISTORY */
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05: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 */
|
|
|
|
|
} else {
|
|
|
|
|
/* key pressed */
|
|
|
|
|
if (c & SPCLKEY) {
|
|
|
|
|
c &= ~SPCLKEY;
|
|
|
|
|
switch (KEYCHAR(c)) {
|
|
|
|
|
/* LOCKING KEYS */
|
|
|
|
|
case NLK:
|
|
|
|
|
case CLK:
|
|
|
|
|
case ALK:
|
|
|
|
|
break;
|
|
|
|
|
case SLK:
|
|
|
|
|
(void)kbdd_ioctl(
|
|
|
|
|
sc->kbd, KDGKBSTATE, (caddr_t)&f);
|
|
|
|
|
if (f & SLKED) {
|
|
|
|
|
scp->status |= SLKED;
|
|
|
|
|
} else {
|
|
|
|
|
if (scp->status & SLKED) {
|
|
|
|
|
scp->status &= ~SLKED;
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_HISTORY
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->status &
|
|
|
|
|
BUFFER_SAVED) {
|
|
|
|
|
if (!sc_hist_restore(
|
|
|
|
|
scp))
|
|
|
|
|
sc_remove_cutmarking(
|
|
|
|
|
scp);
|
|
|
|
|
scp->status &=
|
|
|
|
|
~BUFFER_SAVED;
|
|
|
|
|
scp->status |=
|
|
|
|
|
CURSOR_ENABLED;
|
|
|
|
|
sc_draw_cursor_image(
|
|
|
|
|
scp);
|
|
|
|
|
}
|
|
|
|
|
/* Only safe in Giant-locked
|
|
|
|
|
* context. */
|
|
|
|
|
tp = SC_DEV(sc, scp->index);
|
|
|
|
|
if (!(flags & SCGETC_CN) &&
|
|
|
|
|
tty_opened_ns(tp))
|
|
|
|
|
sctty_outwakeup(tp);
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case PASTE:
|
2001-03-11 17:51:05 -05:00
|
|
|
#ifndef SC_NO_CUTPASTE
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_mouse_paste(scp);
|
2001-03-11 17:51:05 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* NON-LOCKING KEYS */
|
|
|
|
|
case NOP:
|
|
|
|
|
case LSH:
|
|
|
|
|
case RSH:
|
|
|
|
|
case LCTR:
|
|
|
|
|
case RCTR:
|
|
|
|
|
case LALT:
|
|
|
|
|
case RALT:
|
|
|
|
|
case ASH:
|
|
|
|
|
case META:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BTAB:
|
|
|
|
|
if (!(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
return c;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SPSC:
|
2001-08-02 09:22:33 -04:00
|
|
|
#ifdef DEV_SPLASH
|
2019-12-02 21:30:52 -05:00
|
|
|
/* force activatation/deactivation of the screen
|
|
|
|
|
* saver */
|
|
|
|
|
if (!(sc->flags & SC_SCRN_BLANKED)) {
|
|
|
|
|
run_scrn_saver = TRUE;
|
|
|
|
|
sc->scrn_time_stamp -= scrn_blank_time;
|
|
|
|
|
}
|
|
|
|
|
if (cold) {
|
|
|
|
|
/*
|
|
|
|
|
* While devices are being probed, the
|
|
|
|
|
* screen saver need to be invoked
|
|
|
|
|
* explicitly. XXX
|
|
|
|
|
*/
|
|
|
|
|
if (sc->flags & SC_SCRN_BLANKED) {
|
|
|
|
|
scsplash_stick(FALSE);
|
|
|
|
|
stop_scrn_saver(
|
|
|
|
|
sc, current_saver);
|
|
|
|
|
} else {
|
|
|
|
|
if (!ISGRAPHSC(scp)) {
|
|
|
|
|
scsplash_stick(TRUE);
|
|
|
|
|
(*current_saver)(
|
|
|
|
|
sc, TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-08-02 09:22:33 -04:00
|
|
|
#endif /* DEV_SPLASH */
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case RBT:
|
1998-02-11 09:56:02 -05:00
|
|
|
#ifndef SC_DISABLE_REBOOT
|
2019-12-02 21:30:52 -05:00
|
|
|
if (enable_reboot && !(flags & SCGETC_CN))
|
|
|
|
|
shutdown_nice(0);
|
1998-02-11 09:56:02 -05:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case HALT:
|
2000-09-11 16:37:42 -04:00
|
|
|
#ifndef SC_DISABLE_REBOOT
|
2019-12-02 21:30:52 -05:00
|
|
|
if (enable_reboot && !(flags & SCGETC_CN))
|
|
|
|
|
shutdown_nice(RB_HALT);
|
2000-09-11 16:37:42 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
2000-09-11 16:37:42 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case PDWN:
|
2000-09-11 16:37:42 -04:00
|
|
|
#ifndef SC_DISABLE_REBOOT
|
2019-12-02 21:30:52 -05:00
|
|
|
if (enable_reboot && !(flags & SCGETC_CN))
|
|
|
|
|
shutdown_nice(RB_HALT | RB_POWEROFF);
|
2000-09-11 16:37:42 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
2000-09-11 16:37:42 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case SUSP:
|
|
|
|
|
power_pm_suspend(POWER_SLEEP_STATE_SUSPEND);
|
|
|
|
|
break;
|
|
|
|
|
case STBY:
|
|
|
|
|
power_pm_suspend(POWER_SLEEP_STATE_STANDBY);
|
|
|
|
|
break;
|
1995-02-22 08:48:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
case DBG:
|
2004-07-10 18:29:41 -04:00
|
|
|
#ifndef SC_DISABLE_KDBKEY
|
2019-12-02 21:30:52 -05:00
|
|
|
if (enable_kdbkey)
|
|
|
|
|
kdb_break();
|
1993-10-28 01:27:36 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PNC:
|
|
|
|
|
if (enable_panic_key)
|
|
|
|
|
panic("Forced by the panic key");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NEXT:
|
|
|
|
|
this_scr = scp->index;
|
|
|
|
|
for (i = (this_scr - sc->first_vty + 1) %
|
|
|
|
|
sc->vtys;
|
|
|
|
|
sc->first_vty + i != this_scr;
|
|
|
|
|
i = (i + 1) % sc->vtys) {
|
|
|
|
|
struct tty *tp =
|
|
|
|
|
SC_DEV(sc, sc->first_vty + i);
|
|
|
|
|
if (tty_opened_ns(tp)) {
|
|
|
|
|
sc_switch_scr(
|
|
|
|
|
scp->sc, sc->first_vty + i);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PREV:
|
|
|
|
|
this_scr = scp->index;
|
|
|
|
|
for (i = (this_scr - sc->first_vty + sc->vtys -
|
|
|
|
|
1) %
|
|
|
|
|
sc->vtys;
|
|
|
|
|
sc->first_vty + i != this_scr;
|
|
|
|
|
i = (i + sc->vtys - 1) % sc->vtys) {
|
|
|
|
|
struct tty *tp =
|
|
|
|
|
SC_DEV(sc, sc->first_vty + i);
|
|
|
|
|
if (tty_opened_ns(tp)) {
|
|
|
|
|
sc_switch_scr(
|
|
|
|
|
scp->sc, sc->first_vty + i);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
if (KEYCHAR(c) >= F_SCR &&
|
|
|
|
|
KEYCHAR(c) <= L_SCR) {
|
|
|
|
|
sc_switch_scr(scp->sc,
|
|
|
|
|
sc->first_vty + KEYCHAR(c) - F_SCR);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/* assert(c & FKEY) */
|
|
|
|
|
if (!(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
return c;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/* goto next_code */
|
|
|
|
|
} else {
|
|
|
|
|
/* regular keys (maybe MKEY is set) */
|
2011-08-27 18:10:45 -04:00
|
|
|
#if !defined(SC_DISABLE_KDBKEY) && defined(KDB)
|
2019-12-02 21:30:52 -05:00
|
|
|
if (enable_kdbkey)
|
|
|
|
|
kdb_alt_break(c, &sc->sc_altbrk);
|
2011-08-27 18:10:45 -04:00
|
|
|
#endif
|
2019-12-02 21:30:52 -05:00
|
|
|
if (!(sc->flags & SC_SCRN_BLANKED))
|
|
|
|
|
return c;
|
|
|
|
|
}
|
1995-02-22 08:48:07 -05:00
|
|
|
}
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
goto next_code;
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2002-09-28 13:15:38 -04:00
|
|
|
static int
|
2019-12-02 21:30:52 -05:00
|
|
|
sctty_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot,
|
|
|
|
|
vm_memattr_t *memattr)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp;
|
1999-01-10 22:18:56 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
scp = sc_get_stat(tp);
|
|
|
|
|
if (scp != scp->sc->cur_scp)
|
|
|
|
|
return -1;
|
|
|
|
|
return vidd_mmap(scp->sc->adp, offset, paddr, nprot, memattr);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
2013-07-17 19:29:56 -04:00
|
|
|
static void
|
|
|
|
|
update_font(scr_stat *scp)
|
|
|
|
|
{
|
|
|
|
|
#ifndef SC_NO_FONT_LOADING
|
2019-12-02 21:30:52 -05:00
|
|
|
/* load appropriate font */
|
|
|
|
|
if (!(scp->status & GRAPHICS_MODE)) {
|
|
|
|
|
if (!(scp->status & PIXEL_MODE) &&
|
|
|
|
|
ISFONTAVAIL(scp->sc->adp->va_flags)) {
|
|
|
|
|
if (scp->font_size < 14) {
|
|
|
|
|
if (scp->sc->fonts_loaded & FONT_8)
|
|
|
|
|
sc_load_font(scp, 0, 8, 8,
|
|
|
|
|
scp->sc->font_8, 0, 256);
|
|
|
|
|
} else if (scp->font_size >= 16) {
|
|
|
|
|
if (scp->sc->fonts_loaded & FONT_16)
|
|
|
|
|
sc_load_font(scp, 0, 16, 8,
|
|
|
|
|
scp->sc->font_16, 0, 256);
|
|
|
|
|
} else {
|
|
|
|
|
if (scp->sc->fonts_loaded & FONT_14)
|
|
|
|
|
sc_load_font(scp, 0, 14, 8,
|
|
|
|
|
scp->sc->font_14, 0, 256);
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
sc_show_font(scp, 0);
|
|
|
|
|
}
|
|
|
|
|
mark_all(scp);
|
2013-07-17 19:29:56 -04:00
|
|
|
}
|
|
|
|
|
#endif /* !SC_NO_FONT_LOADING */
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
|
|
|
|
save_kbd_state(scr_stat *scp)
|
1996-09-30 19:00:58 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int state;
|
|
|
|
|
int error;
|
1997-01-15 13:16:32 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
error = kbdd_ioctl(scp->sc->kbd, KDGKBSTATE, (caddr_t)&state);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
if (error == 0) {
|
|
|
|
|
scp->status &= ~LOCK_MASK;
|
|
|
|
|
scp->status |= state;
|
|
|
|
|
}
|
|
|
|
|
return error;
|
1999-01-10 22:18:56 -05:00
|
|
|
}
|
1997-01-15 13:16:32 -05:00
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
update_kbd_state(scr_stat *scp, int new_bits, int mask)
|
1999-01-10 22:18:56 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int state;
|
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
if (mask != LOCK_MASK) {
|
|
|
|
|
error = kbdd_ioctl(scp->sc->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;
|
|
|
|
|
}
|
|
|
|
|
error = kbdd_ioctl(scp->sc->kbd, KDSKBSTATE, (caddr_t)&state);
|
1999-01-10 22:18:56 -05:00
|
|
|
if (error == ENOIOCTL)
|
2019-12-02 21:30:52 -05:00
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1997-01-15 13:16:32 -05:00
|
|
|
}
|
|
|
|
|
|
1999-01-10 22:18:56 -05:00
|
|
|
static int
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
update_kbd_leds(scr_stat *scp, int which)
|
1997-01-15 13:16:32 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int error;
|
1996-11-14 17:19:17 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
which &= LOCK_MASK;
|
|
|
|
|
error = kbdd_ioctl(scp->sc->kbd, KDSETLED, (caddr_t)&which);
|
|
|
|
|
if (error == ENOIOCTL)
|
|
|
|
|
error = ENODEV;
|
|
|
|
|
return error;
|
1996-09-30 19:00:58 -04:00
|
|
|
}
|
|
|
|
|
|
1998-09-15 14:16:39 -04:00
|
|
|
int
|
1994-08-17 04:51:59 -04:00
|
|
|
set_mode(scr_stat *scp)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
video_info_t info;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* reject unsupported mode */
|
|
|
|
|
if (vidd_get_info(scp->sc->adp, scp->mode, &info))
|
|
|
|
|
return 1;
|
1993-07-26 17:21:11 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* if this vty is not currently showing, do nothing */
|
|
|
|
|
if (scp != scp->sc->cur_scp)
|
|
|
|
|
return 0;
|
1997-11-21 06:37:07 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
/* setup video hardware for the given mode */
|
|
|
|
|
vidd_set_mode(scp->sc->adp, scp->mode);
|
|
|
|
|
scp->rndr->init(scp);
|
|
|
|
|
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
|
|
|
|
|
(void *)scp->sc->adp->va_window, FALSE);
|
1998-09-15 14:16:39 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
update_font(scp);
|
1999-01-19 06:31:22 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_set_border(scp, scp->border);
|
|
|
|
|
sc_set_cursor_image(scp);
|
1997-04-27 05:03:10 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
return 0;
|
1997-04-27 05:03:10 -04:00
|
|
|
}
|
|
|
|
|
|
1998-09-23 05:59:00 -04:00
|
|
|
void
|
2000-01-15 10:25:43 -05:00
|
|
|
sc_set_border(scr_stat *scp, int color)
|
1998-09-23 05:59:00 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
SC_VIDEO_LOCK(scp->sc);
|
|
|
|
|
(*scp->rndr->draw_border)(scp, color);
|
|
|
|
|
SC_VIDEO_UNLOCK(scp->sc);
|
1998-09-23 05:59:00 -04:00
|
|
|
}
|
|
|
|
|
|
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
1999-06-22 10:14:06 -04:00
|
|
|
#ifndef SC_NO_FONT_LOADING
|
1998-09-15 14:16:39 -04:00
|
|
|
void
|
2005-09-28 10:54:07 -04:00
|
|
|
sc_load_font(scr_stat *scp, int page, int size, int width, u_char *buf,
|
2019-12-02 21:30:52 -05:00
|
|
|
int base, int count)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = scp->sc;
|
|
|
|
|
sc->font_loading_in_progress = TRUE;
|
|
|
|
|
vidd_load_font(sc->adp, page, size, width, buf, base, count);
|
|
|
|
|
sc->font_loading_in_progress = FALSE;
|
1995-01-20 03:35:32 -05:00
|
|
|
}
|
|
|
|
|
|
2000-01-15 10:25:43 -05:00
|
|
|
void
|
2005-09-28 10:54:07 -04:00
|
|
|
sc_save_font(scr_stat *scp, int page, int size, int width, u_char *buf,
|
2019-12-02 21:30:52 -05:00
|
|
|
int base, int count)
|
1995-03-29 15:55:03 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_softc_t *sc;
|
2000-01-15 10:25:43 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
sc = scp->sc;
|
|
|
|
|
sc->font_loading_in_progress = TRUE;
|
|
|
|
|
vidd_save_font(sc->adp, page, size, width, buf, base, count);
|
|
|
|
|
sc->font_loading_in_progress = FALSE;
|
2000-01-15 10:25:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_show_font(scr_stat *scp, int page)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
vidd_show_font(scp->sc->adp, page);
|
1998-09-15 14:16:39 -04:00
|
|
|
}
|
2000-01-15 10:25:43 -05:00
|
|
|
#endif /* !SC_NO_FONT_LOADING */
|
1998-09-15 14:16:39 -04:00
|
|
|
|
|
|
|
|
void
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_paste(scr_stat *scp, const u_char *p, int count)
|
- 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 03:09:19 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
struct tty *tp;
|
|
|
|
|
u_char *rmap;
|
|
|
|
|
|
|
|
|
|
tp = SC_DEV(scp->sc, scp->sc->cur_scp->index);
|
|
|
|
|
if (!tty_opened_ns(tp))
|
|
|
|
|
return;
|
|
|
|
|
rmap = scp->sc->scr_rmap;
|
|
|
|
|
for (; count > 0; --count)
|
|
|
|
|
ttydisc_rint(tp, rmap[*p++], 0);
|
|
|
|
|
ttydisc_rint_done(tp);
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
|
|
|
|
|
Replace syscons terminal renderer by a new renderer that uses libteken.
Some time ago I started working on a library called libteken, which is
terminal emulator. It does not buffer any screen contents, but only
keeps terminal state, such as cursor position, attributes, etc. It
should implement all escape sequences that are implemented by the
cons25 terminal emulator, but also a fair amount of sequences that are
present in VT100 and xterm.
A lot of random notes, which could be of interest to users/developers:
- Even though I'm leaving the terminal type set to `cons25', users can
do experiments with placing `xterm-color' in /etc/ttys. Because we
only implement a subset of features of xterm, this may cause
artifacts. We should consider extending libteken, because in my
opinion xterm is the way to go. Some missing features:
- Keypad application mode (DECKPAM)
- Character sets (SCS)
- libteken is filled with a fair amount of assertions, but unfortunately
we cannot go into the debugger anymore if we fail them. I've done
development of this library almost entirely in userspace. In
sys/dev/syscons/teken there are two applications that can be helpful
when debugging the code:
- teken_demo: a terminal emulator that can be started from a regular
xterm that emulates a terminal using libteken. This application can
be very useful to debug any rendering issues.
- teken_stress: a stress testing application that emulates random
terminal output. libteken has literally survived multiple terabytes
of random input.
- libteken also includes support for UTF-8, but unfortunately our input
layer and font renderer don't support this. If users want to
experiment with UTF-8 support, they can enable `TEKEN_UTF8' in
teken.h. If you recompile your kernel or the teken_demo application,
you can hold some nice experiments.
- I've left PC98 the way it is right now. The PC98 platform has a custom
syscons renderer, which supports some form of localised input. Maybe
we should port PC98 to libteken by the time syscons supports UTF-8?
- I've removed the `dumb' terminal emulator. It has been broken for
years. It hasn't survived the `struct proc' -> `struct thread'
conversion.
- To prevent confusion among people that want to hack on libteken:
unlike syscons, the state machines that parse the escape sequences are
machine generated. This means that if you want to add new escape
sequences, you have to add an entry to the `sequences' file. This will
cause new entries to be added to `teken_state.h'.
- Any rendering artifacts that didn't occur prior to this commit are by
accident. They should be reported to me, so I can fix them.
Discussed on: current@, hackers@
Discussed with: philip (at 25C3)
2009-01-01 08:26:53 -05:00
|
|
|
void
|
2019-12-02 21:30:52 -05:00
|
|
|
sc_respond(scr_stat *scp, const u_char *p, int count, int wakeup)
|
Replace syscons terminal renderer by a new renderer that uses libteken.
Some time ago I started working on a library called libteken, which is
terminal emulator. It does not buffer any screen contents, but only
keeps terminal state, such as cursor position, attributes, etc. It
should implement all escape sequences that are implemented by the
cons25 terminal emulator, but also a fair amount of sequences that are
present in VT100 and xterm.
A lot of random notes, which could be of interest to users/developers:
- Even though I'm leaving the terminal type set to `cons25', users can
do experiments with placing `xterm-color' in /etc/ttys. Because we
only implement a subset of features of xterm, this may cause
artifacts. We should consider extending libteken, because in my
opinion xterm is the way to go. Some missing features:
- Keypad application mode (DECKPAM)
- Character sets (SCS)
- libteken is filled with a fair amount of assertions, but unfortunately
we cannot go into the debugger anymore if we fail them. I've done
development of this library almost entirely in userspace. In
sys/dev/syscons/teken there are two applications that can be helpful
when debugging the code:
- teken_demo: a terminal emulator that can be started from a regular
xterm that emulates a terminal using libteken. This application can
be very useful to debug any rendering issues.
- teken_stress: a stress testing application that emulates random
terminal output. libteken has literally survived multiple terabytes
of random input.
- libteken also includes support for UTF-8, but unfortunately our input
layer and font renderer don't support this. If users want to
experiment with UTF-8 support, they can enable `TEKEN_UTF8' in
teken.h. If you recompile your kernel or the teken_demo application,
you can hold some nice experiments.
- I've left PC98 the way it is right now. The PC98 platform has a custom
syscons renderer, which supports some form of localised input. Maybe
we should port PC98 to libteken by the time syscons supports UTF-8?
- I've removed the `dumb' terminal emulator. It has been broken for
years. It hasn't survived the `struct proc' -> `struct thread'
conversion.
- To prevent confusion among people that want to hack on libteken:
unlike syscons, the state machines that parse the escape sequences are
machine generated. This means that if you want to add new escape
sequences, you have to add an entry to the `sequences' file. This will
cause new entries to be added to `teken_state.h'.
- Any rendering artifacts that didn't occur prior to this commit are by
accident. They should be reported to me, so I can fix them.
Discussed on: current@, hackers@
Discussed with: philip (at 25C3)
2009-01-01 08:26:53 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
struct tty *tp;
|
Replace syscons terminal renderer by a new renderer that uses libteken.
Some time ago I started working on a library called libteken, which is
terminal emulator. It does not buffer any screen contents, but only
keeps terminal state, such as cursor position, attributes, etc. It
should implement all escape sequences that are implemented by the
cons25 terminal emulator, but also a fair amount of sequences that are
present in VT100 and xterm.
A lot of random notes, which could be of interest to users/developers:
- Even though I'm leaving the terminal type set to `cons25', users can
do experiments with placing `xterm-color' in /etc/ttys. Because we
only implement a subset of features of xterm, this may cause
artifacts. We should consider extending libteken, because in my
opinion xterm is the way to go. Some missing features:
- Keypad application mode (DECKPAM)
- Character sets (SCS)
- libteken is filled with a fair amount of assertions, but unfortunately
we cannot go into the debugger anymore if we fail them. I've done
development of this library almost entirely in userspace. In
sys/dev/syscons/teken there are two applications that can be helpful
when debugging the code:
- teken_demo: a terminal emulator that can be started from a regular
xterm that emulates a terminal using libteken. This application can
be very useful to debug any rendering issues.
- teken_stress: a stress testing application that emulates random
terminal output. libteken has literally survived multiple terabytes
of random input.
- libteken also includes support for UTF-8, but unfortunately our input
layer and font renderer don't support this. If users want to
experiment with UTF-8 support, they can enable `TEKEN_UTF8' in
teken.h. If you recompile your kernel or the teken_demo application,
you can hold some nice experiments.
- I've left PC98 the way it is right now. The PC98 platform has a custom
syscons renderer, which supports some form of localised input. Maybe
we should port PC98 to libteken by the time syscons supports UTF-8?
- I've removed the `dumb' terminal emulator. It has been broken for
years. It hasn't survived the `struct proc' -> `struct thread'
conversion.
- To prevent confusion among people that want to hack on libteken:
unlike syscons, the state machines that parse the escape sequences are
machine generated. This means that if you want to add new escape
sequences, you have to add an entry to the `sequences' file. This will
cause new entries to be added to `teken_state.h'.
- Any rendering artifacts that didn't occur prior to this commit are by
accident. They should be reported to me, so I can fix them.
Discussed on: current@, hackers@
Discussed with: philip (at 25C3)
2009-01-01 08:26:53 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
tp = SC_DEV(scp->sc, scp->sc->cur_scp->index);
|
|
|
|
|
if (!tty_opened_ns(tp))
|
|
|
|
|
return;
|
|
|
|
|
ttydisc_rint_simple(tp, p, count);
|
|
|
|
|
if (wakeup) {
|
|
|
|
|
/* XXX: we can't always call ttydisc_rint_done() here! */
|
|
|
|
|
ttydisc_rint_done(tp);
|
|
|
|
|
}
|
Replace syscons terminal renderer by a new renderer that uses libteken.
Some time ago I started working on a library called libteken, which is
terminal emulator. It does not buffer any screen contents, but only
keeps terminal state, such as cursor position, attributes, etc. It
should implement all escape sequences that are implemented by the
cons25 terminal emulator, but also a fair amount of sequences that are
present in VT100 and xterm.
A lot of random notes, which could be of interest to users/developers:
- Even though I'm leaving the terminal type set to `cons25', users can
do experiments with placing `xterm-color' in /etc/ttys. Because we
only implement a subset of features of xterm, this may cause
artifacts. We should consider extending libteken, because in my
opinion xterm is the way to go. Some missing features:
- Keypad application mode (DECKPAM)
- Character sets (SCS)
- libteken is filled with a fair amount of assertions, but unfortunately
we cannot go into the debugger anymore if we fail them. I've done
development of this library almost entirely in userspace. In
sys/dev/syscons/teken there are two applications that can be helpful
when debugging the code:
- teken_demo: a terminal emulator that can be started from a regular
xterm that emulates a terminal using libteken. This application can
be very useful to debug any rendering issues.
- teken_stress: a stress testing application that emulates random
terminal output. libteken has literally survived multiple terabytes
of random input.
- libteken also includes support for UTF-8, but unfortunately our input
layer and font renderer don't support this. If users want to
experiment with UTF-8 support, they can enable `TEKEN_UTF8' in
teken.h. If you recompile your kernel or the teken_demo application,
you can hold some nice experiments.
- I've left PC98 the way it is right now. The PC98 platform has a custom
syscons renderer, which supports some form of localised input. Maybe
we should port PC98 to libteken by the time syscons supports UTF-8?
- I've removed the `dumb' terminal emulator. It has been broken for
years. It hasn't survived the `struct proc' -> `struct thread'
conversion.
- To prevent confusion among people that want to hack on libteken:
unlike syscons, the state machines that parse the escape sequences are
machine generated. This means that if you want to add new escape
sequences, you have to add an entry to the `sequences' file. This will
cause new entries to be added to `teken_state.h'.
- Any rendering artifacts that didn't occur prior to this commit are by
accident. They should be reported to me, so I can fix them.
Discussed on: current@, hackers@
Discussed with: philip (at 25C3)
2009-01-01 08:26:53 -05:00
|
|
|
}
|
|
|
|
|
|
2021-11-03 17:55:32 -04:00
|
|
|
/*
|
|
|
|
|
* pitch is the divisor for 1.193182MHz PIT clock. By dividing 1193172 / pitch,
|
|
|
|
|
* we convert it back to Hz.
|
|
|
|
|
* duration is in ticks of 1/hz.
|
|
|
|
|
*/
|
2000-01-15 10:25:43 -05:00
|
|
|
void
|
|
|
|
|
sc_bell(scr_stat *scp, int pitch, int duration)
|
1993-07-26 17:21:11 -04:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (cold || kdb_active || shutdown_in_progress || !enable_bell)
|
|
|
|
|
return;
|
1998-02-11 09:56:02 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL))
|
|
|
|
|
return;
|
1998-08-03 05:09:35 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (scp->sc->flags & SC_VISUAL_BELL) {
|
|
|
|
|
if (scp->sc->blink_in_progress)
|
|
|
|
|
return;
|
|
|
|
|
scp->sc->blink_in_progress = 3;
|
|
|
|
|
if (scp != scp->sc->cur_scp)
|
|
|
|
|
scp->sc->blink_in_progress += 2;
|
|
|
|
|
blink_screen(scp->sc->cur_scp);
|
|
|
|
|
} else if (duration != 0 && pitch != 0) {
|
|
|
|
|
if (scp != scp->sc->cur_scp)
|
|
|
|
|
pitch *= 2;
|
2021-11-03 17:55:32 -04:00
|
|
|
sysbeep(1193182 / pitch, SBT_1S * duration / hz);
|
2019-12-02 21:30:52 -05:00
|
|
|
}
|
1995-01-12 06:47:05 -05:00
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
|
Restore switching to a separate kernel terminal "input" state and extend
it to a separate state for each CPU.
Terminal "input" is user or kernel output. Its state includes the current
parser state for escape sequences and multi-byte characters, and some
results of previous parsing (mainly attributes), and in teken the cursor
position, but not completed output. This state must be switched for kernel
output since the kernel can preempt anything, including itself, and this
must not affect the preempted state more than necessary. Since vty0 is
shared, it is necessary to affect the frame buffer and cursor position and
history, but escape sequences must not be affected and attributes for
further output must not be affected.
This used to work. The syscons terminal state contained mainly the parser
state for escape sequences and attributes, but not the cursor position,
and was switched. This was first broken by SMP and/or preemptive kernels.
Then there should really be a separate state for each thread, and one more
for ddb, or locking to prevent preemption. Serialization of printf() helps.
But it is arcane that full syscons escape sequences mostly work in kernel
printf(), and I have never seen them used except by me to test this fix.
They worked perfectly except for the races, since "input" from the kernel
was not special in any way.
This was broken to use teken. The general switch was removed, and the
kernel normal attribute was switched specially. The kernel reverse
attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is
still unusable because teken doesn't support default reverse attributes
(it used to only be used via the ANSI escape sequence to set reverse
video).
The only new difficulty for using teken seems to be that the cursor
position is in the "input" state, so it must be updated in the active
input state for each half of the switch. Do this to complete the
restoration.
The per-CPU state is mainly to make per-CPU coloring work cleanly, at
a cost of some space. Each CPU gets its own full set of attribute
(not just the current attribute) maintained in the usual way. This
also reduces races from unserialized printf()s. However, this gives
races for serialized printf()s that otherwise have none. Nothing
prevents the CPU doing the a printf() changing in the middle of an
escape sequence.
2017-03-26 09:03:16 -04:00
|
|
|
static int
|
2017-03-04 01:19:12 -05:00
|
|
|
sc_kattr(void)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
if (sc_console == NULL)
|
|
|
|
|
return (SC_KERNEL_CONS_ATTR); /* for very early, before pcpu */
|
|
|
|
|
return (sc_kattrtab[curcpu % nitems(sc_kattrtab)]);
|
2017-03-04 01:19:12 -05:00
|
|
|
}
|
|
|
|
|
|
1995-01-12 06:47:05 -05:00
|
|
|
static void
|
1997-04-20 12:05:33 -04:00
|
|
|
blink_screen(void *arg)
|
1995-01-12 06:47:05 -05:00
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
scr_stat *scp = arg;
|
|
|
|
|
struct tty *tp;
|
1997-04-20 12:05:33 -04:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
if (ISGRAPHSC(scp) || (scp->sc->blink_in_progress <= 1)) {
|
|
|
|
|
scp->sc->blink_in_progress = 0;
|
|
|
|
|
mark_all(scp);
|
|
|
|
|
tp = SC_DEV(scp->sc, scp->index);
|
|
|
|
|
if (tty_opened_ns(tp))
|
|
|
|
|
sctty_outwakeup(tp);
|
|
|
|
|
if (scp->sc->delayed_next_scr)
|
|
|
|
|
sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1);
|
|
|
|
|
} else {
|
|
|
|
|
(*scp->rndr->draw)(scp, 0, scp->xsize * scp->ysize,
|
|
|
|
|
scp->sc->blink_in_progress & 1);
|
|
|
|
|
scp->sc->blink_in_progress--;
|
|
|
|
|
callout_reset_sbt(&scp->sc->cblink, SBT_1S / 15, 0,
|
|
|
|
|
blink_screen, scp, C_PREL(0));
|
|
|
|
|
}
|
1993-07-26 17:21:11 -04:00
|
|
|
}
|
2004-04-02 10:02:44 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Until sc_attach_unit() gets called no dev structures will be available
|
|
|
|
|
* to store the per-screen current status. This is the case when the
|
|
|
|
|
* kernel is initially booting and needs access to its console. During
|
|
|
|
|
* this early phase of booting the console's current status is kept in
|
|
|
|
|
* one statically defined scr_stat structure, and any pointers to the
|
|
|
|
|
* dev structures will be NULL.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static scr_stat *
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
sc_get_stat(struct tty *tp)
|
2004-04-02 10:02:44 -05:00
|
|
|
{
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
if (tp == NULL)
|
2004-04-02 10:02:44 -05:00
|
|
|
return (&main_console);
|
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
2008-08-20 04:31:58 -04:00
|
|
|
return (SC_STAT(tp));
|
2004-04-02 10:02:44 -05:00
|
|
|
}
|
2006-02-28 18:46:23 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Allocate active keyboard. Try to allocate "kbdmux" keyboard first, and,
|
|
|
|
|
* if found, add all non-busy keyboards to "kbdmux". Otherwise look for
|
|
|
|
|
* any keyboard.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
sc_allocate_keyboard(sc_softc_t *sc, int unit)
|
|
|
|
|
{
|
2019-12-02 21:30:52 -05:00
|
|
|
int idx0, idx;
|
|
|
|
|
keyboard_t *k0, *k;
|
|
|
|
|
keyboard_info_t ki;
|
2006-02-28 18:46:23 -05:00
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
idx0 =
|
2019-12-23 16:32:07 -05:00
|
|
|
kbd_allocate("kbdmux", -1, (void *)&sc->kbd, sckbdevent, sc);
|
2006-02-28 18:46:23 -05:00
|
|
|
if (idx0 != -1) {
|
|
|
|
|
k0 = kbd_get_keyboard(idx0);
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
for (idx = kbd_find_keyboard2("*", -1, 0); idx != -1;
|
2006-02-28 18:46:23 -05:00
|
|
|
idx = kbd_find_keyboard2("*", -1, idx + 1)) {
|
|
|
|
|
k = kbd_get_keyboard(idx);
|
|
|
|
|
|
|
|
|
|
if (idx == idx0 || KBD_IS_BUSY(k))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
bzero(&ki, sizeof(ki));
|
|
|
|
|
strcpy(ki.kb_name, k->kb_name);
|
|
|
|
|
ki.kb_unit = k->kb_unit;
|
|
|
|
|
|
2019-12-02 21:30:52 -05:00
|
|
|
(void)kbdd_ioctl(k0, KBADDKBD, (caddr_t)&ki);
|
2006-02-28 18:46:23 -05:00
|
|
|
}
|
|
|
|
|
} else
|
2019-12-02 21:30:52 -05:00
|
|
|
idx0 = kbd_allocate(
|
2019-12-23 16:32:07 -05:00
|
|
|
"*", unit, (void *)&sc->kbd, sckbdevent, sc);
|
2006-02-28 18:46:23 -05:00
|
|
|
|
|
|
|
|
return (idx0);
|
|
|
|
|
}
|