Simulation and Porting of MiniGUI Based on ARM-Linux
2026-04-06 07:28:45··#1
In recent years, with the increasing development of embedded systems and the widespread application of 32-bit embedded processors and graphics display devices, the demand for GUIs (Graphical User Interfaces) in target products has been increasing. Because embedded systems generally have high real-time requirements, the GUI for embedded systems needs to be lightweight, resource-efficient, and high-performance. Furthermore, embedded systems are often customized devices with varying GUI requirements; therefore, the GUI must also be customizable. MiniGUI is a highly efficient, reliable, customizable, compact, and flexible graphical user interface support system perfectly suited for real-time embedded products, and it is widely used in high-end technology products. Developing a good human-computer interaction interface using MiniGUI has become an urgent need in embedded development. This paper implements the simulation development and debugging of a QVFB-based MiniGUI in an ARM-Linux environment. After completing the application through simulation on a PC, cross-compilation tools are used to compile the code to run on the target machine. Then, the MiniGUI and executable application are ported to the S3C2410 target board, which saves development time and improves development efficiency and quality. 1. Features and Architecture of MiniGUI The initial goal of the MiniGUI project was to provide a lightweight graphical user interface support system for Linux-based real-time embedded operating systems. As middleware between the operating system and applications, MiniGUI hides the differences between the underlying operating system and the hardware platform and provides consistent functionalities to upper-level applications. 1.1 Features of MiniGUI (1) Low resource consumption: MiniGUI itself occupies very little space. The entire MiniGUI system occupies 2-4MB of space. On some systems, the space occupied by the MiniGUI system itself can be further reduced to less than 1MB. (2) High performance and high reliability: MiniGUI's good architecture and optimized graphics interface can ensure the fastest graphics drawing speed. (3) Customizable configuration: Similar to the Linux kernel, MiniGUI also has a large number of compilation configuration options. These options can specify which functions required by users are included in the MiniGUI library. (4) Cross-operating system support: MiniGUI supports embedded operating systems such as Linux/uClinux, eCos, uC/OS-II, and VxWorks. At the same time, MiniGUI provides fully compatible API interfaces on different operating systems. 1.2 MiniGUI Architecture From an overall structural perspective, MiniGUI adopts a layered design, as shown in Figure 1. Figure 1: MiniGUI Layered Architecture At the bottom layer are the GAL (Graphics Abstraction Layer) and IAL (Input Abstraction Layer), as well as the drivers for the mouse and keyboard; the middle layer is the core layer of MiniGUI, including all the essential modules of the window system; the top layer is the API, i.e., the programming interface. GAL and IAL provide MiniGUI with the underlying Linux console or X-Window graphical interface and input interface, while Pthread provides a C function library for kernel-level thread support. Utilizing GAL and IAL greatly improves the portability of MiniGUI and makes program development and debugging easier. 2. MiniGUI Simulation Application on QVFB MiniGUI can run on a PC and can also be ported to a target board. On a Linux PC, the MiniGUI application can be run in two ways: (1) in X-Window, in the virtual Frame Buffer QVFB; (2) in the Linux character console, in the Frame Buffer driver provided by the Linux kernel. This section mainly introduces the simulation of MiniGUI in QVFB. QVFB is a virtual Frame Buffer tool provided by Qt (Qt is the underlying function library used by the Linux window manager KDE). This program is developed based on Qt. 2.1 Establishing the MiniGUI running environment on Linux In the Linux environment, copy the downloaded compressed installation file qvfb-1.0.tar.gz to the /opt directory, decompress it in the directory, and use the make install command to install QVFB to the system default /usr/local/bin directory. In the X-Window environment, open the terminal, type the qvfb& command, and start the QVFB simulation program. Next, configure the QVFB running environment. Here, it is configured as 640×480 and Depth as 16bit. QVFB provides a software method to see how your image application will look on a PC. It can simulate different resolutions and display colors, thus simulating embedded displays on the target machine, greatly facilitating application development and debugging. 2.2 Installing Resource Files and Configuring MiniGUI Library Files In a Linux environment, copy the downloaded compressed resource file minigui-res-1.3.3.tar.gz (which contains fonts, cursors, icons, bitmaps, etc.) to the /opt/emulation directory (the emulation directory is a newly created directory). After successfully running the ./configure script, you can execute the make and make install commands to install the resource files to the system's default /usr/local/lib/minigui/res directory. Copy the downloaded compressed library file libminigui-1.3.3.tar.gz to the /opt/emulation directory. Enter the decompression command and navigate to the decompressed directory. In this directory, enter `make menuconfig` to launch the graphical interface configuration tool. After configuration, enter `make` to recompile the library file. If compilation is successful, enter the command `make install` to install the MiniGUI library to the default /usr/local/lib/ directory. Next, check the file /etc/ld.so.conf. If the line /usr/local/lib is missing, add it to the end of the file, and then execute `ldconfig`. 2.3 MiniGUI Simulation on QVFB Copy the downloaded mg-samples-1.3.1 and mde-1.3.0.tar.gz to the /opt/emulation/ directory. In the terminal, navigate to this directory and execute `./configure` and `make` in sequence to compile these sample programs into programs executable on QVFB. First, modify the configuration file MiniGUI.cfg in the /usr/local/etc directory, changing gal_engine=fbcon to gal_engine=qvfb and ial_engine=console to ial_engine=qvfb. Then, use the qvfb& command to start qvfb, and run the executable program in the /opt/emulation/mg-samples/src directory, such as bomb. You will then see the MiniGUI program running in QVFB, as shown in Figure 2: Figure 2 MiniGUI Simulation on QVFB 3 Porting MiniGUI on S3C2410 3.1 Installing MiniGUI Resource Files Create a target directory in the /opt directory of the PC, copy the resource file minigui-res-1.3.3.tar.gz to the /opt/target directory and decompress it. Edit the config.linux file in the /opt/target/minigui-res-1.3.3 directory, changing “TOPDIR=" to “TOPDIR= /opt/target/minigui”, save and exit. Then, type `make install` to install the resource files in the `/opt/target/minigui/usr/local/lib/minigui/res` directory. Simultaneously, copy the `minigui` directory under `/opt/target/minigui/usr/local/lib` to the folder in the file system you want to create. 3.2 Configuring and Installing the MiniGUI Library Files Before compiling the MiniGUI library file `libminigui-1.3.3`, you must first correctly install a cross-compiler, specifically an armv41-unknow-linux series cross-compiler. Using the cross-compiler, you can compile the `libminigui-1.3.3` library file into a dynamic link library. By calling this dynamic link library, you can correctly run MiniGUI applications. In `/opt/target/libminigui-1.3.3`, type the command `make menuconfig` to configure it. After configuration, save and exit. Then type `make` and `make install`. This will install the cross-compiled MiniGUI library files in the `/opt/host/armv41/armv41-unknown-linux/lib` directory, specifically `libminigui-1.3.so.3.0.0` and `libmgext-1.3.so.3.0.0`. There are also symbolic links pointing to these libraries: symbolic links to `libminigui-1.3.so.3` and `libminigui.so` point to the library file `libminigui-1.3.so.3.0.0`, and symbolic links to `libgext-1.3.so.3.0.0` point to the library file `libgext-1.3.so.3` and `lib-mgext.so`. The header files used by MiniGUI are installed in the `/opt/host/armv41/armv41-unknown-linux/include/minigui` folder. There is also a configuration file named `minigui.cfg` in `/opt/host/armv41/armv41-unknown-linux/etc/`. 3.3 Porting MiniGUI Successfully porting MiniGUI to the S3C2410 target board generally involves the following steps: (1) Copy the MiniGUI library files libminigui-1.3.so.3.0.0 and libgext-1.3.so.3.0.0, along with their symbolic link files, to the /lib directory in the root_tech directory where the cramfs file system is to be created. (2) Copy the minigui directory under /opt/target/minigui/usr/local/lib to the directory where the cramfs file system is to be created, such as /usr/sbin/ in that directory. When the embedded system runs, the application calls the relevant resource files in the minigui directory. (3) In the root_tech folder, create a directory using the command `mkdir -p /opt/host/armv41/armv41-unknown-linux/`, and then create a symbolic link using the command `ln -s /lib /opt/host/armv41/armv41-unknown-linux/lib`. The above commands ensure that the system can find the correct dynamic link library. (4) Modify the MiniGUI.cfg file in the directory `/opt/host/armv41/armv41-unknown-linux/etc`, and change the path where the resources are stored to the corresponding path in the root_tech directory, so that the application can find the resource files it uses. For example, if the storage path on the PC is `/usr/local/lib`, then in the root_tech directory, if the MiniGUI resource directory is placed in `/usr/sbin`, the path in the MiniGUI.cfg file must be changed from `/usr/local/lib` to `/usr/sbin/`, and `ial_engine=console` must also be changed to `ial_engine =ads`. Additionally, change "defaultmode = 1024×768-16 bpp" under [fbcon] to "defaultmode = 640×480-16 bpp". Place the modified MiniGUI.cfg file in the /mnt/etc directory of the root_tech directory. (5) Finally, use the mkcramfs command to generate a cramfs file system from the prepared root_tech folder, and use the NFS network file system to migrate the generated file system to the S3C2410. Then, navigate to the directory /usr/sbin where the executable file is located under minicom. The result of running the executable program bomb on the S3C2410 target board is shown in Figure 3 below: Figure 3 MiniGUI running on the S3C2410 development board 4 Conclusion This paper simulates the MiniGUI-1.3.3 version in QVFB under the ARM-Linux environment. After cross-compilation, it was successfully ported to the S3C2410 development board hardware platform. The experimental results show that it can run stably and reliably, laying the foundation for the development and application of subsequent practical projects based on graphical user interface programs. With the increasing application of embedded products, developing a good human-computer interaction interface based on MiniGUI is a trend in embedded development and also has broad market prospects. References [1] Xu Yinghui, Ma Zhongmei, Wang Lei, et al. ARM9 Embedded System Design—Based on S3C2410 and Linux [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2007. [2] Liu Changsheng, Guo Yong, Xie Xihua. Research and Porting of MiniGUI in Embedded Linux Environment [J]. Embedded Software Application, (2008) 07-2-0101-03. [3] Li Min. Porting of MiniGUI on S3C2410 Development Board in ARM-Linux Environment [J]. Science and Technology Information Development and Economy, (2008) 28-0139-02. [4] Liu Zhengrong, Zhang Zhichao, Xu Zhenshan, et al. Detailed Explanation of Embedded Linux Application Development [M]. Beijing: Machinery Industry Press, 2004. [5] Beijing Feiman Software. MiniGUI User Manual. http://www.minigui.com. [6] ARM Limited. ARM920T Technical Reference Manual. 2000, 2001.