From 909252eb2dc93bbb9916cb9c29d4268bc529b3da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Mon, 28 Nov 2016 23:22:27 +0100 Subject: [PATCH] syscons - Add option for the default terminal border color to kernel config. * The default terminal border can be set to e.g. darkgrey by adding option SC_BORDER_COLOR="FG_DARKGREY" to the kernel configuration. --- share/man/man4/syscons.4 | 13 +++++++++++++ sys/config/LINT64 | 1 + sys/dev/misc/syscons/syscons.c | 2 +- sys/dev/misc/syscons/syscons.h | 3 +++ sys/platform/pc64/conf/options | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/share/man/man4/syscons.4 b/share/man/man4/syscons.4 index f104de4bda..fdfe0fae9f 100644 --- a/share/man/man4/syscons.4 +++ b/share/man/man4/syscons.4 @@ -51,6 +51,7 @@ .Cd "options SC_NORM_REV_ATTR=_attribute_" .Cd "options SC_KERNEL_CONS_ATTR=_attribute_" .Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_" +.Cd "options SC_BORDER_COLOR=_attribute_" .Cd "options SC_DFLT_FONT" .Cd "makeoptions SC_DFLT_FONT=_font_name_" .Cd "device sc0 at isa?" Op flags Ar flags @@ -362,6 +363,7 @@ above. .It Dv SC_NORM_REV_ATTR=_attribute_ .It Dv SC_KERNEL_CONS_ATTR=_attribute_ .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_ +.It Dv SC_BORDER_COLOR=_attribute_ These options will set the default colors. Available colors are defined in .In machine/pc/display.h . @@ -781,6 +783,17 @@ The reversed message will be black on red background. .D1 Cd "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)" .D1 Cd "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)" .Pp +The following line will set the default border color of the terminal. +If the console is in framebuffer mode, or in raster (pixel) text mode, +a thin green border will be visible around the terminal if the screen +size is not an exact multiple of the font size. +This border area can be much larger if the column or row count is +explicitly specified (for example when using the +.Va kern.kms_columns +tunable). +.Pp +.D1 Cd "options SC_BORDER_COLOR=FG_GREEN" +.Pp The following example adds the font files .Pa cp850-8x16.fnt , .Pa cp850-8x14.font diff --git a/sys/config/LINT64 b/sys/config/LINT64 index 241bbb0658..93aa5c4be9 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -908,6 +908,7 @@ options SC_NORM_ATTR="(FG_GREEN|BG_BLACK)" options SC_NORM_REV_ATTR="(FG_YELLOW|BG_GREEN)" options SC_KERNEL_CONS_ATTR="(FG_RED|BG_BLACK)" options SC_KERNEL_CONS_REV_ATTR="(FG_BLACK|BG_RED)" +options SC_BORDER_COLOR="FG_BLACK" # If you have a two button mouse, you may want to add the following option # to use the right button of the mouse to paste text. diff --git a/sys/dev/misc/syscons/syscons.c b/sys/dev/misc/syscons/syscons.c index e1f249d6ca..236e824c2d 100644 --- a/sys/dev/misc/syscons/syscons.c +++ b/sys/dev/misc/syscons/syscons.c @@ -3536,7 +3536,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) scp->tsw = NULL; scp->ts = NULL; scp->rndr = NULL; - scp->border = BG_BLACK; + scp->border = SC_BORDER_COLOR; scp->cursor_base = sc->cursor_base; scp->cursor_height = imin(sc->cursor_height, scp->font_height); scp->mouse_cut_start = scp->xsize * scp->ysize; diff --git a/sys/dev/misc/syscons/syscons.h b/sys/dev/misc/syscons/syscons.h index 83e69aca65..10a6152a26 100644 --- a/sys/dev/misc/syscons/syscons.h +++ b/sys/dev/misc/syscons/syscons.h @@ -343,6 +343,9 @@ typedef struct scr_stat { #ifndef SC_KERNEL_CONS_REV_ATTR #define SC_KERNEL_CONS_REV_ATTR (FG_BLACK | BG_LIGHTGREY) #endif +#ifndef SC_BORDER_COLOR +#define SC_BORDER_COLOR FG_BLACK +#endif /* terminal emulator */ diff --git a/sys/platform/pc64/conf/options b/sys/platform/pc64/conf/options index 5d2fe3e9fc..0e38009bee 100644 --- a/sys/platform/pc64/conf/options +++ b/sys/platform/pc64/conf/options @@ -19,6 +19,7 @@ HAMMER_CPU opt_cpu.h MAXCONS opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h +SC_BORDER_COLOR opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h SC_DISABLE_DDBKEY opt_syscons.h -- 2.11.4.GIT