2009年9月18日

腦殘鐵馬行-0918竹田火車站

今天鐵馬行程是騎去竹田火車站
感覺狀況越來越好
不像之前回程時會撐不住
小戰馬的表現不錯^^














今天騎的路線如下
這是回來後做的圖
與原先計畫的路線有出入= =




















結論是我們根本是亂騎!!
多繞了滿多路
果然是順著感覺走阿

但竹田車站真的很不錯
空氣新鮮又是古蹟建築
























































目前最大的課題是出發前該吃多少份量的東西??
吃多騎會想吐 吃太少會餓 不吃更不可能= =
好難拿捏阿

2009年3月31日

QT4 with Mysql Driver on Debian lenny

#sudo apt-get install mysql-server libmysqlclient15-dev
#su -
#cd $QTDIR/src/plugins/sqldrivers/mysql
#qmake "INCLUDEPATH+=/usr/include/mysql"
"LIBS+=-L/usr/lib/mysql -lmysqlclient_r" mysql.pro
#make
#make install

then,"libqsqlmysql.so" at $QTDIR/plugins/sqldrivers/

參考資料:QT4 Doc-SQL Database Driver

2009年3月22日

Debian lenny 建立XEN虛擬機器

Environment : Debian lenny
CPU : Intel Core 2 Duo E6550

Step 1:
#apt-get install xen-hypervisor-i386 xen-tools xen-docs-3.2 xen-shell xen-utils-3.2-1 xen-utils-common libc6-xen
xen-linux-system-2.6.26-1-xen-686 linux-headers-2.6.26-1-xen-686
bridge-utils

Step 2:
檢查/boot/grub/menu.list
default=0 //對應XEN核心版本Kernel Image
重新開機以XEN核心版本Kernel開機。

Step 3:
#nano /etc/xen/xend-config.sxp
修改如下區段
#(network-script network-dummy) //註解本行
(network-script network-bridge) //增加本行
(vif-script vif-bridge)

Step 4:
設定預設GuestOS建立環境
#nano /etc/xen-tools/xen-tools.conf
dir = /home/xen
size = 8Gb
memory = 512Mb
swap = 1024Mb
fs = ext3
dist = lenny
gateway = "gateway.ip"
netmask = "netmask.ip"
broadcast = "broadcast.ip"
passwd = 1
kernel = /boot/vmlinuz-`uname -r`
initrd = /boot/initrd.img-`uname -r`
mirror = http://ftp.de.debian.org/debian/
serial_device = hvc0
disk_device = xvda

Step 5:
建立GuestOS
#xen-create-image --hostname=debian-guest01 --ip=ip --role=udev
過程會要求輸入root的密碼

Step 6:
#xm create /etc/xen/debian-guest01.cfg //啟動GuestOS(debian-guest01)
#xm list //列出虛擬機狀態
#xm console debian-guest01 //登入GuestOS

Step 7:
自動啟動GuestOS
#ln -s /etc/xen/debian-guest01.cfg /etc/xen/auto

參考資料:
Virtualization With Xen On Debian Lenny (AMD64)
Xen on Debian Etch 安裝

2009年3月21日

PXA270實驗筆記(六)

[ 關閉LCD power off ]
修改Kernel內核char/vt.c,將blankinterval設為0,如下:
static int blankinterval = 0;
//static int blankinterval = 10*60*HZ;

[ tslib編譯 ]
require package:automake libtool

執行autogen.sh後產生 configure 檔案

#./configure --prefix="path" CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc --host=arm-linux --enable-inputapi=no ac_cv_func_malloc_0_nonnull=yes
#make
#make install

將 /usr/local/arm/3.4.1/arm-linux/lib 底下的libdl-2.3.2.so以及libdl.*等檔案放到"tslib_path"/lib
建立plugins資料夾,將"tslib_path"/lib/ts 中的所有檔案複製到plugins 資料夾

export QWS_MOUSE_PROTO=TPanel:/dev/ts
export TS_ROOT="tslib_path"
export LD_LIBRARY_PATH=$TS_ROOT/lib
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/ts
export TSLIB_CALIBFILE=$TS_ROOT/etc/pointercal
export TSLIB_CONFFILE=$TS_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$TS_ROOT/plugins

在ARM上執行定點程式,將記錄下來的定點pointercal複製到/tmp/cf_card

[ Qtopia-core移植 ]
將qtopia-core-opensource-src-4.3.0.tar.gz放到/tmp/cf_card
#tar zxvf qtopia-core-opensource-src-4.3.0.tar.gz //解壓
#mv qtopia-core-opensource-src-4.3.0 qtopia-core //改名
#cd /tmp/cf_card/qtopia-core
# export QTDIR=$PWD
# export PATH=$QTDIR/bin:$PATH
# export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

在qmouselinuxtp_qws.h里面添加
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW
修改qmouselinuxtp_qws.cpp,增加
/dev/h3600_tsraw改为/dev/ts
修改qmouse_qws.cpp
把pointercal位置設為/tmp/cf_card/pointercal

#./configure -prefix /tmp/cf_card/qtopia-core -embedded arm -xplatform qws/linux-arm-g++ -qt3support -qt-zlib -qt-libpng -qt-gif -qt-libtiff -qt-libmng -qt-libjpeg -nocups -no-openssl -no-stl -qt-mouse-linuxtp -depths 4,8,16
#make
#make install
把toolchain的lib(除了libc)複製到qtopia-core/lib
打包qtopia-core為qtopia-core.tar
將qtopia-core.tar移植到板子上的/tmp/cf_card之中解開

修改file system bashrc設定
#nano -w /usr/local/fstest/target/.bashrc
將QPEDIR QTDIR PATH LD_LIBRARY_PATH的設定改為
export QPEDIR="/tmp/cf_card/qte"
export QTDIR="/tmp/cf_card/qte"
export PATH=/usr/Qtopia/demo/bin:$QPEDIR/bin:/tmp/cf_card/jamvm/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:/usr/Qtopia/demo/lib
export QWS_MOUSE_PROTO=linuxtp:/dev/ts

修改/usr/local/fstest/target/usr/qpe.sh
echo "qpe -qws" -> #echo "qpe -qws"
/usr/Qtopia/qtopia-free-1.7.0/bin/qpe -qws -> #/usr/Qtopia/qtopia-free-1.7.0/bin/qpe -qws

#mkcrmfs target root_tmp.cramfs //重新包裝

PXA270實驗筆記(五)

PXA270與OSGi (JSP Support)

下載equinox OSGi framework : http://download.eclipse.org/equinox/
將equinox解開之後在plugin資料夾中加入
(1)org.eclipse.equinox.http.helper
(2)org.eclipse.equinox.jsp.jstl
(3)org.eclipse.equinox.jsp.example
三個Bundle之後重新打包成tar檔。
!注意! 這三個Bundle必須以CVS方式從Equinox Incubator取得

將包好的tar檔複製到PXA270上/tmp/cf_card中,解開之後執行
#jamvm -jar /tmp/cf_card/eclipse/plugin/org/eclipse/osgi_"bundle version".jar -console

畫面範例如下:
osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.4.0.v20080605-1900

使用以下指令安裝bundle
osgi>install file:"bundle name".jar

需安裝的bundle與完成畫面如下:

osgi>ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.4.0.v20080605-1900
2 ACTIVE org.eclipse.equinox.http.jetty_1.1.0.v20080425
3 ACTIVE org.eclipse.equinox.http.servlet_1.0.100.v20080427-0830
4 ACTIVE org.apache.commons.logging_1.0.4.v20080605-1930
5 ACTIVE org.mortbay.jetty_5.1.14.v200806031611
6 ACTIVE javax.servlet_2.4.0.v200806031604
7 ACTIVE javax.servlet.jsp_2.0.0.v200806031607
8 ACTIVE org.eclipse.equinox.http.registry_1.0.100.v20080427-0830
10 ACTIVE org.eclipse.osgi.services_3.1.200.v20071203
11 ACTIVE org.eclipse.equinox.ds_1.0.0.v20080427-0830
12 ACTIVE org.eclipse.osgi.util_3.1.300.v20080303
13 ACTIVE org.eclipse.equinox.util_1.0.0.v20080414
14 ACTIVE org.eclipse.equinox.log_1.1.0.v20080414
15 ACTIVE org.apache.commons.el_1.0.0.v200806031608
16 ACTIVE org.apache.jasper_5.5.17.v200806031609
17 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.100.v20080427-0830
18 ACTIVE org.eclipse.equinox.common_3.4.0.v20080421-2006
19 ACTIVE org.eclipse.equinox.registry_3.4.0.v20080516-0950
20 ACTIVE org.eclipse.equinox.jsp.jasper.registry_1.0.0.v20080427-0830
22 ACTIVE org.eclipse.equinox.http.helper_1.0.0.qualifier
24 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
25 ACTIVE org.eclipse.equinox.jsp.examples_1.0.0
26 ACTIVE org.eclipse.equinox.jsp.jstl.examples_1.0.0

osgi>

將所有bundle啟動為active狀態,並開啟瀏覽器瀏覽http://192.168.1.12/jsp-examples/index.html