IAMROOT.ORG에서 세미나를 한 문서

2010년 11월 20일, 서울대학교에서 함. 끝나고, 동호회 사람들이랑 찐하게 뒷풀이.. 


Posted by blee
,
항상 HW 코덱을 사용하다가, SW 코덱을 사용해야 하는 경우가 발생했다. 그래서 ffmpeg를 선택하게 되었는데, 최종 목적은 안드로이드 앱에서 사용 할 목적이다. 

막상 NDK 용으로 빌드를 했지만, 도대체 어떻게 돌아 가는 것인지 복잡한 코드를 분석하는 것은 쉽지 않았다. 그래서 고민 끝에 MSVC++ 에서 디버깅 및 트레이스를 해 보기로 했다. 다행히 인터넷에서는 ffmpeg를 원도우 환경으로 컴파일 하는 문서가 많았다. 하지만, ffplay를 MSVC++ 에서 컴파일 한 경우는 없는 듯하였다. 

이를 정리 하면, 나와 같은 고민에 빠진 사람들에게 도움이 될 것이다.

1.    다운로드 MinGW

http://sourceforge.net/projects/mingw/files/

mingw-get-inst-20101030.exe (796.0 KB)

 

2.    MinGW 설치

인스톨 옵션 : 풀 인스톨

설치 경로 : C:\MinGW

 

3.    다운로드 ffmpeg

http://www.ffmpeg.org/download.html#release

ffmpeg-0.6.1.tar.bz2

ffmpeg 작업 디렉토리에 압축해제

– MinGW Shell의 홈 디렉토리에 풀었다.

 

C:\MinGW\msys\1.0\home\MYHOME

C:\MinGW\msys\1.0\home\MYHOME\ffmpeg-0.6.1\ffmpeg-0.6.1

 

4.    MinGW Shell 실행, ffmpeg 컴파일

$ ./configure --enable-memalign-hack --enable-shared --enable-swscale

--enable-postproc --enable-gpl --enable-avfilter --enable-avfilter-lavf


$make

$install

 


5.    헤더파일 설치 경로

 

6.    inttypes.h, stdint.h 다운로드 및 복사

헤더파일 경로에 같이 위치 시킨다.

 

7.    라이브러리 설치 경로


8.    SDL 다운로드

http://www.libsdl.org/download-1.2.php

Development Libraries:

Win32: 
SDL-devel-1.2.14-VC6.zip (Visual C++ 6.0)

 

9.    압축 해제 및 복사


라이브러리는 ffmpeg 라이브러리와 동일한 위치에 복사

 


헤더 파일은 ffmpeg 헤더파일과 동일한 위치에 복사

 

10. MSVC 6.0 프로젝트 생성


Win32 Console Application 선택 및 Project name , Location 를 입력한다.

Location ffmpeg 디렉토리로 하였다.

11. Cpp 파일을 c 파일로 수정 ( Blee2.cpp -> blee2.c )


 

프로젝터 파일에 ffplay.c, cmdutils.c 포함한다.

 

12. 설정

Project settings -> C/C++, Precompiled Headers -> Not using precompiled headers


Project Settings -> Link  라이브러리 추가


avcodec-52.lib avdevice-52.lib avformat-52.lib avutil-50.lib

swscale-0.lib postproc-51.lib avfilter-1.lib SDL.lib

 

11. 헤더파일과 라이브러리 경로 추가

Tools -> Options -> Directories


Include files 추가

C:\MINGW\MSYS\1.0\LOCAL\INCLUDE

C:\MINGW\MSYS\1.0\INCLUDE

 


C:\MINGW\MSYS\1.0\LOCAL\BIN

 

13. 소스 수정

//-----------------------------------------------

// ffplay.c

//-----------------------------------------------

#include <windows.h>

void usleep(unsigned long usec)

{

     Sleep(usec/1000);

}

 

#define rint(x) (floor((x)+0.5))

 

//    DECLARE_ALIGNED(16,uint8_t,audio_buf1)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];

//    DECLARE_ALIGNED(16,uint8_t,audio_buf2)[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];

    uint8_t audio_buf1[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];

    uint8_t audio_buf2[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];

 

//static int wanted_stream[AVMEDIA_TYPE_NB]={

//    [AVMEDIA_TYPE_AUDIO]=-1,

//    [AVMEDIA_TYPE_VIDEO]=-1,

//    [AVMEDIA_TYPE_SUBTITLE]=-1,

//};

static int wanted_stream[AVMEDIA_TYPE_NB]={

     0,

    -1,

    -1,

     0,

    -1

};

 

//    ap->time_base= (AVRational){1, 25};

     ap->time_base.num = 1;

     ap->time_base.den = 25;

 

//uint64_t size=  url_fsize(cur_stream->ic->pb);

int64_t size=  url_fsize(cur_stream->ic->pb);

 

//            FFTSample data[2][2*nb_freq];

                FFTSample data[2][4096];

 

int main(int argc, char **argv) -> int ff_main(int argc, char **argv)

 

//#if !defined(__MINGW32__) && !defined(__APPLE__)

//    flags |= SDL_INIT_EVENTTHREAD; /* Not supported on Windows or Mac OS X */

//#endif

 

//-----------------------------------------------

// libavutil\common.h

//-----------------------------------------------

#define inline __inline

 

14.   라이브러리 복사


 

15. 빌드 및 실행 화면


 


 

16. 기타

정리하지 못한 문제도 있을 것임.


다음은 투토리얼을 따라 해 보고, 정리 되면, 문서를 만들어 볼 계획이다.

Posted by blee
,


# git clone git://android.kernel.org/kernel/common.git kernel-goldfish
# cd kernel-goldfish
# git branch -r
  origin/HEAD
  origin/android-2.6.25
  origin/android-2.6.27
  origin/android-2.6.29
  origin/android-goldfish-2.6.27
  origin/android-goldfish-2.6.29

# git checkout --track -b android-goldfish-2.6.29 origin/android-goldfish-2.6.29

# export ARCH=arm
# export CROSS_COMPILE=/home/qt/android.blee/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-
# make goldfish_defconfig
# make

파일 복사
arch/arm/boot/zImage -> platforms/android-1.5/images/kernel-qemu

'안드로이드 > 플랫폼' 카테고리의 다른 글

ADB 사용  (0) 2009.10.18
SystemServer, MediaServer  (0) 2009.10.12
결과물  (0) 2009.09.30
service_manager 흐름  (0) 2009.08.25
init 분석 open 하는 디바이스 - null, kmsg  (0) 2009.08.18
Posted by blee
,


cd C:\and\android-sdk-windows-1.5_r3\tools

* emulator 실행

emulator.exe -avd blee

* shell 를 보고 싶을때

adb shell

* 파일 복사 ( push 는 emulator 로 복사 )

adb push acp.exe /data/acp.exe

* 파일 복사 ( pull 는 emulator 에서 가져 오는것 )
adb pull /init.rc ttt

* shell 에서 insmod 를 입력하면 .. 아래와 같이 나온다.
# insmod
insmod
usage: insmod <module.o>
#


hardware/libhardware/modules/README.android

# cd /system/lib/hw/
# ls -l
-rw-r--r-- root     root         9812 2009-07-01 00:24 sensors.goldfish.so
-rw-r--r-- root     root         5292 2009-07-01 00:26 lights.goldfish.so

'안드로이드 > 플랫폼' 카테고리의 다른 글

Goldfish-emulator용 커널 빌드  (0) 2009.10.20
SystemServer, MediaServer  (0) 2009.10.12
결과물  (0) 2009.09.30
service_manager 흐름  (0) 2009.08.25
init 분석 open 하는 디바이스 - null, kmsg  (0) 2009.08.18
Posted by blee
,

소스 분석중 system_server 와 mediaserver 의 코드는 동일한 동작을 보이고 있습니다.
그래서 저번 스터디시에 혼동이 있었는데요. 훓어 보니 동일한 동작이 아니였습니다.

타겟의 ps 로 보면, mediaserver 가 system_server 보다 빨리 시작되었다는 것을 알 수 있는데, 저희는 zygote 를 따라 가다 보니 system_server 를 먼저 분석하게 되었지요.
우선 이번주 스터디를 위해서 각각의 역할을 클리어 하게 정의 되어야 할 것 같다.

프로세스의 상태를 보면 아래와 같습니다.

root     1     0     280   192   c00bd90c 0000c8dc S /init
 :
root     1783  1     69252 19788 c00bd90c afe0c584 S zygote
media    1784  1     16232 3620  ffffffff afe0c45c S /system/bin/mediaserver
system   1807  1783  185064 26652 ffffffff afe0c45c S system_server

mediaserver 는 init 에 의해서 생성 되었고,
system_server 는 zygote 에 의해서 생성 되었다.

코드를 분석하면, 먼저 system_server 를 저번 주에 보았습니다.
자세히 보면, system_server 는 SurfaceFlinger::instantiate(); 만 실행하도록 되어 있습니다. proc->supportsProcesses() 는 true 를 리턴하도록 되어 있기 때문이지요.

이로서 저번 시간에 왜 동일한 동작을 할까에 대한 부분은 해결 되었습니다.
proc->supportsProcesses() 를 false 로 되는 환경이 있나 봅니다.

// frameworks/base/cmds/system_server/library/system_init.cpp
 :
    if (strcmp(propBuf, "1") == 0) {
        // Start the SurfaceFlinger
        SurfaceFlinger::instantiate();
    }

    // On the simulator, audioflinger et al don't get started the
    // same way as on the device, and we need to start them here
    if (!proc->supportsProcesses()) {

        // Start the AudioFlinger
        AudioFlinger::instantiate();

        // Start the media playback service
        MediaPlayerService::instantiate();

        // Start the camera service
        CameraService::instantiate();
    }
 :
 
실제로 mediaserver 에서 아래 서비스 provider 들이 시작 될 것입니다.

AudioFlinger::instantiate();
MediaPlayerService::instantiate();
CameraService::instantiate();

// frameworks/base/media/mediaserver/main_mediaserver.cpp 
int main(int argc, char** argv)
{
    sp<ProcessState> proc(ProcessState::self());
    sp<IServiceManager> sm = defaultServiceManager();
    LOGI("ServiceManager: %p", sm.get());
    AudioFlinger::instantiate();
    MediaPlayerService::instantiate();
    CameraService::instantiate();
    ProcessState::self()->startThreadPool();
    IPCThreadState::self()->joinThreadPool();
}

'안드로이드 > 플랫폼' 카테고리의 다른 글

Goldfish-emulator용 커널 빌드  (0) 2009.10.20
ADB 사용  (0) 2009.10.18
결과물  (0) 2009.09.30
service_manager 흐름  (0) 2009.08.25
init 분석 open 하는 디바이스 - null, kmsg  (0) 2009.08.18
Posted by blee
,

 
Version : 1.0
- 초안

Version : 1.1
- GTK 프로그램시 한글처리 추가
- QTextEdit 버그 수정
- sqlite 가 버그 수정 


Last update : 2007.10.15

+-----------------------------------------------------------------------------------------
+ 작업 디렉토리
+-----------------------------------------------------------------------------------------
타겟의 디렉토리 : /user/app
호스트 작업 디렉토리 : /home/qt/target/WallPad
호스트에서 크로스 컴파일된 이미지 설치 디렉토리 : /user/app

 크로스 컴파일된 이미지는 호스트의 /user/app 밑에 모두 모이게 한다.
 gtk 를 컴파일 하고, 설치하는 중에 default 로 생성되는 환경 설정 파일에서
 지정되는 경로를 수정 없이 사용하기 위함이다.

타켓의 /user 는 nand flash 로 yaffs2 파일시스템이다.
/dev/mtdblock/3 on /user type yaffs2 (rw)

+-----------------------------------------------------------------------------------------
+ 환경변수 및 기타
+-----------------------------------------------------------------------------------------
export PKG_CONFIG_PATH=/user/app/lib/pkgconfig

- 실행에 필요한 library 가 무엇이 필요한지 검사
arm-linux-objdump -x $(TARGET) | grep NEEDED

- config.log 에서 유심히 보아야 할 에러들..
No such file or directory
undefined reference to

+-----------------------------------------------------------------------------------------
+
+ X11 및 GTK 포팅
+
+-----------------------------------------------------------------------------------------
 termcap-2.0.8, flex-2.5.4 를 미리 설치 하지 않아도 x는 컴파일이 된다.
 몇몇 app 들이 안 되는 것이 있는 것 같지만, 사용할 일이 없다면, x 만 컴파일 해도 된다.
 
 Gtk를 포팅 한다는 것은 필요한 lib 들의 버전 서로 맞추는 것이 일이다.
 이 후 컴파일 하는 lib 버전은 몇 번의 시행착오를 거치면서, 잘 맞는 버전들이다.
 
 shared memory 를 사용 하도록 하려면, x와 gtk 설정을 해 주어야 한다.
 x 에서는 사용하지 않는 것이 default 이고 gtk 에서는 사용하는 것이 default 이다.
 그대로 하면, gtk 프로그램들이 이유 없이 죽는 경우가 발생한다.
 
 필요한 lib 를 걸러 내는 작업을 하다가 그만 두었다.
 다른 일이 급해서.. 아마도 지금은 풀 버전에 가깝다.
 
+-----------------------------------------------------------------------------------------
+ termcap-2.0.8  http://prdownloads.sourceforge.net/ltsp/termcap-2.0.8.tar.bz2?download
+-----------------------------------------------------------------------------------------
tar zxvf termcap-2.0.8.tar.gz
cd termcap-2.0.8
 
Makefile 파일 수정
 
 CC=arm-linux-gcc
 AR=arm-linux-ar
 prefix=/user/app

#       if [ -x /sbin/ldconfig -o -x /etc/ldconfig ]; then \
#         ldconfig; \
#       fi

make
 :
 arm-linux-gcc -I. -c tparam.c
 In file included from tparam.c:34:
 /usr/local/arm/arm-linux/include/string.h:242: syntax error before '(' token
 /usr/local/arm/arm-linux/include/string.h:242: syntax error before "const"
 make: *** [tparam.o] Error 1
 :
 
툴체인의 string.h 파일에서 에러가 발생한다.
/usr/local/arm/arm-linux/include/string.h 아래 주석 처리
vi /usr/local/arm/arm-linux/include/string.h
// extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;

make
 arm-linux-gcc -shared -o ../libtermcap.so.2.0.8 -Wl,-soname,libtermcap.so.2 termcap.o tparam.o version.o
 makeinfo termcap.texi --output=termcap.info
 termcap.texi:2615: warning: `.' or `,' must follow cross reference, not ).

make install
 
 chown bin.bin /user/app/lib/libtermcap.so.2.0.8
 chown: changing ownership of `/user/app/lib/libtermcap.so.2.0.8': Operation not permitted
 make: *** [install] Error 1


심볼링크 에러 난다. 직접 만들어 주었다.
cd /user/app/lib
ln -s libtermcap.so.2.0.8 libtermcap.so
cd -

vi /usr/local/arm/arm-linux/include/string.h
extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;

+-----------------------------------------------------------------------------------------
+ flex-2.5.4 --shared 없음 ftp://ftp.gnu.org/non-gnu/flex/flex-2.5.4a.tar.gz
+-----------------------------------------------------------------------------------------
tar zxvf flex-2.5.4a.tar.gz
cd flex-2.5.4

CC=arm-linux-gcc STRIP=arm-linux-strip AR=arm-linux-ar RANLIB=arm-linux-ranlib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--x-includes=/user/app/include --x-libraries=/user/app/lib

make
make install

+-----------------------------------------------------------------------------------------
+ XFree86 4.2.0  ftp://xfree86.mirror.or.kr/.3/ftp.xfree86.org/pub/XFree86/4.2.0/source/
+ patch   ftp://xfree86.mirror.or.kr/.3/ftp.xfree86.org/pub/XFree86/4.2.0/fixes/
+-----------------------------------------------------------------------------------------
tar zxvf X420src-1.tgz
cd xc
cat ../4.2.0-libGLU-bad-extern.patch | patch -p1
cat ../4.2.0-xlib-i18n-module.patch | patch -p1
cat ../4.2.0-zlib-security.patch | patch -p1
cat ../4.2.0-xlib-security.patch | patch -p1

 +-----------------------------------------------------------
 + host.def 파일을 수정한다.
 +-----------------------------------------------------------

vi config/cf/host.def
#define KDriveXServer YES
#define KdriveServerExtraDefines -DMAXSCREENS=1
#define TinyXServer YES
#define CrossCompiling YES
#define TouchScreen YES
#define XfbdevServer YES
#define ProjectRoot /user/app
#define SystemUsrLibDir /user/app/lib
#define SystemUsrIncDir /user/app/include
#define EtcX11Directory /user/app/etc
#define BuildXprint NO

 +-----------------------------------------------------------
 + 2006.12.05. "xc/config/cf/host.def" shared memory
 + shared memory 를 사용하도록 하기 위해서는 아래 define이 필요하며,
 +-----------------------------------------------------------
 
#define HasShm YES

 +-----------------------------------------------------------
 + 커널에서도 아래의 설정이 요구된다.
 +-----------------------------------------------------------

File systems  --->
[*] Virtual memory file system support (former shm fs)
[*] /dev file system support (EXPERIMENTAL)

 +-----------------------------------------------------------
 + cross.def 파일을 수정한다.
 +-----------------------------------------------------------

vi config/cf/cross.def
/* $XFree86: xc/config/cf/cross.def,v 1.2 2001/03/30 02:15:17 keithp Exp $ */
/*
 * This file contains redefinitions of some symbols to enable
 * cross compilation: e.g. paths for include files and paths to
 * compiler images.  It will have to be edited to reflect these
 * given your local configuration.
 */
#undef i386Architecture
#define Arm32Architecture

#undef OptimizedCDebugFlags
#define OptimizedCDebugFlags  -O2
#define ServerCDebugFlags -O2
#undef StandardDefines
#define StandardDefines  -Dlinux -D__arm__ -D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE
#undef CcCmd
#define StdIncDir /usr/local/arm/arm-linux/include
#define PreIncDir
#undef PostIncDir
#define PostIncDir /usr/local/arm/lib/gcc-lib/arm-linux/3.2.3/include
#define CcCmd /usr/local/arm/bin/arm-linux-gcc
#undef CplusplusCmd
#define HasCplusplus YES
#define CplusplusCmd /usr/local/arm/bin/arm-linux-g++
#define DoRanlibCmd YES
#define RanlibCmd /usr/local/arm/bin/arm-linux-ranlib
#undef ExtraLoadFlags
#define ExtraLoadFlags
#define FbNoPixelAddrCode
/*
#undef TermcapLibrary
#define TermcapLibrary -ltermcap
*/
#undef LdPostLib
#define LdPostLib

#undef ExtensionOSDefines
#define ExtensionOSDefines
/*
#define ServerXdmcpDefines
*/
#include <cross.rules>

 +-----------------------------------------------------------
 + kdrive.cf 파일을 수정한다. ( 안 해도 상관없다. )
 + 폰트는 다 필요 없다. 이후에 하나의 폰트만 포팅 할 것이다.
 +-----------------------------------------------------------

vi config/cf/kdrive.cf
/*#define DefaultFontPath built-ins,$(FONTDIR)/misc/,$(FONTDIR)/75dpi/,$(FONTDIR)/100dpi/ */
#define DefaultFontPath built-ins

 +-----------------------------------------------------------
 + 마우스를 사용 하지 않도록 한다. 사용하면 이상이 생긴다.
 + 콘솔 먹통 되고, 터치가 올바르게 동작하지 않는다.
 +-----------------------------------------------------------
 
programs/Xserver/hw/kdrive/kinput.c

#if 0 // by B.LEE
 if (kdMouseFuncs)
     (*kdMouseFuncs->Init) ();
#endif

#if 0  // by B.LEE    
     if (kdMouseFuncs)
  (*kdMouseFuncs->Fini) ();
#endif

 +-----------------------------------------------------------
 + 컴파일 및 인스톨
 +-----------------------------------------------------------
  
make World > World.log 2>&1
make intall

 +-----------------------------------------------------------
 + 만약 폰트를 추가해 주고 싶으면
 +-----------------------------------------------------------
/user/app/lib/X11/fonts/ 밑에 추가해 주자.. 인터넷에 떠도는 폰트로 설치해 주었다. 폰트 설정은 호스트에서 작업한다.
/user/app/lib/X11/fonts/Type1/blee.ttf
cd /user/app/lib/X11/fonts/Type1/
mkfontdir
mkfontscale

 +-----------------------------------------------------------
 + 만약 호스트의 font 를 복사 할 경우, 폰트가 많아지면, gtk가
 + 실행하면서 font cache 를 하기 때문에, 뜨는데 엄청나게 오래 걸린다.
 +-----------------------------------------------------------
 cp -rv /usr/app/lib/X11/fonts /user/app/lib/X11/fonts

 +-----------------------------------------------------------
 + 폰트 캐쉬 디렉토리를 만들어 주자.. 그리고 권한을 모두 풀어 놓자..
 + 왜냐면, nfs 실행시키면 이곳에 타겟이 접근해야 하는데,
 + 권한이 없으면, 제대로 뜨질 않는다.
 +-----------------------------------------------------------
 
mkdir -p /user/app/var/cache/fontconfig
chmod chmod -R 777 /user/app/var/

 +-----------------------------------------------------------
 + 테스트
 + /user/app/lib 및 /user/app/etc 등 x에 관련된 파일들이 생성된 것을 확인한다.
 +-----------------------------------------------------------

nfs 로 마운트 후 테스트 해 본다.
호스트의 /user/app 를 타켓의 /user/app 로 nfs 마운트 해서 테스트 한다. 이는 경로가 바뀌지 않게 하기 위함이다.
테스트 후에 그대로 /user/app 로 복사를 하면 된다.

mount -t nfs 10.2.1.101:/user /mnt/nfs
ln -s /mnt/nfs/app /user/app

export FONTCONFIG_FILE=/user/app/etc/fonts/fonts.conf
export PATH=$PATH:/user/app/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/user/app/lib
export DISPLAY=:0.0

 +-----------------------------------------------------------
 + tty 가 없다면 만들어 준다.
 +-----------------------------------------------------------

mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8

Xfbdev &

* 실행이 안된다면, xdpyinfo 로 정보를 출력해 본다.
x가 실행이 안 되는 것은 십중팔구 커널의 fb device driver 가 제대로 작성이 안된 것이다.

# xdpyinfo
name of display:    :0.0
version number:    11.0
vendor string:    Keith Packard
vendor release number:    600300
maximum request size:  4194300 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 4, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 12, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 24, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 135
focus:  PointerRoot
number of extensions:    13
    BIG-REQUESTS
    DEC-XTRAP
    FontCache
    MIT-SCREEN-SAVER
    MIT-SHM
    MIT-SUNDRY-NONSTANDARD
    RANDR
    RENDER
    SHAPE
    SYNC
    TOG-CUP
    XC-MISC
    XTEST
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    800x480 pixels (271x163 millimeters)
  resolution:    75x75 dots per inch
  depths (7):    1, 4, 8, 12, 16, 24, 32
  root window id:    0x33
  depth of root window:    12 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    16
  preallocated pixels:    black 0, white 4095
  options:    backing-store NO, save-unders NO
  largest cursor:    800x480
  current input event mask:    0x0
  number of visuals:    1
  default visual id:  0x21
  visual:
    visual id:    0x21
    class:    TrueColor
    depth:    12 planes
    available colormap entries:    16 per subfield
    red, green, blue masks:    0xf00, 0xf0, 0xf
    significant bits in color specification:    8 bits
   
+-----------------------------------------------------------------------------------------
+ xc/programs/Xserver 연관된 디렉토리
+-----------------------------------------------------------------------------------------
dix
fb
mi
miext/shadow
miext/layer
os
randr
render
Xext
XTrap
hw/kdrive
hw/kdrive/linux
hw/kdrive/fbdev
 
+-----------------------------------------------------------------------------------------
+ tslib-0.1.1  http://tslib.berlios.de/
+-----------------------------------------------------------------------------------------
타겟은 터치스크린을 사용하며, X11 에서 터치 기능 향상을 위해서 ts lib 를 사용 하도록 포팅 할 것이다.
x에 구현되어 있는 터치는 잘 맞지 않는다.
ts lib 를 포팅 하면, 터치가 티는 것을 보정하며, 잘 맞는 것을 볼 수 있다.

tar zxvf tslib-0.1.1.tar.gz
cd tslib-0.1.1

./configure --prefix=/user/app --host=arm-linux --build=i386-linux

rpl_malloc 가 정의 되지 않도록 config.h 를 수정한다.
vi config.h
//#define malloc rpl_malloc

make
make install

 +-----------------------------------------------------------
 + ts.conf 수정한다. 드라이버를 지정해 주어야 한다.
 +-----------------------------------------------------------

vi /user/app/etc/ts.conf
# Uncomment if you're using an HP iPaq h3600 or similar
module_raw h3600
# Uncomment if you're using a Hitachi Webpad
#module_raw mk712

 +-----------------------------------------------------------
 + 환경변수
 +-----------------------------------------------------------

export TSLIB_TSDEVICE=/dev/digi
export TSLIB_CONFFILE=/user/app/etc/ts.conf
export TSLIB_PLUGINDIR=/user/app/lib/ts
export TSLIB_CALIBFILE=/user/app/etc/pointercal

 +-----------------------------------------------------------
 + 테스트
 +-----------------------------------------------------------
nfs 로 호스트의 /user/app 를 타겟의 /user/app 로 마운트 한다.

/user/app/bin/ts_calibrate 를 실행해서 포인터를 찍고,
/user/app/etc/pointercal 파일을 만든다.(  nfs 에서 접근 할 수 있도록 권한을 풀자 )
/user/app/bin/ts_test 로 확인 할 수 있다.

 +-----------------------------------------------------------
 + x에서 ts lib 를 링크 하도록 한다. 이후에 x11 코드를 수정하여,
 + ts lib 를 사용할 것이다.
 +-----------------------------------------------------------

vi config/cf/cross.def 파일을 수정한다.
#undef LdPostLib
#define LdPostLib -L/user/app/lib -lts
  
programs/Xserver/hw/kdrive/kdrive.h(201)
  
typedef struct _KdMouseInfo {
    struct _KdMouseInfo *next;
    void  *driver;
    void  *closure;
    char  *name;
    char  *prot;
    char  map[KD_MAX_BUTTON];
    int   nbutton;
    Bool  emulateMiddleButton;
    unsigned long emulationTimeout;
    Bool  timeoutPending;
    KdMouseState mouseState;
    Bool  eventHeld;
    xEvent  heldEvent;
    unsigned char buttonState;
    int   emulationDx, emulationDy;
 int inputType; // by B.LEE
} KdMouseInfo;

programs/Xserver/hw/kdrive/linux/ts.c

/*
 * $XFree86: xc/programs/Xserver/hw/tinyx/linux/tslib.c,v 1.1tsi Exp $
 * TSLIB based touchscreen driver for TinyX
 * Derived from ts.c by Keith Packard
 * Derived from ps2.c by Jim Gettys
 *
 * Copyright ?1999 Keith Packard
 * Copyright ?2000 Compaq Computer Corporation
 * Copyright ?2002 MontaVista Software Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of Keith Packard or Compaq not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  Keith Packard and Compaq makes no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * KEITH PACKARD AND COMPAQ DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
 * IN NO EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of Michael Taht or MontaVista not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  Michael Taht and Montavista make no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * MICHAEL TAHT AND MONTAVISTA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
 * IN NO EVENT SHALL EITHER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */


#define NEED_EVENTS
#include "X.h"
#include "Xproto.h"
#include "inputstr.h"
#include "scrnintstr.h"
#include "kdrive.h"
#include "Xpoll.h"
#include <sys/ioctl.h>
#include <tslib.h>

static long lastx = 0, lasty = 0;
static struct tsdev *tsDev = NULL;
int TsScreen;
extern int TsFbdev;

void
TsRead (int tsPort, void *closure)
{
    KdMouseInfo     *mi = closure;
    int      fd = (int) mi->driver;
    struct ts_sample event;
    int      n;
    long     pressure;
    long     x, y;
    unsigned long   flags;
    unsigned long   buttons;

#if 0
    n = ts_read(tsDev, &event, 1);
    if (n == 1) 
    {
 if (event.pressure)
 {
     /*
      * HACK ATTACK.  (static global variables used !)
      * Here we test for the touch screen driver actually being on the
      * touch screen, if it is we send absolute coordinates. If not,
      * then we send delta's so that we can track the entire vga screen.
      */
     if (TsScreen == TsFbdev) {
      flags = KD_BUTTON_1;
      x = event.x;
      y = event.y;
     } else {
      flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
      if ((lastx == 0) || (lasty == 0)) {
          x = 0;
          y = 0;
      } else {
          x = event.x - lastx;
          y = event.y - lasty;
      }
      lastx = event.x;
      lasty = event.y;
     }
 } else {
     flags = KD_MOUSE_DELTA;
     x = 0;
     y = 0;
     lastx = 0;
     lasty = 0;
 }
// fprintf(stderr, "B.LEE \t %d %s , (%d,%d)\n", n, (flags==KD_BUTTON_1) ? "KD_BUTTON_1" : "KD_MOUSE_DELTA", x, y);
 KdEnqueueMouseEvent (mi, flags, x, y);
    }
#endif

 n = 1;

 while(n)
 {
//  fprintf(stderr, "B.LEE \t ts_read start\n");
 n = ts_read(tsDev, &event, 1);
    if (n == 1) 
    {
 if (event.pressure)
 {
     /*
      * HACK ATTACK.  (static global variables used !)
      * Here we test for the touch screen driver actually being on the
      * touch screen, if it is we send absolute coordinates. If not,
      * then we send delta's so that we can track the entire vga screen.
      */
     if (TsScreen == TsFbdev) {
      flags = KD_BUTTON_1;
      x = event.x;
      y = event.y;
     } else {
      flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
      if ((lastx == 0) || (lasty == 0)) {
          x = 0;
          y = 0;
      } else {
          x = event.x - lastx;
          y = event.y - lasty;
      }
      lastx = event.x;
      lasty = event.y;
     }
 } else {
     flags = KD_MOUSE_DELTA;
     x = 0;
     y = 0;
     lastx = 0;
     lasty = 0;
 }
 fprintf(stderr, " %s , (%d,%d)\n", (flags==KD_BUTTON_1) ? "KD_BUTTON_1" : "KD_MOUSE_DELTA", x, y);
 KdEnqueueMouseEvent (mi, flags, x, y);
    }
 }

// fprintf(stderr, "B.LEE \t finish \n");

}

static char *TsNames[] = {
   "/dev/digi"
};

#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0]))

int TsInputType;

int
TsInit (void)
{
    int  i;
    KdMouseInfo *mi, *next;
    int  fd= 0;
    int  n = 0;

   if (!TsInputType)
 TsInputType = KdAllocInputType ();
    
    for (mi = kdMouseInfo; mi; mi = next)
    {
 next = mi->next;
// if (mi->inputType)
//     continue;

 if (!mi->name)
 {
     for (i = 0; i < NUM_TS_NAMES; i++)   
     {
if( tsDev == NULL )
{
  if(!(tsDev = ts_open(TsNames[i],0)))
  {
   fprintf(stderr,"B.LEE TsInit open error.\n");
   continue;
  }
     ts_config(tsDev);
}

     fd=ts_fd(tsDev);

  if (fd >= 0)
  {
      mi->name = KdSaveString (TsNames[i]);
      break;
  }
     }
 }

 if (fd > 0 && tsDev != 0)
   {
     mi->driver = (void *) fd;
     mi->inputType = TsInputType;
      if (KdRegisterFd (TsInputType, fd, TsRead, (void *) mi))
      n++;
   }
 else
 {
   if (fd > 0) close(fd);
 }
 }
}

void
TsFini (void)
{
    KdMouseInfo *mi;
 

//    KdUnregisterFds (TsInputType, TRUE);
    KdUnregisterFds (TsInputType, 0);
    for (mi = kdMouseInfo; mi; mi = mi->next)
    {
 if (mi->inputType == TsInputType)
 {
     if(mi->driver)
  { ;
  // ts_close(tsDev);
  // tsDev = NULL
     }
     mi->driver = 0;
     mi->inputType = 0;
     if (mi->name != NULL)
  {
  free(mi->name);
  mi->name = NULL;
     }
 }
   }
}

KdMouseFuncs TsFuncs = {
    TsInit,
    TsFini
};

make World > World.log 2>&1
make intall


테스트, nfs 로 마운트 후 테스트 해 본다.
호스트의 /user/app 를 타켓의 /user/app 로 nfs 마운트 해서 테스트 한다.
이는 경로가 바뀌지 않게 하기 위함이다.
테스트 후에 그대로 /user/app 로 복사를 하면 된다.

export TSLIB_TSDEVICE=/dev/digi
export TSLIB_CONFFILE=/user/app/etc/ts.conf
export TSLIB_PLUGINDIR=/user/app/lib/ts
export TSLIB_CALIBFILE=/user/app/etc/pointercal
export FONTCONFIG_FILE=/user/app/etc/fonts/fonts.conf
export PATH=$PATH:/user/app/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/user/app/lib
export DISPLAY=:0.0

mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8

Xfbdev

* ts_calibrate로 /user/app/etc/pointercal 파일이 생성되어 있어야 한다.

 +-----------------------------------------------
 + x 백그라운드 색 바꾸기
 +-----------------------------------------------
programs/Xserver/dix/window.c
//! by B.LEE 백그라운드 색..
//!static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
//!static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
static unsigned char _back_lsb[4] = {0xff, 0xff, 0xff, 0xff};
static unsigned char _back_msb[4] = {0xff, 0xff, 0xff, 0xff};

 +-----------------------------------------------
 + x 마우스 커서를 없애기
 +-----------------------------------------------
programs/Xserver/dix/cursor.c

/***********************************************************
 * CreateRootCursor
 *
 * look up the name of a font
 * open the font
 * add the font to the resource table
 * make a cursor from the glyphs
 * add the cursor to the resource table
 *************************************************************/

CursorPtr
CreateRootCursor(pfilename, glyph)
    char *  pfilename;
    unsigned int glyph;
{
    CursorPtr  curs;
    FontPtr  cursorfont;
    int err;
    XID  fontID;

//! return NullCursor;

#if 0 //! by b.lee
   fontID = FakeClientID(0);
    err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync,
 (unsigned)strlen( pfilename), pfilename);
    if (err != Success)
 return NullCursor;

    cursorfont = (FontPtr)LookupIDByType(fontID, RT_FONT);
    if (!cursorfont)
 return NullCursor;
//!    if (AllocGlyphCursor(fontID, glyph, fontID, glyph + 1,
//!    if (AllocGlyphCursor(fontID, glyph, fontID, glyph,
    if (AllocGlyphCursor(fontID, 40, fontID, 41,
  0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success)
 return NullCursor;

    if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs))
 return NullCursor;
#else
//! 스크린 세이버 루틴에서.. 참조..
    int j;
    int result;
    XID attributes[3];
    Mask mask;
    WindowPtr pWin;  
    CursorMetricRec cm;
    unsigned char *srcbits, *mskbits;
    CursorPtr cursor;
    XID cursorID = 0;
    int attri;
   /*
     * create a blank cursor
     */

    cm.width=16;
    cm.height=16;
    cm.xhot=8;
    cm.yhot=8;
    srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
    mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
    if (!srcbits || !mskbits)
    {
 xfree(srcbits);
 xfree(mskbits);
 cursor = 0;
    }
    else
    {
 for (j=0; j<BitmapBytePad(32)*16; j++)
     srcbits[j] = mskbits[j] = 0x0;
 cursor = AllocCursor(srcbits, mskbits, &cm, 0, 0, 0, 0, 0, 0);
 if (cursor)
 {
     cursorID = FakeClientID(0);
     if (AddResource (cursorID, RT_CURSOR, (pointer) cursor))
     {
  attributes[attri] = cursorID;
  mask |= CWCursor;


  curs = cursor; //!
     }
     else
  cursor = 0;
 }
 else
 {
     xfree (srcbits);
     xfree (mskbits);
 }
    }
#endif

    return curs;
}

* 다음부터는 줄줄이.. gtk 를 설치해 주기 위함이다.
+-----------------------------------------------------------------------------------------
+ xproto-7.0.7  http://packages.debian.org/unstable/source/libx11
+     http://xlibs.freedesktop.org/release/
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-core_7.0.7.orig.tar.gz
cd xproto-7.0.7
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ x11proto-xext-7.0.2
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-xext_7.0.2.orig.tar.gz
cd x11proto-xext-7.0.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ xtrans-1.0.1
+-----------------------------------------------------------------------------------------
tar zxvf xtrans_1.0.1.orig.tar.gz
cd xtrans-1.0.1
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ x11proto-xcmisc-1.1.2
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-xcmisc_1.1.2.orig.tar.gz
cd x11proto-xcmisc-1.1.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ x11proto-bigreqs-1.0.2
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-bigreqs_1.0.2.orig.tar.gz
cd x11proto-bigreqs-1.0.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ kbproto-1.0.3
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-kb_1.0.3.orig.tar.gz
cd kbproto-1.0.3
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ x11proto-input-1.3.2
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-input_1.3.2.orig.tar.gz
cd x11proto-input-1.3.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ x11proto-xf86bigfont-1.1.2
+-----------------------------------------------------------------------------------------
tar zxvf x11proto-xf86bigfont_1.1.2.orig.tar.gz
cd x11proto-xf86bigfont-1.1.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ libiconv-1.11  http://www.gnu.org/software/libiconv/
+-----------------------------------------------------------------------------------------
tar zxvf libiconv-1.11.tar.gz
cd libiconv-1.11
#CFLAGS=-I/user/app/include \
LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ glib-2.12.0  http://www.gtk.org/download/
+-----------------------------------------------------------------------------------------

tar jxvf glib-2.12.0.tar.bz2
cd glib-2.12.0

rm win32.cache
[참조] glib-2.12.0/docs/reference/glib/html/glib-cross-compiling.html

 +-----------------------------------------------------------
 + win32.cache는 configure 에서 사용하는데..
 + 이전에 사용된 것이 있다면, 지우고 다시 만들어 준다. 이 파일이 있으면, configure 를 변경해도
 + 적용이 안 되는 경우가 있다.
 +-----------------------------------------------------------
vi win32.cache 
glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=no


CFLAGS=-I/user/app/include \
LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--cache-file=win32.cache --with-libiconv=gnu

 +-----------------------------------------------------------
 + 내가 가진 툴체인은 상수가 정의되어 있지 않는 것들이 몇 개 있다.
 + 이러한 것은 에러가 나면, 추가해 주자.
 + 미리 추가 할 필요는 없다.. 에러가 나면 그곳을 찾아서 해 주면 된다.
 +-----------------------------------------------------------

vi glib-2.12.0/glib/giounix.c

#ifndef SSIZE_MAX  // by B.LEE
# define SSIZE_MAX      INT_MAX
#endif

make
make install
+-----------------------------------------------------------------------------------------
+ atk-1.9.1  http://www.gtk.org/
+-----------------------------------------------------------------------------------------
tar jxvf atk-1.9.1.tar.bz2
cd atk-1.9.1
./configure --prefix=/user/app --host=arm-linux --build=i386-linux

make
make install

+-----------------------------------------------------------------------------------------
+ zlib-1.2.3
+-----------------------------------------------------------------------------------------
tar jxvf zlib-1.2.3.tar.bz2
cd zlib-1.2.3

CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib STRIP=arm-linux-strip \
./configure  --prefix=/user/app --shared
make
make install

cp zlib.h zconf.h /user/app/include
cp: cannot create regular file `/user/app/include/zlib.h': Permission denied
cp: cannot create regular file `/user/app/include/zconf.h': Permission denied

cd /user/app/include
mv zlib.h zlib.bak.h
mv zconf.h zconf.bak.h

make install

+-----------------------------------------------------------------------------------------
+ freetype-2.2.1  http://www.freetype.org
+-----------------------------------------------------------------------------------------
tar zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1

./configure --prefix=/user/app --host=arm-linux --build=i386-linux --target=arm-linux

apinames 은 호스트에서 사용하는 것인데, 크로스 컴파일 되므로 에러가 발생된다. 미리 컴파일 해주고 진행한다.

cd src/tools/
gcc apinames.c -o apinames
mv apinames ../../objs/
cd -

make
make install

+-----------------------------------------------------------------------------------------
+ libxml2-2.6.23 http://xmlsoft.org/
+-----------------------------------------------------------------------------------------

tar zxvf libxml2-2.6.23.tar.gz
cd libxml2-2.6.23

LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-zlib=/user/app --with-iconv=/user/app

 +-----------------------------------------------------------
 + 내가 가진 툴체인은 상수가 정의되어 있지 않는 것들이 몇 개 있다. 이러한 것은 에러가 나면, 추가해 주자.
 + 미리 추가 할 필요는 없다.. 에러가 나면 그곳을 찾아서 해 주면 된다.
 +-----------------------------------------------------------

#ifndef PATH_MAX // by B.LEE
#define PATH_MAX        4096
#endif

make
make install

+-----------------------------------------------------------------------------------------
+ fontconfig-2.4.1  http://www.fontconfig.org
+-----------------------------------------------------------------------------------------

tar zxvf fontconfig-2.4.1.tar.gz
cd fontconfig-2.4.1

./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--enable-libxml2 --with-arch=arm --with-freetype-config=/user/app/bin/freetype-config \
--with-default-fonts=/user/app/lib/X11/fonts \
--with-cache-dir=/user/app/var/cache/fontconfig \
--with-confdir=/user/app/etc/fonts

make
make install

+-----------------------------------------------------------------------------------------
+ libpng-1.2.12  http://www.libpng.org/
+-----------------------------------------------------------------------------------------

tar zxvf libpng-1.2.12.tar.gz
cd libpng-1.2.12
CFLAGS=-I/user/app/include \
LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-pkgconfigdir=/user/app/lib/pkgconfig

:
checking for GNU libc compatible malloc... no
:

 +-----------------------------------------------------------
 + vi config.h
 +-----------------------------------------------------------
/* Define to rpl_malloc if the replacement function should be used. */
//#define malloc rpl_malloc

make
make install

+-----------------------------------------------------------------------------------------
+ render-0.8 http://xlibs.freedesktop.org/release/
+-----------------------------------------------------------------------------------------

tar zxvf render-0.8.tar.gz
cd render-0.8
./configure --prefix=/user/app

make
make install

+-----------------------------------------------------------------------------------------
+ libXrender-0.8.4 http://xlibs.freedesktop.org/release/
+-----------------------------------------------------------------------------------------

tar zxvf libXrender-0.8.4.tar.gz
cd libXrender-0.8.4

./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

make
make install

+-----------------------------------------------------------------------------------------
+ libXft-2.1.10  http://xlibs.freedesktop.org/release/
+-----------------------------------------------------------------------------------------

tar jxvf libXft-2.1.10.tar.bz2
cd libXft-2.1.10
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

make
make install

+-----------------------------------------------------------------------------------------
+ jpeg-6b  http://www.ijg.org/
+-----------------------------------------------------------------------------------------
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b

CC=arm-linux-gcc AR=arm-linux-ar RANLIB=/usr/bin/ranlib STRIP=arm-linux-strip \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib --enable-shared

make
make install

+-----------------------------------------------------------------------------------------
+ tiff-3.7.4  http://www.libtiff.org/
+-----------------------------------------------------------------------------------------

tar zxvf tiff-3.7.4.tar.gz
cd tiff-3.7.4
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-zlib-include-dir=/user/app/include \
--with-zlib-lib-dir=/user/app/lib \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib \
--with-docdir=/user/app/share/doc/tiff-3.7.4


Libtiff is now configured for arm-unknown-linux-gnu

  Installation directory:             /user/app
  Documentation directory:            /user/app/share/doc/tiff-3.7.4
  C compiler:                         arm-linux-gcc -I/user/app/include -Wall
  C++ compiler:                       arm-linux-g++ -g -O2
  Enable runtime linker paths:        no

 Support for internal codecs:
  CCITT Group 3 & 4 algorithms:       yes
  Macintosh PackBits algorithm:       yes
  LZW algorithm:                      yes
  ThunderScan 4-bit RLE algorithm:    yes
  NeXT 2-bit RLE algorithm:           yes
  LogLuv high dynamic range encoding: yes

 Support for external codecs:
  ZLIB support:                       yes
  Pixar log-format algorithm:         yes
  JPEG support:                       yes
  Old JPEG support:                   no

  C++ support:                        yes

  OpenGL support:                     no
 
  make
  make install
+-----------------------------------------------------------------------------------------
+ cairo-1.2.4  http://cairographics.org
+-----------------------------------------------------------------------------------------

tar zxvf cairo-1.2.4.tar.gz
cd cairo-1.2.4

configure( 28019)
  LIBS="$LIBS $ft_LIBS" =>
   LIBS="$LIBS $ft_LIBS -lxml2 -lz -liconv"


./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

make
make install

+-----------------------------------------------------------------------------------------
+ pango-1.14.4 http://www.gtk.org/download/
+-----------------------------------------------------------------------------------------
tar zxvf pango-1.14.4.tar.gz
cd pango-1.14.4

configure 수정
LIBS="-lcairo  $LIBS"
LIBS="-lcairo  $LIBS -lz -lfreetype -lfontconfig -lpng12 -lXrender -lX11 -lxml2 -liconv"


CFLAGS="-I/user/app/include" \
LDFLAGS="-L/user/app/lib" \
FREETYPE_CONFIG=/usr/bin/freetype-config \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

configuration:
        backends: FreeType X Xft Cairo

* backends: FreeType X Xft Cairo 가 모두 출력 되는지 확인한다....

make
make install
+-----------------------------------------------------------------------------------------
+ xextensions-1.0.1  http://xlibs.freedesktop.org/release/
+-----------------------------------------------------------------------------------------
tar zxvf xextensions-1.0.1.tar.gz
cd xextensions-1.0.1
./configure --prefix=/user/app --host=arm-linux --build=i386-linux
make
make install
+-----------------------------------------------------------------------------------------
+ fixesext-2.0.1
+-----------------------------------------------------------------------------------------
tar zxvf fixesext-2.0.1.tar.gz
cd fixesext-2.0.1
./configure --prefix=/user/app --host=arm-linux --build=i386-linux
make
make install

+-----------------------------------------------------------------------------------------
+ libXfixes-2.0.1
+-----------------------------------------------------------------------------------------
tar zxvf libXfixes-2.0.1.tar.gz
cd libXfixes-2.0.1
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

+-----------------------------------------------------------------------------------------
+ libXcursor-1.1.2
+-----------------------------------------------------------------------------------------
tar zxvf libXcursor-1.1.2.tar.gz
cd libXcursor-1.1.2
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--with-x --x-includes=/user/app/include --x-libraries=/user/app/lib

+-----------------------------------------------------------------------------------------
+ gtk+-2.10.0 http://www.gtk.org/download/
+-----------------------------------------------------------------------------------------
tar zxvf gtk+-2.10.0.tar.gz
cd gtk+-2.10.0

vi configure ( 30735 )
  PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES` =>
  PANGO_LIBS="`$PKG_CONFIG --libs $PANGO_PACKAGES` -lpangoft2-1.0 -lfontconfig -lfreetype -lz -lpng12 -lXrender -lX11 -lxml2 -liconv"


 +-----------------------------------------------------------
 + no shared memory
 +-----------------------------------------------------------
 
CFLAGS=-I/user/app/include \
LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--disable-glibtest --with-gdktarget=x11 --with-x \
--x-includes=/user/app/include --x-libraries=/user/app/lib \
--enable-shm=no

 +-----------------------------------------------------------
 + shared memory
 +-----------------------------------------------------------
 
CFLAGS=-I/user/app/include \
LDFLAGS=-L/user/app/lib \
./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--disable-glibtest --with-gdktarget=x11 --with-x \
--x-includes=/user/app/include --x-libraries=/user/app/lib
      
module/Makefile 수정
#PRINTBACKENDS_SUBDIR = printbackends
PRINTBACKENDS_SUBDIR =

gtk/Makefile 수정
#          ./gtk-update-icon-cache --force --ignore-theme-index                 \
#          --source builtin_icons stock-icons > gtkbuiltincache.h

* 이를 수정하지 않으면.. gtkbuiltincache.h 사이즈가 0 이 된다.

make
make install

테스트

cd /user/app/etc
mkdir gtk-2.0
chmod 777 gtk-2.0
chmod 777 /user/app/var/cache/fontconfig/
타겟에서
/user/app/bin/gdk-pixbuf-query-loaders > /user/app/etc/gtk-2.0/gdk-pixbuf.loaders
/user/app/bin/pango-querymodules > /user/app/etc/pango/pango.modules
 +---------------------------------------------------------------------------+
  * /user/app/etc/pango/pangorc 만들어 줌

  [Pango]
  ModuleFiles = /user/app/etc/pango/pango.modules
  ModulesPath = /user/app/lib/pango/1.5.0/modules
 +---------------------------------------------------------------------------+

export TSLIB_TSDEVICE=/dev/digi
export TSLIB_CONFFILE=/user/app/etc/ts.conf
export TSLIB_PLUGINDIR=/user/app/lib/ts
export TSLIB_CALIBFILE=/user/app/etc/pointercal
export FONTCONFIG_FILE=/user/app/etc/fonts/fonts.conf
export PATH=$PATH:/user/app/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/user/app/lib
export DISPLAY=:0.0

mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8

Xfbdev&
gtk-demo

+-----------------------------------------------------------------------------------------
+ 에러 해결 방법
+-----------------------------------------------------------------------------------------

(gtk-demo:424): Gdk-WARNING **: Error converting from UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1'
(gtk-demo:424): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported

 +---------------------------------------------------------------------------+
  glib-2.12.0 의 glib\gconvert.c , open_converter 에서 나는 에러로 예상
  glib-2.12.0/INSTALL 내용중
 
  In order to implement conversions between character sets,
  GLib requires an implementation of the standard iconv() routine.
  Most modern systems will have a suitable implementation, however
  many older systems lack an iconv() implementation. On such systems,
  you must install the libiconv library. This can be found at:
  
   http://www.gnu.org/software/libiconv/
  
 * libiconv-1.11 설치로 해결 
 +---------------------------------------------------------------------------+

(gtk-demo:424): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/user/app/etc/gtk-2.0/gdk-pixbuf.loaders': No such file or directory

 +---------------------------------------------------------------------------+
 * /user/app/etc/gtk-2.0/gdk-pixbuf.loaders 를 생성시켰다.
 그리고, png 부분만 빼고 삭제.. 왜냐면 죽는다.
 
 > host
mkdir gtk-2.0
chmod 777 gtk-2.0
 
 > target
  #/user/app/bin/gdk-pixbuf-query-loaders > /user/app/etc/gtk-2.0/gdk-pixbuf.loaders
 +---------------------------------------------------------------------------+

(gtk-demo:424): Pango-WARNING **: No builtin or dynamically
loaded modules were found. Pango will not work correctly.
This probably means there was an error in the creation of:
  '/user/app/etc/pango/pango.modules'
You should create this file by running pango-querymodules.
 +---------------------------------------------------------------------------+
  [root@localhost pango-1.14.4]# find / -name pango-querymodules
  /usr/bin/pango-querymodules
  /home/qt/target/X/pango-1.14.4/pango/.libs/pango-querymodules
  /home/qt/target/X/pango-1.14.4/pango/pango-querymodules
  /home/qt/target/user/bin/pango-querymodules
  /home/qt/target/N/pango-1.14.4/pango/.libs/pango-querymodules
  /home/qt/target/N/pango-1.14.4/pango/pango-querymodules
  /user/bin/pango-querymodules
  /user/app/bin/pango-querymodules

  
  * /user/app/etc/pango/pango.modules 를 생성해 주었다.

  /user/app/bin/pango-querymodules > /user/app/etc/pango/pango.modules
  
 +---------------------------------------------------------------------------+


(gtk-demo:422): Pango-WARNING **: error opening config file '/user/app/etc/pango/pangorc': Success

 +---------------------------------------------------------------------------+
  * /user/app/etc/pango/pangorc 만들어 줌
 +---------------------------------------------------------------------------+

  [Pango]
  ModuleFiles = /user/app/etc/pango/pango.modules
  ModulesPath = /user/app/lib/pango/1.5.0/modules

 +---------------------------------------------------------------------------+
  * 폰트 디렉토리가 없을 때 발생한다.
 +---------------------------------------------------------------------------+
Could not init font path element /user/app/lib/X11/fonts/misc/, removing from list!
Could not init font path element /user/app/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /user/app/lib/X11/fonts/100dpi/, removing from list!


 +---------------------------------------------------------------------------+
  * 아이콘이 안 보일 때
 +---------------------------------------------------------------------------+
 gtk를 컴파일 할 때, Makefile 를 수정하지 않아서, gtkbuiltincache.h 가 사이즈가 0 인 경우..
 
+-----------------------------------------------------------------------------------------
+ 줄인 파일 목록
+-----------------------------------------------------------------------------------------
# du
680     ./lib/X11/fonts/Type1
684     ./lib/X11/fonts
688     ./lib/X11
240     ./lib/pango/1.5.0/modules
244     ./lib/pango/1.5.0
248     ./lib/pango
276     ./lib/gtk-2.0/2.10.0/loaders
280     ./lib/gtk-2.0/2.10.0
284     ./lib/gtk-2.0
40      ./lib/ts
13096   ./lib
6868    ./bin
116     ./etc/fonts/conf.avail
4       ./etc/fonts/conf.d
140     ./etc/fonts
24      ./etc/pango
8       ./etc/gtk-2.0
184     ./etc
12      ./var/cache/fontconfig
16      ./var/cache
20      ./var
20172   .

# ls -Rl
.:
total 16
drwxrwxr-x    2 qt       qt           4096 Jun 20 15:15 bin
drwxrwxr-x    5 qt       qt           4096 Jun 20 14:13 etc
drwxrwxr-x    6 qt       qt           4096 Jun 20 15:14 lib
drwxrwxr-x    3 qt       qt           4096 Jun 20 10:01 var

./bin:
total 6864
-rwxr-xr-x    1 qt       qt        6261012 Jun 20 15:15 netfront
-rwxr-xr-x    1 qt       qt          18312 Jun 20 15:15 ts_calibrate
-rwxr-xr-x    1 qt       qt          16472 Jun 20 15:15 ts_test
-rwxr-xr-x    1 qt       qt         704852 Jun 20 15:15 Xfbdev

./etc:
total 20
drwxrwxr-x    4 qt       qt           4096 Jun 20 10:01 fonts
drwxrwxr-x    2 qt       qt           4096 Jun 20 12:49 gtk-2.0
drwxrwxr-x    2 qt       qt           4096 Jun 20 12:51 pango
-rwxrwxr-x    1 qt       qt             43 Jun  8 10:20 pointercal
-rw-r--r--    1 qt       qt            644 Jun  8 08:03 ts.conf

./etc/fonts:
total 24
drwxrwxr-x    2 qt       qt           4096 Jun 20 10:01 conf.avail
drwxrwxr-x    2 qt       qt           4096 Jun 20 10:01 conf.d
-rw-r--r--    1 qt       qt           5217 Jun 20 10:01 fonts.conf
-rw-r--r--    1 qt       qt           6907 Jun 20 10:01 fonts.dtd

./etc/fonts/conf.avail:
total 112
-rw-r--r--    1 qt       qt            250 Jun 20 10:01 10-autohint.conf
-rw-r--r--    1 qt       qt            257 Jun 20 10:01 10-no-sub-pixel.conf
-rw-r--r--    1 qt       qt            256 Jun 20 10:01 10-sub-pixel-bgr.conf
-rw-r--r--    1 qt       qt            256 Jun 20 10:01 10-sub-pixel-rgb.conf
-rw-r--r--    1 qt       qt            257 Jun 20 10:01 10-sub-pixel-vbgr.conf
-rw-r--r--    1 qt       qt            257 Jun 20 10:01 10-sub-pixel-vrgb.conf
-rw-r--r--    1 qt       qt            247 Jun 20 10:01 10-unhinted.conf
-rw-r--r--    1 qt       qt            943 Jun 20 10:01 20-fix-globaladvance.conf
-rw-r--r--    1 qt       qt            301 Jun 20 10:01 20-lohit-gujarati.conf
-rw-r--r--    1 qt       qt           1188 Jun 20 10:01 20-unhint-small-vera.conf
-rw-r--r--    1 qt       qt            514 Jun 20 10:01 30-amt-aliases.conf
-rw-r--r--    1 qt       qt           1484 Jun 20 10:01 30-urw-aliases.conf
-rw-r--r--    1 qt       qt           1723 Jun 20 10:01 40-generic.conf
-rw-r--r--    1 qt       qt            545 Jun 20 10:01 49-sansserif.conf
-rw-r--r--    1 qt       qt            269 Jun 20 10:01 50-user.conf
-rw-r--r--    1 qt       qt            271 Jun 20 10:01 51-local.conf
-rw-r--r--    1 qt       qt           1064 Jun 20 10:01 60-latin.conf
-rw-r--r--    1 qt       qt          12559 Jun 20 10:01 65-fonts-persian.conf
-rw-r--r--    1 qt       qt            954 Jun 20 10:01 65-nonlatin.conf
-rw-r--r--    1 qt       qt            454 Jun 20 10:01 69-unifont.conf
-rw-r--r--    1 qt       qt            306 Jun 20 10:01 70-no-bitmaps.conf
-rw-r--r--    1 qt       qt            296 Jun 20 10:01 70-yes-bitmaps.conf
-rw-r--r--    1 qt       qt            433 Jun 20 10:01 80-delicious.conf
-rw-r--r--    1 qt       qt           1754 Jun 20 10:01 90-synthetic.conf
-rw-r--r--    1 qt       qt           1474 Jun 20 10:01 README

./etc/fonts/conf.d:
total 0
lrwxrwxrwx    1 qt       qt             39 Aug 14 10:25 20-fix-globaladvance.conf -> ../conf.avail/20-fix-globaladvance.conf
lrwxrwxrwx    1 qt       qt             36 Aug 14 10:25 20-lohit-gujarati.conf -> ../conf.avail/20-lohit-gujarati.conf
lrwxrwxrwx    1 qt       qt             39 Aug 14 10:25 20-unhint-small-vera.conf -> ../conf.avail/20-unhint-small-vera.conf
lrwxrwxrwx    1 qt       qt             33 Aug 14 10:25 30-amt-aliases.conf -> ../conf.avail/30-amt-aliases.conf
lrwxrwxrwx    1 qt       qt             33 Aug 14 10:25 30-urw-aliases.conf -> ../conf.avail/30-urw-aliases.conf
lrwxrwxrwx    1 qt       qt             29 Aug 14 10:25 40-generic.conf -> ../conf.avail/40-generic.conf
lrwxrwxrwx    1 qt       qt             31 Aug 14 10:25 49-sansserif.conf -> ../conf.avail/49-sansserif.conf
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 50-user.conf -> ../conf.avail/50-user.conf
lrwxrwxrwx    1 qt       qt             27 Aug 14 10:25 51-local.conf -> ../conf.avail/51-local.conf
lrwxrwxrwx    1 qt       qt             27 Aug 14 10:25 60-latin.conf -> ../conf.avail/60-latin.conf
lrwxrwxrwx    1 qt       qt             35 Aug 14 10:25 65-fonts-persian.conf -> ../conf.avail/65-fonts-persian.conf
lrwxrwxrwx    1 qt       qt             30 Aug 14 10:25 65-nonlatin.conf -> ../conf.avail/65-nonlatin.conf
lrwxrwxrwx    1 qt       qt             29 Aug 14 10:25 69-unifont.conf -> ../conf.avail/69-unifont.conf
lrwxrwxrwx    1 qt       qt             31 Aug 14 10:25 80-delicious.conf -> ../conf.avail/80-delicious.conf
lrwxrwxrwx    1 qt       qt             31 Aug 14 10:25 90-synthetic.conf -> ../conf.avail/90-synthetic.conf

./etc/gtk-2.0:
total 4
-rw-r--r--    1 qt       qt           2802 Jun 20 12:49 gdk-pixbuf.loaders

./etc/pango:
total 20
-rw-r--r--    1 qt       qt           2560 Jun 20 12:49 pango.modules
-rw-rw-r--    1 qt       qt            104 Jun 20 12:51 pangorc
-rw-r--r--    1 qt       qt          11446 Jun 20 10:20 pangox.aliases

./lib:
total 11848
drwxrwxr-x    3 qt       qt           4096 Jun 20 14:17 gtk-2.0
lrwxrwxrwx    1 qt       qt             21 Aug 14 10:25 libatk-1.0.so.0 -> libatk-1.0.so.0.901.0
-rwxr-xr-x    1 qt       qt         105640 Jun 20 15:14 libatk-1.0.so.0.901.0
lrwxrwxrwx    1 qt       qt             17 Aug 14 10:25 libcairo.so.2 -> libcairo.so.2.9.2
-rwxr-xr-x    1 qt       qt         377260 Jun 20 15:14 libcairo.so.2.9.2
lrwxrwxrwx    1 qt       qt             22 Aug 14 10:25 libfontconfig.so.1 -> libfontconfig.so.1.1.0
-rwxr-xr-x    1 qt       qt         182576 Jun 20 15:14 libfontconfig.so.1.1.0
lrwxrwxrwx    1 qt       qt             21 Aug 14 10:25 libfreetype.so.6 -> libfreetype.so.6.3.10
-rwxr-xr-x    1 qt       qt         383108 Jun 20 15:14 libfreetype.so.6.3.10
lrwxrwxrwx    1 qt       qt             29 Aug 14 10:25 libgdk_pixbuf-2.0.so.0 -> libgdk_pixbuf-2.0.so.0.1000.0
-rwxr-xr-x    1 qt       qt         125352 Jun 20 15:14 libgdk_pixbuf-2.0.so.0.1000.0
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 libgdk-x11-2.0.so.0 -> libgdk-x11-2.0.so.0.1000.0
-rwxr-xr-x    1 qt       qt         733288 Jun 20 15:14 libgdk-x11-2.0.so.0.1000.0
lrwxrwxrwx    1 qt       qt             23 Aug 14 10:25 libglib-2.0.so.0 -> libglib-2.0.so.0.1200.0
-rwxr-xr-x    1 qt       qt         826708 Jun 20 15:14 libglib-2.0.so.0.1200.0
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.1200.0
-rwxr-xr-x    1 qt       qt          12988 Jun 20 15:14 libgmodule-2.0.so.0.1200.0
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 libgobject-2.0.so.0 -> libgobject-2.0.so.0.1200.0
-rwxr-xr-x    1 qt       qt         319124 Jun 20 15:14 libgobject-2.0.so.0.1200.0
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 libgthread-2.0.so.0 -> libgthread-2.0.so.0.1200.0
-rwxr-xr-x    1 qt       qt          17960 Jun 20 15:14 libgthread-2.0.so.0.1200.0
lrwxrwxrwx    1 qt       qt             26 Aug 14 10:25 libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.1000.0
-rwxr-xr-x    1 qt       qt        4911396 Jun 20 15:14 libgtk-x11-2.0.so.0.1000.0
lrwxrwxrwx    1 qt       qt             17 Aug 14 10:25 libiconv.so.2 -> libiconv.so.2.4.0
-rwxr-xr-x    1 qt       qt         904296 Jun 20 15:14 libiconv.so.2.4.0
lrwxrwxrwx    1 qt       qt             24 Aug 14 10:25 libpango-1.0.so.0 -> libpango-1.0.so.0.1400.4
-rwxr-xr-x    1 qt       qt         320120 Jun 20 15:14 libpango-1.0.so.0.1400.4
lrwxrwxrwx    1 qt       qt             29 Aug 14 10:25 libpangocairo-1.0.so.0 -> libpangocairo-1.0.so.0.1400.4
-rwxr-xr-x    1 qt       qt          37808 Jun 20 15:14 libpangocairo-1.0.so.0.1400.4
lrwxrwxrwx    1 qt       qt             27 Aug 14 10:25 libpangoft2-1.0.so.0 -> libpangoft2-1.0.so.0.1400.4
-rwxr-xr-x    1 qt       qt         260924 Jun 20 15:14 libpangoft2-1.0.so.0.1400.4
lrwxrwxrwx    1 qt       qt             25 Aug 14 10:25 libpangox-1.0.so.0 -> libpangox-1.0.so.0.1400.4
-rwxr-xr-x    1 qt       qt          54472 Jun 20 15:14 libpangox-1.0.so.0.1400.4
lrwxrwxrwx    1 qt       qt             27 Aug 14 10:25 libpangoxft-1.0.so.0 -> libpangoxft-1.0.so.0.1400.4
-rwxr-xr-x    1 qt       qt          31448 Jun 20 15:14 libpangoxft-1.0.so.0.1400.4
lrwxrwxrwx    1 qt       qt             18 Aug 14 10:25 libpng12.so.0 -> libpng12.so.0.12.0
-rwxr-xr-x    1 qt       qt         208600 Jun 20 15:14 libpng12.so.0.12.0
lrwxrwxrwx    1 qt       qt             18 Aug 14 10:25 libts-0.0.so.0 -> libts-0.0.so.0.1.1
-rwxr-xr-x    1 qt       qt           8524 Jun 20 15:14 libts-0.0.so.0.1.1
lrwxrwxrwx    1 qt       qt             18 Aug 14 10:25 libts.so -> libts-0.0.so.0.1.1
lrwxrwxrwx    1 qt       qt             13 Aug 14 10:25 libX11.so.6 -> libX11.so.6.2
-rwxr-xr-x    1 qt       qt         671708 Jun 20 15:14 libX11.so.6.2
lrwxrwxrwx    1 qt       qt             19 Aug 14 10:25 libXcursor.so.1 -> libXcursor.so.1.0.2
-rwxr-xr-x    1 qt       qt          31968 Jun 20 15:14 libXcursor.so.1.0.2
lrwxrwxrwx    1 qt       qt             14 Aug 14 10:25 libXext.so.6 -> libXext.so.6.4
-rwxr-xr-x    1 qt       qt          58372 Jun 20 15:14 libXext.so.6.4
lrwxrwxrwx    1 qt       qt             18 Aug 14 10:25 libXfixes.so.0 -> libXfixes.so.0.1.0
-rwxr-xr-x    1 qt       qt          14304 Jun 20 15:14 libXfixes.so.0.1.0
lrwxrwxrwx    1 qt       qt             15 Aug 14 10:25 libXft.so.2 -> libXft.so.2.1.2
-rwxr-xr-x    1 qt       qt          67992 Jun 20 15:14 libXft.so.2.1.2
lrwxrwxrwx    1 qt       qt             17 Aug 14 10:25 libxml2.so.2 -> libxml2.so.2.6.23
-rwxr-xr-x    1 qt       qt        1205308 Jun 20 15:14 libxml2.so.2.6.23
lrwxrwxrwx    1 qt       qt             19 Aug 14 10:25 libXrender.so.1 -> libXrender.so.1.2.2
-rwxr-xr-x    1 qt       qt          27120 Jun 20 15:14 libXrender.so.1.2.2
lrwxrwxrwx    1 qt       qt             13 Aug 14 10:25 libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x    1 qt       qt          75264 Jun 20 15:14 libz.so.1.2.3
drwxrwxr-x    3 qt       qt           4096 Jun 20 14:17 pango
drwxrwxr-x    2 qt       qt           4096 Jun 20 14:30 ts
drwxrwxr-x    3 qt       qt           4096 Jun 20 14:31 X11

./lib/gtk-2.0:
total 4
drwxrwxr-x    3 qt       qt           4096 Jun 20 14:17 2.10.0

./lib/gtk-2.0/2.10.0:
total 4
drwxrwxr-x    2 qt       qt           4096 Jun 20 14:17 loaders

./lib/gtk-2.0/2.10.0/loaders:
total 272
-rwxr-xr-x    1 qt       qt          16812 Jun 20 14:17 libpixbufloader-ani.so
-rwxr-xr-x    1 qt       qt          20404 Jun 20 14:17 libpixbufloader-bmp.so
-rwxr-xr-x    1 qt       qt          30564 Jun 20 14:17 libpixbufloader-gif.so
-rwxr-xr-x    1 qt       qt          19776 Jun 20 14:17 libpixbufloader-ico.so
-rwxr-xr-x    1 qt       qt          17868 Jun 20 14:17 libpixbufloader-jpeg.so
-rwxr-xr-x    1 qt       qt          14256 Jun 20 14:17 libpixbufloader-pcx.so
-rwxr-xr-x    1 qt       qt          18720 Jun 20 14:17 libpixbufloader-png.so
-rwxr-xr-x    1 qt       qt          19852 Jun 20 14:17 libpixbufloader-pnm.so
-rwxr-xr-x    1 qt       qt          10496 Jun 20 14:17 libpixbufloader-ras.so
-rwxr-xr-x    1 qt       qt          19084 Jun 20 14:17 libpixbufloader-tga.so
-rwxr-xr-x    1 qt       qt          15888 Jun 20 14:17 libpixbufloader-tiff.so
-rwxr-xr-x    1 qt       qt           8256 Jun 20 14:17 libpixbufloader-wbmp.so
-rwxr-xr-x    1 qt       qt          11416 Jun 20 14:17 libpixbufloader-xbm.so
-rwxr-xr-x    1 qt       qt          29264 Jun 20 14:17 libpixbufloader-xpm.so

./lib/pango:
total 4
drwxrwxr-x    3 qt       qt           4096 Jun 20 14:17 1.5.0

./lib/pango/1.5.0:
total 4
drwxrwxr-x    2 qt       qt           4096 Jun 20 14:30 modules

./lib/pango/1.5.0/modules:
total 236
-rwxr-xr-x    1 qt       qt          13404 Jun 20 14:17 pango-arabic-fc.so
-rwxr-xr-x    1 qt       qt          11736 Jun 20 14:17 pango-basic-fc.so
-rwxr-xr-x    1 qt       qt          81368 Jun 20 14:17 pango-basic-x.so
-rwxr-xr-x    1 qt       qt          12412 Jun 20 14:17 pango-hangul-fc.so
-rwxr-xr-x    1 qt       qt          15828 Jun 20 14:17 pango-hebrew-fc.so
-rwxr-xr-x    1 qt       qt          27040 Jun 20 14:17 pango-indic-fc.so
-rwxr-xr-x    1 qt       qt          11288 Jun 20 14:17 pango-khmer-fc.so
-rwxr-xr-x    1 qt       qt          13064 Jun 20 14:17 pango-syriac-fc.so
-rwxr-xr-x    1 qt       qt          23228 Jun 20 14:17 pango-thai-fc.so
-rwxr-xr-x    1 qt       qt          10584 Jun 20 14:17 pango-tibetan-fc.so

./lib/ts:
total 36
-rwxr-xr-x    1 qt       qt           5096 Jun 20 14:17 dejitter.so
-rwxr-xr-x    1 qt       qt           4032 Jun 20 14:17 h3600.so
-rwxr-xr-x    1 qt       qt           5216 Jun 20 14:17 linear.so
-rwxr-xr-x    1 qt       qt           4784 Jun 20 14:17 pthres.so
-rwxr-xr-x    1 qt       qt           4912 Jun 20 14:17 variance.so

./lib/X11:
total 4
drwxr-xr-x    3 qt       qt           4096 Jun 20 14:17 fonts

./lib/X11/fonts:
total 4
drwxr-xr-x    2 qt       qt           4096 Jun 20 14:17 Type1

./lib/X11/fonts/Type1:
total 676
-rw-r--r--    1 qt       qt         674756 Jun 20 14:17 blee.ttf
-rw-r--r--    1 qt       qt           2587 Jun 20 14:17 fonts.cache-1
-rw-r--r--    1 qt       qt            128 Jun 20 14:17 fonts.dir
-rw-r--r--    1 qt       qt            128 Jun 20 14:17 fonts.scale

./var:
total 4
drwxrwxr-x    3 qt       qt           4096 Jun 20 10:01 cache

./var/cache:
total 4
drwxrwxr-x    2 qt       qt           4096 Jun 20 14:36 fontconfig

./var/cache/fontconfig:
total 8
-rw-r--r--    1 qt       qt           3120 Jun 20 14:36 025940843c8f619711e5a2e4315ec693-arm.cache-2
-rw-r--r--    1 qt       qt            112 Jun 20 14:36 3c4cc90c92e4ad1f6479574f39aa30d0-arm.cache-2
+-----------------------------------------------------------------------------------------
+
+ gtk 한글 처리
+
+-----------------------------------------------------------------------------------------

gchar *str = NULL;
 gchar *tmp="한글";
 
{
 GError *error = NULL;
 str = g_convert (tmp, -1, "UTF-8", "euc-kr", NULL, NULL, &error);
 if (!str)
 {
    g_warning ("Cannot convert text from charset to UTF-8 %s: %s", "euc-kr", error->message);
    g_error_free (error);
  }
  g_free (tmp);
 }
 
    /* Creates a new button with the label "Hello World". */
    button = gtk_button_new_with_label (str);


+-----------------------------------------------------------------------------------------
+
+ qt 및 konq-embedded 포팅
+
+-----------------------------------------------------------------------------------------
 * qt, konq-embedded 컴파일 옵션에서 -fno-rtti 제거하고 컴파일 한다.
 
export PKG_CONFIG_PATH=/user/app/lib/pkgconfig
export QTDIR=/home/qt/target/WallPad/qt

+-----------------------------------------------------------------------------------------
+ qt-embedded-free-3.3.3
+-----------------------------------------------------------------------------------------

tar zxvf qt-embedded-free-3.3.3.tar.gz
ln -s qt-embedded-free-3.3.3 qt
cd qt

./configure -qconfig full -depths 16 -embedded arm \
-thread -no-qvfb -no-xft -no-cups -qt-sql-sqlite \
-qt-gif -qt-libpng -qt-libjpeg -qt-libmng  -qt-imgfmt-png  -qt-imgfmt-jpeg  -qt-imgfmt-mng \
-qt-mouse-linuxtp -prefix /user/app \
-little-endian

Makefile 수정, examples , tools 등 필요 없는 것은 뺀다.

all: symlinks src-qmake src-moc sub-src

 +-----------------------------------------------------------
 + -fno-rtti 옵션을 제거, 이는 konq-embedded 가 이를 사용하기 때문이다.
 + konq-embedded가 자바 스크립터에서 죽는 부분 해결 위함
 +-----------------------------------------------------------
 
모든 Makefile 에서 -fno-rtti 옵션을 제거한다.

 +-----------------------------------------------------------
 + 특정 arm보드 계열에서 QTextEdit 생성 안되는 문제
 +-----------------------------------------------------------
$QTDIR/src/kernel/qfont.cpp
QString QFont::toString() const
{
    const QChar comma( ',' );
    return family() + comma +
#if 0 // by B.LEE
 QString::number(  pointSizeFloat() ) + comma +
#else
 QString::number(  (int)pointSizeFloat() ) + comma +
#endif
 QString::number(       pixelSize() ) + comma +
 QString::number( (int) styleHint() ) + comma +
 QString::number(          weight() ) + comma +
 QString::number( (int)    italic() ) + comma +
 QString::number( (int) underline() ) + comma +
 QString::number( (int) strikeOut() ) + comma +
 QString::number( (int)fixedPitch() ) + comma +
 QString::number( (int)   rawMode() );
}

 +-----------------------------------------------------------
 + sqlite 에 버그가 있다는데, 다른분이 수정했다. 뭘 했는지 모른다.
 +-----------------------------------------------------------

 +-----------------------------------------------------------
 + 터치를 사용하기 위해 linuxtp 를 수정한다.
 +-----------------------------------------------------------

vi src/embedded/qmouselinuxtp_qws.cpp

/****************************************************************************
** $Id: qt/qmouselinuxtp_qws.cpp   3.3.3   edited Apr 7 10:45 $
**
** Implementation of Qt/Embedded mouse drivers
**
** Created : 20020220
**
** Copyright (C) 1992-2002 Trolltech AS.  All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses for Qt/Embedded may use this file in accordance with the
** Qt Embedded Commercial License Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#include "qmouselinuxtp_qws.h"

#ifndef QT_NO_QWS_MOUSE_LINUXTP
#include "qwindowsystem_qws.h"
#include "qsocketnotifier.h"
#include "qtimer.h"
#include "qapplication.h"
#include "qgfx_qws.h"

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>

#define QT_QWS_IPAQ

#if defined(QT_QWS_IPAQ)
#define QT_QWS_IPAQ_RAW
typedef struct {
 unsigned short pressure;
 unsigned short x;
 unsigned short y;
 unsigned short pad;
} TS_EVENT;
#elif defined(QT_QWS_EBX)
#define QT_QWS_EBX_RAW
#ifndef QT_QWS_SHARP
typedef struct {
        unsigned short pressure;
        unsigned short x;
        unsigned short y;
        unsigned short pad;
} TS_EVENT;
#else
typedef struct {
       long y;
       long x;
       long pressure;
       long long millisecs;
} TS_EVENT;
#define QT_QWS_TP_SAMPLE_SIZE 10
#define QT_QWS_TP_MINIMUM_SAMPLES 1
#define QT_QWS_TP_PRESSURE_THRESHOLD 500

#define QT_QWS_TP_MOVE_LIMIT 50
#define QT_QWS_TP_JITTER_LIMIT 2
#endif
#else
typedef struct {
 unsigned short pressure;
 unsigned short x;
 unsigned short y;
 unsigned short pad;
} TS_EVENT;
#endif

#ifndef QT_QWS_TP_SAMPLE_SIZE
#define QT_QWS_TP_SAMPLE_SIZE 5
#endif

#ifndef QT_QWS_TP_MINIMUM_SAMPLES
#define QT_QWS_TP_MINIMUM_SAMPLES 5
#endif

#ifndef QT_QWS_TP_PRESSURE_THRESHOLD
#define QT_QWS_TP_PRESSURE_THRESHOLD 1
#endif

#ifndef QT_QWS_TP_MOVE_LIMIT
#define QT_QWS_TP_MOVE_LIMIT 100
#endif

#ifndef QT_QWS_TP_JITTER_LIMIT
#define QT_QWS_TP_JITTER_LIMIT 2
#endif

// by nahel
#define QT_QWS_TP_SAMPLE_SIZE 10
#define QT_QWS_TP_MINIMUM_SAMPLES 1
#define QT_QWS_TP_PRESSURE_THRESHOLD 10
#define QT_QWS_TP_MOVE_LIMIT 50
#define QT_QWS_TP_JITTER_LIMIT 1

class QWSLinuxTPMouseHandlerPrivate : public QObject
{
    Q_OBJECT
public:
    QWSLinuxTPMouseHandlerPrivate( QWSLinuxTPMouseHandler *h );
    ~QWSLinuxTPMouseHandlerPrivate();

private:
    static const int mouseBufSize = 2048;
    int mouseFD;
    QPoint oldmouse;
    QPoint oldTotalMousePos;
    bool waspressed;
    QPointArray samples;
    unsigned int currSample;
    unsigned int lastSample;
    unsigned int numSamples;
    int skipCount;
    int mouseIdx;
    uchar mouseBuf[mouseBufSize];
    QWSLinuxTPMouseHandler *handler;

private slots:
    void readMouseData();
};

QWSLinuxTPMouseHandler::QWSLinuxTPMouseHandler( const QString &, const QString & )
{
    d = new QWSLinuxTPMouseHandlerPrivate( this );
}

QWSLinuxTPMouseHandler::~QWSLinuxTPMouseHandler()
{
    delete d;
}

QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate( QWSLinuxTPMouseHandler *h )
    : samples(QT_QWS_TP_SAMPLE_SIZE), currSample(0), lastSample(0),
    numSamples(0), skipCount(0), handler(h)
{
// by nahel
//printf("QWSLinuxTPMouseHandlerPrivate open\n");

/*
#if defined(QT_QWS_IPAQ)
# ifdef QT_QWS_IPAQ_RAW
printf("#1\n");
    if ((mouseFD = open( "/dev/h3600_tsraw", O_RDONLY | O_NDELAY)) < 0) {
# else
printf("#2\n");
    if ((mouseFD = open( "/dev/h3600_ts", O_RDONLY | O_NDELAY)) < 0) {
# endif
 qWarning( "Cannot open /dev/h3600_ts (%s)", strerror(errno));
 return;
    }
#elif defined(QT_QWS_EBX)
printf("#3\n");
//# ifdef QT_QWS_EBX_TSRAW
# if 0
    if ((mouseFD = open( "/dev/tsraw", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/tsraw (%s)", strerror(errno));
       return;
    }
# else
// by nahel
printf("ts open\n");
    if ((mouseFD = open( "/dev/ts", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/ts (%s)", strerror(errno));
        return;
     }
# endif
#endif
*/

//printf("ts open\n");
    if ((mouseFD = open( "/dev/digi", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/digi (%s)", strerror(errno));
        return;
     }

//printf("#5\n");
    QSocketNotifier *mouseNotifier;
    mouseNotifier = new QSocketNotifier( mouseFD, QSocketNotifier::Read,
      this );
    connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData()));
    waspressed=FALSE;
    mouseIdx = 0;
}

QWSLinuxTPMouseHandlerPrivate::~QWSLinuxTPMouseHandlerPrivate()
{
    if (mouseFD >= 0)
 close(mouseFD);
}


void QWSLinuxTPMouseHandlerPrivate::readMouseData()
{
    if(!qt_screen)
 return;

    int n;
    do {
 n = read(mouseFD, mouseBuf+mouseIdx, mouseBufSize-mouseIdx );
 if ( n > 0 )
     mouseIdx += n;
    } while ( n > 0 && mouseIdx < mouseBufSize );

    TS_EVENT *data;
    int idx = 0;

    // perhaps we shouldn't be reading EVERY SAMPLE.
    while ( mouseIdx-idx >= (int)sizeof( TS_EVENT ) ) {
 uchar *mb = mouseBuf+idx;
 data = (TS_EVENT *) mb;

//printf("data->pressure=%d:%d\n", data->pressure, QT_QWS_TP_PRESSURE_THRESHOLD);

 if(data->pressure >= QT_QWS_TP_PRESSURE_THRESHOLD)
 {

#ifdef QT_QWS_SHARP
     samples[currSample] = QPoint( 1000 - data->x, data->y );
#else
     samples[currSample] = QPoint( data->x, data->y );
#endif

     numSamples++;
     if ( numSamples >= QT_QWS_TP_MINIMUM_SAMPLES ) {
  int sampleCount = QMIN(numSamples + 1,samples.count());

  // average the rest
  QPoint mousePos = QPoint( 0, 0 );
  QPoint totalMousePos = oldTotalMousePos;
  totalMousePos += samples[currSample];
  if(numSamples >= samples.count())
      totalMousePos -= samples[lastSample];

  mousePos = totalMousePos / (sampleCount - 1);

# if defined(QT_QWS_IPAQ_RAW) || defined(QT_QWS_EBX_RAW)
  mousePos = handler->transform( mousePos );
# endif
  if(!waspressed)
      oldmouse = mousePos;
  QPoint dp = mousePos - oldmouse;
  int dxSqr = dp.x() * dp.x();
  int dySqr = dp.y() * dp.y();
  if ( dxSqr + dySqr < (QT_QWS_TP_MOVE_LIMIT * QT_QWS_TP_MOVE_LIMIT) ) {
      if ( waspressed ) {
   if ( (dxSqr + dySqr > (QT_QWS_TP_JITTER_LIMIT * QT_QWS_TP_JITTER_LIMIT) ) || skipCount > 2) {
//printf("#1\n");
       handler->mouseChanged(mousePos,Qt::LeftButton);
       oldmouse = mousePos;
       skipCount = 0;
   } else {
       skipCount++;
   }
      } else {
   handler->mouseChanged(mousePos,Qt::LeftButton);
   oldmouse=mousePos;
   waspressed=true;
      }

      // save recuring information
      currSample++;
      if (numSamples >= samples.count())
   lastSample++;
      oldTotalMousePos = totalMousePos;
  } else {
      numSamples--; // don't use this sample, it was bad.
  }
     } else {
  // build up the average
  oldTotalMousePos += samples[currSample];
  currSample++;
     }
     if ( currSample >= samples.count() )
  currSample = 0;
     if ( lastSample >= samples.count() )
  lastSample = 0;
 } else {
     currSample = 0;
     lastSample = 0;
     numSamples = 0;
     skipCount = 0;
     oldTotalMousePos = QPoint(0,0);
     if ( waspressed ) {
  handler->mouseChanged(oldmouse,0);
  oldmouse = QPoint( -100, -100 );
  waspressed=false;
     }
 }
 idx += sizeof( TS_EVENT );
    }

    int surplus = mouseIdx - idx;
    for ( int i = 0; i < surplus; i++ )
 mouseBuf[i] = mouseBuf[idx+i];
    mouseIdx = surplus;
}

#include "qmouselinuxtp_qws.moc"
#endif //QT_NO_QWS_MOUSE_LINUXTP


make
make install
+-----------------------------------------------------------------------------------------
+ PCRE - Perl Compatible Regular Expressions http://www.pcre.org/
+-----------------------------------------------------------------------------------------

./configure --prefix=/user/app --host=arm-linux --build=i386-linux

+-----------------------------------------------------------------------------------------
+ konqueror3-embedded-0.2-20060121 http://www.cirulla.net/kdenox-snapshots/
+         http://www.konqueror.org/embedded/
+-----------------------------------------------------------------------------------------

 +-----------------------------------------------------------
 + configure 파일 수정
 +-----------------------------------------------------------
linux* 에 해당하는 lib 경로가 fix 되어 있다. 타켓에 맞게 수정해 준다.
여러 군데 있으므로 잘 찾아서 고쳐 준다.
 
#sys_lib_dlsearch_path_spec="/lib /usr/lib"
#sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/user/app/lib /usr/local/arm/lib/gcc-lib/arm-linux/3.2.3/../../../../arm-linux/lib"
sys_lib_search_path_spec="/user/app/lib /usr/local/arm/lib/gcc-lib/arm-linux/3.2.3/../../../../arm-linux/lib"


./configure --prefix=/user/app --host=arm-linux --build=i386-linux \
--enable-debug=yes \
--enable-qt-embedded \
--enable-pie \
--disable-pcre \
--enable-embedded \
--disable-qtopia \
--disable-mac \
--enable-mt \
--disable-dlopen \
--disable-printing \
--enable-ftp \
--enable-cgi \
--enable-pcre \
--disable-bookmarks \
--with-konq-tmp-prefix="/user/temp" \
--with-extra-includes=/user/app/include \
--with-extra-libs=/user/app/lib \
--with-qt-dir="/home/qt/target/WallPad/qt" \
--with-qt-includes="/home/qt/target/WallPad/qt/include" \
--with-qt-libraries="/user/app/lib" \
--without-arts \
--with-javascript=static \
--with-ipv6-lookup=no \
--without-ssl \
--with-gui=kiosk

#--disable-pcre \

 +-----------------------------------------------------------
 + -fno-rtti 옵션을 제거, 이는 konq-embedded 가 이를 사용하기 때문이다.
 +-----------------------------------------------------------
모든 Makefile 에서 -fno-rtti 옵션을 제거한다.


make
make install

 +-----------------------------------------------------------
 + user/app/share/config/kcookiejarrc 생성
 + 이 파일이 없다면, 쿠키를 가진 웹페이지는 제대로 로딩되지 않는다.
 +-----------------------------------------------------------
 
vi /user/app/share/config/kcookiejarrc 
[Cookie Dialog]
PreferredPolicy=1
ShowCookieDetails=false
[Cookie Policy]
CookieGlobalAdvice=Accept
Cookies=true
IgnoreExpirationDate=false

 +-----------------------------------------------------------
 + 그 외 필요한 파일, 하지만 install 하면 자동 생성된다.
 +-----------------------------------------------------------
 
user/app/share/config/konq-embedrc
user/app/share/apps/khtml/css/html4.css
+-----------------------------------------------------------------------------------------
+ 테스트
+-----------------------------------------------------------------------------------------
 +-----------------------------------------------------------
 + QT 환경 설정
 +-----------------------------------------------------------

export LD_LIBRARY_PATH=/user/app/lib:$LD_LIBRARY_PATH
export TSLIB_TSDEVICE=/dev/digi
export QTDIR=/user/app
export QWS_MOUSE_PROTO=linuxtp:/dev/digi
cp /user/app/etc/pointercal /etc/

 +-----------------------------------------------------------
 + konq-embedded 환경 설정
 +-----------------------------------------------------------
export KDEDIR=/user/qpp
export KDEHOME=$KDEDIR
export KDEROOTHOME=$KDEDIR
#export KIO_HTTP_USECACHE=true
export KIO_HTTP_USECACHE=false
export KIO_HTTP_MAXCACHESIZE=1024

export KIO_HTTP_CONNECT_TIMEOUT=5
export KIO_HTTP_RESPONSE_TIMEOUT=3
export KIO_HTTP_READ_TIMEOUT=3

CACHE_DIR=/var/webbrowser/cache

if [ ! -d $CACHE_DIR ]
then
        mkdir -p $CACHE_DIR
fi

./konqueror -qws
+-----------------------------------------------------------------------------------------
+ 실행시 필요한 파일
+-----------------------------------------------------------------------------------------
-rw-r--r-- root/root        38 2007-08-10 21:08:45 user/app/etc/pointercal
-rw-r--r-- root/root        47 2007-08-10 21:02:37 user/app/share/config/konq-embedrc
-rw-r--r-- root/root       171 2007-08-10 21:02:37 user/app/share/config/kcookiejarrc
-rw-r--r-- root/root      8033 2007-08-10 21:01:47 user/app/share/apps/khtml/css/html4.css
lrwxrwxrwx root/root         0 2007-08-10 20:59:45 user/app/lib/libqte-mt.so -> libqte-mt.so.3.3.3
lrwxrwxrwx root/root         0 2007-08-10 20:59:43 user/app/lib/libqte-mt.so.3 -> libqte-mt.so.3.3.3
-rwxr-xr-x root/root   7725664 2007-08-11 00:15:53 user/app/lib/libqte-mt.so.3.3.3
lrwxrwxrwx root/root         0 2007-08-10 21:01:03 user/app/lib/libkonqe.so -> libkonqe.so.0.0.0
drwxr-xr-x root/root         0 2007-08-11 00:28:49 user/app/lib/fonts/
-rwxr--r-- root/root    756264 2007-08-11 00:29:16 user/app/lib/fonts/na.ttf
-r-xr--r-- root/root    538044 2007-08-11 00:29:15 user/app/lib/fonts/ygo130.ttf
-rwxr--r-- root/root  10500792 2007-08-11 00:29:14 user/app/lib/fonts/simsun.ttc
-rwxr--r-- root/root     26580 2007-08-11 00:29:02 user/app/lib/fonts/nekoyanagi.ttf
-r-xr--r-- root/root   2569040 2007-08-11 00:29:02 user/app/lib/fonts/mssong.ttf
-r-xr--r-- root/root      1629 2007-08-11 00:28:56 user/app/lib/fonts/mkfontdir-qws
-rwxr--r-- root/root     21628 2007-08-11 00:28:56 user/app/lib/fonts/m36_ledbit.TTF
-r-xr--r-- root/root     72680 2007-08-11 00:28:56 user/app/lib/fonts/lcd.ttf
-rwxr--r-- root/root   6114396 2007-08-11 00:28:56 user/app/lib/fonts/HMFMOLD.TTF
-rwxr--r-- root/root     46320 2007-08-11 00:28:49 user/app/lib/fonts/gaufontkusanagi.ttf
-rwxr--r-- root/root      7822 2007-08-11 00:28:49 user/app/lib/fonts/fontdir-lots
-rwxr--r-- root/root        50 2007-08-11 00:28:49 user/app/lib/fonts/fontdir
lrwxrwxrwx root/root         0 2007-08-11 00:24:54 user/app/lib/libz.so -> libz.so.1.2.3
lrwxrwxrwx root/root         0 2007-08-11 00:24:53 user/app/lib/libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x root/root     75264 2007-08-11 00:24:40 user/app/lib/libz.so.1.2.3
lrwxrwxrwx root/root         0 2007-08-10 21:01:02 user/app/lib/libkonqe.so.0 -> libkonqe.so.0.0.0
lrwxrwxrwx root/root         0 2007-08-11 00:24:18 user/app/lib/libjpeg.so -> libjpeg.so.62.0.0
lrwxrwxrwx root/root         0 2007-08-11 00:24:17 user/app/lib/libjpeg.so.62 -> libjpeg.so.62.0.0
-rwxr-xr-x root/root    115676 2007-08-11 00:24:05 user/app/lib/libjpeg.so.62.0.0
lrwxrwxrwx root/root         0 2007-08-11 00:23:47 user/app/lib/libpng12.so -> libpng12.so.0.12.0
lrwxrwxrwx root/root         0 2007-08-11 00:23:46 user/app/lib/libpng12.so.0 -> libpng12.so.0.12.0
-rwxr-xr-x root/root    208600 2007-08-11 00:23:20 user/app/lib/libpng12.so.0.12.0
-rwxr-xr-x root/root   1404092 2007-08-11 00:16:09 user/app/lib/libkonqe.so.0.0.0
-rwxr-xr-x root/root       702 2007-08-11 00:34:38 user/app/bin/run_web
-rwxr-xr-x root/root   4306548 2007-08-11 00:58:21 user/app/bin/konqueror

+-----------------------------------------------------------------------------------------
+ 소스 수정
+-----------------------------------------------------------------------------------------

 +-----------------------------------------------------------
 + 마우스 커서 없애기
 +-----------------------------------------------------------
konq-embed/src/main.cc

QWSServer::setCursorVisible(FALSE);

 +-----------------------------------------------------------
 + 페이지 요청 실패, 에러 다이얼로그 박스 대신에  web 페이지 출력하도록 수정
 +-----------------------------------------------------------

konq-embed/kdesrc/khtml/khtml_part.cpp

void KHTMLPart::showError( KIO::Job* job )
{
  kdDebug(6050) << "KHTMLPart::showError d->m_bParsing=" << (d->m_doc && d->m_doc->parsing()) << " d->m_bComplete=" << d->m_bComplete
                << " d->m_bCleared=" << d->m_bCleared << endl;

  if (job->error() == KIO::ERR_NO_CONTENT)
 return;

  if ( (d->m_doc && d->m_doc->parsing()) || d->m_workingURL.isEmpty() ) // if we got any data already
#if 0 //! by B.LEE
   job->showErrorDialog( /*d->m_view*/ );
#else
  {
  QString myHTMLCode = QString::fromLatin1( "<HTML><HEAD></HEAD><BODY><P>" );
  myHTMLCode += job->errorString();
  myHTMLCode += QString::fromLatin1( "<P>BY B.LEE</BODY></HTML>" );
  begin();
  write(myHTMLCode);
  end();
  }
#endif
  else
  {
    htmlError( job->error(), job->errorText(), d->m_workingURL );
  }
}

 +-----------------------------------------------------------
 + 보안 경고 다이얼로그 띄우지 않게
 +-----------------------------------------------------------

konq-embed\kdesrc\khtml\khtml_part.cpp

#if 0 //! by B.LEE
  if (!d->m_submitForm) {
    if (u.protocol() != "https" && u.protocol() != "mailto") {
      if (d->m_ssl_in_use) {    // Going from SSL -> nonSSL
        int rc = KMessageBox::warningContinueCancel(NULL, i18n("Warning:  This is a secure form but it is attempting to send your data back unencrypted."
                                                               "\nA third party may be able to intercept and view this information."
                                                               "\nAre you sure you wish to continue?"),
                                                    i18n("Network Transmission"),KGuiItem(i18n("&Send Unencrypted")));
        if (rc == KMessageBox::Cancel)
          return;
      } else {                  // Going from nonSSL -> nonSSL
        KSSLSettings kss(true);
        if (kss.warnOnUnencrypted()) {
          int rc = KMessageBox::warningContinueCancel(NULL,
                                                      i18n("Warning: Your data is about to be transmitted across the network unencrypted."
                                                           "\nAre you sure you wish to continue?"),
                                                      i18n("Network Transmission"),
                                                      KGuiItem(i18n("&Send Unencrypted")),
                                                      "WarnOnUnencryptedForm");
          // Move this setting into KSSL instead
          KConfig *config = kapp->config();
          QString grpNotifMsgs = QString::fromLatin1("Notification Messages");
          KConfigGroupSaver saver( config, grpNotifMsgs );

          if (!config->readBoolEntry("WarnOnUnencryptedForm", true)) {
            config->deleteEntry("WarnOnUnencryptedForm");
            config->sync();
            kss.setWarnOnUnencrypted(false);
            kss.save();
          }
          if (rc == KMessageBox::Cancel)
            return;
       }
      }
    }

    if (u.protocol() == "mailto") {
      int rc = KMessageBox::warningContinueCancel(NULL,
                                                  i18n("This site is attempting to submit form data via email.\n"
                                                       "Do you want to continue?"),
                                                  i18n("Network Transmission"),
                                                  KGuiItem(i18n("&Send Email")),
                                                  "WarnTriedEmailSubmit");

      if (rc == KMessageBox::Cancel) {
        return;
      }
    }
  }
#endif
  // End form security checks
  //

+-----------------------------------------------------------------------------------------
+ 터치 serial 바꾸었다.
+-----------------------------------------------------------------------------------------

./configure -qconfig full -depths 16 -embedded arm \
-thread -no-qvfb -no-xft -no-cups -qt-sql-sqlite \
-qt-gif -qt-libpng -qt-libjpeg -qt-libmng  -qt-imgfmt-png  -qt-imgfmt-jpeg  -qt-imgfmt-mng \
-qt-mouse-yopy -prefix /user/app \
-little-endian


qmouseyopy_qws.cpp

export QWS_MOUSE_PROTO=yopy

Posted by blee
,
sizes[INDEX_AC].cs_cachep = kmem_cache_create(names[INDEX_AC].name,
                    sizes[INDEX_AC].cs_size,
                    ARCH_KMALLOC_MINALIGN,
                    ARCH_KMALLOC_FLAGS|SLAB_PANIC,
                    NULL, NULL);
 sizes[INDEX_L3].cs_cachep =
            kmem_cache_create(names[INDEX_L3].name,
                sizes[INDEX_L3].cs_size,
                ARCH_KMALLOC_MINALIGN,
                ARCH_KMALLOC_FLAGS|SLAB_PANIC,
                NULL, NULL);
하고, 난뒤 sizes->cs_size != ULONG_MAX 일때까지 while 돌면서 나머지 생성해 준다.
sizes->cs_cachep, sizes->cs_dmacachep...

malloc_sizes[]

0 cs_size=0x20
1 cs_size=0x40
2 cs_size=0x60
3 cs_size=0x80
4 cs_size=0xc0
5 cs_size=0x100
6 cs_size=0x200
7 cs_size=0x400
8 cs_size=0x800
9 cs_size=0x1000
10 cs_size=0x2000
11 cs_size=0x4000
12 cs_size=0x8000
13 cs_size=0x10000
14 cs_size=0x20000
15 cs_size=0xffffffff
 
cache_names[]
 
0 names.name=size-32
1 names.name=size-64
2 names.name=size-96
3 names.name=size-128
4 names.name=size-192
5 names.name=size-256
6 names.name=size-512
7 names.name=size-1024
8 names.name=size-2048
9 names.name=size-4096
10 names.name=size-8192
11 names.name=size-16384
12 names.name=size-32768
13 names.name=size-65536
14 names.name=size-131072
15 names.name=<NULL>
Posted by blee
,

[ IRQ 처리 ]

리눅스커널 2009. 10. 2. 14:51
CP15 c1, Control Register 의  V bit 에 의해 hign vector 를 사용하도록 설정된다.
arch/arm/mm/proc-v6.S
__v6_setup 에서 Control Register 를 읽고 v6_crval 값에 지정된 것으로 clear 후 set 한다.
여서기 V bit 가 설정됨으로 high vector 가 사용된다.

Control Register 를 저장 하지 않지만.. 나중에 __enable_mmu -> __turn_mmu_on 에서 저장함
__v6_setup:
:
adr r5, v6_crval
ldmia   r5, {r5, r6}
mrc p15, 0, r0, c1, c0, 0       @ read control register
bic r0, r0, r5          @ clear bits them
orr r0, r0, r6          @ set them
mov pc, lr              @ return to head.S:__ret
:
v6_crval:
    crval   clear=0x01e0fb7f, mmuset=0x00c0387d, ucset=0x00c0187c
:
 
arch/arm/kernel/entry-armv.S
 vector table 과 handler 가 정의되어 있다.
  
devicemaps_init
 high vector(0xffff0000) 페이지 테이블 생성
trap_init
 high vector(0xffff0000) 로 복사
 
init_IRQ
 kernel IRQ 스택 초기화
 
s3c_init_irq
 CPU 인터럽터 컨트롤러 초기화
 
동작은
arch/arm/kernel/entry-armv.S  의 vector table , handler 에서 처리후
asm_do_IRQ  호출한다.
Posted by blee
,
struct stack {
    u32 irq[3];
    u32 abt[3];
    u32 und[3];
} ____cacheline_aligned;
static struct stack stacks[NR_CPUS];
CPU 갯수만큼 stacks 이 만들어 진다.
IRQ_MODE, ABT_MODE, UND_MODE 의 sp 를 지정한다.
irq[0] <- IRQ_MODE 의 sp 시작
irq[1]
irq[2]
abt[0] <- ABT_MODE 의 sp 시작
abt[1]
abt[2]
und[0] <- UND_MODE 의 sp 시작
und[1]
und[2]

[ setup_per_cpu_areas ] init/main.c
 
DEFINE_PER_CPU 로 정의된 것들이 컴파일 되면서, __per_cpu_start ~__per_cpu_end 사이의 영역에 들어간다.
DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data);

[ smp_prepare_boot_cpu ] arch/arm/kernel/smp.c
 
cpu_data.idle = current 를 저장한다.

 
[ sched_init ] kernel/sched.c
 
cpu_rq(cpu) 는 해당 cpu의 struct rq자료를 리턴한다.  각 cpu 의 run queue 자료를 초기화 한다.
 
[ preempt_disable ] include/linux/preempt.h
 
CONFIG_PREEMPT 가 정의 되어 있어야 한다. 정의 되어 있지 않다면, preempt_disable , preempt_enable 는 빈 함수로 구현된다.
 
// include/linux/preempt.h
#define preempt_disable() \
do { \
    inc_preempt_count(); \
    barrier(); \
} while (0)
#define preempt_enable() \
do { \
    preempt_enable_no_resched(); \
    barrier(); \
    preempt_check_resched(); \
} while (0)
#define add_preempt_count(val) do { preempt_count() += (val); } while (0)
#define sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
#define inc_preempt_count() add_preempt_count(1)
#define dec_preempt_count() sub_preempt_count(1)
#define preempt_count() (current_thread_info()->preempt_count)
 
[ build_all_zonelists ] mm/page_alloc.c
 
system_state = SYSTEM_BOOTING 이면
__build_all_zonelists(NULL); 를 호출한다.

 
[ sort_main_extable ] kernel/extable.c
 
섹션 __start___ex_table 부터 __stop___ex_table 에 까지 등록되어 있는 struct exception_table_entryinsn 값으로 정열한다.
struct exception_table_entry
{
    unsigned long insn, fixup;
};

[ trap_init ] arch/arm/kernel/traps.c
 
0xffff0000 에 __vectors_start 부터 __vectors_end  를 복사한다.
0xffff0000 + 0x200 에 __stubs_start 부터 __stubs_end 를 복사한다.
0xffff0000 + 0x1000 - kuser_sz 에 __kuser_helper_start 부터 kuser_sz 만큼 복사한다.
kuser_sz = __kuser_helper_end - __kuser_helper_start

'리눅스커널' 카테고리의 다른 글

[ kmem_cache_init ] mm/slab.c  (0) 2009.10.02
[ IRQ 처리 ]  (0) 2009.10.02
[ devicemaps_init ] arch/arm/mm/mmu.c  (0) 2009.10.02
[ bootmem_bootmap_pages ] mm/bootmem.c  (0) 2009.10.02
[ create_mapping ] arch/arm/mm/mmu.c  (0) 2009.10.02
Posted by blee
,
페이지 테이블에서 VMALLOC_END ~ 끝까지  영역을 0 으로 초기화 한다.
high-vectors ( 0xffff0000 ) 맵핑한다.
mdesc->map_io() 호출하여, device 맵핑한다.
SMDK2410 경우엔 smdk2410_map_io 호출한다.

swapper_pg_dir ( 0xC0004000 )

 offset   level 1 descriptor 
 0x000 * 4   0
  :   :
 0xF00 * 4 0x4a000452
 0xF01 * 4
0x48000452
 0xF02 * 4
0x4c000452
 0xF03 * 4 
0x4d000452
 0xF04 * 4 
0x50000452
 0xF05 * 4   0x51000452
 0xF06 * 4 
0
 0xF07 * 4 
0x53000452
  :  
 0xF64 * 4 
0x56000452
  :  
 0xFFE * 4 
0x30002031
 0xFFF * 4 0x30002431
 
[ free_area_init_node ] mm/page_alloc.c
contig_page_data 의 node_id, node_start_pfn 값을 설정하고
calculate_node_totalpages() 를 호출하여, node_spanned_pages, node_present_pages 값을 계산한다.
alloc_node_mem_map() 를 호출해서 page 배열을 할당하고, node_mem_map 에 시작 위치를 가리킨다.mem_map 값으로도 설정한다.
free_area_init_core() 를 호출하여, 각 page 들을 초기화 한다.
 
[ free_area_init_core ] mm/page_alloc.c
 
zone 를 초기화 한다.
 
[ devicemaps_init ] arch/arm/mm/mmu.c

vectors 를 bootmem 에서 PAGE_SIZE 만큼 할당 받는다.
페이지 테이블 0xffff0000 에 등록한다.
mdesc->map_io 를 호출한다.
MACHINE_START(INTEGRATOR, "ARM-Integrator")
    /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
    .phys_io    = 0x16000000,
    .io_pg_offst    = ((0xf1600000) >> 18) & 0xfffc,
    .boot_params    = 0x00000100,
    .map_io     = ap_map_io,
    .init_irq   = ap_init_irq,
    .timer      = &ap_timer,
    .init_machine   = ap_init,
MACHINE_END

'리눅스커널' 카테고리의 다른 글

[ IRQ 처리 ]  (0) 2009.10.02
[ cpu_init ] arch/arm/kernel/setup.c  (0) 2009.10.02
[ bootmem_bootmap_pages ] mm/bootmem.c  (0) 2009.10.02
[ create_mapping ] arch/arm/mm/mmu.c  (0) 2009.10.02
[ bootmem_init_node ] arch/arm/mm/init.c  (0) 2009.10.02
Posted by blee
,