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.

  1. What is MiniGUI?
  2. 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

  3. The advantages of MiniGUI on uClinux
    • Lightweight and need very little memory
    • 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.

    • More effective
    • 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.

    • Most stable
    • 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.

    • Be able to configure
    • 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.

  4. 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.
    • We optimized MiniGUI-1.3 for uClinux. It can run fast and stably on uClinux.

Installing uClinux and Xcopilot emulator

  1. First, Install elf tools. Visit: http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ to get elf tools and more information.
  2. Change your directory to <uClinux-path>/uClibc, and run
  3.             $make menuconfig
    

    and select General Library Setting, and selectd POSIX Threading support.

  4. Change directory to <uClinux-path>, and run
  5.             $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

  1. Uncompress libminigui-1.3.0.tar.gz:
  2.             $ tar xzvf libninigui-1.3.0.tar.gz
    
  3. Enter directory libminigui-1.3.0/, and run ./buildlib-m68k-elf:
  4.             $ ./buildlib-m68k-elf
    
  5. Compile and install MiniGUI:
  6.             $ 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

  1. Copy MiniGUI-Demo(mde) to <uClinux-path>/user:
  2.             $ cp -r <minigui-sample directory> <uClinux-path>/user
    
  3. Enter your copyed directory, and refer to the 'Makefile' of applications in user directory, create a 'Makefile', just like:
  4.             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
    
  5. Copy resources of your application to <uClinux-path>/romfs/bin
  6.             $ cp -r res <uClinux-path>/romfs/bin
    
  7. Enter your uClinux directory, and run make:
  8.             $ cd <uClinux-path>
                $ make
    

    After did all above steps, you can see your binary application in <uClinux-path>/romfs/bin directory.

Running MiniGUI-Demo

  1. Start Xcopilot emulator
  2.             $./xcopilot -ramsize 4096
    
  3. Enter /bin directory:
  4.             $cd bin
    
  5. Run MiniGUI-Demo
  6. You can see result in xcopilot LCD.

    Enjoying it ^o^