Graphics support for /boot/loader

Look at the current text menu of FreeBSD's bootloader, look at the old-fashioned ASCII logo. FreeBSD aims to support the most modern hardware platforms, to implement the latest protocols and greatest algorithms. Do you think it's appropriate that FreeBSD greets its users with a boot screen that looks like a 20 years old DOS program?
That's why I'm working this:
Graphics support for /boot/loader
Lets start with a screenshot (this e is not completely up-to-date, current WIP looks a bit different):
http://www.secnetix.de/olli/FreeBSD/vloader/screenshot.png
The project consists of the following parts (in bottom-up order):
  • Graphics functions that access the actual hardware and/or machine firmware (BIOS, EFI, whatever).
  • A switch structure that calls the appropriate functions depending the platform.
  • FICL glue that binds the graphics functions to Forth words.
  • Forth code that uses the new words to construct a graphical menu.
  • A collection of themes.
Every theme has its own subdirectory /boot/themes/ <name> which contains at least a configuration file, and possibly other files as well. Example:
/boot/themes/default/biglogo.pcx
/boot/themes/default/default.font
/boot/themes/default/theme.conf
And the configuration file ( /boot/themes/default/theme.conf) looks like this:
theme_background="/boot/themes/default/biglogo.pcx"
theme_font="/boot/themes/default/default.font"
theme_bgcolor="0 0 0" # black
theme_fgcolor="255 255 255" # white
theme_options_xy="64 10"
theme_actions_xy="64 82"
A theme is enabled by adding a line to /boot/loader.conf:
beastie_theme="/boot/themes/default/theme.conf"
New themes can easily be created. It is expected that the base system will ship ly with a limited number of themes (maybe just e), and more themes can be provided through the ports collection.
If a theme wants to do more sophisticated things, such as using multiple graphics files or fonts, or re-arrange the menu in completely different ways, it will have to bring its own Forth code and modify beastie.4th directly (an appropriate mechanism to provide hooks into may be provided at a later time).
Note this is currently work in progress, happening in the FreeBSD Perforce ("p4") repository. I plan to commit it to FreeBSD when it's ready, after proper review and approval.
For those you are eager to check out the WIP, there's a tarball available for preliminary testing. Please see the testing instructions for details. Note this is "bleeding edge", so it might not work for you.
Current status:
Item
Lang
Status
low-level graphics functions
C
(./) done for i386/amd64 (BIOS-based, VGA, 4bpp)
platform switch
C
in progress
FICL Forth words
C
(./) done
"beastie" menu graphics support
Forth
(./) done
text/binary converter for fonts
awk
(./) done (a version written in C also exists)
initial default theme
-
(./) done (background p_w_picpath, font)
multiple themes support
Forth
in progress
documentation
-
in progress
If you have any questions or requests, please contact OliverFromme. 原文: [url]http://wiki.freebsd.org/OliverFromme/BootLoader[/url]