999精品在线视频,手机成人午夜在线视频,久久不卡国产精品无码,中日无码在线观看,成人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.

主站蜘蛛池模板: 九九九精品视频| 92午夜福利影院一区二区三区| 国产在线观看一区精品| 日韩成人在线网站| 看国产毛片| 午夜a视频| 在线va视频| 免费在线播放毛片| 欧美区一区| 亚洲美女一级毛片| 午夜高清国产拍精品| 爆操波多野结衣| 亚洲aⅴ天堂| 无码人中文字幕| 四虎在线高清无码| 国产精品视频白浆免费视频| 9cao视频精品| 国产精品无码AⅤ在线观看播放| 波多野结衣一区二区三区四区视频| 9丨情侣偷在线精品国产| 久久无码高潮喷水| 国产在线无码一区二区三区| 91无码视频在线观看| 99久久精品久久久久久婷婷| 久久久久久久久18禁秘| 在线欧美a| 国产精品太粉嫩高中在线观看| 天堂av综合网| 91无码人妻精品一区二区蜜桃| 欧美黄网站免费观看| 精品无码国产自产野外拍在线| 亚洲欧美不卡视频| 日本亚洲欧美在线| 青青草国产一区二区三区| 亚洲一区免费看| 国产精品无码制服丝袜| 日日拍夜夜操| 丁香婷婷激情网| 国产婬乱a一级毛片多女| 国产一级视频在线观看网站| 99视频免费观看| 韩日无码在线不卡| 三区在线视频| 日韩国产亚洲一区二区在线观看| 亚洲欧美在线综合一区二区三区| 国产精品欧美日本韩免费一区二区三区不卡 | h视频在线播放| 国产亚洲欧美在线中文bt天堂 | 日韩色图区| 久久国语对白| 中文字幕中文字字幕码一二区| 永久成人无码激情视频免费| 凹凸精品免费精品视频| 国产99热| 99久久免费精品特色大片| 色妞www精品视频一级下载| 欧美激情视频一区二区三区免费| 无码精品国产VA在线观看DVD| 国产亚洲精品资源在线26u| 欧美一级爱操视频| 在线免费观看AV| 99精品国产电影| 999国内精品视频免费| 蜜臀AV在线播放| 狠狠色噜噜狠狠狠狠色综合久| 熟女视频91| 999国产精品| 亚洲成人黄色在线观看| 国产一级毛片yw| 国产精品无码作爱| 婷婷午夜影院| 欧美福利在线播放| 国产欧美日韩91| 色哟哟国产成人精品| 中文字幕首页系列人妻| 亚洲无线国产观看| 91九色国产porny| 亚洲天堂网站在线| aaa国产一级毛片| 日韩无码一二三区| 8090成人午夜精品| 亚瑟天堂久久一区二区影院|