2007年1月11日 星期四
Qtopia phone edition 4.1.4
cd qtopia-phone-4.1.4
./configure -edition phone (-prefix 改變安裝位置,例如 -prefix /opt/Qtopia)
make
make install
所有的執行時所需要的檔案會放在image/opt/Qtopia/
export PATH=$PATH:$PWD/image/opt/Qtopia/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/image/opt/Qtopia/lib
export QPEHOME=$PWD/image/opt/Qtopia
bin/startdemo
#QT/Embedded now rename to Qtopia Core
#Cross compile Qtopia Core for ARM
cd $QTOPIA
cd qtopiacore
./configure -embedded arm -no-qt3support
gmake
make install
#It will install to /usr/local/Trolltech/QtopiaCore-4.1.12-arm/
cp -a mkspecs /usr/local/Trolltech/QtopiaCore-4.1.12-arm/
#Ok, now we finish it
#Compile QTE application
export QTDIR=/home/gigijoe/MIP200/qtopia-phone-4.1.4/qtopiacore/qt
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
cd qt4_example
qmake -project
vi qt4_example.pro
#Add CONFIG += release
qmake -makefile -unix -o Makefile -spec qws/linux-arm-g++
2007年1月3日 星期三
Fonera kernel panic
今天又碰到了,但是在login之後一段時間.原因可能是因為接上10MbaseT hub的關係
root@(none):/# ps -ax
PID Uid VmSize Stat Command
1 root 396 S init
2 root SW [keventd]
3 root SWN [ksoftirqd_CPU0]
4 root SW [kswapd]
5 root SW [bdflush]
6 root SW [kupdated]
8 root SW [mtdblockd]
16 root 396 S syslogd -C 16
17 root 436 S /bin/sh /etc/init.d/rcS
18 root 380 S logger -s -p 6 -t
20 root 488 S /bin/ash --login
22 root 360 S klogd
60 root SWN [jffs2_gcd_mtd2]
126 root 284 S lock /var/run/restart-services
459 root 420 S httpd -p 80 -h /www -r OpenWrt
498 root 424 S crond -c /etc/crontabs
516 root 328 S watchdog -t 5 /dev/misc/watchdog
517 root 328 D watchdog -t 5 /dev/misc/watchdog
518 root 424 S /usr/sbin/httpd -R /cgi-bin/splash.sh -H 192.168.10.1
628 nobody 420 S dnsmasq -C /etc/dnsmasq.conf --dhcp-range=192.168.10.
655 root 480 S hostapd -B /tmp/hostapd.conf
669 root 404 S udhcpc -i eth0 -R
885 root 452 S /bin/sh /etc/init.d/N50chillispot loop
888 root 4900 S /usr/sbin/chilli --dns1=192.168.0.37 --dns2=192.168.0
896 root 276 S lock /var/run/restart-services
1755 root 300 S sleep 1
1756 root 368 R ps -ax
root@(none):/# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
wifi0 no wireless extensions.
ath1 IEEE 802.11g ESSID:"MyPlace"
Mode:Master Frequency:2.417 GHz Access Point: 00:18:84:14:54:9E
Bit Rate:0 kb/s Tx-Power:18 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:5445-E469-653E-44D9-8C37-DEB0-2079-DE42 [2] Security mode:open
Power Management:off
Link Quality=50/98 Signal level=-44 dBm Noise level=-94 dBm
Rx invalid nwid:29 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
ath0 IEEE 802.11g ESSID:"FON_AP"
Mode:Master Frequency:2.417 GHz Access Point: 00:18:84:14:54:9D
Bit Rate:0 kb/s Tx-Power:18 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=50/98 Signal level=-44 dBm Noise level=-94 dBm
Rx invalid nwid:21 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
tun0 no wireless extensions.
root@(none):/# skput:over: 800e9d34:2044 put:2044 dev:eth0Break instruction in kernel code in traps.c::do_bp, line 593:
$0 : 00000000 10009d00 0000002b 80710000 00000000 00000000 0000001f 8035d520
$8 : 00000000 00001193 00001193 00001165 801c0000 801c0000 801c0000 ffffffff
$16: 802bed60 80a8ad60 802b0d40 00000018 a02bb980 00000060 00000002 802bec00
$24: 00000002 00000003 80710000 80711e00 100009e0 800f4d40
Hi : 00000000
Lo : 00000000
epc : 800f4d40 Tainted: P
Status: 10009d03
Cause : 10800024
PrId : 00019064
Process chilli (pid: 888, stackpage=80710000)
Stack: 800fa4ec 800e9d34 000007fc 000007fc 802bec00 00000018 800e9d44
800e9d6c 00000000 7fff69d8 801a2270 801a21a8 801a2180 00007ea2 00000000
801a0000 fffffff8 801c0000 10009d01 80711ef8 10000a28 00000001 8005eb70
00000000 0000012b 00000000 00000000 801a2070 00000001 801a2060 8005e6c4
8005e6c4 80a9f980 80a84002 800fa4ec 80090884 80a9f980 80a84002 000005dc
80238a00 ...
Call Trace: [<800fa4ec>] [<800e9d34>] [<800e9d44>] [<800e9d6c>] [<8005eb70>]
[<8005e6c4>] [<8005e6c4>] [<800fa4ec>] [<80090884>] [ ] [ ]
[<8007e470>] [<800f2804>] [<80048a60>]
Code: 2443e128 0c016749 afa30010 <0200000d> 8fbf0018 03e00008 27bd0020 27bdffd8 3c07801f
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
<0>Rebooting in 3 seconds..+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:14:54:9c
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROMRAM]
2007年1月2日 星期二
Building Fonera
chilli.conf
radiusserver1 radius01.fon.com
radiusserver2 radius02.fon.com
radiussecret garrafon
uamsecret garrafon
uamanydns
uamallowed 192.168.10.1,192.168.0.0/24,192.168.182.0/24 <------加入local interface
uamallowed www.martinvarsavsky.net,www.google.com,www.flickr.com,static.flickr.com,video.google.com,216.239.51.0/24,66.249.81.0/24
uamallowed www.fon.com,www.paypal.com,www.paypalobjects.com,www.skype.com,66.249.93.0/24,72.14.207.0/24,72.14.209.0/24,84.96.67.0/24,213.91.9.0/24,80.118.994uamallowed shop.fon.co.kr,secure.nuguya.com,inilite.inicis.com,fon-en.custhelp.com,maps.fon.com,c20.statcounter.com
uamserver https://login.fon.com/cp/index.php
chilli.fonera
DEV="fon0" <------FON AP interface的名稱
NET="192.168.182.0/24" <------FON AP 擁有的網段
MAC="00:60:B3:F3:50:C9" <------FON AP mac address
NAS="00-60-B3-F3-50-C9" <------使用FON AP mac address 做為Radius NAS ID
PID_FILE="/var/run/chilli.pid"
DNS1="168.95.1.1"
DNS2="168.95.192.1"
wlanconfig fon0 create wlandev wifi0 wlanmode ap <------建立新的wireless ap做為FON AP
iwconfig $DEV essid "FON_AP"
ifconfig $DEV hw ether $MAC <------更改mac address
ifconfig $DEV 192.168.10.1 netmask 255.255.255.0
iptables -P FORWARD DROP <------預設forward polacy為drop
iptables -A FORWARD -m state --state INVALID -j DROP
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtuiptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s $NET -j ACCEPT <------允許由tun+ interface forwarding
iptables -A FORWARD -i br0 -j ACCEPT <------允許local lan forwarding
./chilli -c chilli.conf --net=$NET --dhcpif=$DEV --lease=600 --dns1=$DNS1 --dns2=$DNS2 --radiusnasid=$NAS --pidfile=$PID_FILE
修正一個問題.在偶的platform上,當chilli停止後,tunX device並沒有被摧毀,下次執行chilli時又會產生新的tunX.
--- tun.old.c 2007-01-03 17:32:31.000000000 +0800
+++ tun.c 2007-01-03 17:22:39.000000000 +0800
@@ -687,6 +687,8 @@
strncpy((*tun)->devname, ifr.ifr_name, IFNAMSIZ);
(*tun)->devname[IFNAMSIZ] = 0;
+ ioctl((*tun)->fd, TUNSETPERSIST, 0); /*Disable persist to destroy device when closed*/
+
ioctl((*tun)->fd, TUNSETNOCSUM, 1); /* Disable checksums */
return 0;
2006年12月27日 星期三
chillispot installion
1.Download fonear.tar.gz
2.解開並patch
3.修改configure:20961
else
if test "$cross_compiling" = yes; then
ac_cv_func_malloc_0_nonnull=yes <---------------------------------原來是no改成yes
else
4.CFLAGS="-O2 -G 0 -mips32" LDFLAGS="-lcrypt" ./configure --host=mipsel-linux --target=mipsel-linux --cache-file=/dev/null
5.make
6.在來就將src/chilli擺到target上跑跑看.對了,還需要對應FON hotspot的config file
##############################################################################
#
# Fon ChilliSpot configuration file
# Powered by FON (www.fon.com)
#
##############################################################################
radiusserver1 radius01.fon.com
radiusserver2 radius02.fon.com
radiussecret garrafon
uamserver https://login.fon.com/cp/index.php
uamsecret garrafon
uamallowed www.fon.com,www.paypal.com,www.paypalobjects.com,www.skype.com
uamanydns
7.執行囉.注意要停止原本ath0上的dhcp server
./chilli -c ./chilli.conf --dns1=168.95.1.1 --dhcpif=ath0
8.有個地方有bug.在wireless client連線上由dhcp取得IP後送出的封包會轉送到eth0,這會造成skb_buf的錯誤,然後就panic
/fsdata # skput:under: 8010d2e0:54 put:14 dev:eth0Break instruction in kernel code in traps.c::do_bp, line 689:
$0 : 00000000 10008400 00000028 00000000 801bf900 00000001 00000001 00000001
$8 : 00000001 ffffd95e 0000195e 00000000 fffffffa ffffffff 0000000a 00000001
$16: 811b51a0 82c0f920 803aa0a2 810e6e24 00019923 801b3aa8 801b3a80 82a4de60
$24: 82a4dc89 803b4967 82a4c000 82a4dd70 00000005 800df800
Hi : 00000188
Lo : 002b0cdd
epc : 800df800 Tainted: P
Status: 10008403
Cause : 10800024
PrId : 0001800b
Process chilli (pid: 740, stackpage=82a4c000)
Stack: 00019923 8010d2e0 00000036 0000000e 801cb784 82a4dd90 8010d2f0
80000000 803d7780 82a4ddb8 811b51a0 811b51a0 00000008 810e6e24 801cb784
811b51a0 80107a94 80107d28 80154e54 80154fa4 00000036 801c0cb4 00000000
80107fa0 80000000 82a4de00 82a4de68 00000000 00000000 811b51a0 00000008
00000040 800e5558 800dfe18 811b51a0 8368c2e0 00000000 00000000 810e6e24
00000000 ...
Call Trace: [<8010d2e0>] [<8010d2f0>] [<80107a94>] [<80107d28>] [<80154e54>]
[<80154fa4>] [<80107fa0>] [<800e5558>] [<800dfe18>] [<800e5778>] [<800e593c>]
[<8001b20c>] [<800df938>] [<800e5174>] [<800516c0>] [<800c9190>] [<800c9158>]
[<800c921c>] [<8003ddf4>] [<800dd198>] [<8000ba60>]
Code: 248446c8 0c0057bc afa30010 <0000800d> 8fbf0018 03e00008 27bd0020 3c02803c 8c4289e4
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
Trace一下吧
net/core/skbuff.c
void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{
printk("skput:under: %p:%d put:%d dev:%s",
here, skb->len, sz, skb->dev ? skb->dev->name : " ");
BUG(); <-------------------------------------------就在這裡死啦
}
include/linux/skbuff.h
/**
* skb_push - add data to the start of a buffer
* @skb: buffer to use
* @len: amount of data to add
*
* This function extends the used data area of the buffer at the buffer
* start. If this would exceed the total buffer headroom the kernel will
* panic. A pointer to the first byte of the extra data is returned.
*/
static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
{
skb->data-=len;
skb->len+=len;
if(skb->data head) {
skb_under_panic(skb, len, current_text_addr());
}
return skb->data;
}
馬的,找到真正的原因了,Inferone提供的kernel裡有個Netfilter->Turbo NAT.拿掉就好了
2006年12月21日 星期四
Wireless Destribute System (WDS)
http://www.homeoffice.idv.tw/archives/000689.html
http://en.wikipedia.org/wiki/Wireless_Distribution_System
WDS can be used to provide two modes of wireless AP-to-AP connectivity:
- Wireless Bridging in which WDS APs communicate only with each other and don't allow wireless clients or Stations (STA) to access them
- Wireless Repeating in which APs communicate with each other and with wireless STAs
http://www.geocities.com/backgndtest/wlan_tut.html
http://www.meshnode.org/wiki/index.php/Madwifi-WDS-Bridge
WDS is used between Access Points to allow transparent bridging of two ethernets over a wireless link.
Linux wireless WDS
Model
<1.1>.P-to-P WDS support
/*Create WDS device*/
wlanconfig wds0 create wlandev wifi0 wlanmode wds
/*Add WDS peer MAC address*/
iwpriv wds0 wds_add XX:XX:XX:XX:XX:XX
/*Enable WDS*/
iwpriv wds0 wds 1
/*Set ip address*/
/*Attention !!! Both WDS peer must at the same network*/
ifconfig wds0 172.16.100.1
/*Destroy it*/
wlanconfig wds0 destroy
<2.1>.Access Point with WDS support (Multi Bridge)
wlanconfig wds0 create wlandev wifi0 wlanmode ap
iwconfig wds0 essid "WDS_AP"
< Modify Mac filter >
/*Enable WDS support*/
iwpriv wds0 wds 1
iwconfig wds0 key s:xxxxx <------可支援WEP
iwpriv wds0 maccmd X
iwpriv wds0 addmac XX:XX:XX:XX:XX:XX <------可支援Mac filter
brctl addif br0 wds0 <------加入DHCP server服務範圍
ifconfig wds0 up
/*Destroy it*/
brctl delif br0 wds0
wlanconfig wds0 destroy
<2.2>.Access Point + WDS Station (Repeater)
/*Create WDS station*/
wlanconfig wds0 create wlandev wifi0 wlanmode sta nosbeacon
iwconfig wds0 essid "WDS_AP"
iwpriv wds0 wds 1
iwconfig wds0 key s:xxxxx <------可支援WEP
ifconfig wds0 up
brctl addbr br1
brctl addif br1 ath0
brctl addif br1 wds0 <------透過WDS通道使用DHCP服務
/*Destroy it*/
brctl delif br0 wds0
wlanconfig wds0 destroy
2006年12月11日 星期一
802.11技術規格筆記
1.規格簡述
802.11a : Freq 5 GHz, Max speed 54 Mbps, PHY OFDM(Orthogonal frequency division multiplexing)
802.11b : Freq 2.4 GHz, Max speed 11 Mbps, PHY HR/DSSS(High Rate/Direct Sequence Spread Spectrum)
802.11g : Freq 2.4 GHz, Max speed 54 Mbps, PHY OFDM
2.IEEE 802.11 specification
Including 3 layer : LLC (Logical Link Control), MAC(Media Access Control), PHY(Phyical layer)
There are one MAC and two PHY layer in 802.11
Component : Station, Access point, Wireless media (RF), Distribution system (Bridge)
Network type (Basic Service Set) :
-> Independent BSS (ad hoc bss) : Peer to peer network
-> Infrastructure BSS : Station type network
-> ESS (Extended Service Set) : 以骨幹網路將BSS串聯在一起提供服務,並擁有相同的SSID (Service Set Identifier)
Wi-Fi Multimedia (WMM) and WMM Power Save modes. WMM adds Quality of Service (QoS) capabilities to Wi-Fi networks. WMM Power Save is an improvement to the 802.11e amendment adding advanced power management functionality to WMM. WMM Power Save is based on Unscheduled Automatic Power Save Delivery (U-APSD), which, like WMM, is based on Enhanced Distributed Channel Access (EDCA). U-APSD is a solution well suited for dynamic environments where Wi-Fi is generally deployed and allows clients supporting U-APSD to download all or some of the frames buffered by the access point during unscheduled service periods.
關於WME
考慮到基於時間的數據傳輸的QoS重要性,在IEEE正式批准802.11e標準(預計在2005年上半年)之前,已經有一些無線設備製造商開始在實施能基本滿足近期需要的QoS機制,這些大都是基於EDCF的,最有代表性的就是由Wi-Fi聯盟開發的WME(Wireless Mutimedia Enhancements)技術。WME技術並不是除802.11e標準之外的又一個標準,它實際上只是部份地使用了EDCF的標準,所以WME技術是802.11e的一個子集,或者說是在802.11e正式批准之前的過渡標準。一旦802.11e被批准,採用WME技術的設備都可以升級到802.11e標準。
另外,Wi-Fi聯盟還提出了無線計畫媒體(WSM,Wireless Scheduled Multimedia)技術,這是基於HCF機制的增強QoS的技術。Wi-Fi聯盟將初步使用WME,當802.11e標準最終批准之後才有可能採用WSM。