999精品在线视频,手机成人午夜在线视频,久久不卡国产精品无码,中日无码在线观看,成人av手机在线观看,日韩精品亚洲一区中文字幕,亚洲av无码人妻,四虎国产在线观看 ?

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

2008-04-12 00:00:00SUNQianFANYanbinLANShunguo
現代電子技術 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,FBIOCET_FSCREENINFO,fb_fix_info);

ioctl(fb,FBIOGET_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.

參 考 文 獻[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.

主站蜘蛛池模板: 在线国产毛片| 亚洲欧美另类专区| 亚洲欧美不卡| 婷婷99视频精品全部在线观看| 色哟哟国产成人精品| 亚洲久悠悠色悠在线播放| 亚洲天堂免费观看| 久久久精品无码一二三区| 国产swag在线观看| 亚洲资源在线视频| 激情在线网| 91精品国产无线乱码在线| 色网站在线视频| 毛片网站观看| www.av男人.com| 91九色国产在线| 亚洲视频欧美不卡| 秘书高跟黑色丝袜国产91在线| 久热re国产手机在线观看| 国产尤物视频在线| 国产精品综合久久久| 毛片基地视频| 亚洲国产精品久久久久秋霞影院| 一区二区三区国产精品视频| 中文字幕丝袜一区二区| 国产精品视频导航| 免费看黄片一区二区三区| 国产理论精品| 麻豆国产精品一二三在线观看| 免费Aⅴ片在线观看蜜芽Tⅴ| 免费精品一区二区h| 无码综合天天久久综合网| 国产成人无码AV在线播放动漫| 男人的天堂久久精品激情| 福利在线不卡一区| v天堂中文在线| 亚洲天堂精品在线观看| 日韩午夜福利在线观看| 国产女同自拍视频| 日本午夜精品一本在线观看| 国产第一页免费浮力影院| 亚洲国产欧洲精品路线久久| 亚洲婷婷六月| 日本伊人色综合网| 黄色一级视频欧美| 国产精品久久久久鬼色| 激情无码字幕综合| 国产又粗又爽视频| 精品精品国产高清A毛片| 久久婷婷色综合老司机| 亚洲三级成人| JIZZ亚洲国产| 亚洲国产清纯| 久久96热在精品国产高清| 精品国产成人高清在线| 国产美女91呻吟求| 99久久精品视香蕉蕉| 国产91透明丝袜美腿在线| a级毛片免费看| 亚洲欧美日韩综合二区三区| 狠狠色丁香婷婷| 992Tv视频国产精品| 国产一级视频久久| 亚洲av片在线免费观看| 国产99在线观看| 无码人中文字幕| 就去吻亚洲精品国产欧美| 国产精品手机在线观看你懂的| 天堂在线亚洲| 国产激情无码一区二区三区免费| 97视频在线观看免费视频| 成人国产精品网站在线看| 国产精品手机视频| 一级黄色欧美| 亚洲av无码人妻| 91视频青青草| 69精品在线观看| 久久无码av三级| 亚洲第一区在线| 男女男免费视频网站国产| 日本午夜网站| 中文字幕va|