Running MiniGUI on uClinux
by Lu Gaofeng
Introduction
MiniGUI is a GPLed free software project, led and maitained by Feynman Software (Beijing Feynman Software Technology Co., Ltd.).
It aims to provide a fast, stable, and lightweight Graphics User Interface support system, which is especially fit for real-time embedded systems based-on Linux.
- What is MiniGUI?
- The advantages of MiniGUI on uClinux
- Lightweight and need very little memory
- More effective
- Most stable
- Be able to configure
- The optimizations of MiniGUI-1.3 for uClinux
- You can compile the resources (bitmaps, icons, and fonts) into the library (libminigui), and there is no need to read the resource configuration information from MiniGUI.cfg.
- You can compile MiniGUI for static library, then you can run your applications base on MiniGUI library on uClinux without install MiniGUI.
MiniGUI is a Graphics User Interface support system which runs on Linux or other UNIX-like system. It defines a set of light windowing and GDI (Grahpics Device Interface) APIs for applications. By using them, an application can create multiple windows and/or controls, and can draw in these windows/controls without interfering the others.
MiniGUI is composed of three libiraries: libminigui (source is in src/), libmgext (ext/), and libvcongui (vcongui/). Libminigui is the core library, which provides windowing and graphics interfaces as well as standard controls. Libmgext is an extension library of libminigui and provides some useful controls and convenient user interface functions, such as `Open File Dialog Box'. Libvcongui provides a virtual console window in which you can run programs in character mode.
You can configure and compile MiniGUI as one of three run-time modes:
* `MiniGUI-Threads': A program running on MiniGUI-Threads can create
multiple cascaded windows in different threads, and all the windows
belong to a single process. MiniGUI-Threads is fit for some real-time
systems with simple functionality.
* `MiniGUI-Lite': A program running on MiniGUI-Lite is an independent
process, which can also create multiple windows. MiniGUI-Lite is fit for
some complex embedded systems, such as PDAs, Thin-Clients or STBs.
* `MiniGUI-Standalone': A single process version of MiniGUI.
Currently, the latest stable version of MiniGUI is version 1.3.0. You can find latest information about MiniGUI and download the source from http://www.minigui.com
MiniGUI aims to provide a fast, stable, and lightweight Graphics User Interface. MiniGUI can run on the system what has only 30 Mhz main-frequency CPU and 4M RAM. it is impossible for microwindows to do it.
The application base on MiniGUI can boot and interact with user fast, because the structure of MiniGUI is very different from normally, and we optimized graphic engine.
Since 1999 we have released the first version of MiniGUI, The fact that MiniGUI be used in a lot of products and projects proved MiniGUI is very stable.
You can configure MiniGUI for your projects, just configure a version only suitable for your system. it is very smart and not waste your memory.
We optimized MiniGUI-1.3 for uClinux. It can run fast and stably on uClinux.
Installing uClinux and Xcopilot emulator
- First, Install elf tools. Visit: http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ to get elf tools and more information.
- Change your directory to <uClinux-path>/uClibc, and run
- Change directory to <uClinux-path>, and run
$make menuconfig
and select General Library Setting, and selectd POSIX Threading support.
$make menuconfig
$make dep
$make
About how to install uClinux and xcopilot emulator, please visit: http://www.snapgear.com/tb20020807.html for more information.
Configure and compile MiniGUI for uClinux
- Uncompress libminigui-1.3.0.tar.gz:
- Enter directory libminigui-1.3.0/, and run ./buildlib-m68k-elf:
- Compile and install MiniGUI:
$ tar xzvf libninigui-1.3.0.tar.gz
$ ./buildlib-m68k-elf
$ make; su -c 'make install'
By default, MiniGUI library will be installed to /opt/uClinux/uClinux-dist/minigui/m68k-elf/.
Compile MiniGUI-Demo on uClinux
- Copy MiniGUI-Demo(mde) to <uClinux-path>/user:
- Enter your copyed directory, and refer to the 'Makefile' of applications in user directory, create a 'Makefile', just like:
- Copy resources of your application to <uClinux-path>/romfs/bin
- Enter your uClinux directory, and run make:
$ cp -r <minigui-sample directory> <uClinux-path>/user
CFLAGS+= -I/opt/uClinux/uClinux-dist/minigui/m68k-elf/include
LDFLAGS+= -L/opt/uClinux/uClinux-dist/minigui/m68k-elf/lib
EXEC = bomb
OBJS = bomb.o
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) -lminigui -lmgext $(LIBPTHREAD) $(LIBM) $(LDLIBS)
romfs:
$(ROMFSINST) /bin/$(EXEC)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
$ cp -r res <uClinux-path>/romfs/bin
$ cd <uClinux-path>
$ make
After did all above steps, you can see your binary application in <uClinux-path>/romfs/bin directory.
Running MiniGUI-Demo
- Start Xcopilot emulator
- Enter /bin directory:
- Run MiniGUI-Demo
$./xcopilot -ramsize 4096
$cd bin
You can see result in xcopilot LCD.
Enjoying it ^o^