Author:
Reading: 149
Quote: 0
Published: 2006-06-04 22:09
Source: "MCU and Embedded System Application"
Summary: Analyze the structure and characteristics of the typical graphical user interface miniGUI under the embedded operating system, and propose to port it to the DVD720 of SunPlus. Keywords: graphical user interface (GUI) Embedded system frame buffer 1 Embedded Linux GUI Overview 1.1 GUI's position in embedded system
With the wide application of embedded systems, PDAs, set-top boxes, DVD / VCD players and WAP phones have been quickly popularized. The extensive popularity of the graphical user interface (GUI) is one of the major achievements of today's computer technology. It greatly facilitates the use of non-professional users, so real-time embedded systems are increasingly pronounced by GUI, and all of this requires a high performance, highly reliable GUI support.
Since the real-time requirements of embedded systems are very high, the requirements for GUI are also higher. These systems generally do not want to build huge, very consumable system resources, such as Windows or X Window, too huge and bloated. In this way, these systems have more highlighted demand for light GUI. An additional embedded system is often a custom device that is different from the demand for GUI. Some systems require only some graphical functions, while some system requires a complete GUI support, and GUI must also be customizable. The basic requirements of the embedded system for GUI include light, less resource, high performance, high reliability, and configurable [1].
1.2 Realization of GUI in the current embedded system
Although the real-time embedded system is increasingly significant to the demand for GUI, the current GUI implementation method has different [1]:
1 Some large vendors have the ability to develop the GUI system that meets their needs.
2 Some vendors do not peel as a software layer from the application, and the GUI's support logic is responsible by the application. 3 Adopt some mature GUI systems such as Mini GUI, MicroWindows, or other GUI systems.
Compared to the following GUI systems: Tightened X Window System, MiniGUI, MicroWindows, OpenGUI, and QT / Embedded, etc. These systems are briefly described below.
(1) MiniGUI
MINIGUI [2] is developed by Mr. Wei Yongming, the original Tsinghua University Teacher, is a graphical user interface support system for embedded systems or real-time systems. It is mainly running on the Linux console, actually running on any POSIX compatible system with POSIX thread support. MiniGUI is also one of the earliest free software projects in China. It will be described in detail later.
(2) MicroWindows
MicroWindows [3] is a well-known open source embedded GUI software. MicroWindows provides some features of a modern graphics window system. MicroWindows API interface support class WIN32 API, interface trial and Win32 are fully compatible. It also implements some Win32 user module features. MicroWindows uses a layered design method so that different levels can be rewritten when needed and is basically implemented in C language. MicroWindows has supported Intel 16-bit and 32-bit CPUs, MIPS R4000, and ARM chips; but as a window system, the window processing feature provided by the project also needs further improvement, such as control or components are still very incomplete, keyboard and mouse, etc. The driver is still very imperfect.
(3) OpenGUI
OpenGUI [4] There is a long time in the Linux system. This library is written in C , only the C interface is provided. OpenGUI provides a high-level C / C graphics / window interface based on an X86 graphic kernel with assembly. OpenGUI provides two-dimensional drawing primary language, message-driven API and BMP file format support. OpenGUI is powerful and easy to use. OpenGUI supports the mouse and keyboard events to implement a drawing based on Frame Buffer or SvGalib on Linux. The OpenGUI runs very quickly due to its compilation-implemented kernel and utilizes MMX instructions. Due to its compilation of its kernel, portability is affected. Usually in the first level, performance, and portability of the driver are contradictory, a compromise must be found. (4) QT / Embedded
QT / Embedded [5] is a famous QT library developer Trolltech's QT version of an embedded system. The main feature of this version is good portability, many QT-based X Window programs can be easily ported to embedded systems; however, the system is not open source, if this library is used, you may need to pay an expensive license fee.
2 miniGUI features and architecture
2.1 MiniGUI Features
The main features of MiniGUI have [1]: Follow the purely software of the GPL terms. Provide a complete multi-window mechanism, including: multi-window running in multiple separate threads; a single thread's attachment; dialog, a predefined control class (button, single line, and multi-line editing box, list box, progress Tips and toolbars, etc.); messaging mechanism. Multi-character sets and multi-font support, currently supports ISO8859-1, GB2312, and BIG5, and supports various grating fonts and TRUETYPE, TYPE 1 and other vector fonts. Full fight and five Chinese characters input method support. Common image files such as BMP, GIF, JPEG, and PCX. Windows resource file support, such as bitmap, icon, cursor, insert, timer, and accelerator, etc. Smart. The library file containing all the features is about 300 kB. Configurable. Custom configuration and compile can be customized according to project requirements. High stability and high performance. MiniGUI has actually applied in critical applications such as Linux distribution installation, CNC system, and blue dot embedded systems. It is good to be portable. Currently, MiniGUI can run on the X Window and Linux consoles. The EEOS Development Group of the Chinese Academy of Sciences has successfully transplanted MINIGUI to their POSIX compatible system. The Blue Point Software (Beijing) R & D center has also successfully ported MINIGUI to two Strongar-based embedded systems.
2.2 MiniGUI architecture
From the overall structure, MiniGUI is a hierarchical design, and the hierarchical structure is shown in Figure 1. In the bottom, GAL and IAL provide the underlying graphics interface and the mouse and keyboard drive; the intermediate layer is the core layer of MiniGUI, including each module that the window system is essential; the topmost is the API, the programming interface. GAL and IAL provide the underlying Linux console or the graphical interface on X WINDOW and the input interface, while pthread is used to provide the C function library supported by the kernel level. With GAL and IAL, it greatly enhances MiniGUI's portability and makes the development and commissioning of procedures easier. You can develop and debug your own MiniGUI program on X Window, allow the MiniGUI application to run on a special embedded hardware platform by recompiling. 3 MiniGUI's transplant project DVD720 works under the μC / OS embedded operating system, the core CPU is the MIPS chip. The platform is a multimedia platform provided by SunPlus, not only to achieve DVD play, but also features additional features, such as games, karaoke, vod, and Internet access, and provide users with programming interfaces, users can be on DVD Controlled Lego's robots. In order to provide users with a friendly interface, MiniGUI is transplanted to our DVD720 platform from ease and versatility. The architecture of the DVD720 platform is shown in Figure 2 [6]. Due to the hierarchical implementation of MiniGUI, it is only necessary to consider the drivers under the HAL interface: mouse drivers, keyboard drivers, and graphics drivers 3.1 Mouse and keyboard driver mouse drivers are very simple. In the abstract sense, after initializing the mouse, you can get a displacement value in an X and Y directions each time you move the mouse. The current location of the mouse is maintained. After the user moves the mouse, the current location is added to the displacement value, and the user will be "mobile" by the upper Cursor support, the user thinks that the mouse is correctly "moving". There are now a wide variety of mice, such as MS mouse, PS / 2 mouse, bus mouse, and GPM mouse, etc., its main difference is to initialize and packet formats. The implementation of the keyboard driver is also relatively simple, which is not described in detail here.
3.2 Graphics Driver
The interface function provided by HAL is related to graphics, mainly by calling the graphics driver to complete the task. The graphics driver shields the details of the underlying drive, realizing the underlying drive-related functions, rather than hardware-related features, such as some painting circles and Picture GDI functions, ordinary shears, can be implemented directly in the HAL interface layer.
The display driver of DVD720 is based on the driver of Frame Buffer. Refresh of TV and displays can be implemented by writing Frame Buffers and Video BitStream Buffer in SDRAM. The write mode and sequence of pixels are shown in Figure 3 [6].
The following describes each interface function:
Open, Close
Basic initialization and closing functions. In the Open function, select the sub-graphics driver to assign the function of this PSD structure to the function pointer of the PSD structure. Here only consider the initialization of a grantric engine based on Frame Buffer. SetPalette, getPalette
When using a graphics mode of 8 bits or less, use the system palette. Here is the palette processing function, and they are similar to the concepts in the Windows API. The Linux system uses IOCTL to provide an interface for processing a palette.
AllocateMemgc, MapMemgc, Freememgc
The memory screen is a pseudo screen. During the screen graphics operation, such as a mobile window, a memory screen, copy a area of the physical screen to the memory screen, then copy the new location of the physical screen, which reduces the latency of the screen directly. AllocateMEMGC is used to assign space to memory screen, and MapMemgc do some initialization work, and FreeMEMGC releases the memory screen. Drawpixel, Readpixel, Drawhline, DrawVline and FillRect
These are underlying graphics functions. They are drawing points, reading points, drawing water, painted vertical lines and draw a solid rectangle. The reason why so many functions is achieved under the bottom layer is to improve efficiency. Graphics functions support multiple drawing modes, commonly used, direct settings or Alpha hybrid modes, so that various graphics effects can be supported.
Puthline, Gethline, Putvline, GetVline, Putbox, GetBox and Putboxmask
The Get * function is used to copy pixels from the screen to a memory area, and the PUT * function is used to draw pixels stored in the memory area to the screen. The only difference between PUTBOXMASK and PUTBOX is that if the pixels you want to draw are white, it will not be drawn to the screen, thereby reaching a transparent effect.
4 Summary and Prospect
So far, our graft work has been successfully completed. MiniGUI has been able to run successfully on our DVD720 platform. As the GUI system supported by the underlying, MiniGUI should also be free software for open source, and should be promoted by the developer. So far, many embedded system developers have developed embedded systems with miniGUI and have developed many important applications. We expect to have more people to join MiniGUI development to promote MiniGUI to become standard GUI on embedded Linux systems. Although MINIGUI is currently very powerful, it has been successfully applied to many embedded systems, but it also needs to be developed in the following areas:
Build a C class library to encapsulate MiniGUI's API;
Establish a MiniGUI based on traditional process-class client / server architecture so that MiniGUI is suitable for some larger embedded systems, such as supporting a set-top box for full-featured browsers. As MiniGUI continues to promote and function, it will continue to mature in practical applications. GUI development on real-time embedded systems is in the start phase. In this field, there are many technical puzzles waiting for free software programmers to resolve.