Background Development and advantages of embedded system MiniGUI

Source: Internet
Author: User
Tags html interpreter
Background Development and advantages of the MiniGUI embedded system-Linux general technology-Linux programming and kernel information. For details, see the following. This article introduces the graphic user interface MiniGUI for real-time embedded systems. Its generation, Development and advantages are compared with other GUI for embedded systems, next, we introduce some important functions and features of MiniGUI in combination with examples. Finally, this article introduces the development of MiniGUI in progress.

Overview of GUI development in Embedded Linux

1.1 position of GUI in embedded or real-time systems

In common small handheld devices such as PDAs, due to restrictions of hardware conditions, the user interfaces we see are very simple, and almost do not see the gorgeous and beautiful GUI support we see on PC machines. However, the recent appearance of handheld computers such as Palm or operating systems for embedded systems such as Windows CE has seen the complete graphic user interface support. With the improvement of the hardware conditions of hand-held devices, we estimate that embedded systems require more and more lightweight guis.

Recent market demands show that more and more embedded systems, including PDAs, set-top boxes, DVD/VCD players, and WAP mobile phones, require a full-featured Web browser. This includes support for HTML 4.0, JavaScript, and even Java virtual machines. All of these require the support of a high-performance, highly reliable GUI.

Another system that urgently needs a lightweight GUI is an industrial real-time control system. These systems are generally built on a standard PC platform. The hardware conditions are better than those of embedded systems, but they have high requirements on real-time performance. In addition, they have higher requirements on GUI than embedded systems. These systems generally do not want to be built on a huge and cumbersome operating system or GUI that consumes a lot of system resources, such as Windows or X Window. at present, many of these systems are built on DOS and other systems, and GUI is implemented in a relatively simple way. however, after the emergence of Linux systems, especially RT-Linux systems, many industrial control systems began to adopt RT-Linux as the operating system, but the GUI is still a problem. The key is that X Windows is too large and bloated. In this way, these systems have more prominent requirements for light GUI.

However, we must be clear that embedded systems are often customized devices with different GUI requirements. For example, some systems only require some graphical functions, while some systems require complete GUI support. Therefore, the GUI must also be customizable.

To sum up, the role of GUI in embedded systems or real-time systems will become more and more important. The basic requirements of these systems for GUI include: 1. Light and less resource occupation.

2. High Performance.

3. high reliability.

4. configurable.

1.2 Current Implementation of Real-time embedded system GUI

Although real-time embedded systems require more and more GUI, the current GUI implementation methods are different:

1. Some large manufacturers have the ability to develop their own GUI systems to meet their own needs.

2. Some vendors did not strip the GUI from the application as a software layer, and the GUI support logic is the responsibility of the application itself.

3. Use some mature GUI systems, such as MiniGUI or other GUI systems.

Among the above measures, the 2nd method is a temporary solution. Programs written using this method cannot be divided into display logic and data processing logic, resulting in poor program structure, difficulty in debugging, and a large number of code duplication. We believe that GUI is a kind of basic software similar to the operating system. Such software systems should follow certain standards and should be open source free software, this allows Open vendors to focus on developing their own applications. Currently, vendors that develop (Real-Time) Embedded systems on Linux generally choose the following GUI systems: Compact X Window System, MiniGUI, MicroWindows, OpenGUI, QT/Embedded, etc, the following describes these systems and compares their advantages and disadvantages.

1.2.1 tightening X Window System

As we all know, X Window is a standard GUI for Linux and other UNIX-like systems. X Window adopts a standard client/server architecture and has good scalability and portability. However, we all know that the system is huge, cumbersome, and inefficient. To achieve the portability of applications, many manufacturers have tried to compress the X Window System so that it can run on embedded systems. An X server with a size of about 800 K has been developed abroad. This can basically meet the needs of embedded systems in Western countries. However, the source code of the system is not open, making it difficult to implement local development.

1.2.2 MicroWindows

MicroWindows is an open-source project, which is currently under development by a U.S. company. The development of this project is very active, and some people in China have also participated in the development, and compiled support for GB2312 and other character sets. The main feature of this project is to provide relatively complete graphics functions, including some advanced functions, such as Alpha hybrid, 3D support, TrueType font support, etc. However, as a window system, the window processing functions provided by this project need to be further improved. For example, the implementation of controls or components is not complete yet, and the keyboard and mouse drivers are not complete yet. It is worth mentioning that many controls of this project are transplanted from the MiniGUI, and the mine clearance game is also transplanted from the MiniGUI.

This project has launched an open-source browser project, which is developed based on the HTML interpreter provided by KDE kfm. Currently, it can explain some simple HTML pages.

1.2.3 OpenGUI

OpenGUI has existed on Linux for a long time. The initial name is FastGL, which only supports the linear memory mode of 256. However, other display modes are also supported. This library is written in C ++ and only provides C ++ interfaces.

1.2.4 Qt/Embedded

QT/Embedded is a well-known QT library open-source QT version for Embedded systems. This version has good portability. Many QT-based X Window programs can be easily transplanted to embedded versions. However, this system is not open source code. If you want to use this library, you may have to pay for expensive authorization fees. Currently, the demo version of QT/Embedded is available. It is expected that the official release of QT/Embedded will be available early next year.

1.3 introduction to MiniGUI

MiniGUI is a graphical user interface Support System for embedded systems or real-time systems. It runs mainly on the Linux console and can actually run on any POSIX compatible system with POSIX thread support. MiniGUI is also one of the first free software projects in China.

The main features of MiniGUI include:

Pure free software that complies with LGPL terms.

Provides a complete multi-window mechanism. This includes multiple Windows running in multiple separate threads.

The subsidiary of the main window in a single thread.

Dialog Box and predefined controls (buttons, single-line and multi-line edit boxes, list boxes, progress bars, and toolbar ).

Message transmission mechanism.

Multi-Character Set and multi-font support, currently supports ISO8859-1, GB2312, Big5 and other character sets, and supports a variety of grating fonts and TrueType, Type 1 and other vector fonts.

Supports Chinese character input methods such as full spelling and five strokes.

Support for common image files such as BMP, GIF, JPEG, PCX, and TGA.

Windows resource file support, such as bitmap, icon, and cursor.

Inserts, timers, and acceleration keys.

Others (Beep, ETC/INI file operations ).

Small. The size of the library file containing all functions is about 300 kb.

Configurable. Configuration and compilation can be customized based on project requirements.

High Stability and performance. MiniGUI has been applied in key applications such as the Linux release installation program, the CNC system, and the blue-Dot Embedded System. Good portability. Currently, MiniGUI can be run on X Window and Linux console. The EEOS Development Team of the Chinese Emy of Sciences has successfully transplanted MiniGUI to their POSIX compatibility system. The blue dot software (Beijing) R & D center has also successfully transplanted MiniGUI to two StrongARM-based embedded systems. 1.4 comparison of various guis for real-time embedded systems

Compared with the preceding GUI for embedded systems, we believe that the X Window System, MiniGUI, and MicroWindows systems are relatively mature and most developers recognize them. Although the compressed X Window System's X Server can be reduced to 800 K, the operation of X Window System also requires support from other programs and libraries, including X Window Manager, XLib, GTK and QT libraries built on XLib. Therefore, the Compact X Window System occupies a lot of system resources during its operation, after the localized Code such as Chinese display and Chinese input is added, the overall system size and runtime resource consumption will further increase. Therefore, developers of embedded systems often place the tightening X Window System on a set-top box and other embedded systems that do not have strict requirements on resources.

MiniGUI and MicroWindows are both free software, but the former follows the LGPL clause and the latter follows the MPL clause. The technical routes of these two systems are also different. The strategy of MiniGUI is first built on mature graphics engines, such as SVGALib and LibGGI. The focus of development is on window systems and graphic interfaces; at present, the focus of MicroWindows development is on the underlying graphics engine, and the functions of window systems and graphic interfaces are still insufficient. For example, MiniGUI has a set of function interfaces that support multiple character sets and multi-encoding, and supports various common character sets, including GB, BIG5, and UNICODE, microWindows does not have a unified interface for multi-character set support.

Important features of MiniGUI

2.1 design goals: small and configurable

MiniGUI was initially designed and developed to meet the needs of an industrial control system (computer numerical control system. This industrial control system is a computer numerical control system (CNC) designed by Tsinghua University for a numerical control machine tool ). After comparing systems such as DOS, Windows 98, Windows NT, and Linux, the project team decided to select RT-Linux as the real-time operating system to meet the requirement of 2 ms or higher real-time performance. However, the graphical user interface is a problem because X Window is not suitable for real-time control systems, and the localization of X Window systems was not satisfactory at that time. Therefore, we decided to develop a graphical user interface support system. This is the background of MiniGUI. Obviously, MiniGUI was designed for real-time systems from the very beginning. Therefore, it was designed with small size, high performance, and high efficiency. At present, the development of this numerical control system is nearing completion, and MiniGUI plays a very important role in it.

Considering other embedded systems different from the numerical control system, GUI systems must be configurable to meet ever-changing needs. After successful application in the CNC system, we immediately started the configurable design of the MiniGUI. We use the automake and autoconf interfaces in Linux to implement a large number of compilation configuration options. These options can be used to specify which functions are included in the MiniGUI library and which functions are not included at the same time.

Therefore, MiniGUI is a customizable and compact graphic user interface support system suitable for real-time industrial control systems and embedded systems.

2.2 important features

2.2.1 multithreading and Multi-Window

In MiniGUI, there are four types of Windows: Primary windows, dialog boxes, controls, and subwindows in the main window.

The main window in MiniGUI is similar to the Windows application's main window, but there are some important differences. Each Main Window in MiniGUI and its affiliated main Windows correspond to a separate thread, the main window and corresponding threads can be created through function calls. Each thread has a message queue. All the main windows of the same thread obtain messages from this message queue and process the messages by the window process (callback function.

VCOnGUI, that is, Virtual Console On MiniGUI, is the Virtual Console On MiniGUI, that is, the Linux Console simulator running On MiniGUI, as shown in figure 1. as you can see, the MiniGUI application can create multiple windows at the same time and run in different threads.

Figure 1 VConGUI-Linux console simulator on MiniGUI




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772511.jpg'); ">

2.2.2 dialog box and Standard Control

A dialog box in MiniGUI is a special Window. A dialog box is generally used with a control. The two concepts are similar to those in Windows or X Windows. MiniGUI supports the following controls:

Static box: Text, icon, or rectangular box.

Text Box: a text edit box for a single line or multiple lines.

Buttons: single button, check box, and general button.

List box.

Progress bar.

Toolbar.

HappyLinux is a Chinese Linux release developed by a company in China. The installation program of this release is built on MiniGUI. Figure 2 and Figure 3 are typical screens of the HappyLinux installation program.

Figure 2 HappyLinux software package selection page




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772513.jpg'); ">

Figure 3 partition page of HappyLinux




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772515.jpg'); ">

2.2.3 other GUI Elements

MiniGUI also supports pop-up menus, inserts, timers, cursors, shortcuts, and other common GUI elements. Figure 4 and figure 5 illustrate the application of other GUI elements. Figure 4 is a Bomb game, a clone of a Windows clearance game. Figure 5 shows the MiniGUI version of the classic Tetris game, as shown in Figure 5.

Figure 4 clone of a mine clearance game: Bomb game Diagram




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772517.jpg'); ">

Figure 5 MiniGUI version of tetris games




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772519.jpg'); ">

2.2.4 message and message loop

In any GUI system, there is an event or message-driven concept. In MiniGUI, we use the message driver as the application creation framework.

In message-driven applications, events related to computer peripherals, such as Keyboard keys and mouse keys, are collected by the support system, translate the message into a specific message in the agreed format. An application generally contains its own message queue. The system sends messages to the application's message queue. An application can establish a loop in which messages are read and processed until a specific message is sent. Such a cycle is called a message loop. Generally, a message is composed of an integer representing the message and an additional parameter of the message.

An application generally provides a standard function for processing messages. In a message loop, the system can call this function, in which the application processes the corresponding message.

2.2.5 graphics and input Abstraction Layer

In the development of MiniGUI 0.3.xx, we introduced the concepts of Graphics and Input Abstract Layer, GAL and IAL. The concept of the abstraction layer is similar to that of the Linux kernel Virtual File System. It defines a set of abstract interfaces that do not depend on any special hardware. All top-level graphic operations and input processing are built on the abstract interfaces. The underlying code used to implement this abstract interface is called "graphics engine" or "input engine", similar to the driver in the operating system. This is actually an object-oriented program structure. Using GAL and IAL, MiniGUI can run on many graphics engines, such as SVGALib and LibGGI, and can easily port MiniGUI to other POSIX systems, you only need to implement a new graphics engine based on our abstract layer interface. Currently, we have compiled a graphics engine based on SVGALib and LibGGI. Using LibGGI, the MiniGUI application can run on X Window, which greatly facilitates application debugging. We are currently designing and developing the MiniGUI private graphics engine. With MiniGUI's private graphics engine, we can optimize the graphics engine for the window system to the maximum extent, and ultimately improve the system's graphics performance and efficiency.

The implementation of GAL and IAL greatly improves the portability of MiniGUI. We do not need to modify the upper-Layer Code of MiniGUI. We only need to implement the new GAL and IAL engines to run MiniGUI on other embedded Linux systems based on different hardware. For example, the blue dot company transplanted MiniGUI to two StrongARM-based embedded systems within two weeks. Figure 6 is the smart information home appliance product developed by the blue dot company and running on StrongARM.

Figure 6 home appliance client with blue dot information currently in online shopping




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772521.jpg'); ">

2.2.6 multi-font and multi-character set support

After successfully introducing GAL and IAL, we introduced the logical font concept in the module that processes fonts and character sets. Logical font is the top-level interface used by MiniGUI to process text (including text output and Text Analysis. The logical font interface uses different fonts (such as ,,, and) and font formats (such as equal-width fonts, widening fonts, and other raster fonts and TrueType, Type1, and other Vector Fonts ), and a variety of different character sets (ISO-8859, GB2312, Big5, UNICODE, etc.) are integrated, so that the unified interface can display different character sets of different fonts of the text, it can also analyze the composition of various character sets, such as characters and words. In support of multi-font and multi-character set, we also adopt the object-oriented software technology, making it very convenient to add new font support and new character set support. Currently, MiniGUI supports various grating fonts, TrueType, Type 1, and other Vector Fonts, and supports multi-byte character sets such as GB2312 and Big5. UNICODE support is under development. With this technology, we can display texts of different character sets and fonts in the same window of MiniGUI.

Figure 7 shows the advanced font support function of MiniGUI. The first interface uses the TTF font and outputs "MiniGUI is great!" in rotation mode! "; The second interface provides the center, right alignment, and other output effects of multiple types of font text.

Figure 7 advanced fonts supported by MiniGUI




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772523.jpg'); ">




(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2006/7/772525.jpg'); ">

3. Recent Development of MiniGUI

Since the development of MiniGUI in the second half of 1998, it has been encouraged and supported by free software programmers from the Internet. So far, many domestic and foreign embedded system manufacturers have begun to develop their embedded products on MiniGUI, including Tsinghua University, Chinese Emy of sciences and other scientific research units. Therefore, it can be said that the development of MiniGUI has evolved from the initial battle to the market-style development model including enterprises, scientific research units, and individuals, which truly reflects the powerful vitality of free software. Currently, the MiniGUI development in progress includes:

1. Develop a MiniGUI private graphics engine for the GUI system to further improve the graphic operation performance and lay the foundation for adding advanced grating operation functions.

2. Further development on multi-window processing to improve the existing window mechanism. For example, the nested control function is in the testing status.

3. Further develop controls on MiniGUI, such as toolbar and advanced list box.

4. Provides a client/server system based on the traditional UNIX system IPC Mechanism to support large applications.

5. Develop GPL applications based on MiniGUI, such as small word processing programs and email customer programs.

Recent Development of MiniGUI

Since the development of MiniGUI in the second half of 1998, it has been encouraged and supported by free software programmers from the Internet. So far, many domestic and foreign embedded system manufacturers have begun to develop their embedded products on MiniGUI, including Tsinghua University, Chinese Emy of sciences and other scientific research units. Therefore, it can be said that the development of MiniGUI has evolved from the initial battle to the market-style development model including enterprises, scientific research units, and individuals, which truly reflects the powerful vitality of free software. Currently, the MiniGUI development in progress includes:

1. Develop a MiniGUI private graphics engine for the GUI system to further improve the graphic operation performance and lay the foundation for adding advanced grating operation functions.

2. Further development on multi-window processing to improve the existing window mechanism. For example, the nested control function is in the testing status.

3. Further develop controls on MiniGUI, such as toolbar and advanced list box.

4. Provides a client/server system based on the traditional UNIX system IPC Mechanism to support large applications.

5. Develop GPL applications based on MiniGUI, such as small word processing programs and email customer programs.

About the author

Wei Yongming (ymwei@minigui.org), male, 26 years old, Master of Engineering, current Blue Point Software (Shenzhen) Co., Ltd. Beijing R & D center technical director. One of the most influential Free Software Projects in China-the founder and main developers of MiniGUI. He has written "Linux practical tutorial" and "Learning Linux and Windows NT", and presided over and translated a large number of excellent Linux technical books such as "Red Hat Linux Mysteries. He is the keynote speaker of the AKA Linux Programming Technology series at Tsinghua University.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.