RetroBSD Net
Title:
wscons - SPARC OpenBoot edition
Authors:
Paolo Vincenzo Olivo
Date:
Topics:
NetBSD
Id:
vcscda

■ Thoughts on cutomizing wscons

Ever thought about customizing the appearance of NetBSD console? /etc/wscons.conf and `wsconsctl(8)' already provide some options to play with, but this is not all.

The kernel also defines some macros which allow the user to customize wscons colors (background and foregorund), as well as those printed by the kernel during the early boot stages. In addition, the system offers a list of fonts to hard-code in the kernel beside the standard 'bold' one. A popular choice might be the spleen font (OpenBSD's default) which @fcambus contirbuted also to the NetBSD project.

Searching through the syssrc set, we can see that:

- colors are defined in src/sys/dev/wscon/wsdisplayvar.h

- fonts are defined in src/sys/dev/wsfont/files.wsfont. The relevant font files are found in the parent directory.

Naturally, changing those options implies editing the config of the present kernel (e.g., GENERIC), and recompile it. Refer to the docs, 'Chapter 34. Compiling the Kernel'.

■ The SPARC Openboot theme

I've always been fond of 'Sun Gallant Demi', the font used by Sun for their OpenBoot fimrware on SPARC workstations; as of today ,still thet standard console font on Solaris. A true hallmark. In case you're wondering what I'm talking about: <https://imgur.com/rTM9BOq>

Solaris also used to provide a consistantly provide a a .pcf version of the font, to use on the terminal: -sun-gallant-demi-*-normal-*-*-*-*-*-*-*-*-*

Now, turns out that NetBSD sources include a font header named `gallant12x22.h' (option `FONT_GALLANT12x22'), which apparently has been there forever:

* This code is derived from software contributed to the Computer Systems * Engineering Group at Lawrence Berkeley Laboratory and to the University * of California at Berkeley by Jef Poskanzer. * [...] * Derived from: @(#)gallant19.h 8.1 (Berkeley) 6/11/93 */

Is this font a clone? Why the name wasn't changed? What is its relationhip with Sun's vrsion?

I tought that maybe Sun released the source code for Gallant together to OpenSolaris, so I went searching for it inside the illumos sources; here it is, a file named 12x22.c: <https://searchcode.com/file/123359197/usr/src/uts/common/io/12x22.c/>

Interestingly:

/* BEGIN CSTYLED */ /* This is a derivation of a BDF font from the X consolidation */ /* COMMENT Originally a BSD vfont. */ /* FONT -Sun-Gallant-Demi-R-Normal--19-190-72-72-M-120-ISO8859-1 */

So, is it perhaps the other way round? Sun modding a BSD font? Such possiblity sounds appears plausible, considering they were using BSD as base for SunOS in the very beginning.

To switch to the gallant12x22 console font on NetBSD (disabling the standard `bold' font), you can apply this patch to the 9.2_STABLE GENERIC kernel config.

--- GENERIC.orig 2021-06-21 19:34:42.000000000 +0200 +++ GENERIC.new 2022-07-06 14:42:54.339279656 +0200 @@ -1166,8 +1166,7 @@ pseudo-device wsmux # mouse & keyboard multiplexor pseudo-device wsfont ;; Give us a choice of fonts based on monitor size -options FONT_BOLD8x16 -options FONT_BOLD16x32 +FONT_GALLANT12x22

In order to configure both kernel buffer and rc/wscons output to mimic Sun OpenBoot (black on white):

--- GENERIC.orig 2021-06-21 19:34:42.000000000 +0200 +++ GENERIC.new 2022-07-06 15:21:51.535830210 +0200 @@ -238,8 +238,10 @@ ;;options WSEMUL_SUN # sun terminal emulation ;;options WSEMUL_DEFAULT="\"vt100\"" # NB: default is "sun" if enabled ;; different kernel output - see dev/wscons/wsdisplayvar.h -options WS_KERNEL_FG=WSCOL_GREEN -#options WS_KERNEL_BG=WSCOL_BLACK +options WS_KERNEL_FG=WSCOL_WHITE +options WS_KERNEL_BG=WSCOL_BLACK +options WS_DEFAULT_FG=WSCOL_WHITE +options WS_DEFAULT_BG=WSCOL_BLACK ;; compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls

Naturally, the other way round (white on black) is much simpler: defaults are fine but for WS_KERNEL_FG, which could be even left as it is. This mimics modern Solaris.


Powered by NetBSD