Share this

Embedded Linux MiniGUI-based Information Terminal Software Development

2026-04-06 04:49:41 · · #1
Abstract: Embedded system development has become a new industry hotspot. This paper first outlines the characteristics and tools of embedded Linux system development, then describes in detail the porting and usage of the MiniGUI graphical system, and illustrates the process of starting information terminal software on this system. This approach has great application prospects. Introduction In recent years, with the maturity and improvement of software and hardware resources, embedded technology has become increasingly closely related to people's lives, and even single-function public telephones have begun to transform into embedded multimedia information terminals. Research on embedded systems has aroused great interest worldwide. Choosing the open-source Linux operating system to develop next-generation embedded products has become a new technological hotspot. In this system, the MontaVista Linux system is used. It provides many combinations of processors, target boards, and host environments, and has a complete set of auxiliary development tools, facilitating embedded system specialists to design, develop, and release applications. At the same time, equipping the system with an excellent graphical user interface, enabling friendly and reliable interaction between the product and the user, has become a very urgent requirement in development work. The MiniGUI used in this system is a lightweight graphical user interface support system under the embedded Linux system, which is currently relatively mature and has been used in the actual development of many projects. 1. Embedded Linux System Embedded systems are application-centric, computer technology-based, and feature customizable hardware and software. They are suitable for dedicated computer systems where user systems have strict requirements regarding functionality, reliability, cost, size, and power consumption. Since the late 1980s, several embedded operating systems have emerged, such as VxWorks, pSOS, Windows CE, and Linux. Among them, the free-source Linux operating system has gained widespread attention due to its small kernel, support for multiple hardware platforms, and high customizability, providing a powerful choice for embedded system development. Currently, several companies have released embedded Linux distributions. This system uses the latest version, MontaVista Linux 3.0, from MontaVista Software, one of the world's three major embedded Linux vendors. It uses the standard Linux kernel 2.4.2 and is a real-time, professional embedded operating system tailored for embedded devices. Considering the limited processor and memory resources of embedded devices, MontaVista has highly customized and configured the kernel without reducing the beneficial features of the new kernel for embedded devices, resulting in MontaVista Linux 3.0. It uses the standard Linux kernel 2.4.2, a real-time, professional embedded operating system tailored for embedded devices. Considering the limited processor and memory resources of embedded devices, MontaVista has highly streamlined and configured the kernel without reducing its beneficial features, resulting in stable and outstanding performance for MontaVista Linux 3.0. It also includes a priority-driven real-time scheduler to better meet customers' real-time requirements. 2. Software Development Platform MontaVista Software provides the necessary environment for system development in its embedded Linux distribution: a) Kernel and file system tools—Target Configuration Tool (TCT), Library Optimization Tool (LOT); b) Cross-development tools—GNU GCC/C++ compiler, GDB source code debugger, DDD graphical interface debugger, etc.; c) Real-time performance tools and analysis tools. The system kernel is tested using Abatron's BDI2000 debugger and runs on a PowerPC CPU. The target system has implemented Ethernet interface, serial port, and USB interface, and the LCD can also display normally. 3 System Framework Structure The application is the top layer of development, and its interactive interface is directly implemented through the API interface functions of the MiniGUI graphical system. MiniGUI hides the details of programming the underlying display and input devices, allowing programmers to focus more on the features of the information terminal interface, thereby shortening the programming time. After compilation and installation, MiniGUI is generally stored as a library in the /usr/lib directory of the operating system. 4 Porting of MiniGUI (1) Features of MiniGUI MiniGUI is a free software project mainly managed by Wei Yongming. It is now a pure free software that fully complies with the GPL (General Public License) terms and can run on any POSIX-compatible system with POSIX thread support. MiniGUI has many unique features in its architecture. Its main features include: a) providing a complete multi-window mechanism; b) dialog boxes and predefined control classes; c) message passing mechanism; d) support for multiple character sets and multiple fonts; e) support for Chinese input methods such as Pinyin and Wubi; f) support for common image files such as BMP, GIF, and JPEG; g) small size, with the library file containing all functions being about 300KB in size; h) configurable, and can be customized and compiled according to project requirements; i) good portability. (2) Porting process of MiniGUI To make MiniGUI run on the embedded target board PPC, the graphics package needs to be ported in the cross-development environment of MontaVista Linux 3.0. When MiniGUI version 1.2.6 was released, it included the resource file compressed package minigui-res1.2.6.tar.gz, the library file compressed package libminigui-1.2.6.tar.gz, and a comprehensive demonstration program mde-1.2.6.tar.gz. After installing MontaVista Linux 3.0 on the development host, configure the output directory of the host's NFS service to the hard drive path /opt/hardhat/devkit/ppc/8xx/target. Once the target board is running, it will automatically mount to this directory. Install MiniGUI using this target as the current path. Open the resource file archive and execute the command `tar -xvf minigui-res-1.2.6.tar.gz`. This will automatically generate a `minigui-res` directory in the current path. In this directory, you will find a `config.linux` file. Modify the `TOPDIR=NONE` entry to `TOPDIR=/opt/hardhat/devkit/ppc/8xx/target`, where the path corresponds to the previously set NFS output directory. Run the installation command `make install`. When compiling the library file archive `libminigui-1.2.6.tar.gz`, the decompression steps are the same as above. The difference is that you must run the `configure` command in the current directory to configure the library files for porting. The command line is as follows: `CC=ppc_8xx-gcc ./configure --build=i386-linux --target=ppc-unknown-linux --prefix=/opt/hardhat/devkit/ppc/8xx/target --libdir=/opt/hardhat/devkit/ppc/8xx/target/usr/lib --includedir=/opt/hardhat/devkit/ppc/8xx/target/usr/include --enable-debug`. Here, `ppc_8xx-gcc` is the compiler for the PowerPC architecture, provided by MontaVista Linux; `build` refers to the machine on which the compilation is performed, here it's the x86 development host; `target` is the machine running the object files generated by this compiler; `prefix` is the prefix for all installation paths; `libdir` is the library file installation path; `includedir` is the header file installation path; and `enable-debub` indicates that debugging information should be included during compilation. After configuration, run the compilation and installation command. The installation method for the comprehensive demonstration program mde-1.2.6.tar.gz is similar to that for library files. At this point, boot the target board. Under the MontaVisa Linux control program, navigate to the /mde-1.2.6/mginit directory and enter the command line ./mginit to run the MiniGUI background server program. A window manager with a small logo will appear, and a console program sub-window will pop up in the upper left corner. Other demonstration examples in mde can be run in this console. At this point, the MiniGUI graphical package has been successfully ported and installed on the target board. 5. Information Terminal Software Development This system uses a Lite version of MiniGUI specifically developed for embedded systems. It is based on a client/server (C/S) architecture, transmitting input device data between the server and clients, as well as certain syntax and response data between the clients and the server. Based on this structural characteristic, this information terminal software designs one server program and two client processes. The server always runs in the background, recording relevant system information, such as system timers and user card balances, and transmitting data to the client programs below through the Socket mechanism provided by MiniGUI. The main interface client process provides users with a complete operating experience. Users can select functions such as making phone calls and browsing information through the menu. Another client process is an advertising screensaver. During the intervals when no one is using it, some wonderful images can be dynamically displayed to realize commercial value or public welfare publicity. The following are introductions. (1) Information terminal client program The main interface client program of this information terminal is opened in the console program of the MiniGUI server. The main menu of the information terminal pops up, displaying sections such as telephone, information query, city traffic, and news column. When the program is implemented, the header files are included at the beginning. The header files of the MiniGUI graphics package are: common.h (definition of commonly used macros and data types in MiniGUI), minigui.h (definition of global and general interface functions and miscellaneous functions), and window.h (definition of macros, data types, data structures and window functions related to windows). When using GDI functions and controls, the header files gdi.h and control.h are also required. When programming, the program entry point of MiniGUI is the MiniGUIMain function, which will be automatically found after the system is initialized. This function first sets some basic properties of the main window and establishes a unique message queue for each client program. When the program ends, the `MainWindow ThreadCleanup` function is called to clear the message queue system resources used by the main window and return to the server program. Each functional sub-function is called within the procedure function of the main interface window, another main part of the MiniGUI program. When the main window is created, an attribute `MainWindowProc` specifies the procedure function for that window. Messages from each functional module are triggered through the message loop in the main window. The window procedure function body uses `switch` and `case` statements to generate different responses to different messages. Generally, the `MSG_CREATE` message is sent when the window is created, so controls are often created here by calling the `CreateWindow` function. `MSG_PAINT` occurs when the window is moved or `UpdateWindow` is called to redraw; corresponding operations can be defined as needed. `MSG_CLOSE` is the action when closing the window; generally, `DestroyMainWindow` is called to destroy the main window, and `PostQuitMessage` is called to exit the message loop. In addition, the GDI (Graphics Device Interface) provided by MiniGUI in the window procedure function can easily output images such as BMP, GIF, and JPEG to the interface using the LoadBitmap function, and support multiple fonts and character sets through the logical font of the device context (DC). The production of the advertising process is similar and will not be described again. (2) Information terminal software server program Because the server and client programs need to exchange data, we used the Socket communication mechanism wrapped by MiniGUI. In the server, a listening socket is established: #define LISTEN_SOCKET "/var/tmp/socket1" static int listen_fd; BOOL listen_socket(HWND hwnd) { if ((listen_fd=serv_listen(LISTEN_SOCKET))<0) return FALSH; return RegisterListenFD(listen_fd,POLLIN,hwnd,NULL); } The server listens on the socket listen_fd. When a client makes a connection request, the server's procedure function will receive the MSG_FDEVENT message, and the server can accept the request and process it accordingly: static int MainFunProc(HWND hWnd, { switch (message) {case MSG_FDEVENT: if (LOWORD (wParam) == listen_fd) { …… conn_fd=serv_accept(listen_fd,&uid); if (conn_fd>0) { sock_read(conn_fd,buff[20],40); …… sock_write(conn_fd,buff[20],40); }} break; }} In the main interface process, when it is necessary to connect to the server, a request can be made through cli_conn(LISTEN_SOCKET,'b'). In this way, the server and client programs can exchange data with each other. When implementing the advertising process, an event hook function `SetServerEventHook(my_event_hook)` needs to be set in the server. Because the advertising screensaver automatically turns on after a period of no keyboard or mouse input and automatically turns off upon any key press, only a server running in the background can determine whether the advertisement should be turned on or off. This can be done in the message loop: `while (GetMessage(&Msg, HWND_DESKTOP)) {if (pid_scrnsaver == 0 && GetTickCount() > old_tick_count + 1000) { ShowCursor(FLASE); pid_scrnsaver = exec_app("./scrnsaver", "crnsaver"); } DispatchMessage(&Msg); }` `dld_tick_count` is the time of the previous message. If the current time obtained from `GetTickCount()` is greater than the set value and there is no message yet, the advertising screensaver `scrnsaver` program starts, and the mouse cursor is hidden. When the system receives another event, it will automatically execute the previously registered event hook function. Within this function, the `kill(pid_scrnsaver, SIGINT)` command can be used to close the ad program and display the mouse cursor. The completed C program file can be compiled using a cross-compiler and linked with the MiniGUI library file to generate the required executable file. Conclusion Applying embedded Linux to information appliance products and developing excellent human-computer interaction interfaces is a trend in embedded development and has broad market prospects. The embedded information terminal developed in this system has already shown initial success, and it is believed that this solution will be increasingly widely used.
Read next

CATDOLL 126CM Sasha (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22