On Wed, Jul 08, 2020 at 12:37:11PM +1000, Jonathan Gray wrote:
> Thanks for the explanation. The proposal makes more sense from the
> point of view of the existing colours being darker for openboot black
> on white.
>
> #if WS_DEFAULT_BG == WSCOL_WHITE
>
> old
>
> #else
>
> new
>
> #endif
>
> would have made that a bit more readable.
Yes, this is indeed better, thanks for the suggestion.
> It is interesting that the choice of blue comes up as being problematic
> in xterm as well when reading XTerm-col.ad
>
> For us though it really comes down to white on black (!sparc64), black
> on white (sparc64) and white on blue for the kernel.
I understand the concern is about the contrast for printed kernel
messages.
Currently, output originating from the kernel is displayed using
WSCOL_WHITE on WSCOL_BLUE, which translates to NORMAL_WHITE on
NORMAL_BLUE, and I agree that 0xaaaaaa as foreground on a blue
background is not optimal, I think I raised the issue a few years
ago as it's what we currently get when booting in BIOS mode. But
it doesn't have to be this way, it could be changed.
> I agree with the sentiment that people should be using X and leave
> rasops/wscons as simple as possible.
I understand some developers share this position, however we do have
supported platforms (loongson being one, for example), on which X is
not realistically usable.
So here is a new iteration taking feedback into account, using the
#if WS_DEFAULT_BG == WSCOL_WHITE check for clarity, and also switching
the foreground color of printed kernel messages to light cyan to improve
contrast and readability.
Does this proposal look reasonable?
Index: sys/dev/rasops/rasops.c
===================================================================
RCS file: /cvs/src/sys/dev/rasops/rasops.c,v
retrieving revision 1.63
diff -u -p -r1.63 rasops.c
--- sys/dev/rasops/rasops.c 11 Jul 2020 15:02:52 -0000 1.63
+++ sys/dev/rasops/rasops.c 15 Jul 2020 14:55:45 -0000
@@ -47,7 +47,8 @@
/* ANSI colormap (R,G,B) */
-#define NORMAL_BLACK 0x000000
+#if WS_DEFAULT_BG == WSCOL_WHITE
+#define NORMAL_BLACK 0x000000 /* Rasops palette */
#define NORMAL_RED 0x7f0000
#define NORMAL_GREEN 0x007f00
#define NORMAL_BROWN 0x7f7f00
@@ -64,6 +65,25 @@
#define HILITE_MAGENTA 0xff00ff
#define HILITE_CYAN 0x00ffff
#define HILITE_WHITE 0xffffff
+#else
+#define NORMAL_BLACK 0x000000 /* VGA text mode palette */
+#define NORMAL_RED 0xaa0000
+#define NORMAL_GREEN 0x00aa00
+#define NORMAL_BROWN 0xaa5500
+#define NORMAL_BLUE 0x0000aa
+#define NORMAL_MAGENTA 0xaa00aa
+#define NORMAL_CYAN 0x00aaaa
+#define NORMAL_WHITE 0xaaaaaa
+
+#define HILITE_BLACK 0x555555
+#define HILITE_RED 0xff5555
+#define HILITE_GREEN 0x55ff55
+#define HILITE_BROWN 0xffff55
+#define HILITE_BLUE 0x5555ff
+#define HILITE_MAGENTA 0xff55ff
+#define HILITE_CYAN 0x55ffff
+#define HILITE_WHITE 0xffffff
+#endif
const u_char rasops_cmap[256 * 3] = {
#define _C(x) ((x) & 0xff0000) >> 16, ((x) & 0x00ff00) >> 8, ((x) &
0x0000ff)
Index: sys/dev/wscons/wsemul_vt100.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsemul_vt100.c,v
retrieving revision 1.39
diff -u -p -r1.39 wsemul_vt100.c
--- sys/dev/wscons/wsemul_vt100.c 25 May 2020 09:55:49 -0000 1.39
+++ sys/dev/wscons/wsemul_vt100.c 15 Jul 2020 14:55:45 -0000
@@ -165,13 +165,13 @@ wsemul_vt100_cnattach(const struct wsscr
edp->cbcookie = NULL;
#ifndef WS_KERNEL_FG
-#define WS_KERNEL_FG WSCOL_WHITE
+#define WS_KERNEL_FG WSCOL_CYAN
#endif
#ifndef WS_KERNEL_BG
#define WS_KERNEL_BG WSCOL_BLUE
#endif
#ifndef WS_KERNEL_COLATTR
-#define WS_KERNEL_COLATTR 0
+#define WS_KERNEL_COLATTR WSATTR_HILIT
#endif
#ifndef WS_KERNEL_MONOATTR
#define WS_KERNEL_MONOATTR 0