aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2018-06-02 14:07:27 +0000
committerBruce Evans <bde@FreeBSD.org>2018-06-02 14:07:27 +0000
commit972913032199ca192e650ff4c0979d802e840020 (patch)
tree3f01f16814ece20f0aed40d1153a4feeca8398a3 /sys
parentfa49511709009dd1a3c89c10eec6111303b63aed (diff)
Improve defaults for per-CPU kernel console colors, especially with 2
or 4 CPUs. Add a compile-time option SC_KERNEL_CONS_ATTRS to control the defaults. Default to color numbers in reverse order to CPU numbers (instead of in the same order with white first and wrapping to dark grey), so that the brightest bright colors are used first. Don't use dark grey at all; replace it by dark green. Syscons has too many compile-time options, but this one is needed in in case the defaults give something like white on white, or the user really hates this feature and can't wait to turn it off in rc. MFC after: next release?
Notes
Notes: svn path=/head/; revision=334530
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/NOTES1
-rw-r--r--sys/conf/options1
-rw-r--r--sys/dev/syscons/syscons.c20
3 files changed, 15 insertions, 7 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index d2e42b959756..06b05437f4bf 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -1474,6 +1474,7 @@ options SC_PIXEL_MODE # add support for the raster text mode
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_ATTRS=\"\x0c\x0d\x0e\x0f\x02\x09\x0a\x0b\"
options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)
# The following options will let you change the default behavior of
diff --git a/sys/conf/options b/sys/conf/options
index 02c77224d367..dcfdf495e6cc 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -774,6 +774,7 @@ SC_DISABLE_KDBKEY opt_syscons.h
SC_DISABLE_REBOOT opt_syscons.h
SC_HISTORY_SIZE opt_syscons.h
SC_KERNEL_CONS_ATTR opt_syscons.h
+SC_KERNEL_CONS_ATTRS opt_syscons.h
SC_KERNEL_CONS_REV_ATTR opt_syscons.h
SC_MOUSE_CHAR opt_syscons.h
SC_NO_CUTPASTE opt_syscons.h
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 92ed069b63c7..dd2ecc4627ac 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -3153,6 +3153,17 @@ scinit(int unit, int flags)
static u_char font_16[256*16];
#endif
+#ifdef SC_KERNEL_CONS_ATTRS
+ static const u_char dflt_kattrtab[] = SC_KERNEL_CONS_ATTRS;
+#elif SC_KERNEL_CONS_ATTR == FG_WHITE
+ static const u_char dflt_kattrtab[] = {
+ FG_WHITE, FG_YELLOW, FG_LIGHTMAGENTA, FG_LIGHTRED,
+ FG_LIGHTCYAN, FG_LIGHTGREEN, FG_LIGHTBLUE, FG_GREEN,
+ 0,
+ };
+#else
+ static const u_char dflt_kattrtab[] = { FG_WHITE, 0, };
+#endif
sc_softc_t *sc;
scr_stat *scp;
video_adapter_t *adp;
@@ -3163,13 +3174,8 @@ scinit(int unit, int flags)
/* one time initialization */
if (init_done == COLD) {
sc_get_bios_values(&bios_value);
- for (i = 0; i < nitems(sc_kattrtab); i++) {
-#if SC_KERNEL_CONS_ATTR == FG_WHITE
- sc_kattrtab[i] = 8 + (i + FG_WHITE) % 8U;
-#else
- sc_kattrtab[i] = SC_KERNEL_CONS_ATTR;
-#endif
- }
+ for (i = 0; i < nitems(sc_kattrtab); i++)
+ sc_kattrtab[i] = dflt_kattrtab[i % (nitems(dflt_kattrtab) - 1)];
}
init_done = WARM;