Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2008 20:43:39 +0100 (CET)
From:      Oliver Fromme <>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   /boot/loader graphics support & extensibility
Message-ID:  <>

next in thread | raw e-mail | index | archive | help
Hi everyone,

I'm currently working on adding graphics support to the
boot loader.  At the moment only the standard VGA mode
640 x 480 at 4 bit depth (16 colors) is supported, but
support for other modes can be added in the future.
Only i386 and amd64 machines with VGA BIOS are supported.

Here's a screen shot of my work in progress:

It will not replace the current text menu ("beastie.4th"),
so you can still use it on your Hercules monochrome or CGA
machine or with serial console, of course.

I need a little help with a few design decisions regarding
the implementation.

First, I'm not sure if and how the infrastructure of the
existing code should be used to allow future support for
other architectures or other kind of hardware.

This is a list of things that comes to mind:

(a)  Support for i386/amd64 machines that have VGA hard-
     ware but no VGA BIOS (this is different from the
     system BIOS!).  Is there a sufficiently large number
     of such systems that it would be desirable to support

(b)  Support for non-i386/amd64 machines that have VGA
     hardware (ia64, powerpc, ...).

(c)  Support for non-VGA graphics hardware (any platform).

(d)  Did I forget anything?

Personally I won't be able to implement any of the above
because I only have standard i386/amd64 hardware.  But
if someone else wants to implement it, my code certainly
shouldn't get in the way.

Currently my code is simply compiled conditionally,
depending on make(1) variables (${MACHINE_ARCH}), so it
is only included for i386 and amd64.

So, basically, if multiple platforms are supported, the
source file with the graphics support functions would be
selected based on ${MACHINE_ARCH}.

Would that be sufficient?  I have looked at the archsw,
but I'm not sure if that gives any additional benefit
in this case.  For a different architecture you ahve to
compile a different binary anyway, so it seems that it
is sufficient to make the decision at build time, so the
additional indirection of the archsw isn't required.
Please someone correct me if I'm wrong.

By the way, please have a look at the current graphics.h
file which defines the interface between the implementation
of the graphics functions and FICL: 

By the way, the Forth code that produced the above screen
shot only used the PCX functions to load the background
image, and the text functions to print the menu.

Comments appreciated.

Best regards

Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:

"I started using PostgreSQL around a month ago, and the feeling is
similar to the switch from Linux to FreeBSD in '96 -- 'wow!'."
        -- Oddbjorn Steffensen

Want to link to this message? Use this URL: <>