Home | History | Annotate | Download | only in wscons
History log of /src/sys/dev/wscons/wsemul_vt100_subr.c
RevisionDateAuthorComments
 1.34  03-Aug-2023  uwe wsemul_vt100_subr: fix comment - CPR is not DSR

DSRs (device status report) are 'n', but cursor position report is 'R'
 1.33  03-Aug-2023  uwe wsemul_vt100_subr: fix IL/DL to match specified behavior

Acoording to DEC manuals: "The cursor is reset to the first column.
This sequence is ignored when the cursor is outside the scrolling
region."
 1.32  03-Aug-2023  uwe wsemul_vt100_subr: properly clamp CUU/CUD parameter

If the cursor is outside of the scrolling region the movement should
stop at the screen border. Reported by David Leadbeater.
 1.31  26-Jul-2023  uwe wsemul_vt100_subr: complete the refactoring from 2010

In 1.20 refactoring, functions in this file were changed to accept a
pointer to the new base class instead of the full emuldata:

-wsemul_vt100_foo(struct wsemul_vt100_emuldata *edp, ...)
+wsemul_vt100_foo(struct vt100base_data *edp, ...)

but the argument name was not changed. While this saved on the diff
churn back then, it created a rather unfortunate situation where the
same emulation state variables are referred to differently in this
file and other vt100 emulation files. Complete that old change by
renaming the base class arguments to match the variable name used for
it in other files.

Same object code is generated.
 1.30  26-Feb-2023  uwe wsemul_vt100_subr: spell edp->tabs assertion with NULL
 1.29  26-Feb-2023  uwe wsemul_vt100_subr: don't assert unsigned ncols >= 0
 1.28  23-Feb-2023  riastradh wscons(4): Paranoia: Clamp numbers of rows and columns.
 1.27  23-Feb-2023  riastradh wscons(4): Ignore nonsense tab stops in vt100 emulation.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.26  18-Jan-2023  christos Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe)
 1.25  09-Jan-2023  christos Fix off by one (Crystal Kolipe in tech-kern@)
 1.24  06-Dec-2018  uwe branches: 1.24.30;
#ifdef _KERNEL_OPT
 1.23  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.22  05-Jun-2018  uwe branches: 1.22.2;
PR kern/53245 - support SGR 39 (default foreground) and 49 (background).
 1.21  19-May-2017  macallan branches: 1.21.8;
add support for loading fonts in vcons and subsequently resizing screens
- drivers can use this by setting VCONS_LOADFONT and WSSCREEN_RESIZE
- each vcons screen can now have its own font and geometry
- while there, add support for xterm's ESC[18t to report the text buffer's
size

With this tou can:
wsfontload -N foo /usr/share/wscons/fonts/flori.816
wsconsctl -dw font=foo
currently this is limited to drivers that don't use the glyph cache, like genfb
 1.20  10-Feb-2010  drochner branches: 1.20.20; 1.20.38;
Allow big parts of the vt100 emulation code (what is in
wsemul_vt100_subr.c) to be used by alternative terminal emulators
(which are not in-tree yet but can be loaded as LKMs).
For this, split out that part of the state structure which is used
by the sharable code and include that in the original vt100 state.
This is only a query-replace and sed(1) job for now, it makes sense
to rearrange things a bit so that even more code can be changed --
will do so later.
 1.19  11-Dec-2005  christos branches: 1.19.74; 1.19.96;
merge ktrace-lwp.
 1.18  29-May-2005  christos - sprinkle const.
- avoid variable shadowing.
 1.17  28-Jul-2004  jmmv Implement support to dynamically change wscons console and kernel colors.

Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").

A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.

Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.

wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.

Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
 1.16  23-Apr-2004  itojun use bounded string ops
 1.15  24-Mar-2004  drochner remove license clauses 3 and 4 from my cpoyright notices
 1.14  02-Apr-2003  drochner branches: 1.14.2;
allow to customize how highlighting and underlining text is substituted
if the display doesn't provide this
submitted by xs@kittenz.org per PR kern/18004
 1.13  02-Apr-2003  drochner fix crash due to wrong argument in the (almost useless)
DECRQUPSS escape sequence
 1.12  20-Jan-2003  simonb The Double-Semi-Colon Police.
 1.11  04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.10  13-Nov-2001  lukem branches: 1.10.8; 1.10.10;
add/cleanup RCSIDs
 1.9  13-Oct-2001  augustss ANSIfy.
 1.8  24-Feb-2001  cgd branches: 1.8.2; 1.8.4;
C requires that labels be followed by statements.
 1.7  28-Apr-2000  mycroft branches: 1.7.4;
Add a concept of the `background attribute'. This is the same as the
current attribute, but has all non-color flags turned off. Use this when
doing erasure, as this allows us to optimize repainting in curses.

XXX The way the default attribute is handled is totally bogus and needs to
be fixed.
 1.6  25-Feb-2000  mycroft Only call the cursor method when the cursor state is actually changing.
This avoid corrupting VGA displays in text mode (e.g. the first character
of the prompt when you exit vi).
 1.5  10-Jan-1999  augustss branches: 1.5.8;
Change from bcopy/bzero to memxxx. From PR 6778 by
Erik Bertelsen <erik@q610.ebe.uni-c.dk>.
 1.4  12-Aug-1998  drochner stricter parameter check for scrolling regions
(PR kern/5954 by Dave Huang <khym@bga.com>)
 1.3  29-Jun-1998  drochner fix VT300 tab stop report format
 1.2  26-Jun-1998  drochner Improvements to the VT100 emulation:
-display DEC special graphics and DEC technical characters as far as
possible
-implement the font switching controls (need documentation!)
-behave well if double-width characters are requested
-simplify the state machine: store CSI command modifiers in variables
instead of dedicating own states to each of them
 1.1  20-Jun-1998  drochner First cut on a VT100 emulation.
It should be able to parse escape sequences up to VT300, but not everything
is implemented. Most notably, there is no font handling - all displayable
characters are handed to the graphics driver. To solve this, a serious
interface change to the graphics driver is needed (Unicode?).
 1.5.8.2  12-Mar-2001  bouyer Sync with HEAD.
 1.5.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.4.1  27-May-2003  msaitoh Pullup rev. 1.13 (requested by drochner in ticket #43)

fix crash due to wrong argument in the (almost useless)
DECRQUPSS escape sequence
 1.8.4.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.3  01-Aug-2002  nathanw Catch up to -current.
 1.8.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.8.2.1  22-Oct-2001  nathanw Catch up to -current.
 1.10.10.1  25-Jun-2003  grant Pull up revision 1.13 (requested by tron in ticket #1277):

fix crash due to wrong argument in the (almost useless)
DECRQUPSS escape sequence
 1.10.8.1  15-Jul-2002  gehenna catch up with -current.
 1.14.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.19.96.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.19.74.1  11-Mar-2010  yamt sync with head
 1.20.38.1  28-Aug-2017  skrll Sync with HEAD
 1.20.20.1  03-Dec-2017  jdolecek update from HEAD
 1.21.8.3  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.21.8.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.21.8.1  25-Jun-2018  pgoyette Sync with HEAD
 1.22.2.1  10-Jun-2019  christos Sync with HEAD
 1.24.30.1  30-Jul-2023  martin Pull up following revision(s) (requested by uwe in ticket #257):
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.25
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.26
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.27
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.28
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.29
sys/dev/wscons/wsemul_vt100.c: revision 1.50
sys/dev/wscons/wsemul_vt100.c: revision 1.51
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.30
sys/dev/wscons/wsemul_vt100_subr.c: revision 1.31

Fix off by one (Crystal Kolipe in tech-kern@)

Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe)

wscons(4): Ignore nonsense tab stops in vt100 emulation.

wscons(4): Paranoia: Clamp numbers of rows and columns.

wsemul_vt100_subr: don't assert unsigned ncols >= 0

wsemul_vt100_subr: spell edp->tabs assertion with NULL

Avoid overflow with too many ';' (David Leadbeater)

Prefix all messages with the method name

wsemul_vt100_subr: complete the refactoring from 2010
In 1.20 refactoring, functions in this file were changed to accept a
pointer to the new base class instead of the full emuldata:
-wsemul_vt100_foo(struct wsemul_vt100_emuldata *edp, ...)
+wsemul_vt100_foo(struct vt100base_data *edp, ...)
but the argument name was not changed. While this saved on the diff
churn back then, it created a rather unfortunate situation where the
same emulation state variables are referred to differently in this
file and other vt100 emulation files. Complete that old change by
renaming the base class arguments to match the variable name used for
it in other files.

Same object code is generated.

RSS XML Feed