📄 uclinux下显示驱动移植及minigui的移植 .txt
字号:
--disable-fblin16 \
--disable-fblin32 \
--disable-textmode \
--enable-dummyial \
--disable-mc68x328ial \
--disable-nativeial \
--disable-qvfbial \
--disable-qpfsupport \
--disable-ttfsupport \
--disable-type1support \
--disable-latin9support \
--disable-gbksupport \
--disable-big5support \
--disable-unicodesupport \
--disable-savebitmap \
--disable-imegb2312 \
--disable-imegb2312py \
--disable-aboutdlg \
--disable-savescreen \
--disable-grayscreen \
--enable-tinyscreen \
--enable-video-fbcon \
--disable-video-qvfb \
--disable-nativegalqvfb \
--with-osname=uclinux
运行该脚本, 然后make, make install, ldconfig。先编译例子中最简单的helloworld.c下到板中运行,提示错误
/bin> helloworld
No available video device.
NEWGAL: Does not find matched engine: qvfb.
GDI: Can not get graphics engine information!
InitGUI failure when using incore resource.
pid 30: failed 256
经过跟踪,进入sysres/mgedt.c
#include "common.h"
typedef struct _ETCSECTION
{
int key_nr; /* key number in the section */
char *name; /* name of the section */
char **keys; /* key string arrays */
char **values; /* value string arrays */
} ETCSECTION;
typedef ETCSECTION* PETCSECTION;
typedef struct _ETC_S
{
int section_nr; /* number of sections */
PETCSECTION sections; /* pointer to section arrays */
} ETC_S;
#ifdef _INCORE_RES
static char *SYSTEM_KEYS[] = {"gal_engine", "ial_engine", "mdev", "mtype"};
#ifdef __ECOS
static char *SYSTEM_VALUES[] = {"ecoslcd", "ipaq", "/dev/ts", "none"};
#else
//static char *SYSTEM_VALUES[] = {"qvfb", "qvfb", "/dev/ts", "none"}; //这是我注释掉的原来的, 你们看看程序结构,不管我怎么配置NEWGAL,
//这里都将不可避免的进入QVFB
static char *SYSTEM_VALUES[] = {"fbcon", "dummy", "none", "none"}; //我新加的。
#endif
static char *FBCON_KEYS[] = {"defaultmode"};
static char *FBCON_VALUES[] = {"240x320-8bpp"}; //原来的是240X320-16bpp
static char *QVFB_KEYS[] = {"defaultmode", "display"};
static char *QVFB_VALUES[] = {"640x480-16bpp", "0"};
static char *SYSTEMFONT_KEYS[] =
{"font_number", "font0", "font1", "font2", "default", "wchar_def", "fixed", "caption", "menu", "control"};
static char *SYSTEMFONT_VALUES[] =
{
"3","rbf-fixed-rrncnn-6-12-ISO8859-1", "*-fixed-rrncnn-*-12-GB2312", "*-SansSerif-rrncnn-*-12-GB2312",
"0", "1", "1", "1", "1", "1"
};
static char *CURSORINFO_KEYS[] = {"cursornumber"};
static char *CURSORINFO_VALUES[] = {"2"};
static char *ICONINFO_KEYS[] = {"iconnumber"};
static char *ICONINFO_VALUES[] = {"5"};
static char *BITMAPINFO_KEYS[] = {"bitmapnumber"};
static char *BITMAPINFO_VALUES[] = {"3"};
/*
static char *BGPICTURE_KEYS[] = {"position"};
static char *BGPICTURE_VALUES[] = {"center"};
static char *MOUSE_KEYS[] = {"dblclicktime"};
static char *MOUSE_VALUES[] = {"300"};
static char *EVENT_KEYS[] = {"timeoutusec", "repeatusec"};
static char *EVENT_VALUES[] = {"300000", "50000"};
*/
static ETCSECTION mgetc_sections [] =
{
{4, "system", SYSTEM_KEYS, SYSTEM_VALUES},
{1, "fbcon", FBCON_KEYS, FBCON_VALUES},
{2, "qvfb", QVFB_KEYS, QVFB_VALUES},
{10,"systemfont", SYSTEMFONT_KEYS, SYSTEMFONT_VALUES},
{1, "cursorinfo", CURSORINFO_KEYS, CURSORINFO_VALUES},
{1, "iconinfo", ICONINFO_KEYS, ICONINFO_VALUES},
{1, "bitmapinfo", BITMAPINFO_KEYS, BITMAPINFO_VALUES},
/* optional sections */
/*
{1, "bgpicture", BGPICTURE_KEYS, BGPICTURE_VALUES},
{1, "mouse", MOUSE_KEYS, MOUSE_VALUES},
{2, "event", EVENT_KEYS, EVENT_VALUES},
*/
};
ETC_S MGETC = { 7, mgetc_sections };
#endif /* _INCORE_RES */
修改后编译并运行。仍然提示错误。
/bin> helloworld
MAP_SHARED not supported (cannot write mappings to disk) //这条一看就知道在MMAP使用了不适合uClibc库的参数, 此项应该设置为0
NEWGAL: Does not find matched engine: fbcon. GDI: Can not get graphics engine information!
InitGUI failure when using incore resource.
Unable to memory map the video hardwarepid 30: failed 256
后来经过跟踪。在/libminigui-1.3.3/src/newgal/fbcon/fbvideo中找到OPEN及MMAP引用。
将mapped_mem = mmap(NULL, mapped_memlen,
PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
改为
#ifdef __uClinux__
mapped_mem = mmap(NULL, mapped_memlen,
PROT_READ|PROT_WRITE, 0, console_fd, 0);
#else
mapped_mem = mmap(NULL, mapped_memlen,
PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
#endif
将mapped_io = mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,
MAP_SHARED, console_fd, mapped_memlen);
改为
#ifdef __uClinux__
mapped_io = mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,
0, console_fd, mapped_memlen);
#else
mapped_io = mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,
MAP_SHARED, console_fd, mapped_memlen);
#endif
编译后运行。发现出现代码崩溃,
/bin/helloworld
Unhandled fault: external abort on linefetch (F4) at 0x00000001
fault-common.c(97): start_code=0xcd00040, start_stack=0xcdfff84)
pid 32: failed 7
经过艰苦的跟踪分析。在/home/libminigui-1.3.3/src/kernel/desktop.c中。
将if (!InitSystemRes ()) {
fprintf (stderr, "DESKTOP: Can not initialize system resource!\n");
return FALSE;
}注释掉。
编译运行。 显示OK, 有跑了几个例子都正常。那个时刻真的很高兴。
2005-12-15
从今天起将做触摸屏的移植, 这是很重要的移植步骤,将使我们的程序真正意义的运行起来。
在/home/uClinux-dist/linux-2.4.x/drivers/char找到mc68328digi.c将起改名为s3c44b0xts.c,将/home/uClinux-dist/linux-2.4.x/include/linux下的mc68328digi.h改为s3c44b0xts.h。
先做好内核配置准备:
在/home/uClinux-dist/linux-2.4.x/drivers/char/config.in中增加
if [ "$CONFIG_ARCH_S3C44B0" = "y" ]; then
bool 'S3C44B0 TOUCH SCREEN SUPPORT' CONFIG_TS_S3C44B0
fi
在/home/uClinux-dist/linux-2.4.x/drivers/char/makefile中增加
obj-$(CONFIG_TS_S3C44B0) += s3c44b0xts.o
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -