DocsReleasesCommunityGuidesBlog

GSoC'24: UEFI Graphics Output Protocol Support in Unikraft, Part IV

This is the fourth post in a series of posts where I talk about my progress with the project.

Project Overview#

The widely available and standardized UEFI Graphics Output Protocol (GOP) interface is an excellent alternative to VGA or serial port consoles for printing logs to the screen.

This project aims to implement a UEFI GOP based console. For more information, check out Part I, Part II and Part III of this series.

Progress#

All the work referred to here can be found in this draft PR.

ASCII code support#

Added support for ASCII codes \a, \b, \t.

Colored output support#

Enabling the configuration option CONFIG_LIBUKDEBUG_ANSI_COLOR generates colored logs with the use of ANSI escape codes. These codes are now parsed and the logs are colored appropriately by the GOP console. All the new code has been pushed to the draft PR!

Parsing ANSI escape codes and coloring log output

ANSI escape codes control various paramters of text output such as foreground color, background color, formatting etc.

These escape codes are prefixed with the escape character, which has the ASCII value 27 or 033 in octal or 0x1b in hex.

The format of ANSI color codes is \033[<code>m. There are many of these codes, but the focus of my implementation is on parsing just the color codes that the Unikraft kernel outputs in in logs when CONFIG_LIBUKDEBUG_ANSI_COLOR is on, which currently are:

Color NameForeground Color CodeBackground Color Code
Reset00
Black3040
Red3141
Green3242
Yellow3343
Blue3444
Magenta3545
Cyan3646
White3747

Full reference here.

For example, \033[37m\033[44mHello World! would print Hello World! in white on a blue background. The order in which the foreground and the background sequences are issued does not matter.

Acknowledgement#

I would once again like to thank all the great Unikraft folk for their continued support! This work would not have been possible without them ❤️

Edit this page on GitHub

Connect with the community

Feel free to ask questions, report issues, and meet new people.

Join us on Discord!
®

Getting Started

What is a unikernel?Install CLI companion toolUnikraft InternalsRoadmap

© 2024  The Unikraft Authors. All rights reserved. Documentation distributed under CC BY-NC 4.0.