Discussion:
Let's improve splash screen support in vt(4)
Mateusz Piotrowski
2018-09-11 10:02:29 UTC
Permalink
Hello,

I'd like to improve splash screen support in vt(4) and I'm looking for your
guidance and suggestions.

Background
----------

As you may know, vt(4) does not support custom splash screens at the
moment.[1][2][3]

As splash screen could be turned on by specifying the -m flag to boot(8).
It cannot be customized, however: the displayed image, its colors and size
are set at compile time.

Goals
-----

- Support for BMP files so that they could be specified in loader.conf(5)
(similarly to how it is done when using sc(4) and splash(4)).

- Kernel tunables to control colors of the displayed image. Basically, I'd
like to "unhardcode" colors used for vt(4) splash screens.

Proposed implementation
-----------------------

Unhardcoding colors seems to be an easy task: from what I understand it all
boils down to adding a couple of sysctls. This way a user might choose
which colors of the vt(4) color pallet should be used for the splash image.

The more challenging part is getting raw data from a bitmap file in the
vt(4) driver.

I've done some research and I think that the easiest solution would be to
use the existing splash(4) driver to extract data from a BMP file as
drawing functions in vt(4) expect raw data. We could use splash(4) to load
the file and put it into a C structure, which would then be accessible in
vt(4) via a to-be-written interface.

This approach does not feel super clean so this I decided to ask you if
you've got any suggestions on how to improve this solution.

Stretched goals
--------------

At first I thought that adding support for 8-bit colors is not going to be
a big problem. Then I found out that the vd_bitblt_bmp function expect
exactly two colors (1 for foreground and 1 for background).

I'll have to do more research if I want to support bitmaps with an 8-bit
color depth. I'll be grateful for al suggestions, hints and pieces of
advice.

----

The wiki page of this project is here:
https://wiki.freebsd.org/MateuszPiotrowski/ImproveVtSplashScreenSupport

Thanks & happy hacking,
Mateusz

[1]: https://wiki.freebsd.org/Newcons
[2]:
https://svnweb.freebsd.org/base/head/sys/dev/vt/vt_core.c?revision=338324&view=markup#l142
[3]:
https://svnweb.freebsd.org/base/head/sys/dev/vt/vt_core.c?revision=338324&view=markup#l1373
Dag-Erling Smørgrav
2018-09-11 11:46:04 UTC
Permalink
I'd like to improve splash screen support in vt(4) [...]
Let me know if you get it working, because I'd like to get graphical
screensavers to work with vt(4) as well.

DES
--
Dag-Erling Smørgrav - ***@des.no
Loading...