Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jan 2010 02:37:47 +1100
From:      Antony Mawer <lists@mawer.org>
To:        stable@freebsd.org
Subject:   [patch] New splash_txt module - support for ASCII splash(4) boot  screens
Message-ID:  <ea2d4a5b1001290737n487dc114n8fc8564f38981e1e@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--000e0cd10562dffc18047e4f6a4a
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

I recently dusted off an old patch I put together years ago which adds
a new splash_txt decoder module for the splash(4) boot splash screen.
The module allows you to use a binary-format ASCII drawing (80x25) as
a boot splash screen rather than the graphical modes offered by
splash_bmp and splash_pcx. We have been and still are using it, but I
finally got around to adding the relevant changes to the splash(4) man
page and putting together some examples for wider testing. If it seems
of use to others it would be nice if someone would be interested in
committing it at some stage.

In case the list eats the patch, you can grab a copy of it here:

http://www.mawer.org/freebsd/splash_txt.patch

To give you an idea of what it looks like, here is a screenshot of a
quick generic FreeBSD splash screen I put together:

http://www.mawer.org/freebsd/splash_txt.png

If you'd like to try it for yourself then the process to build it
should be something like this:

1. Download the attached patch
2. Create the required folders before applying the patch -- cd
/usr/src && mkdir sys/modules/splash/txt
3. Apply the patch -- patch < splash_txt.patch
4. Build the module -- cd sys/modules/splash/txt && make && make install

Once that's completed, you can configure it by adding the following to
loader.conf:

splash_txt_load="YES"
bitmap_load="YES"
bitmap_name="/boot/freebsd.bin"

I have uploaded a sample boot splash screen at
http://www.mawer.org/freebsd/freebsd.bin . The files can be produced
using TheDraw and saving in its Binary file format, which consists of
a sequence of 2 byte pairs. The first byte in a pair is the character
to draw on the screen, and the second is the colour/display attributes
to draw the character with.

If anyone else would like to try this out and has any feedback, or if
someone thinks it may be of interest to integrate into the tree please
let me know ...

-- Antony

--000e0cd10562dffc18047e4f6a4a
Content-Type: application/octet-stream; name="splash_txt.patch"
Content-Disposition: attachment; filename="splash_txt.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g514lfl40

LS0tIC9kZXYv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lZAo=
--000e0cd10562dffc18047e4f6a4a--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ea2d4a5b1001290737n487dc114n8fc8564f38981e1e>