




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
MiniGUI移植总结/2007-12-18 网络点击: 1026 评论 需准备的软件包:libminigui-1.6.x-linux.tar.gz /开发库minigui-res-1.6.tar.gz /资源文件,如bmp,font,icon 等minigui-dev-1.6.2-for-win32 /用于在windows VC开发的程序包下载地址:参考文献:1 Hily Jiang. MiniGUI源码走读.2 uClinux下显示驱动移植及minigui的移植感谢:qq群.嵌入式技术交流02.小鹤1 开启uClinux的FrameBuffer支持1.1 修改/uClinux-dist/vendors/Samsung/44B0/config.linux-2.4.x确定 CONFIG_VT=y /VT 应该是Virtual Terminal1.2 修改/uClinux-dist/linux-2.4.x/drivers/video/s3c44b0xfb.c默认情况下是支持16灰度屏的,如果是256色屏,则需要将#define LCD_GRAY_16 注释掉。1.3 增加fb0设备修改vendors/Samsung/44B0/Makefile1.4 驱动确定linux-2.4.x/drivers/video/Config.inif $CONFIG_CPU_S3C44B0X = y ; then tristate Samsung S3C44B0X built-in LCD controller frame buffer support CONFIG_FB_S3C44B0Xfilinux-2.4.x/drivers/video/Makefileobj-$(CONFIG_FB_S3C44B0X) +=s3c44b0xfb.olinux-2.4.x/drivers/video/fbmem.cextern int s3c44b0xfb_init(void);extern int s3c44b0xfb_setup(void);#ifdef CONFIG_FB_S3C44B0X “s3c44b0xfb”,s3c440xfb_init,s3c44b0xfb_setup,#endifDEVICES = fb0,c,29,01.5 编译uClinux对FrameBuffer部分配置的选择/* Console drivers*VGA text console (CONFIG_VGA_CONSOLE) N/y/? (NEW) nSupport Frame buffer devices (CONFIG_FB) N/y/? (NEW) y* Frame-buffer support*Support for frame buffer devices (EXPERIMENTAL) (CONFIG_FB) Y/n/?Acorn VIDC support (CONFIG_FB_ACORN) N/y/? (NEW) n CLPS711X LCD support (CONFIG_FB_CLPS711X) N/y/? (NEW) n Cyber2000 support (CONFIG_FB_CYBER2000) N/y/? (NEW) n SA-1100 LCD support (CONFIG_FB_SA1100) N/y/? (NEW) n Advanced low level driver options (CONFIG_FBCON_ADVANCED) N/y/? (NEW) y Monochrome support (CONFIG_FBCON_MFB) N/y/? (NEW) n 2 bpp packed pixels support (CONFIG_FBCON_CFB2) N/y/? (NEW) n 4 bpp packed pixels support (CONFIG_FBCON_CFB4) N/y/? (NEW) n 8 bpp packed pixels support (CONFIG_FBCON_CFB8) N/y/? (NEW) y 16 bpp packed pixels support (CONFIG_FBCON_CFB16) N/y/? (NEW) n 24 bpp packed pixels support (CONFIG_FBCON_CFB24) N/y/? (NEW) n 32 bpp packed pixels support (CONFIG_FBCON_CFB32) N/y/? (NEW) n Amiga bitplanes support (CONFIG_FBCON_AFB) N/y/? (NEW) n Amiga interleaved bitplanes support (CONFIG_FBCON_ILBM) N/y/? (NEW) n Atari interleaved bitplanes (2 planes) support (CONFIG_FBCON_IPLAN2P2) N/y/? (NEW) n Atari interleaved bitplanes (4 planes) support (CONFIG_FBCON_IPLAN2P4) N/y/? (NEW) n Atari interleaved bitplanes (8 planes) support (CONFIG_FBCON_IPLAN2P8) N/y/? (NEW) n Amiga bitplanes support (CONFIG_FBCON_AFB) N/y/? (NEW) n Amiga interleaved bitplanes support (CONFIG_FBCON_ILBM) N/y/? (NEW) n Atari interleaved bitplanes (2 planes) support (CONFIG_FBCON_IPLAN2P2) N/y/? (NEW) n Atari interleaved bitplanes (4 planes) support (CONFIG_FBCON_IPLAN2P4) N/y/? (NEW) nAtari interleaved bitplanes (8 planes) support (CONFIG_FBCON_IPLAN2P8) N/y/? (NEW) n Mac variable bpp packed pixels support (CONFIG_FBCON_MAC) N/y/? (NEW) n VGA 16-color planar support (CONFIG_FBCON_VGA_PLANES) N/y/? (NEW) n VGA characters/attributes support (CONFIG_FBCON_VGA) N/y/? (NEW) n HGA monochrome support (EXPERIMENTAL) (CONFIG_FBCON_HGA) N/y/? (NEW) n Support only 8 pixels wide fonts (CONFIG_FBCON_FONTWIDTH8_ONLY) N/y/? (NEW) n Select compiled-in fonts (CONFIG_FBCON_FONTS) N/y/? (NEW) y VGA 8x8 font (CONFIG_FONT_8x8) N/y/? (NEW) y VGA 8x16 font (CONFIG_FONT_8x16) N/y/? (NEW) y Sparc console 8x16 font (CONFIG_FONT_SUN8x16) N/y/? (NEW) n Pearl (old m68k) console 8x8 font (CONFIG_FONT_PEARL_8x8) N/y/? (NEW) n Acorn console 8x8 font (CONFIG_FONT_ACORN_8x8) N/y/? (NEW) nVirtual terminal (CONFIG_VT) Y/n/? Support for console on virtual terminal (CONFIG_VT_CONSOLE) N/y/? (NEW) n*/因为LCD是256色的,所以选择下项8 bpp packed pixels support (CONFIG_FBCON_CFB8) N/y/? (NEW) y如果下载内核后进不去系统,则Virtual Terminal 不选,如果进去后fb0不能用,则要选,因为不选的话会屏蔽Support Frame buffer devices (CONFIG_FB) N/y/? (NEW) y的设置,Virtual Terminal 意思是超级终端显示的数据在LCD上显示,同时超级终端也显示。1.6 测试/dev/fb01)测度程序 test1.c测试/dev/fb0 有没存在,以及其属性/*#include #include #include #include #include #include #include int main () int fp=0;struct fb_var_screeninfo vinfo;struct fb_fix_screeninfo finfo;fp = open (/dev/fb0,O_RDWR);if (fp 0)printf(Error : Can not open framebuffer devicen);return 0;if (ioctl(fp,FBIOGET_FSCREENINFO,&finfo)printf(Error reading fixed informationn);return 0;if (ioctl(fp,FBIOGET_VSCREENINFO,&vinfo)printf(Error reading variable informationn);return 0;printf(The mem is :%dn,finfo.smem_len);printf(The line_length is :%dn,finfo.line_length);printf(The xres is :%dn,vinfo.xres);printf(The yres is :%dn,vinfo.yres);printf(bits_per_pixel is :%dn,vinfo.bits_per_pixel);close (fp);return 0;*/2) 测试程序test2.c在LCD上显示一张图片/*#include #include #include #include #include #include const unsigned char gImage_bmp76560=/该数组可能过Image2LCD软件生成,该软件可在找到int main()int framebuffer_device;int line_size,buffer_size,i;char *screen_memory;struct fb_var_screeninfo var_info;struct fb_fix_screeninfo fix_info; framebuffer_device=open(/dev/fb0,O_RDWR);ioctl(framebuffer_device,FBIOGET_VSCREENINFO,&var_info);ioctl(framebuffer_device,FBIOGET_FSCREENINFO,&fix_info);line_size=var_info.xres*var_info.bits_per_pixel/8;buffer_size=line_size*var_info.yres;var_info.xoffset=0;var_info.yoffset=0;screen_memory=(char*)mmap(0,buffer_size,PROT_READ|PROT_WRITE,0,framebuffer_device,0);for(i=0;ibuffer_size;i+) *(screen_memory+i)=gImage_bmpi;sleep(2);return 0;*/3) 将程序编译进内核uClinux-dist/romfs/ 里的文件是最终生成的内核文件,也是开发板上系统能看到的文件,要将文件编译进内核,只需把文件放到这里就行,然后make arm-elf-gcc elf2flt o test1 test1.carm-elf-gcc elf2flt o test2 test.c将test1 test2 放到uClinux-dist/romfs/usr/里Make 两次,我发现make一次没装进去。内核编译后下载进开发板,进入系统,运行程序就可测出/dev/fb0有没存在,FrameBuffer有没配置成功。2 minigui移植2.1 安装库和资源1)解压minigui-res-1.6.tar.gz,设置config.linux文件,将编译器设置为arm-elf-gcc。并将安装路径设置为arm-elf-gcc所在的目录。tar zxvf minigui-res-1.6.tar.gz修改config.linuxprefix = $(TOPDIR)/usr/local/CC = arm-elf-gcc然后Make install安装到/usr/local/lib/minigui/res该res 是MiniGUI.cfg 里面资源引用的位置,也是进行移植的资源。prefix = $(TOPDIR)/usr/local/arm-elfCC = arm-elf-gcc然后Make install安装到/usr/local/arm-elf/lib/minigui/res编译器库里的资源2)解压libminigui-1.6.x-linux.tar.gz,修改编译参数tar zxvf libminigui-1.6.x-linux.tar.gz修改libminigui-1.6.2-linux/scripts/mkconfigif check_value CONFIG_COMPILER_ARM_ELF; then # CFLAGS=$CFLAGS -D_PIC_ -fpic -msingle-pic-base CFLAGS=$CFLAGS -D_PIC_ -fno-pic -fno-PICFi不然在开发板运行程序时会出现如下错误码:Unhandled fault:external abort on linefetch (F4) at 0x00000001Fault-common.c(97):start_code=0xc2b9ca0,start_stack=0xc63ff98)Pid 28:failed 73)配置编译环境make menuconfig System wid option选择Clipboard supportUnit of timer is 10msMouse button can do double click Gal engine option选择GAL and its engines:NEWGALInclude Advanced 2D Graphics APIsNEWGAL dummy engineNEWGAL engine on Linux FrameBuffer consoleHave console onIAL engine options选择Dummy IAL engineFont options选择Raw bitmap fontImage option选择GIF file supportAppearance options选择FlatExt library options选择TreeView controlListView controlMonthCalendor controlSpinBox controlCoolBar controlAnimation controlIconView controlGrid controlDevelopment environment optionsThe target operating system:uClinuxCompiler:arm-elf-gccLibc:uClibcuClinux-dist directory:/opt/uClinux-dist /uClinux-dist 的位置Path prefix:/usr/local/arm-elf/arm-elf-gcc 的位置CFLAGS和LDFLAGS I 不填。Tarball baler optionsmtype=nonefbcondefaultmode=320x240-8bppqvfbdefaultmode=320x240-8bppdisplay=0# The first system font must be a logical font using RBF device font.systemfontfont_number=1font0=rbf-fixed-rrncnn-8-16-ISO8859-1#font1=*-fixed-rrncnn-*-16-GB2312#font2=*-Courier-rrncnn-*-16-GB2312#font3=*-Times-rrncnn-*-16-GB2312#font4=*-Helvetica-rrncnn-*-16-GB2312default=0wchar_def=0fixed=0caption=0menu=0control=0rawbitmapfontsfont_number=1name0=rbf-fixed-rrncnn-8-16-ISO8859-1fontfile0=/usr/res/font/8x16-iso8859-1.bin#name1=rbf-fixed-rrncnn-16-16-GB2312.1980-0#fontfile1=/usr/res/font/song-16-gb2312.binvarbitmapfontsfont_number=0name0=vbf-Courier-rrncnn-10-15-ISO8859-1fontfile0=/usr/res/font/Courier-rr-10-15.vbfname1=vbf-Helvetica-rrncnn-15-16-ISO8859-1fontfile1=/usr/res/font/Helvetica-rr-15-16.vbfname2=vbf-Times-rrncnn-13-15-ISO8859-1fontfile2=/usr/res/font/Times-rr-13-15.vbfmousedblclicktime=300eventtimeoutusec=300000repeatusec=50000cursorinfo# Edit following line to specify cursor files pathcursorpath=/usr/res/cursor/cursornumber=4cursor0=d_arrow.curcursor1=d_beam.curcursor2=d_pencil.curcursor3=d_cross.curiconinfo# Edit following line to specify icon files pathiconpath=/usr/res/icon/# Note that max number defined in source code is 5.iconnumber=5icon0=form.icoicon1=w95mbx01.icoicon2=w95mbx02.icoicon3=w95mbx03.icoicon4=w95mbx04.icobitmapinfo# Edit following line to specify bitmap files pathbitmappath=/usr/res/bmp/# Note that max number defined in source code is 7bitmapnumber=2bitmap0=capbtns.bmp# bitmap1=arrows.bmp# use large bitmap if your default font is 16 pixel height.bitmap1=arrows16.bmpbitmap2=nonebitmap3=nonebitmap4=nonebitmap5=none# background picture, use your favirate photobitmap6=none# bitmap used by BUTTON controlbutton=button.bmppushbutton=nonepushedbutton=none# bitmap used by LISTBOX controlcheckmark=checkmark.bmp# bitmap used by COMBOBOX controldownarrow=downarrow.bmpupdownarrow=updownarrow.bmpleftrightarrow=leftrightarrow.bmp# bitmap used by IME windowIMEctrlbtn=shurufa.bmp# bitmap used by About dialog boxlogo=MiniGUI256.bmp# logo=MiniGUI16.bmpbgpictureposition=center# position=upleft# position=downleft# position=upright# position=downright# position=upcenter# position=downcenter# position=vcenterleft# position=vcenterright# position=nonemainwinmetricsminwidth=50minheight=50border=2thickframe=2thinframe=1captiony=+4iconx=16icony=16menubary=+0menubaroffx=8menubaroffy=5menuitemy=+0intermenuitemx=12intermenuitemy=2menuitemoffx=18menutopmargin=4menubottommargin=4menuleftmargin=4menurightmargin=4menuitemminx=64menuseparatory=4menuseparatorx=4sb_height=14sb_width=16sb_interx=2cxvscroll=16cyvscroll=16cxhscroll=16cyhscroll=16minbarlen=9defbarlen=18windowelementcolorsbkc_caption_normal=0x00808080fgc_caption_normal=0x00C0C0C0bkc_caption_actived=0x00800000fgc_caption_actived=0x00FFFFFFbkc_caption_disabled=0x00808080fgc_caption_disabled=0x00C0C0C0wec_frame_normal=0x00000000wec_frame_actived=0x00FF0000wec_frame_disabled=0x00000000bkc_menubar_normal=0x00C0C0C0fgc_menubar, _normal=0x00000000bkc_menubar_hilite=0x00800000fgc_menubar_hilite=0x00FFFFFFfgc_menubar_disabled=0x00808080bkc_menuitem_normal=0x00C0C0C0fgc_menuitem_normal=0x00000000bkc_menuitem_hilite=0x00800000fgc_menuitem_hilite=0x00FFFFFFfgc_menuitem_disabled=0x00808080bkc_pppmenutitle=0x00C0C0C0fgc_pppmenutitle=0x00FF0000fgc_menuitem_frame=0x00C66931wec_3dbox_normal=0x00C0C0C0wec_3dbox_reverse=0x00000000wec_3dbox_light=0x00FFFFFFwec_3dbox_dark=0x00808080wec_flat_border=0x00808080bkc_control_def=0x00C0C0C0fgc_control_normal=0x00000000fgc_control_disabled=0x00C0C0C0bkc_hilight_normal=0x00FF0000bkc_hilight_lostfocus=0x00BDA69Cfgc_hilight_normal=0x00FFFFFFfgc_hilight_disabled=0x00C0C0C0bkc_desktop=0x00FF0000bkc_dialog=0x00C0C0C0bkc_tip=0x00C8FCF8imeinfoimetabpath=/usr/res/imetab/imenumber=0ime0=pinyinappinfoapprespath=/usr/local/lib/shared/miniguiapps/*/2) 资源包 resres/ 放在/usr/ 下。RESBMP 包含位图文件CURSOR包含光标文件FONT 包含字体文件ICON包含图标文件IMETAB包含输入法文件FONT/ 里只放8x16-iso8859-1.bin文件,由于字体只有一种,所以下面都选0.default=0wchar_def=0fixed=0caption=0menu=0control=0资源文件不要配置得太多,如果DRAM不够,而配置资源多的话,会出现如下错误:Allocation of length 1259251 from process 16 failedBuffer memory: 356kBCache memory: 344kBFree pages: 2384kB ( 0kB HighMem)Zone:DMA freepages: 0kBZone:Normal freepages: 2384kBZone:HighMem freepages: 0kB( Active: 138, inactive: 37, free: 596 )= 0kB)0*4kB 0*8kB 1*16kB 0*32kB 1*64kB 0*128kB 1*256kB 0*512kB 0*1024kB 1*2048kB = 23)= 0kB)Unable to allocate RAM for process text/data, errno 12或者pid 16: failed 4或者直接重启3 测试程序Hello.c/*#include #include #include #include #include /#pragma comment(lib,minigui.lib)/#pragma comment(lib,pthreadVC1.lib) 用于VC编译static int MainWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam) HDChdc; switch (message) case MSG_CREATE: break; case MSG_PAINT: hdc = BeginPaint (hWnd);/得到绘图设备 EndPaint (hWnd, hdc);/结束绘图break; case MSG_CLOSE:/当窗口关闭时该消息产生 DestroyMainWindow (hWnd);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论