2007年9月19日 星期三

QEMU Installion

http://www.aurel32.net/info/debian_mips_qemu.php
http://d-i.alioth.debian.org/manual/en.mipsel/index.html

wget http://fabrice.bellard.free.fr/qemu/qemu-0.9.0.tar.gz
$ cd qemu-0.9.0
$ ./configure --prefix=/usr

$ make
$make install

$cd ..
$qemu-img create -f qcow hda.img 10G

wget http://ftp.de.debian.org/debian/dists/etch/main/installer-mipsel/current/images/qemu/netboot/vmlinux-2.6.18-5-qemu

wget http://ftp.de.debian.org/debian/dists/etch/main/installer-mipsel/current/images/qemu/netboot/initrd.gz

dd if=/dev/zero of=/usr/share/qemu/mips_bios.bin bs=1024 count=128

qemu-system-mipsel -kernel vmlinux-2.6.18-5-qemu -initrd initrd.gz -hda hda.img -append "root=/dev/ram console=ttyS0" -nographic

#After installation

qemu-system-mipsel -kernel vmlinux-2.6.18-5-qemu -initrd initrd.gz -hda hda.img -append "root=/dev/hda1 console=ttyS0" -nographic

2007年9月10日 星期一

System upgrade by cpio

Link


http://linux.vbird.org/linux_basic/0240tarcompress.php#cpio


http://tw.myblog.yahoo.com/blue-comic/article?mid=41&prev=48&next=40&l=f&fid=7


1.備份檔案


find phone/bin/nxphone -print | cpio -o -H newc > ./nxphone.cpio


2.備份整個目錄


find phone -type f -print | cpio -o -H newc > ./phone.cpio


find參數 -type f 代表檔案形態為一般檔案 (即不包含目錄)


3.輸出備份檔案列表


cpio -t < phone.cpio > phone.list


4.以檔案列表做備份


cat phone.list | cpio -o -H newc > phone.cpio


5.還原檔案


5.1.還原檔案並自動覆蓋較舊的檔案


cpio -iu < phone.cpio


5.2.還原檔案及建立目錄並自動覆蓋較舊的檔案


cpio -idu < phone.cpio


2007年8月28日 星期二

Squash FS with Lzma

squashfs3.2-r2.tar.gz
sqlzma3.2-r2b.zip
lzma443.zip

tar -zxvf squashfs3.2-r2.tar.gz
unzip sqlzma3.2-r2b.zip
unzip lzma443.zip

cd squashfs3.2-r2

[gigijoe@localhost squashfs3.2-r2]$ patch -p1 < ../sqlzma3.2-r2b/sqlzma2u-3.2-r2.patch
patching file squashfs-tools/Makefile
patching file squashfs-tools/mksquashfs.c
patching file squashfs-tools/read_fs.c
patching file squashfs-tools/unsquashfs.c

cd lzma443

[gigijoe@localhost lzma443]$ patch -p1 < ../sqlzma3.2-r2b/sqlzma1-443.patch
patching file C/7zip/Compress/LZMA_Alone/comp.cc
patching file C/7zip/Compress/LZMA_Alone/sqlzma.mk
patching file C/7zip/Compress/LZMA_C/kmod.mk
patching file C/7zip/Compress/LZMA_C/sqlzma.mk
patching file C/7zip/Compress/LZMA_C/testflags.c
patching file C/7zip/Compress/LZMA_C/uncomp.c
patching file C/7zip/Compress/LZMA_C/kmod/Makefile
patching file C/7zip/Compress/LZMA_C/kmod/module.c

cd sqlzma3.2-r2b
mv ../squashfs3.2-r2 .
mv ../lzma443 .

Disable BuildSquashfs in Makefile

make

Then we have squashfs tools with lzma support

2007年6月28日 星期四

Allwin MySQL

cd /opt/mysql


bin/mysql


mysql> UPDATE user SET Password=PASSWORD('allwin')
           WHERE user='allwin';
mysql> FLUSH PRIVILEGES;


Start MySQL


cd /opy/mysql


bin/mysqld_safe --user=mysql &


2007年5月8日 星期二

CLE yum

Yum Repository 的使用方式:

我舉 FC5 為例:
1.到 ftp://cle.linux.org.tw/pub/fedora/yum/repos/ 目錄底下把所有的 *.repo 檔下載回去,放到 /etc/yum.repos.d/ 底下 (可以蓋掉原來的舊的設定檔)


2.相關的 RPM GPG KEYs 都可以在 ftp://cle.linux.org.tw/pub/fedora/yum/ 目錄底下找到,把 RPM-* 的檔案都下載回去,然後用 “rpm –import RPM-*” 指令來把所需的 KEYs Import 進去


3.接下來,就是 yum update、yum install
、yum remove ….


rpm --import /usr/share/doc/fedora-release-3/*GPG-KEY*


刪除/etc/yum..repos.d/livna.repo


2007年5月4日 星期五

HOWTO : can&#39;t access tty; job control turned off

#/etc/fstab

/dev/root       /       auto    defaults,errors=continue        0 0
proc            /proc   proc    defaults    0   0
none            /tmp    tmpfs   defaults    0   0

#/etc/init.d/rcS

mount -a
mount -n /proc
mount -n -o remount,rw /

ln -s /dev/tts/0 /dev/ttyS0
ln -s /dev/vc/0 /dev/tty0

#/etc/inittab

::sysinit:-/etc/init.d/rcS
#::askfirst:-/bin/sh
#::respawn:-/bin/sh
::respawn:/sbin/getty -L ttyS0 9600 vt100
::ctrlaltdel:/bin/umount -a -r



2007年4月10日 星期二

ISDN 筆記

1.Different between ISDN BRI-S/T and BRI-U


ISDN service is typically provided using modular plugs. These plugs include a RJ45 interface (8 pin) for data equipment (called a BRI-S/T) and the other physical connection type is a two-wire, RJ11 type standard (called the BRI-U). 


2.ISDN basic document


http://ckp.made-it.com/isdn.html


http://www.delmar.edu/Courses/ITSC1391/Sem4/5ISDN.htm


3.ISDN switch types, causes and value


http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/dbook/disdn.htm


2007年3月30日 星期五

quadBRI mini PCI ISDN

http://www.voip-info.org/wiki/index.php?page=BRI


http://www.ciscopress.com/articles/article.asp?p=29737&seqNum=3&rl=1


1.quadBRI mini PCI card. http://www.junghanns.net
2.Download driver : bristuff-0.3.0-PRE-1y-d.tar.gz
3.Download zaptel : zaptel-1.2.16.tar.gz
4.Build zaptel

FIX Makefile for platform and target running kernel

cp bristuff-0.3.0-PRE-1y-d/patches/zaptel.patch .
cd zaptel-1.2.16
patch -p1 < ../zaptel.patch

[gigijoe@localhost zaptel-1.2.16]$ CC=mipsel-linux-gcc AR=mipsel-linux-ar LD=mipsel-linux-ld KVERS=2.4.31 KSRC=../../linux_2_4_31 make
mipsel-linux-gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O4 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -c -o gendigits.o gendigits.c
mipsel-linux-gcc -o gendigits gendigits.o -lm
./gendigits > tones.h
/bin/sh: ./gendigits: cannot execute binary file
make: *** [tones.h] Error 126
[gigijoe@localhost zaptel-1.2.16]$ gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -c -o gendigits.o gendigits.c
[gigijoe@localhost zaptel-1.2.16]$ gcc -o gendigits gendigits.o -lm
[gigijoe@localhost zaptel-1.2.16]$ CC=mipsel-linux-gcc AR=mipsel-linux-ar LD=mipsel-linux-ld KVERS=2.4.31 KSRC=../../linux_2_4_31 make ./gendigits > tones.h
mipsel-linux-gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" makefw.c -o makefw
./makefw tormenta2.rbt tor2fw > tor2fw.h
/bin/sh: ./makefw: cannot execute binary file
make: *** [tor2fw.h] Error 126
[gigijoe@localhost zaptel-1.2.16]$ gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" makefw.c -o makefw
[gigijoe@localhost zaptel-1.2.16]$ ./makefw tormenta2.rbt tor2fw > tor2fw.h
Loaded 69900 bytes from file
[gigijoe@localhost zaptel-1.2.16]$ gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" makefw.c -o makefw
[gigijoe@localhost zaptel-1.2.16]$ CC=mipsel-linux-gcc AR=mipsel-linux-ar LD=mipsel-linux-ld KVERS=2.4.31 KSRC=../../linux_2_4_31 make

End up with error, but it's ok.
What we need are zaptel.o and zaptel-base.o

5.Build qozap

cd bristuff-0.3.0-PRE-1y-d/qozap

FIX Makefile for platform and target running kernel
[gigijoe@localhost qozap]$ make
mipsel-linux-gcc -c qozap.c -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DRELAXED_LOCKING -fomit-frame-pointer -O2 -Wall -I/home/gigijoe/ECS040/linux_2_4_31/include -I../../zaptel-1.2.16 -D__LINUX__ -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wparentheses -O2 -G 0 -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-abicalls -fno-pic -pipe -mips2 -Wa,--trap -Wa,--trap -D__linux__ -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -D__MIPSEL__ -DUTS_MACHINE='mips' -mlong-calls -DMODVERSIONS -include /home/gigijoe/ECS040/linux_2_4_31/include/linux/modversions.h

Now you have qozap.o

6.Insert modules

/tmp # insmod zaptel.o
Using zaptel.o
Zapata Telephony Interface Registered on major 196
Zaptel Version: 1.2.16
Zaptel Echo Canceller: MG2

/tmp # insmod zaptel-base.o
Using zaptel-base.o
Zapata Telephony Interface Registered on major 196
Zaptel Version: 1.2.16
Zaptel Echo Canceller: MG2

/tmp # insmod qozap.o
Using qozap.o
qozap: S/T ports: 2 [ TE TE ]
qozap: 1 multiBRI card(s) in this box, 0 BRI ports total, bloop 0, pcmslave 0.

7.Build ztcfg

[gigijoe@localhost zaptel-1.2.16]$ CC=mipsel-linux-gcc AR=mipsel-linux-ar LD=mipsel-linux-ld KVERS=2.4.31 KSRC=../../linux_2_4_31 make ztcfg mipsel-linux-gcc -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -c -o ztcfg.o ztcfg.c
mipsel-linux-gcc -c -fPIC -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DBUILDING_TONEZONE -o zonedata.lo zonedata.c
mipsel-linux-gcc -c -fPIC -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE -I. -O2 -g -Wall -DBUILDING_TONEZONE -o tonezone.lo tonezone.c
ar rcs libtonezone.a zonedata.lo tonezone.lo
mipsel-linux-gcc -o ztcfg ztcfg.o libtonezone.a -lm

8.Create device node
http://lists.digium.com/pipermail/asterisk-bsd/2005-April/000744.html


http://lists.digium.com/pipermail/asterisk-users/2003-February/000638.html



/tmp # mkdir /dev/zap
/tmp # mknod /dev/zap/ctl c 196 0
/tmp # mknod /dev/zap/channel c 196 254


9.Configure zaptel

/tmp # ./ztcfg -c zaptel.conf.quadBRI -vvvv -d 3 -a
Line 1: loadzone=nl
Line 2: defaultzone=nl
Line 5: span=1,1,3,ccs,ami
Line 6: span=2,2,3,ccs,ami
Line 7: span=3,3,3,ccs,ami
Line 8: span=4,4,3,ccs,ami
Line 10: bchan=1,2
Line 11: dchan=3
Line 12: bchan=4,5
Line 13: dchan=6
Line 14: bchan=7,8
Line 15: dchan=9
Line 16: bchan=10,11
Line 17: dchan=12


Zaptel Configuration
======================

SPAN 1: CCS/ AMI Build-out: 399-533 feet (DSX-1)
SPAN 2: CCS/ AMI Build-out: 399-533 feet (DSX-1)
SPAN 3: CCS/ AMI Build-out: 399-533 feet (DSX-1)
SPAN 4: CCS/ AMI Build-out: 399-533 feet (DSX-1)

Channel map:

Channel 01: Clear channel (Default) (Slaves: 01)
Channel 02: Clear channel (Default) (Slaves: 02)
Channel 03: D-channel (Default) (Slaves: 03)
Channel 04: Clear channel (Default) (Slaves: 04)
Channel 05: Clear channel (Default) (Slaves: 05)
Channel 06: D-channel (Default) (Slaves: 06)
Channel 07: Clear channel (Default) (Slaves: 07)
Channel 08: Clear channel (Default) (Slaves: 08)
Channel 09: D-channel (Default) (Slaves: 09)
Channel 10: Clear channel (Default) (Slaves: 10)
Channel 11: Clear channel (Default) (Slaves: 11)
Channel 12: D-channel (Default) (Slaves: 12)

12 channels configured.

Changing signalling on channel 1 from Unused to Clear channel
Changing signalling on channel 2 from Unused to Clear channel
Changing signalling on channel 3 from Unused to HDLC with FCS check
Changing signalling on channel 4 from Unused to Clear channel
Changing signalling on channel 5 from Unused to Clear channel
Changing signalling on channel 6 from Unused to HDLC with FCS check
Changing signalling on channel 7 from Unused to Clear channel
Changing signalling on channel 8 from Unused to Clear channel
Changing signalling on channel 9 from Unused to HDLC with FCS check
Changing signalling on channel 10 from Unused to Clear channel
Changing signalling on channel 11 from Unused to Clear channel
Changing signalling on channel 12 from Unused to HDLC with FCS check
Registered tone zone 3 (Netherlands)



10.Patch and build libpri-1.2.4
cp bristuff-0.3.0-PRE-1y-e/patches/libpri.patch .
cd libpri-1.2.4
patch -p1 < ../libpri.patch


Edit Makefile for mipsel cross compile


make


[gigijoe@localhost libpri-1.2.4]$ make
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o copy_string.o copy_string.c
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o pri.o pri.c
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o q921.o q921.c
q921.c: In function `__q921_receive_qualified':
q921.c:1429: warning: `tei' might be used uninitialized in this function
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o prisched.o prisched.c
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o q931.o q931.c
mipsel-linux-gcc -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -c -o pri_facility.o pri_facility.c
ar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
ranlib libpri.a
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o copy_string.lo -c copy_string.c
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o pri.lo -c pri.c
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o q921.lo -c q921.c
q921.c: In function `__q921_receive_qualified':
q921.c:1429: warning: `tei' might be used uninitialized in this function
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o prisched.lo -c prisched.c
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o q931.lo -c q931.c
mipsel-linux-gcc -fPIC -G 0 -mips32 -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -DRELAX_TRB -DRELAXED_TIMERS -o pri_facility.lo -c pri_facility.c
mipsel-linux-gcc -shared -Wl,-hlibpri.so.1.0 -o libpri.so.1.0 copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
/sbin/ldconfig -n .
ln -sf libpri.so.1.0 libpri.so
ln -sf libpri.so.1.0 libpri.so.1


11.Build zapate


Edit Makefile for mipsel cross compile and zaptel.h


[gigijoe@localhost zapata]$ make
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o goertzel.o goertzel.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o filtros.o filtros.c
In file included from filtros.c:33:
coef_in.h:9:8: warning: no newline at end of file
In file included from filtros.c:43:
coef_out.h:3:4: warning: no newline at end of file
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o demodulador.o demodulador.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o serie.o serie.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o baudot.o baudot.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o dpll.o dpll.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -G 0 -mips32 -O2 -I../zaptel-1.2.16   -c -o tone_detect.o tone_detect.c
ar rcs libzap.a zap.o goertzel.o filtros.o demodulador.o serie.o baudot.o dpll.o tone_detect.o
ranlib libzap.a
mipsel-linux-gcc -shared -Wl,-soname,libzap.so.1 -o libzap.so.1.0 zap.o goertzel.o filtros.o demodulador.o serie.o baudot.o dpll.o tone_detect.o -lc -lm
/sbin/ldconfig -n .
rm -f libzap.so
ln -sf libzap.so.1 libzap.so




2007年3月6日 星期二

ARM gdb howto (轉載)

一.下载gdb-6.4.tar.gz源代码
http://ftp.gnu.org/gnu/gdb/


二.编译 GDB
#tar zxvf gdb-6.4.tar.gz


2.1 编译GDB Server
#cd gdb-6.4
#./configure --target=arm-linux --prefix=/usr/local/arm-gdb
#make
#make install           // 生成/usr/local/arm-gdb/bin


2.2 编译GDB Client
#cd ./gdb/gdbserver
#export PATH=$PATH:/usr/local/arm-gdb/bin
#./configure --target=arm-linux --host=arm-linux
#vi config.h
    //#define HAVA_SYS_REG_H    //注释此句
#make  CC=arm-linux-gcc           //编译用于目标机的stub程序  生成gdbserver是GDB客户端程序,在板子上运行。


三.实战调试
1.编辑文件
# vi gdbtest.c
1 #include <stdio.h>

3 int
4 func(int n){
5     int   sum=0, i;
6     for (i=0; i<n; i++){
7         sum += i;
8     }
9     return sum;
10 }
11
12 int
13 main(void)
14 {
15    int   i;
16    long result = 0;
17    for (i=0; i<=100; i++){
18        result += i;
19    }
20  
21    printf("result[1-100] = %d \n", result);
22    printf("resutl[1-225] = %d \n", func(255));
23
24    return 0;
25 }
#  arm-linux-gcc -g gdbtest.c -o gdbtest          // 交叉编译
2.下载文件到目标板: gdbtest和gdbserver
假设 host pc ip:192.168.1.45
     board   ip:192.168.1.180    
将文件拷贝到目标板上:
先将gdbtest和gdbserver两个文件拷贝到主机的/tftpboot目录下
在目标板的Linux中运行:
#mount 192.168.1.108:/tftpboot /mnt/nfs
#cd /mnt/nfs
#ls
看是否有gdbtest和gdbserver两个文件。
3.运行调试
client board:
#./gdbserver 192.168.1.45:1234 gdbtest  // 目标板上运行gdbtest 监听端口1234


host pc:
#cd /usr/local/arm-gdb/bin/
#copy gdbtest /usr/local/arm-gdb/bin/   // 将前面编译的文件gdbtest拷贝到此目录
#./arm-linux-gdb gdbtest
(gdb) target remote 192.168.1.180:1234   // 连接到开 发板 成功后就可以进行调试               
(gdb)list   or l
(gdb)break func 
(gdb)break 22
(gdb)info br    
(gdb)continue   or c    // 这里不能用 run
(gdb)next   or n
(gdb)print or p    result  
(gdb) finish        // 跳出func函数
(gdb) next
(gdb) quit
建立连接后进行gdb远程调试和gdb本地调试方法相同



2007年2月16日 星期五

S3C2410 MMC / Linux 2.6.19

1.Get s3c2420 mmc from http://www.handhelds.org/moin/moin.cgi/HpIpaqH1940Downloads

2.The linux DMA stack has been modified since 2.6.18
Fix s3c2410mci.h

#define S3C2410SDI_DMA DMACH_SDI

3.make zImage
4.Create device node
mknod mmcblk0 b 254 0
mknod mmcblk0p1 b 254 1

5.mount sd card
mount -t vfat -o sync /dev/mmcblk0p1 /mnt


2007年2月14日 星期三

Linux USB Ethernet/RNDIS gadget

From http://embedded.seattle.intel-research.net/wiki/index.php?title=Setting_up_USBnet


Currently the Linux kernel supports a CDC Ethernet USB Gadget driver (see USBnet (http://www.linux-usb.org/usbnet/) for more information); however, Windows in unable to use this device because it only support RNDIS Ethernet drivers (the CDC Ethernet driver does work under Linux though).


I'm fail to running Linux USB Ethernet/RNDIS gadget with Windows XP by MS default RNDIS driver. (Error code 10).


Finally I found MCCI RNDIS (Evalution version). It works.


I get it from http://members.driverguide.com/driver/detail.php?driverid=557038


1.Linux Ethernet/RNDIS device


ifconfig usb0 10.0.0.1


2.Windows Ethernet/RNDIS host


Set IP address for Eval MCCI?USB networking device (NDIS 5)


For example 10.0.0.2


Then it works as a real ethernet connection ...


2007年2月6日 星期二

Howto initramfs on linux-2.6.x

@Create external cpio archie


1.Create root file system on $BUSYBOX/ramdisk
2.cd $BUSYBOX/ramdisk
3.find . | cpio -o -H newc > ../initramfs.cpio
4.cp $BUSYBOX/initramfs.cpio $KERNEL/usr
5.cd $KERNEL
6.Set kernel config -> CONFIG_INITRAMFS_SOURCE="usr/initramfs.cpio"
7.make zImage

Note:Busybox can be dynamic linked, but be sure shared libraries in /lib

        /*
         * check if there is an early userspace init.  If yes, let it do all
         * the work
         */

        if (!ramdisk_execute_command)
                ramdisk_execute_command = "/init"; <- Symblic link /init to /bin/sh. We can run into shell and never return

        if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
                ramdisk_execute_command = NULL;
                prepare_namespace();
        }


@Create cpio archie by script


1.Create script file $KERNEL/usr/cpio_list


dir /dev 755 0 0
nod /dev/ram0 644 0 0 b 1 0
nod /dev/null 644 0 0 c 1 3
nod /dev/zero 644 0 0 c 1 5
nod /dev/random 644 0 0 c 1 8
nod /dev/urandom 644 0 0 c 1 9
nod /dev/tty0 644 0 0 c 4 0
nod /dev/tty1 644 0 0 c 4 1
nod /dev/tty2 644 0 0 c 4 2
nod /dev/tty 644 0 0 c 5 0
nod /dev/console 644 0 0 c 5 1
nod /dev/loop0 644 0 0 b 7 0
nod /dev/rtc 644 0 0 c 10 135
nod /dev/dsp 644 0 0 c 14 3
slink /dev/sound/dsp /dev/dsp 644 0 0
nod /dev/mtdblock0 644 0 0 b 31 0
nod /dev/mtdblock1 644 0 0 b 31 1
nod /dev/mtdblock2 644 0 0 b 31 2
nod /dev/mtd0 644 0 0 c 90 0
nod /dev/mtd1 644 0 0 c 90 1
nod /dev/mtd2 644 0 0 c 90 2
nod /dev/ttySAC0 644 0 0 c 204 64
nod /dev/ttySAC1 644 0 0 c 204 65
nod /dev/ttySAC2 644 0 0 c 204 66
dir /dev/pts 644 0 0


 


dir /bin 755 1000 1000
file /bin/busybox /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/bin/busybox 755 0 0
slink /bin/sh /bin/busybox 777 0 0
slink /bin/login /bin/busybox 777 0 0
slink /bin/mount /bin/busybox 777 0 0
slink /bin/umount /bin/busybox 777 0 0
slink /bin/hostname /bin/busybox 777 0 0
slink /bin/ifconfig /bin/busybox 777 0 0
slink /bin/ping /bin/busybox 777 0 0
slink /bin/netstat /bin/busybox 777 0 0
slink /bin/date /bin/busybox 777 0 0
slink /bin/ls /bin/busybox 777 0 0
slink /bin/ln /bin/busybox 777 0 0
slink /bin/mkdir /bin/busybox 777 0 0
slink /bin/mv /bin/busybox 777 0 0
slink /bin/rm /bin/busybox 777 0 0
slink /bin/cat /bin/busybox 777 0 0
slink /bin/echo /bin/busybox 777 0 0
slink /bin/kill /bin/busybox 777 0 0
slink /bin/killall /bin/busybox 777 0 0
slink /bin/ps /bin/busybox 777 0 0
slink /bin/df /bin/busybox 777 0 0
slink /bin/free /bin/busybox 777 0 0


 


dir /sbin 755 0 0
slink /sbin/init /bin/busybox 755 0 0
slink /sbin/getty /bin/busybox 755 0 0
slink /sbin/poweroff /bin/busybox 755 0 0
slink /sbin/halt /bin/busybox 755 0 0
slink /sbin/reboot /bin/busybox 755 0 0
slink /sbin/hwclock /bin/busybox 755 0 0
slink /sbin/insmod /bin/busybox 755 0 0
slink /sbin/rmmod /bin/busybox 755 0 0
slink /sbin/lsmod /bin/busybox 755 0 0
slink /sbin/modprobe /bin/busybox 755 0 0
slink /sbin/syslogd /bin/busybox 755 0 0
file /sbin/ftpd /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/sbin/ftpd 755 0 0



slink /init /bin/sh 755 0 0



dir /etc 755 0 0
file /etc/inittab /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/inittab 644 0 0
file /etc/fstab /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/fstab 644 0 0
file /etc/passwd /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/passwd 644 0 0
file /etc/group /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/group 644 0 0
file /etc/resolv.conf /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/resolv.conf 644 0 0
file /etc/hosts /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/hosts 644 0 0
file /etc/host.conf /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/host.conf 644 0 0
file /etc/services /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/services 644 0 0
dir /etc/init.d 755 0 0
file /etc/init.d/rcS /home/gigijoe/S3C2410/busybox-1.2.1/ramdisk/etc/init.d/rcS 755 0 0


 


dir /proc 755 0 0
dir /sys 755 0 0
dir /mnt 755 0 0
dir /tmp 755 0 0
dir /var 755 0 0
dir /var/log 755 0 0


2.Set kernel config -> CONFIG_INITRAMFS_SOURCE="usr/cpio_list"


3.make zImage


2007年2月5日 星期一

USB gadget serial, gserial.inf

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%LINUX%
DriverVer=08/17/2004,0.0.2.0
; Copyright (C) 2004 Al Borchers (alborchers@steinerpoint.com)

[Manufacturer]
%LINUX%=GSerialDeviceList

[GSerialDeviceList]
%GSERIAL%=GSerialInstall, USB\VID_0525&PID_A4A7

[DestinationDirs]
DefaultDestDir=10,System32\Drivers

[GSerialInstall]
CopyFiles=GSerialCopyFiles
AddReg=GSerialAddReg

[GSerialCopyFiles]
usbser.sys

[GSerialAddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[GSerialInstall.Services]
AddService = usbser,0x0002,GSerialService

[GSerialService]
DisplayName = %GSERIAL_DISPLAY_NAME%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\usbser.sys
LoadOrderGroup = Base

[Strings]
LINUX = "Linux"
GSERIAL = "Gadget Serial"
GSERIAL_DISPLAY_NAME = "USB Gadget Serial Driver"


























; MS-Windows driver config matching some basic modes of the
; Linux-USB Ethernet/RNDIS gadget firmware:
;
; - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS
; cable modem profile, and supports most non-Microsoft USB hosts
;
; - RNDIS plus CDC Subset ... used by hardware that incapable of
; full CDC Ethernet support.
;
; Microsoft only directly supports RNDIS drivers, and bundled them into XP.
; The Microsoft "Remote NDIS USB Driver Kit" is currently found at:
; http://www.microsoft.com/whdc/hwdev/resources/HWservices/rndis.mspx


[Version]
Signature = "$CHICAGO$"
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Linux%
Compatible = 1
MillenniumPreferred = .ME
DriverVer = 03/30/2004,0.0.0.0
; catalog file would be used by WHQL
;CatalogFile = Linux.cat

[Manufacturer]
%Linux% = LinuxDevices,NT.5.1

[LinuxDevices]
; NetChip IDs, used by both firmware modes
%LinuxDevice% = RNDIS, USB\VID_0525&PID_a4a2

[LinuxDevices.NT.5.1]
%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2

[ControlFlags]
ExcludeFromSelect=*

; Windows 98, Windows 98 Second Edition specific sections --------

[RNDIS]
DeviceID = usb8023
MaxInstance = 512
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common

[RNDIS_AddReg_98]
HKR, , DevLoader, 0, *ndis
HKR, , DeviceVxDs, 0, usb8023.sys
HKR, NDIS, LogDriverName, 0, "usb8023"
HKR, NDIS, MajorNdisVersion, 1, 5
HKR, NDIS, MinorNdisVersion, 1, 0
HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98"
HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98"
HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98"
HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"

[RNDIS_Install_98]
CopyFiles=RNDIS_CopyFiles_98

[RNDIS_CopyFiles_98]
usb8023.sys, usb8023w.sys, , 0
rndismp.sys, rndismpw.sys, , 0

; Windows Millennium Edition specific sections --------------------

[RNDIS.ME]
DeviceID = usb8023
MaxInstance = 512
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15

[RNDIS_AddReg_ME]
HKR, , DevLoader, 0, *ndis
HKR, , DeviceVxDs, 0, usb8023.sys
HKR, NDIS, LogDriverName, 0, "usb8023"
HKR, NDIS, MajorNdisVersion, 1, 5
HKR, NDIS, MinorNdisVersion, 1, 0
HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME"
HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME"
HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME"
HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"

[RNDIS_Install_ME]
CopyFiles=RNDIS_CopyFiles_ME

[RNDIS_CopyFiles_ME]
usb8023.sys, usb8023m.sys, , 0
rndismp.sys, rndismpm.sys, , 0

; Windows 2000 specific sections ---------------------------------

[RNDIS.NT]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
CopyFiles = RNDIS_CopyFiles_NT

[RNDIS.NT.Services]
AddService = USB_RNDIS, 2, RNDIS_ServiceInst_NT, RNDIS_EventLog

[RNDIS_CopyFiles_NT]
; no rename of files on Windows 2000, use the 'k' names as is
usb8023k.sys, , , 0
rndismpk.sys, , , 0

[RNDIS_ServiceInst_NT]
DisplayName = %ServiceDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\usb8023k.sys
LoadOrderGroup = NDIS
AddReg = RNDIS_WMI_AddReg_NT

[RNDIS_WMI_AddReg_NT]
HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys"

; Windows XP specific sections -----------------------------------

[RNDIS.NT.5.1]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
; no copyfiles - the files are already in place

[RNDIS.NT.5.1.Services]
AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog

[RNDIS_ServiceInst_51]
DisplayName = %ServiceDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\usb8023.sys
LoadOrderGroup = NDIS
AddReg = RNDIS_WMI_AddReg_51

[RNDIS_WMI_AddReg_51]
HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys"

; Windows 2000 and Windows XP common sections --------------------

[RNDIS_AddReg_NT]
HKR, Ndi, Service, 0, "USB_RNDIS"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"

[RNDIS_EventLog]
AddReg = RNDIS_EventLog_AddReg

[RNDIS_EventLog_AddReg]
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll"
HKR, , TypesSupported, 0x00010001, 7

; Common Sections -------------------------------------------------

[RNDIS_AddReg_Common]
HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress%
HKR, NDI\params\NetworkAddress, type, 0, "edit"
HKR, NDI\params\NetworkAddress, LimitText, 0, "12"
HKR, NDI\params\NetworkAddress, UpperCase, 0, "1"
HKR, NDI\params\NetworkAddress, default, 0, " "
HKR, NDI\params\NetworkAddress, optional, 0, "1"

[SourceDisksNames]
1=%SourceDisk%,,1

[SourceDisksFiles]
usb8023m.sys=1
rndismpm.sys=1
usb8023w.sys=1
rndismpw.sys=1
usb8023k.sys=1
rndismpk.sys=1

[DestinationDirs]
RNDIS_CopyFiles_98 = 10, system32/drivers
RNDIS_CopyFiles_ME = 10, system32/drivers
RNDIS_CopyFiles_NT = 12

[Strings]
ServiceDisplayName = "USB Remote NDIS Network Device Driver"
NetworkAddress = "Network Address"
Linux = "Linux Developer Community"
LinuxDevice = "Linux USB Ethernet/RNDIS Gadget"
SourceDisk = "Ethernet/RNDIS Gadget Driver Install Disk"



Vinetic 2cpe v2.2

drv_tapi-3.5.1

CFLAGS="-O2 -G 0" ./configure --host=mipsel-linux --target=mipsel-linux --enable-warnings --enable-obsolete-bitfield-event-interface --enable-module --enable-kernelincl=/home/gigijoe/ECS040/linux_2_4_31/include --cache-file=/dev/null

drv_vinetic-1.2.6

CFLAGS="-O2 -G 0" ./configure --host=mipsel-linux --target=mipsel-linux --enable-warnings --enable-spi --disable-udp-redirect --enable-kernelincl=/home/gigijoe/ECS040/linux_2_4_31/include --enable-boardname=AM5120 --disable-v1 --with-access-mode=INTEL_DEMUX --with-access-width=8 --enable-2cpe --with-max-devices=1 --enable-trace --enable-obsolete-premapping --enable-tapiincl=/home/gigijoe/ECS040/Vinetic_BSP/drv_tapi-3.5.1/src/ --cache-file=/dev/null


drv_vinetic-1.1.20

< src/tapi/src/drv_tapi_io.h >

/** TAPI phone volume control */

/** Switch the phone off */
#define IFX_TAPI_LINE_VOLUME_OFF (0xFF)
/** Switch the volume to low, -24 dB */
#define IFX_TAPI_LINE_VOLUME_LOW (-24)
/** Switch the volume to medium, 0 dB */
#define IFX_TAPI_LINE_VOLUME_MEDIUM (0)
/** Switch the volume to high, 24 dB */
#define IFX_TAPI_LINE_VOLUME_HIGH (24)

/** TAPI Lec control */

/** LEC delay line maximum length */
#define IFX_TAPI_LEC_LEN_MAX (16)
/** LEC delay line minimum length */
#define IFX_TAPI_LEC_LEN_MIN (4)


< src/drv_vinetic_tapi.c >


/**
Set the phone volume
\param pChannel Handle to TAPI_CONNECTION structure
\param pVol Handle to IFX_TAPI_LINE_VOLUME_t structure
\return Return value according to IFX_return_t
- IFX_ERROR if an error occured
- IFX_SUCCESS if successful
\remarks
Gain Parameter are given in 'dB'. The range is -24dB ... 24dB.
*/
IFX_return_t TAPI_LL_Phone_Volume (TAPI_CONNECTION *pChannel,
IFX_TAPI_LINE_VOLUME_t const *pVol)
{
IFX_int32_t ret;
IFX_uint8_t ch = pChannel->nChannel;
IFX_boolean_t bALM_mute = IFX_FALSE;
VINETIC_DEVICE *pDev = (VINETIC_DEVICE *)pChannel->pDevice;

/* range check, cos gain var is integer */
if ((pVol->nGainTx < (IFX_TAPI_LINE_VOLUME_LOW)) ||
(pVol->nGainTx > IFX_TAPI_LINE_VOLUME_HIGH) ||
(pVol->nGainRx < (IFX_TAPI_LINE_VOLUME_LOW)) ||
(pVol->nGainRx > IFX_TAPI_LINE_VOLUME_HIGH))
{
/* parameter are out of supported range */

if ((pVol->nGainRx == IFX_TAPI_LINE_VOLUME_OFF) &&
(pVol->nGainTx == IFX_TAPI_LINE_VOLUME_OFF))
{
/* special case: mute the interface with both parameter set to
IFX_TAPI_LINE_VOLUME_OFF */
bALM_mute = IFX_TRUE;
}
else
{
LOG (TAPI_DRV,DBG_LEVEL_HIGH,
("\n\rDRV_ERROR: Volume Gain out of range!\n\r"));
return IFX_ERROR;
}
}

/* protect fw msg */
IFXOS_MutexLock (pDev->memberAcc);

if (bALM_mute == IFX_FALSE)
{
/* get actual settings into local var */
pDev->pAlmCh[ch].ali_ch.bit.gain_x =
(IFX_uint32_t)VINETIC_AlmPcmGain [pVol->nGainTx + 24];
pDev->pAlmCh[ch].ali_ch.bit.gain_r =
(IFX_uint32_t)VINETIC_AlmPcmGain [pVol->nGainRx + 24];
pDev->pAlmCh[ch].ali_ch.bit.en = 1;
}
else
{
/* mute the interface */
pDev->pAlmCh[ch].ali_ch.bit.en = 0;
}

/* write local configuration if */
ret = CmdWrite (pDev, pDev->pAlmCh[ch].ali_ch.value, CMD_ALM_CH_LEN);
/* release lock */
IFXOS_MutexUnlock (pDev->memberAcc);

/* SetTraceLevel (VINETIC, DBG_LEVEL_HIGH); */

return (ret == IFX_SUCCESS) ? IFX_SUCCESS : IFX_ERROR;
}


drv_tapi-3.5.1

< src/drv_tapi_io.h >

/** TAPI phone volume control */
/** Switch the volume to low, -12 dB */
#define IFX_TAPI_LINE_VOLUME_LOW (-12)
/** Switch the volume to medium, -6 dB */
#define IFX_TAPI_LINE_VOLUME_MEDIUM (-6)
/** Switch the volume to high, 0 dB */
#define IFX_TAPI_LINE_VOLUME_HIGH (0)
/** Switch the volume to minimum gain, -24 dB, note that DTMF detection etc
might not work properly on such low signgals */
#define IFX_TAPI_LINE_VOLUME_MIN_GAIN (-24)
/** Switch the volume to maximum gain, +24 dB */
#define IFX_TAPI_LINE_VOLUME_MAX_GAIN (24)


/** TAPI Lec control */

/** LEC delay line maximum length */
#define IFX_TAPI_LEC_LEN_MAX (16)
/** LEC delay line minimum length */
#define IFX_TAPI_LEC_LEN_MIN (4)


drv_vinetic-1.2.6


< src/drv_vinetic_pcm.c >


/**
Sets the PCM interface volume.
\param pChannel Handle to TAPI_CHANNEL structure
\param pVol Handle to IFX_TAPI_LINE_VOLUME_t structure
\return Return value according to IFX_return_t
- IFX_ERROR if an error occured
- IFX_SUCCESS if successful
\remarks
Gain Parameter are given in 'dB'. The range is -24dB ... 24dB.
*/
IFX_return_t IFX_TAPI_LL_PCM_Volume_Set (IFX_TAPI_LL_CH_t *pLLChannel,
IFX_TAPI_LINE_VOLUME_t const *pVol)
{
IFX_int32_t ret;
VINETIC_CHANNEL *pCh = (VINETIC_CHANNEL *) pLLChannel;
VINETIC_DEVICE *pDev = (VINETIC_DEVICE*) (pCh->pParent);

/* range check, cos gain var is integer */
if ((pVol->nGainTx < (IFX_TAPI_LINE_VOLUME_LOW)) ||
(pVol->nGainTx > IFX_TAPI_LINE_VOLUME_HIGH) ||
(pVol->nGainRx < (IFX_TAPI_LINE_VOLUME_LOW)) ||
(pVol->nGainRx > IFX_TAPI_LINE_VOLUME_HIGH))
{
/* parameter are out of supported range */
TRACE (VINETIC,DBG_LEVEL_HIGH,
("\n\rDRV_ERROR: Volume Gain out of range for PCM!\n\r"));
return IFX_ERROR;
}

/* protect fw msg */
IFXOS_MutexLock (pDev->memberAcc);

/* get actual settings into local var */
pCh->pPCM->fw_pcm_ch.bit.gain_1 = (IFX_uint32_t)VINETIC_AlmPcmGain [pVol->nGainTx + 24];
pCh->pPCM->fw_pcm_ch.bit.gain_2 = (IFX_uint32_t)VINETIC_AlmPcmGain [pVol->nGainRx + 24];
pCh->pPCM->fw_pcm_ch.bit.en = 1;

/* write local configuration if */
ret = CmdWrite (pDev, pCh->pPCM->fw_pcm_ch.value, CMD_PCM_CH_LEN);
/* release lock */
IFXOS_MutexUnlock (pDev->memberAcc);

return ret;
}


2007年1月11日 星期四

Qtopia phone edition 4.1.4

#Qtopia phone

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

跟在ADM5120上碰到的很像,在login網頁按下submit就發生了
今天又碰到了,但是在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;