2009年12月5日 星期六

Chromium OS run on Thinkpad R51 with working wifi

Google has announced Chromium OS for a long time(2009/11/19), and I tried to build the image from source code. The building script can generate vmware image and write image into bootable USB disk. But the default image can't let my Thinkpad R51 wifi work. Looking into the kernel boot log, it fails at the loading stage when it wants to load ipw2200 firmware binary file.
The simple way to solve this issue is to copy the needed file from Ubuntu 9.10.
Copy the /lib/firmware/ipw2200-bss.fw to USBDisk:/C-ROOT/lib/firmware/2.6.31.4-chromeos-intel-menlow/ipw2200-bss.fw



Detail issue can be checked from following url:
http://code.google.com/p/chromium-os/issues/detail?id=706

2009年11月20日 星期五

How to work with Google code

This wiki shows me the detail procedure to use git to work with Google code.
The main procedure is:
1. git svn clone --username my-gmail-name -s https://my-project.googlecode.com/svn
2. git add FILENAME
3. git commit -a
4. git svn dcommit --username jacky.tw -s https://my-project.googlecode.com/svn

參考來源: ExportingToGit - support - Exporting a project to a Git repository - Project Hosting on Google Code (在「Google 網頁註解」中檢視)

Good article to start Gstreamer plugin

If you want to study Gstreamer plugin writing tip, I would like to share this with you all.

參考來源: furseal's lair: 踏出 gstreamer plugin 的第一步 (在「Google 網頁註解」中檢視)

2009年11月8日 星期日

Howto run native Linux application on Android

Recently I am working an Embedded Linux Internal project, and use many open source tools to build cross compiler, Linux kernel, small Linux root filesystem on JK2410(Jollen Kit based on Samsung S3C2410 - ARM 920T).
From this project I learned how to build cross compiler, busybox by myself. and use such kind of tools, the static linked code also can run on Android emulator. I would like to share this knowledge from this blog.
First I used OSELAS toolchain, it must be build by ptxdist tool.
Following is the step how to build ptxdist and setup the right gcc, kernel version you want to build the toolchain. Download ptxdist-1.99.12.tgz and ptxdist-1.99.12-patches.tgz from http://www.ptxdist.org/software/ptxdist/download/v1.99/
Run command in the terminal shell:
# tar -zxf ptxdist-1.99.12.tgz
# tar -zxf ptxdist-1.99.12-patches.tgz
# ./configure --prefix=/usr/local
# make
# make install
then, download OSELAS.Toolchain-1.99.3.5.tar.bz2 from http://www.oselas.com/oselas/toolchain/download/
Run following command in the terminal shell:
# tar xf OSELAS.Toolchain-1.99.3.5.tar.bz2
# cd OSELAS.Toolchain-1.99.3.5
# ptxdist select ptxconfigs/arm-v4t-linux-gnueabi_gcc-4.3.2_glibc-2.8_binutils-2.18_kernel-2.6.31-sanitized.ptxconfig
# ptxdist go

After run "ptxdist go", the tool will get the source code, patch from Internet, and compile the right CPU architecture, gcc, glibc, binutils and kernel version as the select setting you give. You can change the ptxconfig to more match your platform requirement.
The build procedure will take 1 to 2 hours depended on your Building host computing power.
After it finished, you can find the toolchain in /opt/OSELAS.Toolchain-1.99.3/ directory, so make sure your running user have permission to write file into /opt directory.

2nd Step is build up a static linked busybox, now it have some problem to run dynamic shared code on Android, because the linker system program in Android use different technology with toolchain. I haven't let dynamic code run successfully on Android.

Get busybox-1.15.2.tar.bz2 from http://www.busybox.net/downloads/
#tar jxvf busybox-1.15.2.tar.bz2
#cd busybox-1.15.2
#make menuconfig
This step you must change the Busybox setting -> Build options
Choose Build BusyBox as a static binary (no shared libs)
and Set Cross Compiler prefix as "arm-v4t-linux-gnueabi-"
#make
Now you can see the striped busybox present in this folder

3rd Step is to prepare the Android SDK environment, you can get it from here
Please notice the link will not get the whole package, you must following this instruction to get more add-on package.
Assume you place android sdk in /opt/Google/android-sdk-linux, add "/opt/Google/android-sdk-linux/tools" in your PATH variable.
then, run following command:
#android create avd -n my_droid -t 1
#emulator -avd my_droid -shell
From now now, you can see a magic emulator Google phone is launched, and the previous terminal become a single # as prompt.
In this prompt, you are in the Android root shell, you can type "ls -l" "cd" "pwd" as normal command.
Now you also need use following command(in Host Terminal) to put busybox binary into Android emulator.
#adb push busybox /data/busybox
#adb shell chmod 755 /data/busybox

Final, switch to Android shell, and type
#/data/busybox ls -al /system

You can see the file list from the busybox binary output.

This purpose of article is just to share the toolchian buildup experience, and the native C code compatibility on Android platform. You must not to use this way to run your original application. You shall learn how to use Android NDK to build your native C/C++ library.
I am now studying this as my next step to learn more about Android platform. If you are interested on this, we can discuss this by email or other way.

2009年9月29日 星期二

17 FreeCall - 網頁電話服務宣稱可以免費撥打台灣市話及手機

Source from: http://www.ithome.com.tw/itadm/article.php?c=56925

博祥網通繼Web Talk雲端運算在市場造成轟動後,再次推出震撼網路廣告市場的17freecall免費打電話網路平台,博祥網通充分展現web2.0免費威力。
所謂17Freecall,即一起打免費電話。是博祥網通Webphone web2.0網路語音技術結合廣告輪播機制的創新平台。網友加入17Freecall網站成為會員後,不需下載軟體就可以免付費從該網站平台撥打電話到市話、手機甚至是國際電話,有別於一般的網頁電話。而廣告主刊登廣告有別於其他網路廣告平台最大的優勢是17Freecall可鎖定族群撥放廣告,有效幫廣告主找到對的人看廣告,而客戶一次僅看一則廣告,沒有其他廣告干擾廣告主委刊的廣告可以有效直達目標客戶,客戶專心看廣告,廣告當然最有效。
博祥網通廣告託播服務還不止於此,17freecall還會以簡訊方式將廣告主的廣告或促銷活動發簡訊至客戶的手機之中,以達到滴水不漏的廣告效果,網路廣告近年呈逆勢成長之勢,結合免費網頁電話的新服務平台是創舉,17Freecall的出現必然成為網路新寵兒。

參考來源: 一起免費打電話 (在「Google 網頁註解」中檢視)

Soga, Now RTLinux is belonged to WindRiver

It now separate two types of license, one is free used version, another is commercial version

參考來源:

"Wind River Systems acquired FSMLabs technology in February 2007 and now makes a version available as Wind River Real-Time Core for Wind River Linux."
- RTLinux - Wikipedia, the free encyclopedia (在「Google 網頁註解」中檢視)

2009年7月27日 星期一

How to subscribe Google voice service

看到Google要推voice服務的新聞,已經有一陣時間了,記得很早就到這里申請邀請函了。而在前一個禮拜終於收到邀請函,二話不說,馬上就來試用一下,結果啟始網頁竟然說目前僅提供美國地區,哇,這是擺我一道嗎?我想Google的事就問Google吧,搜尋的結果,說是可以透過Proxy或者Open VPN來讓Google認為你是從美國當地網路過來的,後來透過asterisk-tw@googlegroups.com熱心網友提供一個不錯的網站 - http://hotspotshield.com/ ,下載一個VPN工具後,很簡單的就連上美國的SSLVPN,完全不需要做任何的設定,若不放心此網路程式,建議在虛擬機器上跑(我就是這樣做的)
網路環境準備好後,當然最重要的是要有邀請函了。沒有的可以到這里申請,要等多久我就不知道了。前二個禮拜,我又去申請了3個,結果今天就全部都收到了。
透過邀請函連接可以使用原先Gmail帳號登入,或者申請一個新的帳號。接下來的動作就是他會自動配發一個美國的電話號碼給你,像這樣的格式 (408)512-3803,你可以先查一下你比較想在那個區域,我會選在矽谷地區,是因為公司有些代理的原廠總部是在那里。
號碼選定後,就剩下最后一個步驟了,一定要設定一個可轉接的美國號碼(手機或市話,不可使用網路電話)才能完成整個啟用程序喔。
為了解決這個問題,我找到了ipkallvirtualphoneline都可取得美國市話號碼,申請步驟請各位自行看Signup頁面。ipkall大約要等3天,而Virtualphoneline透過facebook馬上申請,馬上開通帳號。不過Virtualphoneline不是提供完全免費的DID,你還需要按下Try Free ,按下後馬上可以免費使用25天的市話轉VoIP設定,它提供的轉接設定,還蠻多的,例如MSN,Skype, Gtalk。我是設定讓他撥到此Virtual PSTN時轉到Skype。
當這個DID轉接設定好後,就可以將此DID填入Google Voice的轉接號碼內,然后按下Call me now。這時Skype就響了,你只要在Skype的撥號盤上輸入Google voice上看到的認證碼就可以完成啟用程序了。
完成整個啟用程序後,就不需要再使用VPN連線了,我想他只有擋一開始的啟用程式吧。此外Google Voice啟用後,就可以在Setting里面的Phone加Gizmo號碼,然後就可以將此Virtual PSTN停用掉,因為25天後,我不會付費繼續使用這個Virtualphoneline的DID阿。

各位若不是很了解Google voice的,可以看這里

2009年6月13日 星期六

FreedomHEC 2009 at Taipei(6/10,11)

今年是第一次參加FreedomHEC,首先說明什麼是FreedomHEC。
FreedomHEC Taipei是場有關Open Source系統的硬體研討會。透過本研討會,台灣的工程師可與國際資深Linux開發者交流。台灣的廠商可以得到國內外Linux專家的協助,以非常低的成本開發出Linux驅動程式,並整合至上游Linux系統中,讓產品能有即時的Linux支援。
詳細活動網站在這裡

今年主辦單位邀請到數位著名的Linux國外專家,例如Greg,Jonathan,Harald
Greg和Jonathan是Linux Device Driver這本書的作者。而Harald則是netfilter/iptables的開發者,同是也是gpl-violations組織的創辦人。而台灣本土專家則有Jserv,Matt,CIH等。
這裡大概整理一下自己的心得:

Jonathan的內容主要環繞在如何跟Linux Kernel community協同運作,讓自己的driver能上傳至mainline,並且得到Community的協助,增加程式碼品質。
Greg的driver教學則是以實際的USB溫度計來實作Linux驅動程式,內容相當實用。教學過程所使用程式碼,可從這裡下載

Harald除了是著名的Linux開發者身份外,目前也致力於違背GPL產品查核工作。從他的部落格可以看到最近他盯上了Palm pre這個產品。演講中提到可用那些方法來找出GPL軟體使用證據。例如ROM, Console, JTAG, Reverse Engineering等等。

Jserv及Matt的主體是Qi-Lightweight Bootloader。目前u-boot及Redboot已經非常強大,為何還需要Qi Bootloader,請看Jserv的簡報

最後是CIH病毒的作者陳盈豪主講的Linux Driver Reverse Engineering。內容真是精彩萬分,技術範圍包含硬體架構,組合語言,程式的除錯技巧等等,真是大開眼界阿。

這二天的收獲真的是滿滿的,但客戶的email還是那麼多,幸好我已經練就隨時可用手機收發的功力,讓我可以在吸收新知之餘又可同時工作,真該感謝現代高科技產品。


2009年6月6日 星期六

Linux forum 2009 Summary at Taiwan Computex

這一次的Linux Forum 2009的主講者, 感覺像是都被Intel所找來的,主題都是環繞在Moblin,不過中間還是有提到點Google Android的東西。
一開始經濟部的長官先來講一下遠景,不過一點都不精彩,接著Intel及Linux Foundation高層也講了一些機會與趨勢。不外就是Economic System, Unified EcosSystem(LSB), Mobility, Connectivity, Easy User Experience(UX) and Cloud service是未來的重點。

Linux廠商間的角力,似乎在這里看得很清楚,Novell因為加入了Moblin組織,今年的Intel的Build tool開始改用Novell的Build Service架構(http://en.opensuse.org/Build_Service ),因為他做的最好,可以build出其他Linux套件(deb,rpm,moblin)。Novell除了提供這些外,還有提供一些企業端的軟體方案,例如Email, MediaPlayer, UX的加強。看起來,Novell做的很像Canonical所包裝的Ubuntu
Linux,只是過去Novell做的綠色OpenSuse,被Canonical模仿後,包裝成咖啡色的Ubuntu,他的OpenSuse被打的很慘。現在Novell則想借助Intel Moblin的力量來板回一成。
當然Canonical也在做自己的MID OS, 叫做Remix吧,號稱HP其中的一款就是使用這個,叫做MIE。
http://www.downloadsquad.com/2009/02/04/hp-releases-netbook-interface-for-ubuntu/
所以鹿死誰手還不知道,會不會到時Canonical及Novell都被Intel買下來啊(在會場的同時,也看到新聞寫:WindRiver被Intel買下來了,所以什麼都有可能發生的)

而臺灣業者Acer, Asus, Linpus也都來站臺,不過礙于Intel,大家都沒談到Android
不過倒是幾個廠商提到可實作Android runtime service在Moblin上,讓Moblin來跑Android的application。這應該是沒有問題的,若反過來?似乎會比較難。因為Android拿掉太多東西了,一些原生的X-Windows程式,或者GTK的程式一定不能跑,所以還要將這些Library porting回Android內,困難度相對來說,會比較高。(註:Forum結束後,在網路上,也看到了Unbuntu Remix可以跑Android application (http://arstechnica.com/open-source/news/2009/05/canonical-developers-aim-to-make-android-apps-run-on-ubuntu.ars )


所以Android及Moblin各有優缺點,目前初步看了,在Desktop x86上Moblin較有優勢,而Embedded device則Android會較有發揮自由度(Apache/BSD license),但難度是比較高點,但這對ODM來說反而較好,有進入的門檻。

這里值得一提的UX是大家都想把所有的東西塞在桌面上了,桌面就是Browser, Brower就是桌面Moblin v2開機進入,就是呈現這個結果。有興趣的,翻看以下連接。

http://moblin.org/documentation/moblin-netbook-intro

Acer也同樣分享他們設計All-in-One的Home Nettop的相同理念。硬體是這一款,但硬體不是重點。
http://goods.ruten.com.tw/item/show?11090428279554 (這個忠孝店Jacky不是我)
Acer所描述的情境是:早上起床,就被這臺AIO所設定的鬧鐘播放的音樂聲喚醒,這時你可以邊起床整理,邊看一下今天的Email,Calendar及Task,這時你大概很清楚今天的工作量(同時壓力也倍增,可能導致不“便”)。這時你也可以要AIO讀你訂閱的新聞給你聽(讀太慢了,你可以改成自己看),也許今天發生大事,你可以不用上班啊。
最厲害的是收到陌生人或者第一次業務來信,Email Client馬上可顯示他的LinkedIn, Facebook, MSN live, Twitter, Blog,etc.. 所有常見的社群網路資訊連接,可以方便讓你多認識了解這個人。這個功能厲害吧(也很可怕),可惜還是構想中,還沒出現。


最後有一位Victor 洪 (公司網址 http://www.ossii.com.tw ), 講了一句發人省思的話。微軟幫Asus及Acer出了研發Linux的費用,真是一語道破啊。Linux的Desktop使用量,去年才剛突破1%喔,而且Asus及Acer的Linux版的Netbook根本就是失敗了,但他們也因為Linux,才可以跟微軟砍授權費,省下來的錢,可能比研發Linux的費用還高啊,何樂而不為呢?所以Linux還是會持續熱下去啊。

2009年4月19日 星期日

Google Android for IBM Thinkpad series

Recently I found a good step-by-step instruction for building Android image for IBM Thinkpad Notebook.

This is a good guide, I will try to build this for Thinkpad T43.

Link - http://wiki.androidx86.org/index.php?title=Building_Android_for_the_ThinkPad_series

2009年4月18日 星期六

How to use monit to monitor Asterisk

Here is a good article Tom wrote about monitoring asterisk IP-PBX service.

http://blog.tmcnet.com/blog/tom-keating/asterisk/using-monit-tool-to-monitor-asterisk.asp

2009年4月14日 星期二

Really need a scheduled reboot on Windows 2003 Server

Hmm, To be or not... For more better life, I really need this. So add this into Task Schedule.
When I updated Adobe Connect from 6.x to 7.0 SP2, this application become a memory exhausted stuff. There is no way to stop it to use more memory, so the best way is refresh it by using "shutdown" command.

2009年2月20日 星期五

How to change ethernet MAC on Linux

# Run ifconfig by manual for changing HW MAC
rmmod forcedeth
sleep 3
modprobe forcedeth
sleep 30
ifconfig eth0 hw ether 00:40:63:DD:89:9E
ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up
route add default gw 192.168.1.1

2009年2月8日 星期日

Google latitude service

Recently, Google announce my location service can be shared to friends you want to him/her to know your location. This is very great service to bi-direct GPS add-on service.

Detail info, see http://m.google.com/latitude

2009年1月20日 星期二

The difference of "==" and "equals" in Java language

Here is an example of == and equals

在Java裡,equals和==常令程式設計師困惑,這裡簡單說明如下:
1. ==

測試物件參考時,唯有當兩個參考指向同一物件時,==運算子的結果才為true,同樣的,唯有當兩個參考指向不同物件時,!=運算子的結果才為true,這兩個運算子的處理與物件的內容無關。需要特別注意的是,在String中使用==,因為Java為節省記憶體,會在某一輪調區中維護唯一的String物件,所以如果在類別裡使用同一字串,Java只會建立一個唯一的字串而已。

2. equals

另一種測試的做法是equals,equals在類別為Java原先就存在時,是比較兩個物件是否為相同類型的類別後再比較其內容值是否相同,是就傳回true,否就傳回false。當要測試的類別是自定類別時,要依自定類別所提供的equals來決定如何比較,如果自定類別沒有覆蓋Object的equals類別的話,就以Object的equals來比較,Object的equals的比較方式如同==。

public class myEquals {

public myEquals() {

//字串型別

String sA = "ABC";

String sB = "ABC";

String sC = new String("ABC");



//==的比較

if (sA == sB)

System.out.println("sA == sB");

else

System.out.println("sA != sB");



if (sA == sC)

System.out.println("sA == sC");

else

System.out.println("sA != sC");



//equals的比較

if (sA.equals(sB))

System.out.println("sA.equals(sB) = true");

else

System.out.println("sA.equals(sB) = false");



if (sA.equals(sC))

System.out.println("sA.equals(sC) = true");

else

System.out.println("sA.equals(sC) = false");



//Java原有的型別

Long lngA = new Long(100);

Long lngB = new Long(100);

Long lngC = new Long("100");



//==的比較

if (lngA == lngB)

System.out.println("lngA == lngB");

else

System.out.println("lngA != lngB");



if (lngA == lngC)

System.out.println("lngA == lngC");

else

System.out.println("lngA != lngC");



//equals的比較

if (lngA.equals(lngB))

System.out.println("lngA.equals(lngB) = true");

else

System.out.println("lngA.equals(lngB) = false");



if (lngA.equals(lngC))

System.out.println("lngA.equals(lngC) = true");

else

System.out.println("lngA.equals(lngC) = false");



//自定型別

myObject1 m1A = new myObject1();

myObject1 m1B = new myObject1();

myObject2 m2A = new myObject2();

myObject2 m2B = new myObject2();



//==的比較

if (m1A == m1B)

System.out.println("m1A == m1B");

else

System.out.println("m1A != m1B");



if (m2A == m2B)

System.out.println("m2A == m2B");

else

System.out.println("m2A != m2B");



//equals的比較

if (m1A.equals(m1B))

System.out.println("m1A.equals(m1B) = true");

else

System.out.println("m1A.equals(m1B) = false");



if (m2A.equals(m2B))

System.out.println("m2A.equals(m2B) = true");

else

System.out.println("m2A.equals(m2B) = false");

}

public static void main(String[] args) {

myEquals myEquals1 = new myEquals();

}

}



執行結果

sA == sB

sA != sC

sA.equals(sB) = true

sA.equals(sC) = true

lngA != lngB

lngA != lngC

lngA.equals(lngB) = true

lngA.equals(lngC) = true

m1A != m1B

m2A != m2B

m1A.equals(m1B) = false

m2A.equals(m2B) = true

2009年1月7日 星期三

What is qemu?

http://en.wikipedia.org/wiki/QEMU
Today I can't use my embedded board, because I don't have serial console line on hand today. So I try to find a simulator tool to run my ARM based software without HW.
Here is the qemu download url -
http://www.jk2410.org/release/host/qemu/qemu-jk2410-20080809.tar.bz2

Installation step is very easy, I did the follows
$tar jxvf qemu-jk2410-20080809.tar.bz2
$sudo apt-get install gcc-3.4
$sudo apt-get install libsdl-dev
$cd qemu-jk2410-20080809
$./configure --cc=/usr/bin/gcc-3.4 --target-list=arm-softmmu
$make
$sudo make install


2009年1月5日 星期一

How to check CPU endian on Embedded Linux


Sometimes you don't know what type of CPU endian on your ARM platform. Here you can write a very simple program to test

/* Test CPU Endian */
#include
#include

int main() {
if (htons(1) == 1) puts("big endian");
else puts("little endian");
return 0;
}
/* End */