Improve vt(4) splash screen support




At the moment (2018-09-11) vt(4) has very limited support for splash screens.

The goal of this project is to extend it a little bit. It should be possible to:

A stretched goal is to support bitmaps with the color depth of more than 1.


Add sysctl tunables for splash colors in vt(4).



Mailing list threads


Commit adding some splash screen support to vt(4): 2ecca071d5eccf38f9a5fd7a03052b261b7bd7d2

sc(4) supports 8-bit colors.

Interesting functions:

The `vtterm_splash` function

There's a function called vtterm_splash in vt_core.c, which displays a boot splash when the kernel is compiled with DEV_SPLASH option, textmode is not activated and a muted booting was requested by the user (for example via specifying -m to boot(8)).

Also the following part of the vtterm_splash function:

suggests that:

  1. Monochrome colors are the only one supported at the moment.
  2. It should not be complicated to add support for 4-bit and 8-bit colors.
    • Actually, there is an sc(4) file, which has a very similar switch construct handling various color depth configurations.
      • What's the name of the sc(4) function with that switch case?
        • There's no such function in sc(4). There is bmp_SetPix in sys/dev/fb/splash_bmp.c but it does not help much as it directly sets video bits. Its signature looks like this: static void bmp_SetPix(BMP_INFO *info, int x, int y, u_char val).

Other questions regarding the vtterm_splash function:

  1. {o} What is the VDF_SPLASH flag inside vd->vd_flags for?

  2. {o} How to load a BMP file into a structure accepted by functions displaying pixels? Could it be that the splash(4) driver provides all the required functions to do so? Ideal scenario:

    1. The splash(4) driver reads the bitmap file that was specified in loader.conf(5) and converts it to a structure accepted by internal vt(4) functions.
    2. vt(4) gets the structure from splash(4).
    3. vt(4) displays the bitmap.
  3. {o} How does the vd->vd_driver->vd_bitblt_bmp function work?

    • struct vt_driver seems to be an interface for different hardware have to implement in order to use the vt(4) driver. vd_bitblt_bmp happens to be one of the drawing functions. It has various implementations like ofwfb_bitblt_bitmap, vga_bitblt_bitmap or vt_fb_bitblt_bitmap.

At the moment the vt(4) driver stores logos in unsigned char structures (see sys/dev/vt/logo/logo_beastie.c), which roughly correspond to the u_char *data member of the BMP_INFO structure (see sys/dev/fb/splash_bmp.c).



MateuszPiotrowski/ImproveVtSplashScreenSupport (last edited 2018-09-25T07:40:25+0000 by MateuszPiotrowski)