Transplantation of MiniGUI on the development board based on OMAP5912
Abstract: with the development of embedded system, users have higher and higher requirements for embedded system, among which the embedded Gul used to realize human-computer communication function has become a focus in the research and has broad application prospects. This paper introduces the migration and use of mingui in detail, and explains the establishment process of cross compilation environment, the libraries and resource files required for migration of MiniGUI and their functions, and the configuration of MiniGUl running environment. Finally, it realizes the interface support of OMAP5912 development board with dual core structure, completes the preliminary work of building an embedded graphical interface system, and achieves good experimental results
Keywords: MiniGUI; Graphical user interface; Cross compilation; Porting
0 introduction
with the rapid development of embedded, the way of taking arm as the hardware platform and Linux as the software platform has attracted extensive attention. Graphical user interface GUI is by far the most mature human-computer interaction technology in computer systems. MiniGUI, as an excellent graphical user interface support system, has been applied in many practical products and projects. Here is a detailed introduction of how to transplant MiniGUI on OMAP5912 development board
1 introduction to OMAP5912 development board
omap5912 processor is a dual core application processor composed of TMS320C55x DSP core (192 MHz) and low-power, enhanced ARM926EJ-S microprocessor (192 MHz), which is most widely used in Ti. It is manufactured by o.13 m CMOS process. C55xdsp can provide real-time multimedia processing support for low-power applications; ARM926EJ-S MPU can meet the processing needs of control and interface. OMAP5912 based on dual core structure has strong computing power and low power consumption. It adopts open and easy to develop software facilities and supports a wide range of operating systems
2 introduction to graphical user interface MiniGUI
compared with several mainstream embedded GUIs, MiniGUI has the following remarkable characteristics: less resources, high performance, high reliability, configurable transformation and upgrading, which is a long process full of pain and suffering. MiniGUl adopts hierarchical design, and the hierarchical structure is shown in Figure 1
at the bottom, gal and ial provide the bottom graphic interface and the drive of mouse and keyboard; The middle layer is the core layer of MiniGUI, including all necessary modules of the window system; The top level is the programming interface API. Gal and ial provide MiniGUI with the bottom Linux console or the graphic interface and input interface on X window, which greatly improves the portability of MiniGUI and makes the program development and debugging easier
3 porting process of MiniGUI on OMAP5912 development board
3.1 building Linux cross compilation environment
in this example, the host system is RedHat 9 Linux, and the cross compilation tool is cross-2.95.3.tar.bz2. Decompress the tool into/usr/local/arm directory, and then execute export path=/usr/local/arm/2.95.3/bin:mympath; Add the path of the installed library resources to the path. In this way, the fixture equipped with the machine should be coated with anti rust oil for storage; The cross compilation environment is built. All the following resource files and library files should be installed in/usr/local/arm/2.95.3/arm linux directory
3.2 cross compile MiniGUI resource files
provide the resources required for program calls, such as bitmaps, cursors, interface control bars, etc. the compilation method is relatively simple. You can use it on the development board after compiling in the host environment. Unzip minigui-res-1.3.3.tar.gz, enter the directory and execute the make install command. The resource files will be installed in the MiniGUI directory under/usr/local/lib. 3.3 cross compile MiniGUI library functions, and configure and install
first extract libminigui-1.3.3.tar.gz, enter the FRA mebuffer controller configuration file libminigui-1.3.3/SRC/new Gal/fbcon, and modify the gal in fbvideo.c_ Fbdev=/dev/FB/O, because after the system is started, the actual device file in its/dev directory is not FB but/FB/0. Generally, frame buffer is treated as a standard character device. The primary device number is 29, and the secondary device number ranges from 0 to 31, corresponding to the device files of/dev/FB/0-/dev/FB/31 respectively. After modification, enter the unzipped directory and execute the following commands to complete the configuration of compilation options:
CC is used to specify the compiler to be used- The target option is used to specify the target platform- The host option is used to indicate the type of host- The build option is arm linux like -arget- The en able Lite option is used to specify the mode of production. MiniGUI 1.3.3 has two modes: threads and lite. In this example, Lite mode is used- The prefix option is used to specify the installation path of MiniGUI function library. In this example, the installation path is/usr/local/arm/2.95.3/arm linux. If it runs successfully, the customized makefile file will be generated, and then you can continue to execute the make and make install commands to compile and install libminigui
3.4 add the support of auxiliary function library
3.4.1 install the zlib library
this library is the basis for compiling many later libraries. Decompress the zlib-1.2.3.tar.gz file. The configure script of the zlib library does not support cross compilation options. You can make the target file point to the current 2.95.3 version of arm linux GCC and arm linux LD linker through soft link; You can also set the library file to the dynamic sharing mode. In this way, many programs can reuse the same code, which can effectively reduce the size of the application. Open makefile and add the following code:
where: the ldshared parameter is set to the sharing mode to generate libz.so.1 shared file; CPP specifies the server path. Finally, make installprefix=/usr/local/arm/2.95.3/arm linux/install to the specified path
3.4.2 install PNG library
this library is used to display PNG graphics. First extract the libpng-1.0.10rcl.tar.gz file. When compiling, there is no configuration file under the main directory, so execute the command CP scripts/makefile.linux to install the configuration file makefile.linux consistent with the development system architecture under the main directory, Then you need to modify the makefile.linux file:
where: the above zliblib parameter and zlibinc parameter specify the path of the library file and header file respectively
3.4.3 install JPEG library
this library is used to support JPEG format image display, and the compilation process is similar to the compilation process of PNG Library:
3.4.4 install libttf library
this is the support library of TrueType fonts, which is used to display text, extract freetype-1.3.1.tar.gz, enter the directory, and then./con figure will generate makefile file, because Xlib testexample is not installed, and later compilation fails, Mask some of the code about test, open the makefile file, find the line with fttestdir field and comment it out, a total of 7 places. Then make compile the library file and generate the link library file in the freetype-1.3.1/lib Directory:
so far, the libttf library installation is completed. The above method is to complete the installation through automatic configuration. In addition, the installation can also be completed through manual configuration:
parameter O2 means that the compilation process should be completed at the same time through secondary optimization, and debugging information such as symbol table is no longer added, so as to minimize the space occupied by the program code and speed up the execution at the same time
4 add MDE library support
mde library is the archive compressed file that executes the igui application program from the statistics, which contains the MiniGUI Lite server program called mginit. The installation process requires the support of popt-1.7.tar.gz library. The installation process is relatively simple, which is similar to the previous library installation
in order to avoid the warning message of minigui-liteverl.2.6 orlater in the installation process, the configuration.in file must be modified, and the following line of statements must be added to specify the search path of the header file and library file:
at the same time, the path of the common.h file containing the commonly used macros of MiniGUI and the definition of data types should be modified in the parameter AC_ CHECK_ Add the following code in the headers line:
5 create device file node
before the kernel starts, ensure that MiniGUI runs in the server mode. When executing MiniGUI application on the embedded system, mginit calls VFORK to generate a sub process, and then calls the system to call EXECL to start. At the same time, the server program also needs to create several device files, Execute the following creation command in the/dev Directory:
mknod ptysf C 263
mknod ttysf C 363
respectively create the device file ptysf with the primary device number of 2 and the secondary device number of 63, and the device file ttysf with the primary device number of 3 and the secondary device number of 63. If you need to automatically load the above device files when the system starts, you can add the above commands to the system startup script file rc.d. So far, the work of the migration phase is completed
6 download the program to the target board and run
through the above compilation, all the library files and applications required to run MiniGUI on the target board have been compiled without affecting users. Enter/usr/local/arm/2.95.3/arm linux/. There are resources that need to be copied to the target machine under the etc, lib subdirectory. First, copy the root file directory to/opt/rootfs, create the same directory structure as/usr/local/arm/2.95.3/arm linux/under the root file directory, and copy the corresponding libraries in/usr/local/arm/2.95.3/arm linux/lib to the/usr/local/Lib directory of the root file system (there is no need to copy libjpeg. A and other static libraries); Copy the MiniGUI resource file, and copy the MiniGUI directory under usr/local/lib/directory to the root file/opt/rootfs directory; Copy the configuration file/usr/local/etc/minigui.cfg, and keep the directory structure consistent. Modify the/etc/ld.so.conf file in the root file system, add/usr/local/Lib in the last line of the file, then execute the command ldconfig-r/opt/rootfs, set the root file directory as the root directory, and finally modify minigui.cfg to make it suitable for the hardware settings of the target board: change the mouse device to mdev=/dev/input/mouse0, change the mouse protocol type to mtype=imps2, and use the default method for others
so far, MiniGUI has been successfully transplanted to the development board. Figure 2 shows the screen after MiniGUI is started on the development board. After that, you can continue to modify MiniGUI library functions and various resources as needed, and write your own applications to make the interface on the development board more beautiful and perfect
7 conclusion
the MiniGUI migration process introduced has been verified by experiments, and the general process is suitable for other models of development boards and other open source versions of MiniGUI. Introducing graphical user interface into embedded system is the inevitable trend of embedded technology development. It is certain that with the continuous promotion and function strengthening of MiniGUI, it will play a decisive role in the design of embedded system, and continue to mature in practical application
LINK
Copyright © 2011 JIN SHI