* 외국 사이트에서 참고한 거라,.. 나름대로 메뉴얼을 영어로 써봅니다. 문제가 있는 부분은 메일 주시면 수정/ 반영 하도록 하겠습니다.


0. Introduction
  - Python is very strong language for development of any applications. From now, I'm introducing the porting python 2.5 to arm-linux target board with external python modules like numarray, Numeric, etc. And also this document includes building the cross-compiling chains for PXA-255 target board.
  - Host PC : Red Hat Linux 9 ( vm-ware, static IP using nat )
  - TargetBoard : arm based board ( pxa255 ), and has embedded linux OS.


1. Installing Redhat linux 9

 - Custom, allowing ftp, ssh
 - Kernel development, Development Tools
 - ( installing build-essential, libncurses5-dev )

사용자 삽입 이미지

Select "Custom"


사용자 삽입 이미지

Allowing ftp, ssh services

사용자 삽입 이미지

Select Development tools and Kernel Development.


2. SSH configuration in redhat 9
 - Starting etc
   # /etc/rc.d/init.d/sshd start
   # vi ~/.bash_profile

 - append line : /etc/rc.d/init.d/sshd start
 - applying bash
   #source ~/.bash_profile

3. vsftpd configuration
 - create /etc/vsftpd/vsftpd.conf at the first excutation
   # /etc/rc.d/init.d/vsftpd start
   # vi /etc/vsftpd/vsftpd.conf
        local_enable = YES
        write_enable = YES
   # vi ~/.bash_profile

 - append line to .bash_profile : /etc/rc.d/init.d/vsftpd start
 - applying bash
   # source ~/.bash_profile

The order of installation is very important! ( binutils -> kernel -> gcc -> ... )


4. Building cross-compiling toolchain
 - reference site : http://www.ailis.de/~k/archives/19-arm- ··· wto.html

 4-1. binutils - 2.11.2
   - Download installation file : ftp://ftp.gnu.org/gnu/binutils/binutils-2.11.2.tar.gz
     # tar xvfz binutils-2.11.2.tar.gz
     # ./configure --target=arm-linux
     # make
     # make install

   - verifying new binaries : /usr/local/bin
   - verifying new directory : /usr/local/arm-linux

사용자 삽입 이미지


 4-2. Linux Kernel header files
   - Download installation file : http://ftp.kernel.org/pub/linux/kernel/ ··· 7.tar.gz
   - Download kernel patch file : ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-
patches/v2.4/patch-2.4.17-rmk4.gz
 
   - unpacking linux kernel source
     # tar xvfz linux-2.4.17.tar.gz
     # cd linux-2.4.17.tar.gz
     # copy ../patch-2.4.17-rmk4.gz .

   - applying kernel 2.4.17-rmk4 to 2.4.17 for ARM kernel patch
     # zcat patch-2.4.17-rmk4.gz | patch -p1

   - configure the kernel for ARM
     # make menuconfig ARCH=arm
   - save configuration ( you don't have to do anything! )

   - make with dependency 
     # make dep
 
   - copy include, asm-arm, linux files from kernel source to toolchain directory 
     # mkdir /usr/local/arm-linux/include
     # cp -dR include/asm-arm /usr/local/arm-linux/include/asm
     # cp -dR include/linux /usr/local/arm-linux/include/linux

   - create symbolic link 'sys-linux' for the next compiling
     # cd /usr/local/arm-linux/
     # ln -s include sys-linux


 4-3. gcc compile for building libraries

   - Download file : ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3.tar.gz
     # tar xvfz gcc-2.95.3.tar.gz
     # vi gcc/config/arm/t-linux

 
   - replace this line :
   (before) TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
   (after) TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h

 
   - configure -> compile -> install the source code
     # ./configure --target=arm-linux --disable-threads --enable-languages=c
     # make ; make install


 4-4. glibc
   - Download file : ftp://ftp.gnu.org/gnu/glibc/glibc-2.2.4.tar.gz
   - Download file2 ( glibc linuxthreads add-on ) : ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.2.4.tar.gz

   - Unpack the source
     # tar xvfz glibc-2.2.4.tar.gz
  
   - linux thread patch to glibc
     # cd glibc-2.2.4
     # tar xvfz ../glibc-linuxthreads-2.2.4.tar.gz

   - set the environment variable for arm-linux
     # export CC=arm-linux-gcc
 
   - configure, make and make install
     # ./configure arm-linux --target=arm-linux --prefix=/usr/local/arm-linux --enable-add-ons
     # make

   - If you see some error like the figure below, don't be confused.
     # ls /usr/local/arm-linux/include/asm/

사용자 삽입 이미지


   - Maybe you can easily find [arch] and [proc] are symbolic link file, and they are broken.
     # cd /usr/local/arm-linux/include/asm/
     # mv arch arch_old
     # mv proc proc_old
     # ln -s /usr/local/arm-linux/include/asm arch
     # ln -s /usr/local/arm-linux/include/asm/proc-armv/ proc

사용자 삽입 이미지


     # make ( it takes pretty much time )
     # make install

   - unset the environment variable
     # unset CC
    

 4-5. second compile for gcc + glibc
     # mv gcc-2.95.3 gcc-2.95.3_old

   - configure, make and make install
     # ./configure --target=arm-linux
     # make
     # make install

   - if you failed make gcc, don't worry about it :)
     in basicio.c, PATH_MAX is undeclared.    
     # vi libchill/basicio.c
   - replace [ #include <limits.h> ] to [ #include <linux/limites.h> ]
      # make ; make install

5. Building python 2.5
 - reference site
     http://whatschrisdoing.com/blog/2006/10 ··· ython-25
     http://www.ailis.de/~k/archives/19-arm- ··· wto.html

 - I found some web page of python 2.5 for ppc-linux. Above web-site is kindly explain the porting python 2.5 to ppc-linux. I was able to port python 2.5 to arm-linux by above two references.

 - Get the source of python 2.5 : http://www.python.org/ftp/python/2.5/Python-2.5.tgz
 - Get the patch of python 2.5 from Chris : http://whatschrisdoing.com/~lambacck/py ··· le.patch


 5-1. Installing Python 2.5
   - Unpack Python-2.5 source codes
     # tar xvfz Python-2.5.tar
 
   - Apply the patch to python-2.5
     # cd Python-2.5
     # cat ../Python2.5_xcompile.patch | patch -p1

   - Configure, make
     # ./configure
     # make python Parser/pgen

   - backup the excutable file for host PC
     # mv python hostpython
     # mv Parser/pgen Parser/hostpgen

 
   - clean
     # make distclean

   - set the environment values
     # export CC=arm-linux-gcc
     # export CXX=arm-linux-g++
     # export AR=arm-linux-ar
     # export LD=arm-linux-ld
     # export RANLIB=arm-linux-ranlib
     # export | grep "arm"

사용자 삽입 이미지

   - Configure python 2.5. I and Chris set the prefix /python, for easy porting to target-board later
     # ./configure --host=arm-linux --target=arm-linux --prefix=/python

   - Make
     # make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-linux-gcc -shared" CROSS_COMPILE=yes
   - You can see many of warnings, for now, just ignore it. ( if you fix this warning, please e-mail me! : hara at hara4u dot net )

   - Make install
     # make install prefix=/python HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-linux-gcc -shared" CROSS_COMPILE=yes

    - If you did all of these processing without any errors, you may success porting!!! :) Congraturations!



6. NFS and Copy the port to the target board
  - I have some target board which includes ARM-PXA255 core and blabla..
  - And this board has embedded linux 2.4 core and has NFS.
 
  6-1. NFS setup
   - You can use NFS ( Network File System ) first time for porting, because the size of builded python is too big for copying to RAM area of target board.
   
   - First, make directory and change the permission
     # mkdir /nfs
     # chmod 777 /nfs
     # chown nobody nfs
     # chgrp nobody nfs

   - Make environment file
     # vi /etc/exports
            /nfs    localhost(rw,insecure)
            /nfs    164.125.xxx.xxx(rw,insecure)
    
   - Do not use that IP address ( that is the IP of my school, PNU in Korea :D )

사용자 삽입 이미지


   - Start the nfs service and register to .bash_profile
     # /etc/rc.d/init.d/nfs start
     # vi ~/.bash_profile
     # adding [/etc/rc.d/init.d/nfs start] at the end of the file
     # source ~/.bash_profile

   - Turn on the target board
     # mount -t nfs -o nolock 164.125.1.1:/nfs /mnt/nfs

   - Test NFS     
     (host pc) # make /nfs/testfolder
     (target pc) #ls /mnt/nfs

   - If your target board doesn't work for NFS, please install that.

사용자 삽입 이미지


   - Copy all of /python/ directory in host PC
     # cp /python /nfs/ -rf

   - Execute python 2.5 on the target board
     # ( target board ) cd /mnt/nfs
     # cd python/bin
     # ./python

   - How do you think about it? Welcome to python in your target board :D
 

사용자 삽입 이미지


7. install the additional module of python
   - If you use the external module of python, just install them :)

 7-1. numarray-1.2.3
   - Reference URL : http://numpy.org/

   - Numarray is another implementation of an arrayobject for Python ...

   - set the environment values
     # export CC=arm-linux-gcc
     # export CXX=arm-linux-g++
     # export AR=arm-linux-ar
     # export LD=arm-linux-ld
     # export RANLIB=arm-linux-ranlib
     # export | grep "arm"

   - Get the source at http://sourceforge.net/project/showfile ··· %3D32367
   - Download numarray-1.2.3.tar.gz ( platform independent version )

   - build & install
     # tar xvfz numarray-1.2.3.tar.gz
     # cd numarray-1.2.3
     # ../Python-2.5/hostpython setup.py build
     # ../Python-2.5/hostpython setup.py install --prefix=/python

   - Copying the libraries of numarray
     # cd /
     # cp python nfs/ -rf

   - Test the module
     # (target board) cd /mnt/nfs
     # (target board) cd python/bin
     # (target board) ./python 'import numarray'

 

사용자 삽입 이미지

 

 7-2. Numeric-24.2

   - This external module compilation is similiar to numarray module.





8. Conclusion
  - This document is for embedded system programmer.
  - if you modify or copy this document to the other web pages, please confirm to me.
   ( Certainly, The authors of above two reference pages can update their pages using this document with indication of my web-page. And I already trackback this document to their pages. )
  - If you have any question or find any bugs ( include English expressions in this documents!! ), please e-mail me or make any comments to this page.
  - If you have any comments like porting to the other platforms, please trackback this pages or comment.
  - Also, you can uses hangul :D, because I'm Korean.
  - E-mail address : [ hara at hara4u dot net ]

Thank you.


크리에이티브 커먼즈 라이센스
Creative Commons License
2008/10/22 16:52 2008/10/22 16:52
TRACKBACK ADDRESS
http://hara4u.net/trackback/288
러블오디 
wrote at 2008/10/23 03:47
먼데? 어쩌라고?-_-;;
하나도 모르겠음;;;ㅋㅋㅋㅋ
하라 
wrote at 2008/10/23 11:34
알면 컴공 해야죠 뭐 - ㅅ- ;; ㅋㅋ
용균 
wrote at 2008/10/31 18:08
몰라도 먹고사는데 지장없으면
모르는게 약이다. ㅋㅋㅋㅋㅋ
이름 :
비밀번호 :
홈사이트 :
비밀글 :

사용자 삽입 이미지

간단하게 Thread에 List를 parameter로 돌려서 ( pointer 넘기고 싶었음 - ㅅ- )
둘간의 스위치로 통신하여 동기화하는 프로그램

사용자 삽입 이미지







크리에이티브 커먼즈 라이센스
Creative Commons License
2007/12/20 11:21 2007/12/20 11:21
tagged with  , ,
TRACKBACK ADDRESS
http://hara4u.net/trackback/241
기타등등 
wrote at 2007/12/31 05:44
@.@
이름 :
비밀번호 :
홈사이트 :
비밀글 :


벼르고 벼르던 걸 이제야 했다 -_-;;
리눅스에 익숙치 않은 터라, 최근 받은 측위 서버 소스를 윈도우로 포팅을 계획.

1. Python 2.4
2. Numeric extension
3. Numpy
4. Numarray
5. IDE

이 환경으로 설치해야 했다.


- Python : http://python.org 에서 download ( win32 )

2.4버전을 받은 이유는 측위 서버 소스가 Numeric, Numarray를 이용하고 있는데 최신 numpy는 이것들을 통합하고 키워드를 합쳐버렸기 때문. Numeric, numarray는 numpy의 일부가 되어버렸는데, 이에 대해 키워드를 통일하면 되지만 귀찮으므로 그냥 -_-; stable한 2.4 설치.

- Numpy, Numeric, Numarray : http://numpy.scipy.org/ 에서 download ( msi )

Numeric, Numarray는 old package로 제공되고 잇음. ( 2.4버전 이하 )

- IDE

DrPython - wxPython 2.5.3.1이상 설치 -> DrPython 설치
Eclipse - 최신 버전 JRE 설치 -> Eclipse 최소 버전 설치 -> Pydev extension 설치

- Source

소스 설치 후, start.py 등에 있는 path를 잡아줌 ( 상대 경로도 가능 ! )
둘 이상의 콘솔이 동시에 제공되지 않으므로, 다른 IDE를 이용하거나 해서
시뮬레이션도 가능



사용자 삽입 이미지

우헤


크리에이티브 커먼즈 라이센스
Creative Commons License
2007/12/18 20:53 2007/12/18 20:53
tagged with  , , ,
TRACKBACK ADDRESS
http://hara4u.net/trackback/240
wrote at 2007/12/18 21:56
먼말인지 원.....-.-;;;
기타등등 
wrote at 2007/12/31 05:45
@.@ -2
이름 :
비밀번호 :
홈사이트 :
비밀글 :

디바이스 드라이버를 이용한 간단한 텀 프로젝트 ( ...라기엔 좀 거창하고. ) 용으로 임베디드 시스템 장비로 CF카드를 읽어 그 속의 엘범을 보여주는 것을 만들었다.

장비는 Hanback 社에서 만든 EMPOS II로, CF card device driver나 LCD, button, Text LCD등이 포함된 임베디드 장비이다. 작업 환경은 레드헷 리눅스(Vm-ware) 9.2에 arm-linux-gcc 최신 버전의 컴파일러 등을 이용하였다. ( Vmware 같은 경우 network card를 bridge로 사용해야 독립적인 IP를 할당할 수 있다. )

CF Card 드라이버는 임베디드 리눅스에서 Plug and play 형태로 지원이 되며, 이는 /etc/inittab ( 구동시 읽어들이는 파일 ) 마지막 줄에 mount -t /dev/hda1 /mnt/cf 등으로 마운트만 하면 기존의 파일 시스템 처럼 읽을 수 있다.

TextLCD와 PushButton은 케릭터 디바이스 등록용 오브젝트 파일을 만들고 ioctl 등을 통해 어플리케이션에서 직접 시스템 콜을 할 수 있도록 한다. TFT-LCD는 프레임 버퍼를 이용하여 간단하게 화면에 출력할수 있다.

dentry와 inode를 이용하여 디렉토리들을 트레버스 ( 트리 처럼 정해진 디렉토리를 루트로 하여 세부 디렉토리까지 모두 검사 ) 하게 작성하였으며, 그 중 최대 20개 ( 설정 )의 BMP파일에 대한 디렉토리명과 파일명을 리스트 형으로 저장한다.

최초 리스트의 0번 인덱스 파일을 TFT-LCD화면에 뿌려주고 TextLCD로는 파일명을 보여준다. 버튼을 누르면 리스트를 오가며 해당 파일을 화면에 뿌려준다.


쉽게 하려고 BMP를 이용하였는데, 인코더/디코더를 이용하여 JPEG나 GIF도 가능할 것으로 보인다. 또한 이를 이용하여 동영상을 화면에 뿌려주는 것도 가능한데 이는 Qt를 이용하는 것이 적절할 것으로 보인다.


전자엘범 구현
텀으로 간단한 전자엘범을 구현하였다
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/06/20 14:20 2007/06/20 14:20
TRACKBACK ADDRESS
http://hara4u.net/trackback/194
러블5D 
wrote at 2007/06/20 21:12
먼말인지는 모르겠지만;;;
여튼 솜씨좋네ㅋ
wrote at 2007/06/22 11:31

사실, 텀 다큐먼트용으로 쓴거예요.
알고보면 별거 아녜요 ㅋㅋ
wrote at 2007/06/20 21:35
열라 멋지군
wrote at 2007/06/22 11:30

예제만 따라하면 절반은 나온다는 ㅋㅋ
이름 :
비밀번호 :
홈사이트 :
비밀글 :
*1 
count total 86775, today 4, yesterday 218
rss
I am
All (265)
Daily_Diary (77)
Photo playground (71)
Play music (33)
Life story (24)
Culture (43)
Trip memory (12)
Emotional Engineering (4)
달력
«   2008/11   »
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
Statistics Graph