2009年8月29日 星期六

如何打國際電話

http://www.cts-travel.com.tw/eWeb_cts-travel/cts_use/Information/tel.htm
由國外撥回台灣
當地國國際冠碼 + 台灣的國碼 + 區域號碼(去0)+ 收話者電話號碼。
舉例:由日本打回台灣先撥日本國際冠碼001後,撥台灣國碼886,再撥台北區域號碼2(去掉0),最後撥對方號碼。


由台灣撥到國外
台灣國際冠碼 +受話當地國國碼 +受話當地國區域號碼(去0)+受話者電話號碼。
舉例:由台灣打到東京先撥台灣國際冠碼002後,撥日本國碼81,再撥東京區域號碼3(去 掉0),最後撥對方號碼。


世界主要國家國際冠碼、國碼

亞洲地區

Top

國名

國際冠碼

國碼

台灣

002

886

日本

001

81

韓國

001

82

香港

001

882

澳門

00

883

中國

001

66

馬來西亞

007

60

新加坡

005

65

印尼

001

62

菲律賓

00

63

印度

00

91

中國大陸

00

86

非洲地區

Top

國名

國際冠碼

國碼

埃及

00

20

南非

00

55

歐洲地區

Top

國名

國際冠碼

國碼

比利時

00

32

盧森堡

00

352

德國

00

49

法國

19

33

挪威

095

47

瑞典

009

46

丹麥

009

45

芬蘭

990

358

冰島

90

354

義大利

00

39

希臘

00

30

西班牙

07

34

葡萄牙

00

351

瑞士

00

41

奧地利

900/00

43

美洲地區

Top

國名

國際冠碼

國碼

阿根廷

00

54

巴西

00

55

加拿大

011

1

美國

011

1

大洋洲地區

Top

國名

國際冠碼

國碼

澳洲

0011

61

紐西蘭

00

64

2009年8月17日 星期一

透過USB連線與OpenMoko模擬裝置互動

在找gadgetfs的訊息時找到的...先留著看看

透過USB連線與OpenMoko模擬裝置互動
http://orzlab.blogspot.com/2007/05/usbopenmoko.html

OpenMoko介绍
http://www.blogger.com/post-create.g?blogID=9025767209155556619

Testing isochronous transfer by gadgetfs

USB Testing on Linux
http://www.linux-usb.org/usbtest/

Linux-USB Gadget API Framework
2003
http://it.linux-usb.org/gadget/
2005
http://www.linux-usb.org/gadget/

SF.net/Projects/SCM Repositories/linux-usb/htdocs/usbtest
http://linux-usb.cvs.sourceforge.net/linux-usb/htdocs/usbtest/

SF.net/Projects/SCM Repositories/linux-usb/htdocs/gadget
http://linux-usb.cvs.sourceforge.net/viewvc/linux-usb/htdocs/gadget/

linux-2.6.27-rc5

Bulk Test
Download usb.c, usbstring.c, usbstring.h, and build them, put them to usb device side. And run:

modprobe gadgetfs;
mkdir /dev/gadget/ -p;
mount -t gadgetfs none /dev/gadget;
ls -l /dev/gadget/;
usb -v &
ls -l /dev/gadget/;

Current result
# modprobe gadgetfs;
gadgetfs: USB Gadget filesystem, version 24 Aug 2004
# mkdir /dev/gadget/ -p;
# mount -t gadgetfs none /dev/gadget;
# ls -l /dev/gadget/;
-rw------- 1 root root 0 Dec 31 17:00 your_pcd_name
# usb -v &
gadgetfs: bound to your_pcd_name driver
/dev/gadget/your_pcd_name ep0 configured
serial="r8z77oqarmbvnpa6bvgo2xllwuo3iu678yvgy753wdb5ivpxp8rnqv9k0hx3bty"
# ls -l /dev/gadget/;
-rw------- 1 root root 0 Dec 31 17:00 your_pcd_name
-rw------- 1 root root 0 Dec 31 17:00 ep1in
-rw------- 1 root root 0 Dec 31 17:00 ep2out
-rw------- 1 root root 0 Dec 31 17:00 ep3in
-rw------- 1 root root 0 Dec 31 17:00 ep4out
-rw------- 1 root root 0 Dec 31 17:00 ep5in
-rw------- 1 root root 0 Dec 31 17:00 ep6out
-rw------- 1 root root 0 Dec 31 17:00 ep7in
-rw------- 1 root root 0 Dec 31 17:00 ep8out

If you saw the following message
# usb -v
?? don't recognize /dev/gadget bulk device

It means that the PCD is not supported by the user mode driver, add PCD dependent init code at autoconfig() in usb.c. (AIO would need alike code in iso_autoconfig())

Isochronous Test
build libaio and install to target
build usb.c with -DAIO option, and load the executables to target
Run with
usb.aio -v -I0 -a20 -s1020 &




http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=77912&start=0
NGW100 with isochronous endpoints
~ # gadgetfs-test -I 1 -s 1024
/dev/gadget/atmel_usba_udc ep0 configured
serial="z0z80c5stcvo90iharg8c0d6ktpto2ru9hjq0gjuy1ki5k5p1mvpp98qkfdko92"
aio_in_thread, io_setup: Success
aio_out_thread, io_setup: Success

Linux Host with testusb results showing the errors
...C...
christos@christos-f2x:~/Desktop/testusb$ sudo ./testusb -a -t15 -c 1000 -s 1024
unknown speed /proc/bus/usb/005/014
/proc/bus/usb/005/014 test 15 --> 33 (Numerical argument out of domain)

...D...
christos@christos-f2x:~/Desktop/testusb$ sudo ./testusb -a -t15 -c 1000 -s 1024
unknown speed /proc/bus/usb/005/014
/proc/bus/usb/005/014 test 16 --> 33 (Numerical argument out of domain)


try CONFIG_USB_DEBUG on host side

[linux-usb-devel] usbtest #10 with gadgetfs hangs
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg49604.html
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg49792.html
By David Brownell,
> I thought this had worked before, but maybe I am getting confused with
> my g_zero testing; I believe it's not expected to work with gadgetfs
> and usb.c, is this right?

Right, that sample program doesn't implement the control requests needed
to support test #14.
That combo is not expected to work. (Which is not
to say it couldn't be _made_ to work on some platforms.)


Rewriting the usb.c without aio?
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg49835.html
> > it would just be papering over a bug elsewhere. Since
> > that uses a different mechanism in the kernel, it's very possible that
> > would work while the kill_fasync() mechanism stays broken.
>
> When I looked at that code I wondered why it needed any sort of
> asynchronous notification at all: can't it just do a normal blocking
> read until it gets the next event? Anyway, as you say, changing it
> would be papering over.

I don't recall all the reasoning right now, but one issue was that signal
handling in threaded userspace programs is a PITA one of the good ways to
do it is have a thread sitting in sigwait() to collect all async signals
(i.e. not SIGFPE, SIGBUS etc which are clearly thread-specific). In this
case I simplified things and had that thread be the overall control thread
for the (host-visible) device.

And "usb.c" was originally a test program, designed more for flexibility
than anything else. So having a "main event loop" -- single thread style
application model, not pure userspace MT -- could make it easy to evolve
in that way.

Of course, AIO support kind of blows that model out of the water because
the io_getevents() call doesn't play well with poll(), sigwait(), select(),
or anything else. :(


gadgetfs & 2.6.29: clients always returns EAGAIN
http://mail.spinics.net/lists/linux-usb/msg17438.html

Gadgetfs's use of spinlocks
http://mail.spinics.net/lists/linux-usb/msg16994.html

2009年8月12日 星期三

2009年8月11日 星期二

Windows 關掉 AutoRun

關掉 AutoRun
http://blog.roodo.com/foreverfish/archives/3327867.html
[開始] -> [Run: gpedit.msc]
[電腦設定] -> [系統管理範本] -> [系統]
[關閉自動播放]

2009年8月8日 星期六

重build Virtualbox host module明明很簡單的說...

最近更新了kernel,卻得忍受不能用VirtualBox...
只因為不知道怎麼build host driver....
而因為早知道了換kernel會有問題,所以也一直沒有試著開virtualbox
今天終於下定決心好好來解決這個問題, 折折雙手, 暖暖身, 一副如臨大敵的樣子....
先上網google一下....找了幾篇...都不太像....

試著打開一個client OS, virtualbox會給以下的error

VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. Users of Ubuntu or Fedora should install the DKMS package at first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

(狐疑)......是這樣嗎? .....(copy-paste)....

# /etc/init.d/vboxdrv setup
* Stopping VirtualBox kernel module
* done.
* Recompiling VirtualBox kernel module
* done.
* Starting VirtualBox kernel module
* done.
完了....ㄜ....是結束了, 就醬? 是的...就醬....

其實人家不但是很簡單的, command都給你了, 只需要你copy-paste...
真是簡單的可以了,真不知道之前在蠢什麼的....