OpenBSD and NetBSD kernel fonts and colors. - BSD

Users browsing this thread: 2 Guest(s)
yrmt
Grey Hair Nixers
What you'll be able to do:

- Change the kernel background/foreground color.
- Change the font

On NetBSD:
``—— ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-6.1/source/sets/``
``—— get sysrc.txz``
``—— tar xf sysrc.txz /``

On OpenBSD:
``—— ftp ftp://ftp.belnet.be/pub/OpenBSD/5.3/``
``—— get sys.txz``
``—— tar xf sys.txz /``

- Then edit the config:

``—— cd /usr/src/sys/arch/i386/conf/``
``—— cp GENERIC MYKERNEL``


#Kernel Font:

- You can use [this](https://github.com/polachok/bdf2wscons) to convert bdf fonts to wscons fonts.
- You should now have a .h font. Put it in /usr/src/sys/dev/wsfont/.
- or get a few premade fonts [from my github](https://github.com/yrmt/ModdedFonts), I'm using my mod of terminus14 which I find really readable.
- Edit /usr/src/sys/dev/wsfont/wsfont.c

Code:
#ifdef FONT_<NAME><YOURxSIZE>
#define HAVE_FONT 1
#include "path/to/include"
#endif
/* Our list of built-in fonts */
static struct font *list, builtin_fonts[] = {
#ifdef FONT_<NAME><YOURxSIZE>
    { NULL, NULL, &<NAME><SIZE>, 0, 1, WSFONT_STATIC | WSFONT_BUILTIN  },
#endif

Add this line to your kernel config, for example:
``options FONT_TERMINUS6x11``
#Kernel Color:

- Change to the color you want in the kernel config:

``options WS_KERNEL_FG=WSCOL_GREEN``
``options WS_KERNEL_BG=WSCOL_BLACK``

- For example, I use:

``options WS_KERNEL_FG=WSCOL_RED``
``options WS_KERNEL_BG=WSCOL_BLACK``

# Compile!
``—— config MYKERNEL``
``—— cd ../compile/MYKERNEL``

On OpenBSD:

``—— make clean;make``
``—— make install``

On NetBSD:

``—— make depend;make``
``—— cp /netbsd /netbsd.old``
``—— cp netbsd /``

On NetBSD you can also use genfb to have a higher resolution; in /boot.cfg, add:
`` menu=Boot NetBSD:vesa 1280x800;boot netbsd``
Only on amd64, macppc and i386 architectures.


Messages In This Thread
OpenBSD and NetBSD kernel fonts and colors. - by yrmt - 30-06-2013, 10:11 AM