Porting minigui1.6.10 through cross-Compilation

Source: Internet
Author: User

This article mainly references how to port MiniGUI to the 2440 Embedded Network blog. Author: Liu Qiqi
MiniGUI 1.3.3 detailed transplantation, Author: Desert Lone Wolf

Note:

Because we want to use MiniGUI as a PDA, We need to port MiniGUI to my Development Board MiniGUI. The transplantation is successful and PNG is supported,

JPG, mouse and touch screen can be used, but the touch screen is not accurate, need to be positive, compared with the original intended to use tslib.1.3, transplanted successfully

To use MiniGUI as the ial, you also need to modify libminigui1.6.10/RES/ial/2410. C and use it

Smdk2410 is its ial, but it has not been released in 1.6.10, 2410.c, v1.3.3.

Hardware environment:

HOST: x86pc

Target: friendly arm mini2440 Development Board

Software environment:

HOST: RedHat Linux 9.0 (fully installed) under vmwarevm)

Target: Arm-Linux kernel: linux-2.6.13

Crosstool: arm-linux-gcc-3.4.1

2. Prepare the following source code package (download)

Http://www.minigui.org/downloads

Development Library: libminigui-1.6.10.tar.gz

Resource file: minigui-res-1.6.10.tar.gz

Example: mg-samples-str-1.6.10.tar.gz

3. Compile and install

(1) Preparations

Create a working directory in RedHat Linux 9.0

[Root @ localhost/] # mkdir/MiniGUI working directory

[Root @ localhost/] # mkdir/MiniGUI/compressed/MiniGUI/source

[Root @ localhost/] # cd/MiniGUI/compressed enter the working directory

Note: Put the source code package downloaded in step 1 to this directory, that is,/MiniGUI/compressed.

(2)compile and install minigui-res-1.6.10.tar.gz

Description: resources used by MiniGUI, including basic fonts, icons, bitmaps, and mouse cursors.

[Root @ localhost compressed] # tar xzvf minigui-res-1.6.10.tar.gz-C ../source

[Root @ localhost compressed] # CD ../source/minigui-res-1.6.10

[Root @ localhost minigui-res-1.6.10] # make install

Put the generated ...... Copy all files under the/MiniGUI/RES directory to the Development Board. The directory on the Development Board is as follows:/usr/local/lib/MiniGUI/RES /......, In fact, this directory is consistent with the directory of the corresponding content in the configuration file MiniGUI. cfg to find the corresponding resources.

(3) Support for JPEG and PNG

First install the zlib library, which is the basis for compiling the subsequent libraries.

Http://www.zlib.net/zlib-1.2.3.tar.gz more than 400 K, download it,

Download To/opt/mini2440 directory

[User] # tar zxf zlib-1.2.3.tar.gz

Because the configure script of the zlib library does not support cross-compilation options, you have to use it on your own. manually modify GCC to point to our cross-compiler Arm-Linux-gcc

[Root] # cd/usr/bin

[Root] # mv GCC gcc_back

[Root] # ln-S/usr/local/ARM/3.4.1/bin/ARM-Linux-GCC./GCC

[Root] # mv LD ld_back

[Root] # ln-S/usr/local/ARM/3.4.1/bin/ARM-Linux-lD./LD

OK, return to the/opt/mini2410/zlib-1.2.3 directory after modification

[User] #./configure -- prefix =/usr/local/ARM/3.4.1/ARM-Linux/-- shared

Note: The configuration points to the/usr/local/ARM/3.4.1/ARM-Linux/directory, which will be automatically installed in/usr/local/ARM/3.4.1/ARM-Linux/[include, lib] Directory, do not install the wrong directory, otherwise the library will not be found later

[User] # Make

[Root] # make install

Check the directory/usr/local/ARM/3.4.1/ARM-Linux/[include, lib] After installation. If zlib is not found in include. header files such as H, without libz in Lib. so.1.2.3, copy them to these directories manually, and remember to copy all *. h must be copied. Use CP-A libz to copy the database. */.... /Lib. Use the-A option.

Remember to change the modified GCC back. Otherwise, an error will occur later !!!!!
The command to change back is:
CD/usr/bin
Rm gcc
MV gcc_back gcc

Install the PNG Library. This is used to display PNG images. Many images in MiniGUI are PNG. Without this library, your MiniGUI will not work properly. Remember to remember!

Http://superb-east.dl.sourceforge.net/sourceforge/libpng/libpng-1.0.10rc1.tar.gz

In other words, do not use the latest database. The latest database may be faulty. If you use this old database, it will be okay.

[User] # tar zxf libpng-1.0.10rc1.tar.gz

[User] # cd libpng-1.0.10rc1

Libpng does not provide a valid configure script, so you have to change the MAKEFILE file by yourself.

[User] # cp scripts/makefile. Linux makefile // copy a makefile under scripts and change it by yourself

[User] # vi makefile // manually modify

Cc = arm-Linux-GCC // modify here

# Where "make install" puts LibPNG. A, LibPNG. So *, PNG. h and pngconf. h

Prefix =/usr/local/ARM/3.4.1/ARM-Linux // modify here

# Where the zlib library and include files are located

# Zliblib =/usr/local/lib

# Zlibinc =/usr/local/include

Zliblib =/usr/local/ARM/3.4.1/ARM-Linux/lib // modify here

Zlibinc =/usr/local/ARM/3.4.1/ARM-Linux/include // modify here

Okay, save it, and compile it.

[User] # Make

[User] # make install

If there is an error, check which of the above steps is not correct :), especially the installation of zlib

As mentioned above, check whether the/usr/local/ARM/3.4.1/ARM-Linux/[include, lib] directory has been successfully installed. If not, then copy the compiled items. Remember, copy the *. h and. So files.

OK. Install the JPEG library now.

Http://www.minigui.org/downloads to download it yourself

[User] # tar zxf restart src.v6b.tar.gz

[User] # cd jpeg-6b

[User] #./configure -- help // you can view its configuration options

(Compile on the local machine first, mainly because the configure file is designed incorrectly. You must first compile a dummy with GCC. c file, and then compile it later. Otherwise, the libtool cannot be found)

[User] #./configure -- enable-shared -- enable-static

[User] # Make

[User] # Make clean

After the local machine passes normal compilation, [user] # Make clean is cleared, and then cross-compilation is executed.

Generally

[CDP @ cdpserver jpeg-6b] $. /configure -- prefix =/usr/local/ARM/3.4.1/ARM-Linux/-- Host = arm-Linux -- enable-shared -- enable-static -- Host = arm-Linux

To specify the cross-compilation option, but it does not recognize it here, so use another method, as shown below:

[User] #./configure -- prefix =/usr/local/ARM/3.4.1/ARM-Linux/CC = arm-Linux-GCC -- enable-shared -- enable-static

[User] # Make

Create a directory in arm-Linux before installation. Otherwise, an error occurs during installation.

[Root] # mkdir-P/usr/local/ARM/3.4.1/ARM-Linux/man/Man1

[Root] # make install // OK

Similarly, check whether the installation is successful :)

Next, you can compile libminigui.

(4) install the popt Library
Popt is required for the Notepad program in PDA. Refer to the steps for porting minigui1.3.3:
This library must be used when compiling the MDE program, otherwise the compilation will fail :)

Http://gd.tuwien.ac.at/utils/rpm.org/dist/rpm-4.1.x/popt-1.7.tar.gz I downloaded from here

[User] # tar zxf popt-1.7.tar.gz
[User] # cd popt-1.7
[User] #./configure -- prefix =/usr/local/ARM/3.4.1/ARM-Linux/-- Host = arm-Linux -- enable-shared -- enable-static
[User] # Make
[Root] # make install

Everything went well.
The cross-compilation environment has been set!

(5)compile and install libminigui-1.6.10.tar.gz

Description: source code of the MiniGUI function library.

[Root @ localhost minigui-res-1.6.10] # cd/MiniGUI/compressed

[Root @ localhost compressed] # tar xzvf libminigui-1.6.10.tar.gz-C ../source

[Root @ localhost compressed] # CD ../source/libminigui-1.6.10

[Root @ localhost libminigui-1.6.10] #. /configure -- prefix =/home/-- Host = arm-Linux -- target = arm-Linux -- Build = i386-linux cc = arm-Linux-GCC -- With-osname = Linux --- style = classic -- With-targetname = fbcon -- enable-autoial -- enable-rbf16 -- disable-vbfsupport

[Root @ localhost libminigui-1.6.10] # Make

[Root @ localhost libminigui-1.6.10] # make install

Copy all the library files under the/home/lib directory (Note: -- prefix =/home/) to the/lib directory on the Development Board, and set MiniGUI under/home/etc. copy CFG to the/etc directory on the Development Board.

Note: -- disable-vbfsupport must pay attention to this option. Otherwise, when running the sample program on the Development Board, the system prompts that VaR bitmap font cannot be found, in fact, there is no var bitmap font library in the/usr/local/lib/MiniGUI/RES/font directory on the development board. I have not studied how to support it. You can use./configure-h to view other options and control the corresponding functions based on your Development Board and project requirements.

(6) Compile mg-samples-str-1.6.10.tar.gz

Same principle:

Extract

[……] #./Configure-host = arm-Linux

[……] # Make

Copy the generated Executable File helloworld to the/usr/local/sbin directory on the Development Board.

(7) Configuration

First, create the lD. So. conf file in the/etc directory of the Development Board and add the following content:

/Usr/local/lib

/Usr/lib

/Lib # actually add the library file directory. The purpose is to find the corresponding library file when running the PDA. The other two library directories are optional. I added it, it is for system expansion.

Second: Modify the/etc/MiniGUI. cfg file on the Development Board.

Open it in the editor and change the following content:

[System]

# Gal engine and default options

Gal_engine = fbcon

# Ial Engine

Ial_engine = cosole

Mdev =/dev/input/Mice

Mtype = imsp2

[Fbcon]

Defaultmode = 240x320-16bpp # My LCD display is a portrait screen of X pixels.

If it is inconsistent with the above content, compare it with your own Development Board and modify it.

Third:

Add the following content to the/etc/init. d/RCS script file:

/Bin/ln-S/dev/VC/0/dev/tty0

If this parameter is not added, the following error occurs: newgal> fbcon: Can ''' t open/dev/tty0: no such file or directory

Newgal: Set video mode failure.

Initgui: Can not initialize graphics engine!

Note: Associate fbcon with your frambuffer device.

4. Test

Run the following command to cross-compile your own PDA on the Super Terminal:

[……] #/Usr/local/sbin/PDA

Or

Add the following content to the/etc/init. d/RCS script file:

/Usr/local/sbin/PDA &

Haha, the MiniGUI PDA is running, and it feels superb. After successful transplantation, MiniGUI's open source is really good. I have learned a lot about it, supporting MiniGUI and flying!

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.