About the TUD:OS Demo CD Features of the TUD:OS Demo CD TUD:OS Screenshots Download the TUD:OS Demo CD Contact the TU Dresden OS Group
About the TUD:OS Demo CD
FEATURES OF THE TUD:OS DEMO CD
TUD:OS Screenshots
Download the TUD:OS Demo CD
Contact the TU Dresden OS Group
Impressum
Maintainer
Webmaster
TUDOS
Qt for the L4 Environment

Qt for the L4 Environment

Carsten Weinhold
2006-09-13

Welcome to the interactive demo of Qt for the L4 environment. Qt (R) is a widely-used cross-platform toolkit that is being developed by the Norwegian software company Trolltech (R). For example, the K Desktop Environment (KDE) and all its applications are based on Qt. The toolkit itself is available for a variety of platforms, including Unix and Microsoft Windows (R). It allows software developers to create applications that can run on any platform that is supported by Qt. To port an application to another operating system or hardware architecture, you just need to recompile it for the new target platform.

Fortunately, the source code of Qt is available under the terms of the GNU General Public License (GPL). So I and a fellow student, Josef Spillner, were able to port version 3.3 the Qt toolkit to the L4 platform. The screenshot below shows two Qt applications running on L4.

How was it ported?

Now you might ask yourself, how difficult was it to port the Qt toolkit to a totally new and even experimental platform? Well, Qt itself has been designed to be easy to port, but then again, the target platform is based on a microkernel that is mainly used in research. The L4/Fiasco microkernel, which is running on your computer right now while you are reading this text, is not a complete operating system (OS). It is merely the basis for an OS that is built from various basic servers running on top of it. They do not yet offer the same functionality as, for example, Linux.

We eventually concluded that Qt/Embedded would be the best starting point for doing a port to the L4 environment. Qt/Embedded is designed to run on Linux-based hand-held devices, such as PDAs or smartphones. The major difficulty we encountered was the dependency on an embedded Linux OS. However, choosing Qt/Embedded also had the advantage that it shipped with its own windowing system, the Qt Window System (QWS). Without the QWS, we would have had to rewrite about 10,000 lines of code just to make Qt's framework for Graphical User Interfaces (GUIs) run on L4.

We identified the following subsystems to be relevant for the port:

  • Platform-specific back ends

    • File system

    • Network

    • Threading

  • Qt Window System

    • Inter-process communication for Qt/Embedded tasks

    • Graphics driver

    • Mouse & keyboard drivers

Actually, we did not have to port file-system and network support, because there already was a POSIX compatibility layer available on L4. However, we had to add missing functionality, so that we could use it for Qt. This layer, the L4 Virtual File System (L4VFS), provides an infrastructure to build up a hierarchical directory tree into which L4VFS servers can be mounted. It also allows for servers that provide network access. The following figure shows the structure of an L4VFS name space as it is used by the interactive demo setup on this Demo CD.

The Linux-specific threading back end could not be reused, we had to rewrite it from scratch. It now uses L4 threads and L4 synchronization primitives. Obviously, we had to write new drivers for the QWS as well. The interactive Qt demo on this CD uses drivers for the native L4 graphical console.

The most tricky part was the QWS itself, as it requires concurrently running Qt/Embedded tasks to communicate with each other. The implementation in Qt/Embedded for Linux uses Unix Domain Sockets, which were unavailable on L4. It turned out that adapting it to use native L4-communication primitives was infeasible. So we finally decided to write our own Unix-Domain-Socket server, which integrates well into the aforementioned L4VFS infrastructure.

Apart from the subsystems mentioned previously, no additional changes were necessary. For example, we did not touch the GUI framework at all.

What can it do? Can I try it?

Okay, so we ported the whole Qt toolkit to the L4 environment. Every Qt application should just work once it is recompiled, should it not? Well, the L4 port is fairly complete with regard to source-level compatibility for many applications. For example, the GUI framework is fully functional. However, the L4 port of the toolkit lacks some less important features, such as printing and OpenGL support. Also, the L4VFS servers for network and file-system support are still proof-of-concept implementations. So, at the moment, network support is unstable.

Nevertheless, you can find a few Qt applications on this Demo CD that were downloaded off the Internet. They now run using Qt for L4 with only minor modifications, which were necessary due to the previously mentioned limitations on the L4 platform. You can play a funny game, Little Sheep, or view images in an image viewer. And of course there is a text editor as well. It is also possible to create Qt applications that use native L4 services. The application launcher QRun is one example and, if you really want to know what is going on, there is even a task monitor.

Curious? Just check it out! You can start an interactive demo by clicking on the link below. Within a second or two, a new virtual console will open up that shows a Qt desktop. You can use the QRun application to start other applications just by clicking on the push buttons. But beware, due to its complexity, the port is till work-in-progress, so it may include glitches. Still, I hope you like it.

Start interactive demo (in the Demo-CD version of this document)

You can always switch between this virtual console and the Qt desktop by pressing either Meta-F1 or Meta-F2.

Future Work

The long-term goal of this Qt port is to use it for L4 applications with a rich GUI, when there are not sufficient resources available to run a whole legacy OS on top of L4. For example, on hand-held devices. It might even be feasible to reuse existing Qt applications. To support this goal, two major tasks remain to be done:

Make a Qt session run as a Nitpicker client

Nitpicker allows to have windows from all kinds windowing systems, either legacy systems, such as the X Window System, or the native L4 system windowing system DOpE, to coexist on the same desktop. So, Nitpicker drivers for the QWS would allow seamless integration of Qt applications.

Complete Qt version 4 port

Work on porting Qt4 to L4 has already started, however, it is not yet complete. Later, it is intended to replace Qt3 for L4.

Contact

Carsten Weinhold

 Technische Universität Dresden
 Fakultät Informatik
 Institut für Systemarchitektur (SyA)
 01062 Dresden
 cw183155@os.inf.tu-dresden.de

References

DROPS — The Dresden Real-Time Operating System

http://os.inf.tu-dresden.de/drops/

Trolltech - Qt Product Overview

http://www.trolltech.com/products/qt/index.html

Qt for L4

Carsten Weinhold, Portierung von Qt auf DROPS. Großer Beleg. TU Dresden (23.03.2005) http://os.inf.tu-dresden.de/papers_ps/weinhold-beleg.pdf

Reboot the machine

Click here (in the Demo-CD version of this document) to reboot your machine.