亚洲免费av电影一区二区三区,日韩爱爱视频,51精品视频一区二区三区,91视频爱爱,日韩欧美在线播放视频,中文字幕少妇AV,亚洲电影中文字幕,久久久久亚洲av成人网址,久久综合视频网站,国产在线不卡免费播放

        ?

        Research and Porting of μC/GUI Based on μClinux

        2008-04-12 00:00:00SUNQianFANYanbinLANShunguo
        現(xiàn)代電子技術(shù) 2008年10期

        Abstract:As μC/GUI occupies small memory and consumes low power,it has a wide range of applications.But it is little used in μClinux,because of being not give full play to its features.By the analysis of μC/GUI architecture structure and working principle,it improves μC/GUI,based on its work in the Framebuffer mode,so that μC/GUI functions and features give full play in μClinux.So it provides a more lightweight embedded GUI software for μClinux.The result shows that the working efficiency of μC/GUI has been improved greatly by using this method,even more than MiniGUI.

        Keywords:μC/GUI;μCLinux;porting;GUI

        CLC:TP391 Document Code:A

        No:1004-373X(2008)10-009-04

        1 Introduction

        Embedded Linux are being widely used because of code to open,inexpensive,powerful and easy to transplant properties[1].μClinux may well represent the world′s first,most mature,and most commercially successful embedded Linux distribution.The results are smaller code,better performance,and lower cost,all of which is applicable to both MMU-less and MMU-enabled system[2].As development of embedded system′s GUI,more and more embedded GUI softwarescome forth.It is very meaningful that a choice of the most suitable μClinux′s GUI.As embedded its own characteristics,it needs to choose a lightweight embedded GUI system[3].

        μC/GUI is a lightweight embedded GUI system deve[CD*4]loped by Micrum Company[4].It is designed to provide an efficient,processor and LCD-controller independent graphical user interface to any application using a graphical LCD.It works in single as well as in multi-task environments.μC/GUI can be adapted to just about any size of physical or virtual display with an LCD controller and CPU.It can easily display text,curves,graphics as well as various objects such as window buttons,editbox,and slider with μC/GUI on the LCD.The effect of display is completely similar to the Windows′.It provides target machine simulator that can complete application development and debugging without the target systems,which makes the development of embedded GUI great convenience.Its low-power,simple and elegant designs are very suitable for high requirements of cost and power.

        2 μC/GUI Features and Structure

        2.1 μC/GUI Features

        (1) Strong Portability

        All of μC/GUI code are written by C language,and it can be easily ported into various CPU.

        (2) Less Consumption of the System Resources

        μC/GUI takes up little RAM and ROM.Most of target machine,μC/GUI needs resources[5] as shown in Table 1.

        Note:small system: no window management;large-scale systems including window management and control;the use of RAM in large systems rely on the number of applied windows;the use of ROM rely on the use of selected μC/GUI function and modules;the use ofROM do not consider the use offonts.

        As μC/GUI these two features,along with its open source,it is suitable for embedded system GUI application development.

        2.2μC/GUI Structure

        We have seen the embryo of software architecture through the directory structure μC/GUI(Figure 1).It details in displaying the μC/GUI Software Architecture[6].μC/GUI library provides GUI interface for user program.μC/GUI library can be configured by GUIConf.H file.To configure GUIConf.h file,known as the high-level configuration,which completes the clipping of the μC/GUI functions.

        In the development application procedures,it may be based on the actual situation to select these directories.If you wish to further reduce the size of program,we can clip each directory which makes retain the header and source in the procedures when compiling and linking.

        Whatever the development platform is,μC/GUI development is based on the standard C language.It achieves the core operation of μC/GUI that calling standard C language format API function.From μC/GUI architecture,the functions of API is platform-independent.This paper is based on the ARM7 development board S3C44B0X and port μC/GUI to μClinux.It has been taken in the development method of host and target board.

        3 μC/GUI Transplant μClinux

        Currently,popular embedded graphics software have MiniGUI,Microwindows,and so on.These are based on Framebuffer,which is considered when they design at the beginning,in the μClinux developping graphical interface,so that they can be easily ported to μClinux.For μC/GUI,although it can be directly ported to μClinux,its original performance cann′t get full play.

        In μClinux,the development of a graphical interface based on the Framebuffer.As Framebuffer is the graphics hardware abstraction,the user interface can easily access graphics hardware.Users regard Framebuffer as a memory,which can be read or written.Therefore,the contents of a frame directly write into this memory.After several experiments for directly transplanting μC/GUI,the process of displaying graphics allocates a certain space in the memory and then the operating system through interrupting put the contents of this memory into the display memory to complete graphical display.It is very similar to the process that based on the Framebuffer.But it occupies more time of CPU and makes the utilization of CPU lower.When interrupted,it calls Framebuffer interface to complete the show,which occupies the larger memory and slows down the speed of display.And μC/GUI with keyboard and touch-screen communication is not stable and lower efficient.

        Based on the above analysis and the characteristics of μClinux application development[7],μC/GUI needs to be changed to enable get full μC/GUI features.

        3.1 Addition of Device Drivers

        There has two parts relating to the device driver: the driver of porting μClinux to board and the driver of porting μC/GUI to μClinux.According to the specification of development board,the first part adds driver,such as LCD driver,keyboard driver,touch screen driver[8].Data structures about the Framebuffer equipment,keyboard equipment,and touch-screen equipment are modified in the source code of μClinux.The second is the important part of transplantation and which can improve the efficiency of μC/GUI.

        In order to maintain the integrity of the original code and compatibility,LCDfb.c,LCDfb.h,kdb.c,touch.c,device.h,kdb.h and touch.h are added under the directory LCDDriver.All the functions of files are as following: 

        (1)LCDfb.c completion of the initialization framebuffer,provide interface for the underlying graphics library;

        (2)kbd.c,touch.c achieve a keyboard and touch-screen equipment open and close;

        (3)kdb.h,touch.h,LCDfb.h state structure of the data.

        As Framebuffer work in the terminal,it is necessary to shield the input terminal to access to graphics mode.It can be completed by the following code:

        int try=open(ttyname,O_RAWR);

        ioctl(tty,KDSETMODE,KD_GRAPHICS);

        close(try);

        Next step: open fb equipment,and read fb_fix_screeninfo fb_var_screeninfo structure and gain the properties of the fb equipment to provide essential parameters for below mapping display memory:

        fb=open(\"/dve/fb0\",O_RDWR);

        ioctl(fb,F(xiàn)BIOCET_FSCREENINFO,fb_fix_info);

        ioctl(fb,F(xiàn)BIOGET_VSCREENINFO,fb_var_info);

        From fb_var_screeninfo and fb_fix_screeninfo,we get the information,such as starting address of display memory,resolution,and color depth.On the basis of these we calculate the size of display memory,then use the map () function to map display memory to the user space:

        size=(size+getpagesize()一1)/getpagesize()* getpagesize();

        addr=mmap(NULL,size,PROT_READ|PROT_WRITE,MAP_SHARED,fb,O);

        \"Addr\" is the initial memory address that it map display memory to the user space.These are realized in LCDfb.c.In addition to it,we need to amend LCD44b0.c under the directory LCDDriver.Main changes are as following:

        U32 *frameBuffer;

        frameBuffer =addr;

        ……

        void * malloc(unsigned nbyte) 

        {

        return addr;//addr that get in LCDfb.c 

        }

        ……

        Those changes make the μC/GUI work based on Framebuffer,thereby eliminate a lot of unnecessary procedures call,reduce the use of the memory,and improve the speed of show and the utilization of CPU.The monitor,keyboard and touch screen in Linux are as a character device[8].So kdb.c and touch.c are the same with LCDfb.c on aspects of implementation.They have open,close,GetModifierInfo and read operation.

        3.2 μC/GUI Library Generation

        As the environment ofμC/GUI develops in Windows system,we change to adapt for the Linux environment to compile.According to this method of transplantation,μC/GUI libraries are compiled in the form of static libraries.

        First we download μC/GUI source-μC/GUI3.9.RAR and decompression tools RAR for Linux-rarlinux-3.3.0.tar.gz,then decompresses rarlinux-3.3.0.tar.gz and installs RAR for Linux,and then use RAR to decompress μC/GUI3.9.RAR.To generate a library,we need to re-layout the directory,establish the new directory ucgui,in which set up scr,lib and include directory,and then put the various *.h files in the original μC/GUI3.9 directory into config.directory.The files under original GUI directory is put into src.In order to retain the Windows environment simulation under Linux development environment,we have retained the directory application.

        Makefile is generated by automake.Then,we execute make,make install to complete the installation of the library.We will see libgui.a in the directory lib.

        3.3 μC/GUI Transportation

        After the above two steps to resolve the main factors that impact μC/GUI efficiency,but the problem of inefficient communication between other peripherals and μC/GUI  have not been solved.The main reason for leading to inefficient communication is for the use of resources in critical resources,so that peripherals resources can only communicate with μC/GUI,if there are other procedures that use the peripheral resources at the same time,it has to wait,thus which affects the efficiency of communications and the utilization of resources.

        Multithreading is one of the most practical programming model [9],in which,the software engineers create multiple threads in procedures.Thread required in the system can concurrently execute after the background,which allows users to feel as if there are multiple processors running at the same time,so that it achieves very good results.Based on the characteristics of thread,every peripheral is as a separate thread,including application programming.This can raise the efficiency of communication,and more rationally use the system resources.

        Touchthread.c and kbdthread.c are added below src directory.They combine the interface that μCLinux provide API interface with driver interface providedby μC/GUI to complete the communication between them.

        kbdthread.c main code

        ……

        while(1)

        {

        a=get_key();//driver interface provided by μCLinux in the file of kdb.c

        ……

        GUI_StoreKey(a);//μC/GUI provide driver interface

        GUI_SendKeyMsg(a,1);//μC/GUI provide driver interface

        }

        ……

        There are three threads,application threads,keyboard incident thread and touch screen incidents thread,in the main program through the above changes.If there are other peripherals,the addition of thread is the same with keyboard incident.This not only ported the μC/GUI to μ/CLinux but also established development environment under Linux,and achieved combination μC/GUI with μ/CLinux.

        4 Application Development

        Masktask.c is established in the Application direc-tory,which is similar with application development under VC++.Main code below:

        ……

        GUI_Init();//finish the Initialization of ucgui

        GUI_ExecDialogBox(_aDialogCreate,GUI_COUNTOF(_aDialogCreate),_cbCallback,0,0,0);

        // Create dialog objects,and to achieve a simple calculation of computing。

        In order to verify the simulation that remains in the Windows development environment,we put this code application directory to compile.The results are the same with in Linux system.

        Using simple way is to test the result of after improving μC/GUI and compare with MiniGUI and microwindows.The premise is the library as static.Let us complete the same program and compare in memory occupied and the using-time of the display and (Table 2).Through this table,it is clear that after improving μC/GUI,it shows that the efficiency is much more improved.These data,in some extent,show the advantages of μC/GUI.

        Note:occupied memory test is the test of the code and data segment.

        5 Conclusions

        Embedded μCLinux has already achieved a very good development under the impetus of the free software community and many developers.At the same time,the open source GUI is promoted by the developers.So far,there are already many embedded system developers using μC/GUI to develop of their embedded systems,and have developed a number of important applications.It describes in detail that μC/GUI is ported to μCLinux.Development environment is established based on μC/GUI graphical interface in the Linux environment,and can be simulated in Windows embedded linux-based GUI development.Therefore it simplifies the development process of embedded GUI and accelerated the development speed.

        參 考 文 獻(xiàn)[HJ*2]

        [1]Bollinger.Survey of Linux Applications[J].IEEE Software,1999,16(1):72-79.

        [2]Drabik,John.μClinux: World′s Most Popular Embedded Linux Distribution.http://www.linuxdevices.com/articles/AT3267251481.html.2002.

        [3]Wang Yunbo,Li Desheng,BaiLin,et al.Light-weight Embedded GUI System and Its Implementation [J].Computer Application,2006,26(9):2 244-2 249.

        [4] μC/GUI.http://www.ucgui.com.

        [5]Chen Qinwu,Zhang Quan,Zhou Linfeng.Transplant μC/GUI on ARM300-S[J].Computer Engineering and Design,2006,27(19):3 697-3 700.

        [6]He Yongtai,Liu Ruiming.The Introduction of Porting μC/GUI to ARM System[J].Development and Application of Computer,2006,12.

        [7]Zhang Dongwei,Mao Yuliang,Liu Weiping,et al.How to Porting μClinux to ColdFire 5272 Microprocessor and Developing User S Applications[J].Microcomputer Information,2003,19(10):48-50.

        [8]Lu Bao,Zhou Beibei,Li Jianming.μClinux Device Driver Development [J].Microcontrollers Embedded Systems,2003(1-6):464-466.

        [9]Wang Yongning,Zhao Shijie,Qi Changyuan.Realizing Multithread System On S3C2410[J].Computer Applications and Software,2007,24(4):99-127.

        作者簡介 Sun Qian,born in Zibo in 1982,graduate,primary research interests include research ofembedded operation system.

        一区二区丝袜美腿视频| 精品亚洲一区二区三区在线观看| 日韩好片一区二区在线看| 国产精品美女黄色av| 亚洲精品国产av成人网| 十八禁视频在线观看免费无码无遮挡骂过| 97久久人人超碰超碰窝窝| 国产精品无码片在线观看| 亚洲一区二区三区国产精品视频 | 黑人大荫道bbwbbb高潮潮喷| 美女一级毛片免费观看97| 国产视频一区二区三区免费| 日韩av无码社区一区二区三区| 久久夜色精品国产| 天天插视频| 久久精品国产精品亚洲艾| 国产情侣真实露脸在线| 欧美亚洲精品一区二区| 少妇特殊按摩高潮惨叫无码 | 久久99亚洲综合精品首页| 在线观看的a站免费完整版 | 不卡一区二区三区国产| 人妻无码一区二区不卡无码av| 伊人婷婷在线| 富婆叫鸭一区二区三区| 久久熟妇少妇亚洲精品| 亚洲男人第一无码av网站| 国产精品高潮av有码久久| 国内偷拍精品一区二区| 国产精久久一区二区三区| 亚洲欧美日韩精品高清| 精品国产乱来一区二区三区| 蜜桃av在线免费网站| 青青草原综合久久大伊人| 亚洲中文无码精品久久不卡| 亚洲日本中文字幕乱码在线| 国产又色又爽又黄刺激在线视频| 成人国产精品一区二区网站| 精品国产一区二区三区九一色| 亚洲av中文无码乱人伦在线咪咕| 老太脱裤让老头玩ⅹxxxx|