First round in syscons update. Several new features has been added:

No kernel config options anymore besides keyboard language layout.
Virtual consoles are now dynamically allocated, no NCONS anymore.
Software cursor blinking/nonblinking.
Visual bell for laptops (don't beep at meetings :-).
Cursor/bell default type setable via config "flags" instead of as defines.
Cursor/bell type setable via ioctl's.
New video modes 80x30 80x60 for some laptops, and those with multisync monitors.
Scroll-lock history (length currently fixed at 100 lines).
Lots of cleanups, some only commented out for now (will goaway soon).
Support for new features in vidcontrol/kbdcontrol.
Updated manpages.
This commit is contained in:
Søren Schmidt 1995-01-12 11:47:05 +00:00
parent 9d68e93aaf
commit 6378775666
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5536
13 changed files with 1656 additions and 1186 deletions

View File

@ -1,4 +1,4 @@
.Dd April 7, 1993
.Dd January 8, 1995
.Dt KEYBOARD 4
.Os FreeBSD
.Sh NAME
@ -22,6 +22,10 @@ then enter a decimal number from 0-255 via the numerical keypad, then
release ALT. The entered value is then used as the ASCII value for one
character. This way it is possible to enter any ASCII value, not present
on the keyboard.
The console driver also includes a history function. It is activatet by
pressing the scroll-lock key. This holds the display, and enables the cursor
arrows for scrolling up and down through the last scrolled out lines.
The keyboard is configurable to suit the individual user and the different
national layout.
@ -86,7 +90,7 @@ The bitmap is backwards ie. 7 for base, 6 for shift etc.
The flgs field defines if the key should react on caps-lock (1),
num-lock (2), both (3) or ignore both (0).
The mapkbd utility is used to load such a description into/outof
The kbdcontrol utility is used to load such a description into/outof
the kernel at runtime. This make it possible to change the key
assignments at runtime, or more important to get (GIO_KEYMAP ioctl)
the exact key meanings from the kernel (fx. used by the X server).
@ -129,7 +133,8 @@ The function keys are numbered like this:
Page down key 59
Insert key 60
.Ed
The kbdcontrol utility also allows changing these values at runtime.
.Pp
.Sh AUTHOR
Søren Schmidt
Email: (sos@login.dkuug.dk -or- sos@kmd-ac.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,4 +1,4 @@
.Dd April 7, 1993
.Dd January 8, 1995
.Dt KEYBOARD 4
.Os FreeBSD
.Sh NAME
@ -22,6 +22,10 @@ then enter a decimal number from 0-255 via the numerical keypad, then
release ALT. The entered value is then used as the ASCII value for one
character. This way it is possible to enter any ASCII value, not present
on the keyboard.
The console driver also includes a history function. It is activatet by
pressing the scroll-lock key. This holds the display, and enables the cursor
arrows for scrolling up and down through the last scrolled out lines.
The keyboard is configurable to suit the individual user and the different
national layout.
@ -86,7 +90,7 @@ The bitmap is backwards ie. 7 for base, 6 for shift etc.
The flgs field defines if the key should react on caps-lock (1),
num-lock (2), both (3) or ignore both (0).
The mapkbd utility is used to load such a description into/outof
The kbdcontrol utility is used to load such a description into/outof
the kernel at runtime. This make it possible to change the key
assignments at runtime, or more important to get (GIO_KEYMAP ioctl)
the exact key meanings from the kernel (fx. used by the X server).
@ -129,7 +133,8 @@ The function keys are numbered like this:
Page down key 59
Insert key 60
.Ed
The kbdcontrol utility also allows changing these values at runtime.
.Pp
.Sh AUTHOR
Søren Schmidt
Email: (sos@login.dkuug.dk -or- sos@kmd-ac.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,4 +1,4 @@
.Dd April 7, 1993
.Dd January 8, 1995
.Dt SCREEN 4
.Os FreeBSD
.Sh NAME
@ -30,9 +30,6 @@ selected as the current virtual console, and given exclusive use of
the keyboard and display. This switch sequence can be changed via
the keyboard mapping ioctl call (see keyboard.4)
.Pp
The number of virtual consoles is changeable in the system config
file, and need recompilation of the kernel to take any effect. The
default is 12.
The console allows entering values that are not physically
present on the keyboard via a special keysequence.
@ -40,6 +37,9 @@ To use this facility press and hold down ALT,
then enter a decimal number from 0-255 via the numerical keypad, then
release ALT. The entered value is then used as the ASCII value for one
character. This way it is possible to enter any ASCII value.
The console driver also includes a history function. It is activatet by
pressing the scroll-lock key. This holds the display, and enables the cursor
arrows for scrolling up and down through the last scrolled out lines.
The console understands a subset of the ANSI x3.64 character
sequences. For compatibility with the old pccons, the PC3 character
@ -121,8 +121,8 @@ SGR E[nm Set character attributes: --
picth is in units of 840 nS,
duration is units of 0,1 S.
-- E[=s:eC Set cursor start and end scanline, --
start on line s, end on line e.
-- E[=tC Set cursor type, 1 selects a blinking --
cursor, 0 a steady cursor.
-- E[=nA Set the border color to color n
(see table) (if supported by HW)
@ -153,5 +153,4 @@ note: the first E in the sequences stands for ESC (0x1b)
.Ed
.Pp
.Sh AUTHOR
Søren Schmidt
Email: (sos@login.dkuug.dk -or- sos@kmd-ac.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,4 +1,4 @@
.Dd April 7, 1993
.Dd January 8, 1995
.Dt SCREEN 4
.Os FreeBSD
.Sh NAME
@ -30,9 +30,6 @@ selected as the current virtual console, and given exclusive use of
the keyboard and display. This switch sequence can be changed via
the keyboard mapping ioctl call (see keyboard.4)
.Pp
The number of virtual consoles is changeable in the system config
file, and need recompilation of the kernel to take any effect. The
default is 12.
The console allows entering values that are not physically
present on the keyboard via a special keysequence.
@ -40,6 +37,9 @@ To use this facility press and hold down ALT,
then enter a decimal number from 0-255 via the numerical keypad, then
release ALT. The entered value is then used as the ASCII value for one
character. This way it is possible to enter any ASCII value.
The console driver also includes a history function. It is activatet by
pressing the scroll-lock key. This holds the display, and enables the cursor
arrows for scrolling up and down through the last scrolled out lines.
The console understands a subset of the ANSI x3.64 character
sequences. For compatibility with the old pccons, the PC3 character
@ -121,8 +121,8 @@ SGR E[nm Set character attributes: --
picth is in units of 840 nS,
duration is units of 0,1 S.
-- E[=s:eC Set cursor start and end scanline, --
start on line s, end on line e.
-- E[=tC Set cursor type, 1 selects a blinking --
cursor, 0 a steady cursor.
-- E[=nA Set the border color to color n
(see table) (if supported by HW)
@ -153,5 +153,4 @@ note: the first E in the sequences stands for ESC (0x1b)
.Ed
.Pp
.Sh AUTHOR
Søren Schmidt
Email: (sos@login.dkuug.dk -or- sos@kmd-ac.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 1991-1994 Søren Schmidt
* Copyright (c) 1991-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -25,14 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: console.h,v 1.12 1994/10/01 02:56:07 davidg Exp $
* $Id: console.h,v 1.13 1994/10/17 22:11:52 sos Exp $
*/
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ioccom.h>
#define KDGKBMODE _IOR('K', 6, int)
#define KDSKBMODE _IO('K', 7)
@ -57,14 +57,16 @@
#define GIO_KEYMAP _IOR('k', 6, keymap_t)
#define PIO_KEYMAP _IOW('k', 7, keymap_t)
#define GIO_ATTR _IOR('a', 0, long)
#define GIO_COLOR _IOR('c', 0, long)
#define CONS_CURRENT _IOR('c', 1, long)
#define CONS_GET _IOR('c', 2, long)
/* #define CONS_IO _IO('c', 3, long) */
#define CONS_BLANKTIME _IOW('c', 4, long)
#define GIO_ATTR _IOR('a', 0, int)
#define GIO_COLOR _IOR('c', 0, int)
#define CONS_CURRENT _IOR('c', 1, int)
#define CONS_GET _IOR('c', 2, int)
#define CONS_IO _IO('c', 3, int)
#define CONS_BLANKTIME _IOW('c', 4, int)
#define CONS_SSAVER _IOW('c', 5, ssaver_t)
#define CONS_GSAVER _IOWR('c', 6, ssaver_t)
#define CONS_CURSORTYPE _IOW('c', 7, int)
#define CONS_BELLTYPE _IOW('c', 8, int)
#define PIO_FONT8x8 _IOW('c', 64, fnt8_t)
#define GIO_FONT8x8 _IOR('c', 65, fnt8_t)
#define PIO_FONT8x14 _IOW('c', 66, fnt14_t)
@ -72,7 +74,7 @@
#define PIO_FONT8x16 _IOW('c', 68, fnt16_t)
#define GIO_FONT8x16 _IOR('c', 69, fnt16_t)
#define CONS_GETINFO _IOWR('c', 73, vid_info_t)
#define CONS_GETVERS _IOR('c', 74, long)
#define CONS_GETVERS _IOR('c', 74, int)
#define VT_OPENQRY _IOR('v', 1, int)
#define VT_SETMODE _IOW('v', 2, vtmode_t)
@ -89,11 +91,12 @@
#define VT_AUTO 0 /* switching is automatic */
#define VT_PROCESS 1 /* switching controlled by prog */
/* compatibility to old pccons & X386 */
/* compatibility to old pccons & X386 about to go away */
/*
#define CONSOLE_X_MODE_ON _IO('t', 121)
#define CONSOLE_X_MODE_OFF _IO('t', 122)
#define CONSOLE_X_BELL _IOW('t',123,int[2])
*/
struct vt_mode {
char mode;
char waitv; /* not implemented yet SOS */
@ -264,15 +267,22 @@ typedef struct ssaver ssaver_t;
#define M_ENH_C80x25 22 /* ega enhanced color 80 columns */
#define M_VGA_C40x25 23 /* vga 8x16 font on color */
#define M_VGA_C80x25 24 /* vga 8x16 font on color */
#define M_VGA_C80x50 30 /* vga 8x8 font on color */
#define M_VGA_M80x25 25 /* vga 8x16 font on mono */
#define M_VGA_M80x50 31 /* vga 8x8 font on color */
#define M_VGA11 26 /* vga 640x480 2 colors */
#define M_BG640x480 26
#define M_VGA12 27 /* vga 640x480 16 colors */
#define M_CG640x480 27
#define M_VGA13 28 /* vga 640x200 256 colors */
#define M_VGA_CG320 28
#define M_VGA_C80x50 30 /* vga 8x8 font on color */
#define M_VGA_M80x50 31 /* vga 8x8 font on color */
#define M_VGA_C80x30 32 /* vga 8x16 font on color */
#define M_VGA_M80x30 33 /* vga 8x16 font on color */
#define M_VGA_C80x60 34 /* vga 8x8 font on color */
#define M_VGA_M80x60 35 /* vga 8x8 font on color */
#define M_ENH_B80x43 0x70 /* ega black & white 80x43 */
#define M_ENH_C80x43 0x71 /* ega color 80x43 */
#define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */
@ -302,9 +312,13 @@ typedef struct ssaver ssaver_t;
#define SW_MCAMODE _IO('S', M_MCA_MODE)
#define SW_VGA_C40x25 _IO('S', M_VGA_C40x25)
#define SW_VGA_C80x25 _IO('S', M_VGA_C80x25)
#define SW_VGA_C80x30 _IO('S', M_VGA_C80x30)
#define SW_VGA_C80x50 _IO('S', M_VGA_C80x50)
#define SW_VGA_C80x60 _IO('S', M_VGA_C80x60)
#define SW_VGA_M80x25 _IO('S', M_VGA_M80x25)
#define SW_VGA_M80x30 _IO('S', M_VGA_M80x30)
#define SW_VGA_M80x50 _IO('S', M_VGA_M80x50)
#define SW_VGA_M80x60 _IO('S', M_VGA_M80x60)
#define SW_VGA11 _IO('S', M_VGA11)
#define SW_BG640x480 _IO('S', M_VGA11)
#define SW_VGA12 _IO('S', M_VGA12)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 1991-1994 Søren Schmidt
* Copyright (c) 1991-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -25,14 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: console.h,v 1.12 1994/10/01 02:56:07 davidg Exp $
* $Id: console.h,v 1.13 1994/10/17 22:11:52 sos Exp $
*/
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ioccom.h>
#define KDGKBMODE _IOR('K', 6, int)
#define KDSKBMODE _IO('K', 7)
@ -57,14 +57,16 @@
#define GIO_KEYMAP _IOR('k', 6, keymap_t)
#define PIO_KEYMAP _IOW('k', 7, keymap_t)
#define GIO_ATTR _IOR('a', 0, long)
#define GIO_COLOR _IOR('c', 0, long)
#define CONS_CURRENT _IOR('c', 1, long)
#define CONS_GET _IOR('c', 2, long)
/* #define CONS_IO _IO('c', 3, long) */
#define CONS_BLANKTIME _IOW('c', 4, long)
#define GIO_ATTR _IOR('a', 0, int)
#define GIO_COLOR _IOR('c', 0, int)
#define CONS_CURRENT _IOR('c', 1, int)
#define CONS_GET _IOR('c', 2, int)
#define CONS_IO _IO('c', 3, int)
#define CONS_BLANKTIME _IOW('c', 4, int)
#define CONS_SSAVER _IOW('c', 5, ssaver_t)
#define CONS_GSAVER _IOWR('c', 6, ssaver_t)
#define CONS_CURSORTYPE _IOW('c', 7, int)
#define CONS_BELLTYPE _IOW('c', 8, int)
#define PIO_FONT8x8 _IOW('c', 64, fnt8_t)
#define GIO_FONT8x8 _IOR('c', 65, fnt8_t)
#define PIO_FONT8x14 _IOW('c', 66, fnt14_t)
@ -72,7 +74,7 @@
#define PIO_FONT8x16 _IOW('c', 68, fnt16_t)
#define GIO_FONT8x16 _IOR('c', 69, fnt16_t)
#define CONS_GETINFO _IOWR('c', 73, vid_info_t)
#define CONS_GETVERS _IOR('c', 74, long)
#define CONS_GETVERS _IOR('c', 74, int)
#define VT_OPENQRY _IOR('v', 1, int)
#define VT_SETMODE _IOW('v', 2, vtmode_t)
@ -89,11 +91,12 @@
#define VT_AUTO 0 /* switching is automatic */
#define VT_PROCESS 1 /* switching controlled by prog */
/* compatibility to old pccons & X386 */
/* compatibility to old pccons & X386 about to go away */
/*
#define CONSOLE_X_MODE_ON _IO('t', 121)
#define CONSOLE_X_MODE_OFF _IO('t', 122)
#define CONSOLE_X_BELL _IOW('t',123,int[2])
*/
struct vt_mode {
char mode;
char waitv; /* not implemented yet SOS */
@ -264,15 +267,22 @@ typedef struct ssaver ssaver_t;
#define M_ENH_C80x25 22 /* ega enhanced color 80 columns */
#define M_VGA_C40x25 23 /* vga 8x16 font on color */
#define M_VGA_C80x25 24 /* vga 8x16 font on color */
#define M_VGA_C80x50 30 /* vga 8x8 font on color */
#define M_VGA_M80x25 25 /* vga 8x16 font on mono */
#define M_VGA_M80x50 31 /* vga 8x8 font on color */
#define M_VGA11 26 /* vga 640x480 2 colors */
#define M_BG640x480 26
#define M_VGA12 27 /* vga 640x480 16 colors */
#define M_CG640x480 27
#define M_VGA13 28 /* vga 640x200 256 colors */
#define M_VGA_CG320 28
#define M_VGA_C80x50 30 /* vga 8x8 font on color */
#define M_VGA_M80x50 31 /* vga 8x8 font on color */
#define M_VGA_C80x30 32 /* vga 8x16 font on color */
#define M_VGA_M80x30 33 /* vga 8x16 font on color */
#define M_VGA_C80x60 34 /* vga 8x8 font on color */
#define M_VGA_M80x60 35 /* vga 8x8 font on color */
#define M_ENH_B80x43 0x70 /* ega black & white 80x43 */
#define M_ENH_C80x43 0x71 /* ega color 80x43 */
#define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */
@ -302,9 +312,13 @@ typedef struct ssaver ssaver_t;
#define SW_MCAMODE _IO('S', M_MCA_MODE)
#define SW_VGA_C40x25 _IO('S', M_VGA_C40x25)
#define SW_VGA_C80x25 _IO('S', M_VGA_C80x25)
#define SW_VGA_C80x30 _IO('S', M_VGA_C80x30)
#define SW_VGA_C80x50 _IO('S', M_VGA_C80x50)
#define SW_VGA_C80x60 _IO('S', M_VGA_C80x60)
#define SW_VGA_M80x25 _IO('S', M_VGA_M80x25)
#define SW_VGA_M80x30 _IO('S', M_VGA_M80x30)
#define SW_VGA_M80x50 _IO('S', M_VGA_M80x50)
#define SW_VGA_M80x60 _IO('S', M_VGA_M80x60)
#define SW_VGA11 _IO('S', M_VGA11)
#define SW_BG640x480 _IO('S', M_VGA11)
#define SW_VGA12 _IO('S', M_VGA12)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,12 @@ characteristics etc.
The following command line options are supported.
.TP
.BI "\-b\ " [ duration.pitch ]
Set the bell duration and pitch values.
Set the bell duration and pitch values. Argument may also be one of
.BI "normal"
which set sound parameters back to normal values, or
.BI "visual"
which set the bell to visual mode, ie flashes the screen instead.
.TP
.BI "\-r\ " [ delay.repeat | slow | fast | normal ]
Set keyboard
@ -72,6 +77,5 @@ Report when found.
.BR vidcontrol (1) ,
.BR keyboard (4) ,
.BR screen (4) ,
.BR /sys/i386/conf/SYSCONS
.SH AUTHORS
Søren Schmidt (sos@login.dkuug.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 1994 Søren Schmidt
* Copyright (c) 1994-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: kbdcontrol.c,v 1.1 1994/08/17 08:59:34 sos Exp $
* $Id: kbdcontrol.c,v 1.2 1994/10/25 20:50:41 swallace Exp $
*/
#include <ctype.h>
@ -86,10 +86,9 @@ nextarg(int ac, char **av, int *indp, int oc)
char *
mkfullname(const char *s1, const char *s2, const char *s3)
{
static char *buf = NULL;
static int bufl = 0;
int f;
static char *buf = NULL;
static int bufl = 0;
int f;
f = strlen(s1) + strlen(s2) + strlen(s3) + 1;
if (f > bufl)
@ -421,14 +420,17 @@ set_functionkey(char *keynumstr, char *string)
void
set_bell_values(char *opt)
{
int duration, pitch;
int bell, duration, pitch;
if (!strcmp(opt, "normal"))
duration = 1, pitch = 15;
if (!strcmp(opt, "visual"))
bell = 1, duration = 1, pitch = 800;
else if (!strcmp(opt, "normal"))
bell = 0, duration = 1, pitch = 800;
else {
int n;
char *v1;
bell = 0;
duration = strtol(opt, &v1, 0);
if ((duration < 0) || (*v1 != '.'))
goto badopt;
@ -443,9 +445,14 @@ set_bell_values(char *opt)
}
if (verbose)
fprintf(stderr, "setting bell values to %d.%d\n",
duration, pitch);
fprintf(stderr, "[=%d;%dB", pitch, duration);
if (bell)
fprintf(stderr, "setting visual bell\n");
else
fprintf(stderr, "setting bell values to %d.%d\n",
duration, pitch);
ioctl(0, CONS_BELLTYPE, &bell);
if (!bell)
fprintf(stderr, "[=%d;%dB", pitch, duration);
}
@ -501,16 +508,17 @@ struct {
usage()
{
fprintf(stderr,
"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
" -d (dump keyboard map to stdout)\n"
" -l filename (load keyboard map file)\n"
" -f <N> string (set function key N to send <string>)\n"
" -F (set function keys back to default)\n"
" -r delay.repeat (set keyboard delay & repeat rate)\n"
" -r slow (set keyboard delay & repeat to slow)\n"
" -r normal (set keyboard delay & repeat to normal)\n"
" -r fast (set keyboard delay & repeat to fast)\n"
" -v (verbose)\n"
"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
" -b normal | visual (set bell to visual type)\n"
" -d (dump keyboard map to stdout)\n"
" -l filename (load keyboard map file)\n"
" -f <N> string (set function key N to send <string>)\n"
" -F (set function keys back to default)\n"
" -r delay.repeat (set keyboard delay & repeat rate)\n"
" -r slow (set keyboard delay & repeat to slow)\n"
" -r normal (set keyboard delay & repeat to normal)\n"
" -r fast (set keyboard delay & repeat to fast)\n"
" -v (verbose)\n"
);
}

View File

@ -30,10 +30,12 @@ screensaver type and timeout.
A new video mode is selected by specifying its name as an argument to
.B vidcontrol
eg. "
.B vidcontrol 80x25
.B vidcontrol VGA_80x25
".
The modes currently supported: 80x25 and 80x50 text.
The modes currently supported: VGA_40x25, VGA_80x25, VGA_80x50, EGA_80x25, EGA_80x43.
On some laptops the modes VGA_80x30 and VGA_80x60 can be used.
The graphic mode VGA_320x200 can also be chosen.
The colors used when displaying text can be changed by specifying the
foreground color (eg. "
@ -63,13 +65,8 @@ Set border color to
.B color
(only supported on VGA hardware):
.TP
.BI "\-c\ " start.end
Change the cursor apperance. The cursor is changed to a shape that starts
on scanline
.B start
and ends on scanline
.B end
.
.BI "\-c\ " blink | noblink
Change the cursor apperance. The cursor is either blinking or nonblinking.
.TP
.BI "\-d\ "
Print out current screen output map.
@ -112,7 +109,6 @@ Report when found.
.BR kbdcontrol(1) ,
.BR keyboard (4) ,
.BR screen (4) ,
.BR /sys/i386/conf/GENERICAH
.SH AUTHORS
Søren Schmidt (sos@login.dkuug.dk)
Søren Schmidt (sos@FreeBSD.org)

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 1994 Søren Schmidt
* Copyright (c) 1994-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: vidcontrol.c,v 1.2 1994/09/15 07:28:06 sos Exp $
* $Id: vidcontrol.c,v 1.3 1994/09/26 20:20:44 ache Exp $
*/
#include <ctype.h>
@ -264,26 +264,19 @@ set_screensaver_type(char *type)
}
void
set_cursor_values(char *size)
set_cursor_type(char *appearence)
{
int start, end;
int n;
char *v1;
int type;
start = strtol(size, &v1, 0);
if ((start < 0) || (*v1 != '.'))
goto badopt;
size = ++v1;
end = strtol(size, &v1, 0);
if ((end < 0) || (*size == '\0') || (*v1 != '\0')) {
badopt:
fprintf(stderr,
"argument to -c must be start.end\n");
if (!strcmp(appearence, "blink"))
type = 1;
else if (!strcmp(appearence, "noblink"))
type = 0;
else {
fprintf(stderr, "argument to -c must be blink or noblink\n");
return;
}
if (verbose)
fprintf(stderr, "setting cursor to %d.%d\n", start, end);
fprintf(stdout, "[=%d;%dC", start, end);
ioctl(0, CONS_CURSORTYPE, &type);
}
@ -297,8 +290,12 @@ video_mode(int argc, char **argv, int *index)
mode = SW_VGA_C40x25;
else if (!strcmp(argv[*index], "VGA_80x25"))
mode = SW_VGA_C80x25;
else if (!strcmp(argv[*index], "VGA_80x30"))
mode = SW_VGA_C80x30;
else if (!strcmp(argv[*index], "VGA_80x50"))
mode = SW_VGA_C80x50;
else if (!strcmp(argv[*index], "VGA_80x60"))
mode = SW_VGA_C80x60;
else if (!strcmp(argv[*index], "VGA_320x200"))
mode = SW_VGA_CG320;
else if (!strcmp(argv[*index], "EGA_80x25"))
@ -397,18 +394,18 @@ usage()
"Usage: vidcontrol mode (available modes: VGA_40x25, VGA_80x25,\n"
" VGA_80x50, VGA_320x200,\n"
" EGA_80x25, EGA_80x43)\n"
" show (show available colors)\n"
" fgcol bgcol (set fore- & background colors)\n"
" -r fgcol bgcol (set reverse fore- & background colors)\n"
" -b color (set border color)\n"
" -c n.m (set cursor start line n & end line m)\n"
" -d (dump screenmap to stdout)\n"
" -l filename (load srceenmap file filename)\n"
" -L (load default screenmap)\n"
" -f DxL filename (load font, D dots wide & L lines high)\n"
" -s saver | help (set screensaver type or help for a list)\n"
" -t N (set screensaver timeout in seconds)\n"
" -x (use hex numbers for output)\n"
" show (show available colors)\n"
" fgcol bgcol (set fore- & background colors)\n"
" -r fgcol bgcol (set reverse fore- & background colors)\n"
" -b color (set border color)\n"
" -c blink | noblink (set cursor type)\n"
" -d (dump screenmap to stdout)\n"
" -l filename (load srceenmap file filename)\n"
" -L (load default screenmap)\n"
" -f DxL filename (load font, D dots wide & L lines high)\n"
" -s saver | help (set screensaver type or help for a list)\n"
" -t N (set screensaver timeout in seconds)\n"
" -x (use hex numbers for output)\n"
);
}
@ -423,13 +420,13 @@ main(int argc, char **argv)
info.size = sizeof(info);
if (ioctl(0, CONS_GETINFO, &info) < 0) {
perror("Must be on a vty");
perror("Must be on a vrtual console");
exit(1);
}
while((opt = getopt(argc, argv, "b:c:df:l:Lr:s:t:vx")) != -1)
switch(opt) {
case 'c':
set_cursor_values(optarg);
set_cursor_type(optarg);
break;
case 'b':
set_border_color(optarg);