rickleaf 发表于 2011-3-29 20:20:26

Microwindows 在 MINI2440 QEMU上的移植

http://blog.csdn.net/rickleaf/archive/2011/03/19/6260866.aspx
嵌入式系统实验室

1、为什么有LCD_Support还需要移植

这个问题我也挺疑惑的,按道理如果redboot上面的lcd_support运行以后,凭借自己以往的经验,

Microwindows应该能运行才是。但是问题层出不穷。大概的原因是目前在ecos上面用UI的人并不多,

而且ecos里面自带的Microwindows也是比较老的版本,功能较低。

因为笔者曾经对Microwindow有过几日的研究,就把问题解决一下,顺便告诉大家这些bug都是什么。
2、一个老问题,Server和Client不能通过sokect连接

@@ -47,6 +47,7 @@

# include <pkgconf/microwindows.h>

# ifdef CYGPKG_NET

#define NONETWORK 0

+#define MW_NOSIGNALS 1

# else

#error Not yet supported.

#define NONETWORK 1

@@ -725,9 +726,11 @@

selection_owner.typelist = NULL;

#if !NONETWORK

+#ifndef MW_NOSIGNALS

/* ignore pipe signal, sent when clients exit*/

signal(SIGPIPE, SIG_IGN);

signal(SIGHUP, SIG_IGN);

+#endif

if (GsOpenSocket() < 0) {

EPRINTF("Cannot bind to named socket\n");
3、MW_APP TABLE的编译器BUG

CYG_HAL_TABLE_TYPE是ecos特有的一种表操作方式,他可以定义在内存特定的区域。

ecos的最新版本中,加入了牛人把这个表应用到ecos app的补丁,乍一看眼花撩乱的。

不过也不用害怕,一些宏操作就是替换变量名和函数名的方法。

为了能在把定义好的struct放到内存中的table段,需要用到HAL层次的CYG_HAL_TABLE_TYPE这个宏。

稍微看看就开始疑惑了吧,之前的写法怎么看上去怎么不像是宏应用。

于是参考ecos本身应用CYG_HAL_TABLE_TYP做设备列表的方法改了如下代码,

在ARM系统下就可以应用了。

不过还有一个红色和蓝色对调的问题没有去解,好像Microwindows没有预留这样的参数。

另外一个问题就是,本人发布的synthetic平台的ecos microwindows并没有这样bug,和网友讨论过

PC上的API模拟本身就有这样那样的问题。

不过比较庆幸,这个修改没有影响synthetic平台的ecos microwindows运行。

------- packages/services/gfx/mw/current/include/microwin/ecos_mw_app.h -------

@@ -56,7 +56,7 @@

#define STACKSIZE ( 65536 )

typedef void fun(CYG_ADDRWORD);

-struct _mw_app_entry {

+typedef struct _mw_app_entry {

   char         *name;

   fun          *entry;

   int          prio;

@@ -64,11 +64,11 @@

   cyg_handle_t t;

   cyg_thread   t_obj;

   char         stack;

-} CYG_HAL_TABLE_TYPE;

+} CYG_HAL_TABLE_TYPE _mw_app_entry_t ;

#define _mw_app(_name_,_id_,_pri_,_init_)               \

externC void _id_##_thread(CYG_ADDRWORD data);          \

-struct _mw_app_entry _mw_app_##_pri_##_##_id_         \

+_mw_app_entry_t _mw_app_##_pri_##_##_id_         \

    CYG_HAL_TABLE_QUALIFIED_ENTRY(_mw_apps,_pri_) =      \

      { _name_, _id_##_thread, _pri_, _init_};

http://cache.amobbs.com/bbs_upload782111/files_37/ourdev_626581RISA54.png
(原文件名:Microwin_on_ecos_mini2440_qemu.png)

quzegang 发表于 2011-3-30 01:38:35

曾在基于2440的linux下面跑过nanoX,觉得很好用,而且最近官方在不断的更新,修正了很多bug,有在linux下面用nanoX的朋友们可以一起交流下

msq-tc 发表于 2012-11-6 10:18:58

新到的公司 界面用Microwindows,以前都没听说过。。。

astankvai 发表于 2014-2-10 09:33:07

quzegang 发表于 2011-3-30 01:38
曾在基于2440的linux下面跑过nanoX,觉得很好用,而且最近官方在不断的更新,修正了很多bug,有在linux下面 ...

你好,我最近也在移植nano-X,用GIT在官方下载的代码.配置了以后提示以下错误,
/NANO_X/microwin/src/nanox/client.c:85: error: 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here (not in a function)
在几台电脑试了都一样.宿主机分别为ubuntu 10.04和ubuntu12.04.
不知道这个怎么解决.另移植LGUI也是socket的问题.

quzegang 发表于 2014-2-10 22:42:51

astankvai 发表于 2014-2-10 09:33
你好,我最近也在移植nano-X,用GIT在官方下载的代码.配置了以后提示以下错误,
/NANO_X/microwin/src/nanox ...

我也是在ubuntu下编译,没有出现此问题你是用的哪个版本的nano-x呢

astankvai 发表于 2014-2-11 13:08:46

本帖最后由 astankvai 于 2014-2-11 13:10 编辑

quzegang 发表于 2014-2-10 22:42
我也是在ubuntu下编译,没有出现此问题你是用的哪个版本的nano-x呢

最新版本的,git clone下来的。没有check out,下来是什么就是什么。
后来关了线程安全后就可以编译通过了,但是我没有加PNG,JPEG和GIF支持,还有就是后台运行就不正常,不后台运行就正常,发邮件到支持也没有回复的。不知道你是怎么样解决PNG等图片支持的呢?我可以确定我的LIB中有libpng,giflib和libjpeg,交叉编译好的,自己的测试程序跑起来都没有问题的。
感觉那个config的配置PNGINC的根本不起作用,我还是在源代码中才改到头文件搜索路径的。

quzegang 发表于 2014-2-11 15:12:54

这是我的config配置,png显示没有问题,我的是0.92版本的
####################################################################
# Microwindows and Nano-X configuration file
#
# This package can be configured to run on Linux (MIPS, ARM, POWERPC or x86)
# UNIX, ELKS, DJGPP, or RTEMS.
# On Linux, we've got drivers for Linux 2.x framebuffers, X11, or,
# svgalib for VGA hardware.
# In addition, a gpm or direct serial mouse driver can be configured.
# On ELKS, the bios screen driver and serial mouse driver are always used.
#
# Either Microwindows and/or Nano-X can be built.
# Microwindows and Nano-X have several demos.
#
# For MSDOS makes, see mcmwin.mak and mcnanox.mak
####################################################################

####################################################################
#
# build target platform
#
# Valid ARCH values are:
#
# LINUX-NATIVE
# LINUX-AVR32 (BIGENDIAN=Y)
# LINUX-TCC
# LINUX-ARM
# LINUX-MIPS
# LINUX-POWERPC (BIGENDIAN=Y)
# LINUX-SPARC (BIGENDIAN=Y)
# LINUX-BLACKFIN
# LINUX-SH
# FREEBSD-X86
# SOLARIS (BIGENDIAN=Y)
# TRIMEDIA
# RTEMS
# DJGPP
# ELKS
#
# note: ELKS can't build client/server nano-X, nor widget lib
#
####################################################################
ARCH                     = LINUX-ARM
BIGENDIAN                = N
NATIVETOOLSPREFIX      =
ARMTOOLSPREFIX         = arm-linux-
MIPSTOOLSPREFIX          = mipsel-linux-
POWERPCTOOLSPREFIX       = powerpc-linux-
SHTOOLSPREFIX            = sh-linux-gnu
AVR32TOOLSPREFIX       = avr32-linux-
BLACKFINTOOLSPREFIX       = bfin-uclinux-
PSPTOOLSPREFIX         = psp-

####################################################################
#
# Compiling options
#
####################################################################
OPTIMIZE               = Y
DEBUG                  = N
VERBOSE                  = N
THREADSAFE               = Y
GPROF                  = N

####################################################################
#
# Libraries to build: microwin, nano-X, nanowidget, object frameworks
#
####################################################################
MICROWIN               = N
NANOX                  = Y
SHAREDLIBS               = N
OBJFRAMEWORK             = N

####################################################################
#
# Demos to build
#
####################################################################
MICROWINDEMO             = N
NANOXDEMO                = Y

####################################################################
#
# Applications to build
#
####################################################################
NANOWM                   = N
FBEMULATOR               = N

####################################################################
#
# The pixeltype of the native hardware or underlying graphics library.
# This definition defines the PIXELVAL to be 32, 16 or 8 bits wide.
# If using Linux framebuffer, set to MWPF_TRUECOLOR0888, and use fbset.
# It also enables GdArea/GrArea for this particular pixel packing format.
#
# define MWPF_PALETTE       /* pixel is packed 8 bits 1, 4 or 8 pal index*/
# define MWPF_TRUECOLOR8888 /* pixel is packed 32 bits A/R/G/B truecolor w/alpha*/
# define MWPF_TRUECOLORABGR /* pixel is packed 32 bits A/B/G/R truecolor w/alpha*/
# define MWPF_TRUECOLOR0888 /* pixel is packed 32 bits 0/R/G/B truecolor 0 alpha*/
# define MWPF_TRUECOLOR888/* pixel is packed 24 bits 8/8/8 truecolor*/
# define MWPF_TRUECOLOR565/* pixel is packed 16 bits 5/6/5 truecolor*/
# define MWPF_TRUECOLOR555/* pixel is packed 16 bits 5/5/5 truecolor*/
# define MWPF_TRUECOLOR332/* pixel is packed 8 bits 3/3/2 truecolor*/
#
####################################################################
SCREEN_PIXTYPE         = MWPF_TRUECOLOR565

####################################################################
#
# NanoX: Put Y to the following line to link the nano-X application
# with the server.This is required for ELKS, if no network is present,
# or for speed or debugging.This affects the nano-X server only.
#
####################################################################
LINK_APP_INTO_SERVER   = Y

####################################################################
# Shared memory support for Nano-X client/server protocol speedup
####################################################################
HAVE_SHAREDMEM_SUPPORT   = Y

####################################################################
#
# File I/O support
# Supporting either below drags in libc stdio, which may not be wanted
#
####################################################################
HAVE_FILEIO            = Y

####################################################################
# BMP, GIF reading support
####################################################################
HAVE_BMP_SUPPORT         = Y
HAVE_GIF_SUPPORT         = Y
HAVE_PNM_SUPPORT         = N
HAVE_XPM_SUPPORT         = N

####################################################################
# JPEG support through libjpeg, see README.txt in contrib/jpeg
####################################################################
HAVE_JPEG_SUPPORT      = N
INCJPEG                  = .
LIBJPEG                  = /usr/lib/libjpeg.so

####################################################################
# PNG support via libpng and libz
####################################################################
HAVE_PNG_SUPPORT         = Y
INCPNG                   = /usr/local/arm/3.4.1/arm-linux/include/
LIBPNG                   = /usr/local/arm/3.4.1/arm-linux/lib/libpng.a
INCZ                     = /usr/local/arm/3.4.1/arm-linux/include/
LIBZ                     = /usr/local/arm/3.4.1/arm-linux/lib/libz.so

####################################################################
# TIFF support through libtiff
####################################################################
HAVE_TIFF_SUPPORT      = N
INCTIFF                  = .
LIBTIFF                  = /usr/lib/libtiff.a

####################################################################
# PCF font support - .pcf/.pcf.gz loadable fonts
####################################################################
HAVE_PCF_SUPPORT         = N
HAVE_PCFGZ_SUPPORT       = N
PCF_FONT_DIR             = "fonts/pcf"

####################################################################
# Truetype fonts - .ttf loadable fonts thru Freetype 2.x
####################################################################
HAVE_FREETYPE_2_SUPPORT= Y
INCFT2LIB                = /usr/local/arm/3.4.1/arm-linux/include/
LIBFT2LIB                = /usr/local/arm/3.4.1/arm-linux/lib/libfreetype.a
FREETYPE_FONT_DIR      = "/mnt/fonts/truetype"

####################################################################
# T1 adobe type1 fonts - .pfb/.afm loadable thru t1lib
# t1lib.config must be setup and in T1LIB_FONT_DIR
####################################################################
HAVE_T1LIB_SUPPORT       = N
T1LIB_FONT_DIR         = "fonts/type1"
INCT1LIB               = /usr/include
LIBT1LIB               = /usr/lib/libt1.a

####################################################################
# FNT font support - .fnt/.fnt.gz loadable fonts (native bdf-converted)
####################################################################
HAVE_FNT_SUPPORT         = N
HAVE_FNTGZ_SUPPORT       = N
FNT_FONT_DIR             = "fonts/fnt"

####################################################################
# Japanese EUC-JP support using loadable MGL font
####################################################################
HAVE_EUCJP_SUPPORT       = N
EUCJP_FONT_DIR         = "fonts/japanese"

####################################################################
# Chinese Han Zi Ku loadable font support
####################################################################
HAVE_HZK_SUPPORT         = Y
HZK_FONT_DIR             = "/mnt/fonts/chinese"

####################################################################
# DBCS Chinese BIG5 compiled in font support (big5font.c)
####################################################################
HAVE_BIG5_SUPPORT      = N

####################################################################
# DBCS Chinese GB2312 compiled in font support (gb2312font.c)
####################################################################
HAVE_GB2312_SUPPORT      = N

####################################################################
# DBCS Japanese JISX0213 compiled in font support (jisx0213-12x12.c)
####################################################################
HAVE_JISX0213_SUPPORT    = N

####################################################################
# DBCS Korean HANGUL font support (jo16x16.c)
####################################################################
HAVE_KSC5601_SUPPORT   = N

####################################################################
# Fribidi and shape/joining support for right to left rendering
####################################################################
HAVE_FRIBIDI_SUPPORT   = N
HAVE_SHAPEJOINING_SUPPORT = N
INCFRIBIDI               = $(TOP)/../../../include
LIBFRIBIDI               = $(TOP)/../../../lib/libfribidi.a

####################################################################
# Generate screen driver interface only with no fonts or clipping
####################################################################
NOFONTSORCLIPPING      = N

####################################################################
#
# Window move algorithms for Microwindows
# Change for tradeoff between cpu speed and looks
# ERASEMOVE repaints only backgrounds while window dragging, quicker.
# Otherwise an XOR redraw is used for window moves only after button up,
# quickest (should set for ELKS)
# UPDATEREGIONS paints in update clipping region only for better look and feel
#
####################################################################
ERASEMOVE                = N
UPDATEREGIONS            = N

####################################################################
#
# Link with Gray Palette (valid only for 4bpp modes)
#
####################################################################
GRAYPALETTE            = N

####################################################################
#
# If the platform is running UNIX, Linux
#
####################################################################
ifneq ($(ARCH), ELKS)

# X Window screen, mouse and kbd drivers
X11                      = N

ifeq ($(X11), Y)
# startup screen width, height, (depth for palette mode only)
SCREEN_WIDTH             = 480
SCREEN_HEIGHT            = 272
SCREEN_DEPTH             = 16

# You may want to turn this on for XFree86 4.x or if your backing store
# isn't functioning properly
USE_EXPOSURE               = N

else

# framebuffer screen driver (linear and/or vga 4 planes)
# set VTSWITCH to include virtual terminal switch code
# set FBREVERSE to reverse bit orders in 1,2,4 bpp
FBVGA                  = N
FRAMEBUFFER            = Y
FBVGA                  = N
VTSWITCH               = N
FBREVERSE                = N

# set HAVETEXTMODE=Y for systems that can switch between text & graphics.
# On a graphics-only embedded system, such as Osprey and Embedded
# Planet boards, set HAVETEXTMODE=N
HAVETEXTMODE             = N

# svgalib screen driver
VGALIB                   = N

# direct VGA hardware access screen driver
HWVGA                  = N

# PSP screen driver
PSP                      = N

####################################################################
# Mouse drivers
# GPMMOUSE        gpm mouse
# SERMOUSE        serial Microsoft, PC, Logitech, PS/2 mice (/dev/psaux)
# SUNMOUSE        Sun Workstation mouse (/dev/sunmouse)
# NOMOUSE        no mouse driver
#
# Touchscreen drivers
# IPAQMOUSE        Compaq iPAQ, Intel Assabet (/dev/h3600_tsraw)
# ZAURUSMOUSE        Sharp Zaurus (/dev/sharp_ts)
# TUXMOUSE        TuxScreen (/dev/ucb1x00-ts)
# ADSMOUSE        Applied Data Systems GC+ (/dev/ts)
# ADS7846MOUSE        ADS7846 chip, PSI OMAP Innovator (/dev/innnovator_ts)
# EPMOUSE        Embedded Planet (/dev/tpanel)
# VHMOUSE        Vtech Helio (/dev/tpanel)
# MTMOUSE        MicroTouch serial (/dev/ttyS1)
# PSIONMOUSE        Psion 5 (/dev/touch_psion)
# YOPYMOUSE        Yopy (/dev/yopy-ts)
# HARRIERMOUSE        NEC Harrier (/dev/tpanel)
# TSLIBMOUSE    Use tslib (/dev/input/event0)
# TTMOUSE       TomTom GO and ONE (/dev/ts)
####################################################################
GPMMOUSE               = N
SERMOUSE               = N
SUNMOUSE               = N
NOMOUSE                  = N
IPAQMOUSE                = N
ZAURUSMOUSE            = N
TUXMOUSE               = N
ADSMOUSE               = N
ADS7846MOUSE             = N
EPMOUSE                  = N
VHMOUSE                  = N
MTMOUSE                  = N
PSIONMOUSE               = N
YOPYMOUSE                = N
HARRIERMOUSE             = N
LIRCMOUSE                = N
TSLIBMOUSE               = Y
TTMOUSE                         = N
PSPMOUSE               = N

# keyboard or null kbd driver
TTYKBD                   = N
SCANKBD                  = N
PIPEKBD                  = N
IPAQKBD                  = N
LIRCKBD                  = N
NOKBD                  = Y

endif

# Secondary keyboard drivers.
# You may have a normal keyboard driver in addition to these
# drivers, e.g. for both normal keyboard and IR input.
LIRCKBD2               = N

####################################################################
# VNC server support through libvncserver
####################################################################
HAVE_VNCSERVER_SUPPORT   = N
VNCSERVER_PTHREADED      = N
LIBVNC                   = /usr/lib/libvncserver.a
INCVNC                   = /usr/include

####################################################################
# Screen driver specific configuration
# SA1100_LCD_LTLEND 4bpp driver with arm SA1100 LCD controller
# INVERT4BPP 4bpp inverted pixel driver for VTech Helio
####################################################################
SA1100_LCD_LTLEND      = N
INVERT4BPP               = N

endif

####################################################################
#
# If the platform is an ELKS box ...
#
####################################################################
ifeq ($(ARCH), ELKS)

# Higher speed asm driver, c driver of hercules screen driver
ASMVGADRIVER             = Y
CVGADRIVER               = N
HERCDRIVER               = N

# Mouse support
SERMOUSE               = Y

endif
页: [1]
查看完整版本: Microwindows 在 MINI2440 QEMU上的移植