2008年8月31日 星期日

發票

發票
invoice

公司統一編號
Company tax ID
VAT number
Unify the serial number
Uniform serial number

明細
Detail

2008年8月30日 星期六

Openmoko Freerunner初體驗 (om2007.2)

一拿到這隻手機,第一印象就是很有質感,不過也很厚實
先充了一個晚上的電,早上大概九點左右拿起來,下午四點左右就沒電了
使用一段時間會有些發熱

沒中文,所以簡訊與通訊人的內容都是亂碼
輸入法只有類似數字鍵盤的輸入法

很多字元打不出來,所以terminal也不太能用要先install qwert keyboard,terminal才比較堪用點。或者乾脆用USB Ethernet+ssh

下午充電中拿起來看了一下
突然發現 點螢幕 沒反應了
不會吧 就這樣爛了嗎?
壓住power鍵也沒有用,最後是拔電池在重開才好的



080901
耗電真的很兇
早上充完電下午就沒電了
不過有部份也是軟體的問題
似乎沒有機制可以把螢幕關掉

即使鎖定螢幕 螢幕被觸碰到還是會啟動
放在口袋裡常常溫熱溫熱的

基本上,現在的image只能用來打電話
其他的什麼都不能做...
得找個時間看看怎麼更新image

鈴聲太小聲
接聽電話的聲音稍小
對方偶而會反應聲音太小
用耳麥聲音與說話都很小聲,且不時會有翁翁聲干擾,干擾源似乎來自外部

Power Management: Dim first, then lock
只要系統鎖定過,來電會振動但是不會響鈴,連點選時的 "爆音" 也不見了
重開機就好了
我想並不是鎖定,應該是suspend
而且suspend到醒過來要很久(3~5s)

另外,免持模式,對方說話時候會聽到明顯的迴音

無法顯示中文、沒有中文輸入法

似乎已經上了GPS issue with microSD的hardware patch,但是GPS似乎仍然會被microSD影響


可能不會想在這裡把中文顯示搞定,想先試試2008.8 or Qtopia image


tangleGPStangoGPS
http://www.tangogps.org
(tangleGPS?? 去google只有這一篇,你寫的阿??)
我先下載了OSM的地圖,然後又下載了google map,剛開始很正常。剛剛回去看發現整個慢到一個不行,這個時候microSD的使用量是91%


剛剛開會回來,被抱怨電話都不接,才發現FR左上顯示Registering,收到任何電話都不會響,沒有反應,沒有紀錄。
重開機後,仍然收不到,撥出時出現下面這個錯誤

就在想,不會吧~~


結果過一下子就好了.............!#@$!%^%^#$%!@#$
能收也能撥了


一定要抱怨一下,我覺得我的FR GPS的hardware patch應該是沒patch好....
晚上開車回來,順便把FR放在前面測GPS(有microSD+SIM)
運氣算不錯了,還定到位了,不只這樣,第一次看到一次可以收到14個衛星
該是很強了吧
.............

並不是...
即使是14個衛星,一下是3個藍色(2D?),一下是4個藍色(3D?),一下是5個藍色(???),一下還可以失去定位...

哇勒....
TTFF 719, fail 877, so 158 fails after first fix, 167 good (after first fix)
意思是,第一次定位到後,仍然有一半的機會會定不到位......

聲音稍小,不過正常接聽還沒問題。背光在陽光下就看不清楚了

http://wiki.openmoko.org/wiki/Today/2007.2
http://wiki.openmoko.org/wiki/Getting_Started_with_your_Neo_FreeRunner


我用tangoGPS下載台灣的google map,下載完成後我想把它備份起來,於是我把它copy到pc上
root@test-laptop:~/tmp# cp /media/disk/googlemap/ . -a
root@test-laptop:~/tmp# du -s googlemap/
77120 googlemap/
root@test-laptop:~/tmp# du -s /media/disk/googlemap/
224352 /media/disk/googlemap/
root@test-laptop:~/tmp#
SD卡上的佔了兩百多MB,copy過來的只有77MB,壓起來(tar cjf)大約30MB
把它再copy回去,還是能佔掉兩百多........
詭異.....

應該是檔案格式的問題,改用ext2/3就沒有這樣的問題了


Chang the default look


  1. gconftool-2 --type bool --set /desktop/poky/interface/reduced false
  2. Edit /etc/matchbox/session, and change the following line:
    matchbox-panel-2 --start-applets systray,startup \
    --end-applets openmoko-panel-clock,openmoko-panel-battery,openmoko-panel-gsm,openmoko-panel-gps,openmoko-panel-usb,openmoko-panel-bt,openmoko-panel-memory,openmoko-panel-wifi --titlebar &



Error:
GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Failed to execute dbus-launch to autolaunch D-Bus session
Error setting value: No D-BUS daemon running
Fix:
Prefix the command with dbus-launch, see below example:
dbus-launch gconftool-2 --type string --set /desktop/poky/interface/wallpaper /usr/share/pixmaps/wallpape

dbus-launch gconftool-2 -R /
dbus-launch gconftool-2 -a --all-dirs /



?Time, Timezone
http://wiki.openmoko.org/wiki/Setting_Date_and_Time

date -s MMDDhhmmYYYY.ss
hwclock --systohc
(Today的時間就改為所設定的時間,但是下date會顯示時區為UTC)

ln -sf /usr/share/zoneinfo/ROC /etc/localtime
/etc/init.d/xserver-nodm restart
(一直印訊息pcfxxx: irq.....,但是跑不進 xserver,最後只好按電源強迫重新開機)
(後來再試也沒遇到同樣的狀況)

date顯示為CST,時間也正確,但是today下的時間竟然變成CST的時間-8,變成UTC時間!!!

試著去改/etc/default/rcS
# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
#UTC=yes
UTC=no
不論UTC=yes or no都沒有用(似乎always是UTC=yes)

放棄....
拿掉/etc/localtime,時間就變成一致了



USB Networking
http://wiki.openmoko.org/wiki/USB_Networking
http://wiki.openmoko.org/wiki/USB_Networking#Debian.2C_Ubuntu_and_others
On Host:
  1. ifconfig usb0 192.168.0.200
  2. ssh root@192.168.0.202
    The default password is blank.
  3. Add NAT for Internet
    On Host PC
    iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24;
    sysctl -w net.ipv4.ip_forward=1;
    In ssh console
    echo nameserver 168.95.1.1 > /etc/resolv.conf;
  4. Edit /etc/network/interfaces and add:
    auto usb0
    iface usb0 inet static
    address 192.168.0.200
    netmask 255.255.255.0
    network 192.168.0.0
    up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &
    up echo 1 > /proc/sys/net/ipv4/ip_forward &
    down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &
  5. Edit /etc/udev/rules.d/85-ifupdown.rules, and changes as follow:
    SUBSYSTEM=="net", DRIVERS=="?*", GOTO="net_start"
    GOTO="net_end"

    LABEL="net_start"

    # Bring devices up and down only if they're marked auto.
    # Use start-stop-daemon so we don't wait on dhcp
    ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"

    ACTION=="remove", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}"

    LABEL="net_end"

    ACTION=="remove", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}"
    http://wiki.openmoko.org/wiki/USB_Networking#Ubuntu_Issues
    https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437

這樣就有網路了!!


Installing qwert keyboard
http://lists.openmoko.org/pipermail/community/2008-July/021284.html
http://www.ginguppin.de/node/15

  1. download keyboard-ipk.tar.bz2, unpack and move the resulting 3 *.ipk to your freerunner:
    scp *.ipk root@openmoko:/tmp/
  2. ssh to the freerunner and do the following:
    opkg remove -force-depends multitap-pad
    opkg install /tmp/matchbox-keyboard-inputmethod_0.0+svnr1910-r10_armv4t.ipk (failed...)
    opkg install /tmp/matchbox-keyboard-im_0.0+svnr1910-r10_armv4t.ipk
    opkg install /tmp/matchbox-keyboard-applet_0.0+svnr1910-r10_armv4t.ipk
    try (http://wiki.openmoko.org/wiki/Switching_Keyboards#How_to_install_it.3F)
    opkg update
    opkg remove -force-depends multitap-pad
    opkg install matchbox-keyboard-inputmethod
    opkg install matchbox-keyboard-im
    opkg install matchbox-keyboard-applet


  3. Edit /etc/matchbox/session, and change the following line:
    matchbox-panel-2 --start-applets systray,startup \
    --end-applets openmoko-panel-clock,keyboard,openmoko-panel-battery,openmoko-panel-gsm,openmoko-panel-gps,openmoko-panel-usb,openmoko-panel-bt,openmoko-panel-memory,openmoko-panel-wifi --titlebar &
  4. /etc/init.d/xserver-nodm restart

package management
http://wiki.openmoko.org/wiki/Package_management

GPS
http://wiki.openmoko.org/wiki/Getting_Started_with_your_Neo_FreeRunner#Use_the_GPS

opkg install gpsd
echo "GPS_DEV=\"/dev/ttySAC1\"" > /etc/default/gpsd
/etc/init.d/gpsd restart (restart似乎有問題,只會stop,沒有start,我們自己下start)
opkg install openmoko-agpsui
opkg install tangogps
似乎第一次定位要很久,收訊似乎也比較差
TTFF: 403s (riding) (這是有定到的,太多次定不到位了), 709s(driving)
fails: 540s(walking),

remove microSD
TTFF: 49s, 79s, 67s, 50s (非常穩定)


http://atmospccu.twbbs.org/blogs/post/1/134
tangleGPStangoGPS用google的圖資
  1. Map Repositories裡新增一個,URI:http://mt.google.com/mt?v2.80&hl=en&x=%d&y=%d&zoom=%d&s=Galile、Cache Dir自己決定,放在記憶卡裡比較好(ex. /media/card/gmap)(沒裝matchbox-keyboard的人知道痛苦了吧)。
  2. Cache Dir下面的Inverted Zoom要選,然後點下面的Save R.. Config...
http://www.tangogps.org/gps/articles/12-FAQ.html
Maps
http://mt3.google.com/mt?v=w2.80&hl=en&x=3&y=5&zoom=13&s=Galile
Terrain
http://mt0.google.com/mt?v=w2p.81&hl=en&x=3&y=5&zoom=13&s=Galile

http://forum.ubuntu-fi.org/index.php?topic=20010.msg149014
Googlen tiekartta:
http://mt1.google.com/mt?n=404&v=ap.80&hl=fi&x=%d&y=%d&zoom=%d&s=Galil
Inverted Zoom valittuna

Googlen maastokartta:
http://mt.google.com/mt?v=w2p.999&x=%d&y=%d&zoom=%d
Inverted Zoom valittuna

OpenAerialMap vapaita ilmakuvia: (lisenssi?)
http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/%d/%d/%d.jpg
Helpommin: URI-kenttään pelkästään "openaerial" ilman lainausmerkkejä.




Getting dfu-util
http://wiki.openmoko.org/wiki/Dfu-util

sudo apt-get install libusb-dev autogen pkg-config autotools-dev autoconf automake
svn co http://svn.openmoko.org/trunk/src/host/dfu-util/
cd dfu-util
./autogen.sh
./configure
make

在光復路上的Nokia專賣店花了250NTD買的充電器



ok...電是滿的...看來沒問題


Power Management: Dim first, then lock
10:39到晚上十點多發現沒有反應了,不過晚上回家的時候在測gps,全程打開著。
所以一顆滿的電池,如果不常用,而且PM設在Dim first, then lock,應該可以撐一天以上,但是 suspend後沒有聲音的問題 卻很麻煩


中文
wlan
bluetooth

Openmoko開箱


本來有11支的,在台北就已經分光光了....


疊疊樂??

Openmoko Freerunner+Spare pack+ Debug Board

Openmoko Freerunner

Debug Board



打開電池蓋

SIM卡與MicroSD的插槽

插上MicroSD卡(這裡我很天兵的以為MicroSD是要直接放在蓋子下面直接蓋上去的,差點把蓋子壓壞....)


看來是有GPS hardware fix過的(不過似乎仍然需要software patch才能正常定位)

插上SIM卡

打包寄給BlueT大 與 PingYeh的郵局便捷箱




080904 今天收到OM的發票

數量是8FR, 3DBoard,另外3隻是獨立發票,由OM直接寄出去了

2008年8月25日 星期一

銀行匯款與轉帳

http://www.bot.com.tw/English/BankServices/ICATMCard/default.htm

ATM account transfer: (Note: per day refers to the working day of the Bank)
1. Maximum number of designated transfer-outs: 8
2. Maximum number of designated transfer-ins:
1. From designated accounts: 8
2. From non-designated accounts: unlimited (Starting from June 1, 2004, new ATM card holders need to apply to have this function.)
3. Banks that accept account transfer-ins must be the member banks participated in the financial system inter-bank account transfer operations.
4. Maximum amount of transfer-out:
1. For designated accounts:
a. Maximum of NT$2 million per account per transfer.
b. The total amount per day should not exceed NT$2 million.
2. For non-designated accounts:
a. Maximum of NT$30,000 per account per transfer.
b. The total amount per day should not exceed NT$30,000.
3. The total amount of designated and non-designated accounts should not exceed NT$2 million per day.
5. For designated account transfer, please fill in the application form and apply to the deposits bank.



credit transfer
銀行轉帳


M.O.
money order 【商】郵政匯票;匯款單
remit
匯款
remittance
匯款;匯款額[C]

Samba IRC

<mkl_> hi...
does any one know that is there any implementation trying to make writing file to samba completely in kernel?
like reading files from samba, with sendfile and mmap.....
My cpu and memory copy is so slow that became the bottleneck, and I would like the writing to samba not going to user space if possible....

<Berge> mkl_: No, there is no Samba implementation in kernel space.
mkl_: If context switching is a major concern on your platform, I'm not quite sure if you want to run Samba on it.

<mkl_> is there any substitution? I would need samba to share files....
but writing to samba is to slow...

<Berge> If your Samba installation performs poorly, there might be other causes than context switching.
CIFS is not a very efficient protocol, especially not with Windows clients.
(In my experience, at least.)

<Berge> What architecture is this?

<mkl_> my target is to improve the write performance...
<Berge> Have you looked at http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/speed.html ?

<mkl_> faraday FA526

--> hi365 (n=hi365@bzq-219-141-66.static.bezeqint.net) has joined #samba
tarbo (n=me@unaffiliated/tarbo) has joined #samba
<hi365> is there some way to reread the configs wothout stoping smbd?

<mkl_> yes, I've read them....

<-- tarbo has quit (Client Quit)
--> tarbo (n=me@unaffiliated/tarbo) has joined #samba

<mkl_> the read performance is improved, but I found no way to improve the write performance.........

<mkl_> btw, I can't subscribe any mailing list from https://lists.samba.org/mailman/, neither can I send mail to request@lists.samba.org......
what's up to the mailing list?

<Berge> mkl_: You'd have to ask the mailing list admins for that, I'd guess.

<mkl> Berge: why the writing to samba have to go through user-space? could it be implemented in kernel space, like sendfile?


2008年8月14日 星期四

Extract vmlinux from vmlinuz/bzImage/zImage/bootpImage

No!!! There is no way (AFAIK) to extract vmlinux from vmlinuz/bzImage/zImage/bootpImage!!!

vmlinux is an elf file of whole uncompressed kernel. We first stripped the elf header to produce the Image, a binary file, then compress it, add some decompress code to produce zImage (refer to Linux Image Generation). So we can only extract Image from vmlinuz/bzImage/zImage/bootpImage, but there is no way to obtain the original elf header, which is vmlinux.

I tried to use objcopy to add the elf header, but the result can't be used by oprofile.



I think this should also work for zImage/bootpImage, but I haven't tested yet.

http://en.wikipedia.org/wiki/Vmlinux
http://en.wikipedia.org/wiki/Vmlinux#bzImage
No specific tool exists to unpack the bzImage file, but there exists a script named extract-ikconfig, which decompresses the image and extracts build configuration directives from the image. One may modify it to get the decompressed image directly. Some distributions (e.g. Red Hat and clones) may come with a kernel-debuginfo RPM that contains the vmlinux file for the matching kernel RPM, it typically gets installed under /usr/lib/debug/lib/modules/`uname -r`/vmlinux


  1. Commnet the clean_up to prevent the temp file been removed. The echo added is for debug and information.
    extract-ikconfig
    TMPFILE=`mktemp -t ikconfig-XXXXXX` || exit 1
    image="$1"
    echo ${TMPFILE}
    (............................)

    echo "ERROR: Unable to extract kernel configuration information."
    echo " This kernel image may not have the config info."

    #clean_up
    exit 1

  2. To avoid confusion, remove all /tmp/ikconfig-* first, then run extract-ikconfig in the linux source directory. The file named with ikconfig-XXXXXX in /tmp is the vmlinux extracted.
    rm /tmp/ikconfig-* -fv;
    sh scripts/extract-ikconfig /boot/vmlinuz-2.6.24-19-generic ;
    sudo cp `ls /tmp/ikconfig-*` /boot/vmlinux-2.6.24-19-generic -av;


Result:
test@test-laptop:/home/prj/linux-2.6.24-current$ rm /tmp/ikconfig-* -fv;
test@test-laptop:/home/prj/linux-2.6.24-current$ sh scripts/extract-ikconfig /boot/vmlinuz-2.6.24-19-generic ;
/tmp/ikconfig-m11819

gzip: stdin: decompression OK, trailing garbage ignored
ERROR: Unable to extract kernel configuration information.
This kernel image may not have the config info.
test@test-laptop:/home/prj/linux-2.6.24-current$ sudo cp `ls /tmp/ikconfig-*` /boot/vmlinux-2.6.24-19-generic -av;
`/tmp/ikconfig-m11819' -> `/boot/vmlinux-2.6.24-19-generic'
test@test-laptop:/home/prj/linux-2.6.24-current$






sudo objcopy -I binary -O elf32-i386 /boot/vmlinux-2.6.24-19-generic /boot/vmlinux-2.6.24-19-generic.elf

but it seems that vmlinux is not simply elf format:
root@debian:/boot# ls *-2.6.18 -al *-2.6.18.elf
-rw-r--r-- 1 root root 70682 2008-08-13 23:44 config-2.6.18
-rw------- 1 root root 2397636 2008-08-14 22:24 Image-2.6.18
-rw-r--r-- 1 root root 2398101 2008-08-14 22:34 Image-2.6.18.elf
-rw-r--r-- 1 root root 5173248 2008-08-14 19:55 initrd.img-2.6.18
-rw-r--r-- 1 root root 723178 2008-08-14 19:39 System.map-2.6.18
-rwxr-xr-x 1 root root 3401973 2008-08-14 22:19 vmlinux-2.6.18
-rw-r--r-- 1 root root 1260411 2008-08-14 19:39 vmlinuz-2.6.18


root@debian:/boot# file vmlinuz-2.6.18
vmlinuz-2.6.18: Linux kernel x86 boot executable RO-rootFS, root_dev 0x301, swap_dev 0x1, Normal VGA

root@debian:/boot# file vmlinux-2.6.18
vmlinux-2.6.18: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped

result of modified extract-ikconfig
root@debian:/boot# file Image-2.6.18
Image-2.6.18: data

result of modified extract-ikconfig and objcopy
root@debian:/boot# file Image-2.6.18.elf
Image-2.6.18.elf: ELF 32-bit LSB relocatable, no machine, version 1 (SYSV), not stripped

root@debian:/boot# readelf -h vmlinuz-2.6.18
readelf: Error: Unable to read in 0xff bytes of section headers
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

root@debian:/boot# readelf -h vmlinux-2.6.18
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x100000
Start of program headers: 52 (bytes into file)
Start of section headers: 2442068 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 3
Size of section headers: 40 (bytes)
Number of section headers: 37
Section header string table index: 34

root@debian:/boot# readelf -h Image-2.6.18
readelf: Error: Unable to seek to 0xc1f92900 for section headers
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

root@debian:/boot# readelf -h Image-2.6.18.elf
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: None
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 2397724 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 5
Section header string table index: 2


root@debian:/boot# readelf -S vmlinux-2.6.18
There are 37 section headers, starting at offset 0x254354:

Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS c0100000 001000 181645 00 AX 0 0 4096
[ 2] __ex_table PROGBITS c0281650 182650 0009c8 00 A 0 0 8
[ 3] .rodata PROGBITS c0283000 184000 0304ce 00 A 0 0 32
[ 4] .pci_fixup PROGBITS c02b34d0 1b44d0 000528 00 A 0 0 4
[ 5] __ksymtab PROGBITS c02b39f8 1b49f8 0045f0 00 A 0 0 4
[ 6] __ksymtab_gpl PROGBITS c02b7fe8 1b8fe8 000da8 00 A 0 0 4
[ 7] __ksymtab_unused PROGBITS c02b8d90 1b9d90 000040 00 A 0 0 4
[ 8] __kcrctab PROGBITS c02b8dd0 1b9dd0 0022f8 00 A 0 0 4
[ 9] __kcrctab_gpl PROGBITS c02bb0c8 1bc0c8 0006d4 00 A 0 0 4
[10] __kcrctab_unused PROGBITS c02bb79c 1bc79c 000020 00 A 0 0 4
[11] __ksymtab_strings PROGBITS c02bb7c0 1bc7c0 00b4bf 00 A 0 0 32
[12] __param PROGBITS c02c7000 1c8000 00035c 00 A 0 0 4
[13] .data PROGBITS c02c7360 1c8360 040f84 00 WA 0 0 32
[14] .data_nosave PROGBITS c0309000 20a000 001004 00 WA 0 0 4096
[15] .data.page_aligne PROGBITS c030b000 20c000 000800 00 WA 0 0 32
[16] .data.cacheline_a PROGBITS c030b800 20c800 006680 00 WA 0 0 32
[17] .data.read_mostly PROGBITS c0311e80 212e80 000934 00 WA 0 0 32
[18] .data.init_task PROGBITS c0314000 214000 002000 00 WA 0 0 32
[19] .smp_locks PROGBITS c0316000 216000 002ff0 00 A 0 0 4
[20] .init.text PROGBITS c0319000 219000 01b4ef 00 AX 0 0 1
[21] .init.data PROGBITS c0335000 235000 00c433 00 WA 0 0 4096
[22] .init.setup PROGBITS c0341440 241440 00057c 00 WA 0 0 4
[23] .initcall.init PROGBITS c03419bc 2419bc 0002e4 00 WA 0 0 4
[24] .con_initcall.ini PROGBITS c0341ca0 241ca0 00000c 00 WA 0 0 4
[25] .security_initcal PROGBITS c0341cac 241cac 000008 00 WA 0 0 4
[26] .altinstructions PROGBITS c0341cb4 241cb4 001fdf 00 A 0 0 4
[27] .altinstr_replace PROGBITS c0343c93 243c93 0008cf 00 AX 0 0 1
[28] .exit.text PROGBITS c0344562 244562 0005a4 00 AX 0 0 1
[29] .init.ramfs PROGBITS c0345000 245000 000086 00 A 0 0 1
[30] .data.percpu PROGBITS c03450a0 2450a0 004524 00 WA 0 0 32
[31] .bss.page_aligned NOBITS c034a000 2495c4 002000 00 WA 0 0 4
[32] .bss NOBITS c034c000 2495c4 03d294 00 WA 0 0 4096
[33] .comment PROGBITS 00000000 2495c4 00abbc 00 0 0 1
[34] .shstrtab STRTAB 00000000 254180 0001d1 00 0 0 1
[35] .symtab SYMTAB 00000000 25491c 066040 10 36 17199 4
[36] .strtab STRTAB 00000000 2ba95c 083f99 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)


root@debian:/boot# readelf -S Image-2.6.18
Image-2.6.18 Image-2.6.18-6-686 Image-2.6.18-6-686.elf Image-2.6.18.elf
root@debian:/boot# readelf -S Image-2.6.18.elf
There are 5 section headers, starting at offset 0x24961c:

Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .data PROGBITS 00000000 000034 2495c4 00 WA 0 0 1
[ 2] .shstrtab STRTAB 00000000 2495f8 000021 00 0 0 1
[ 3] .symtab SYMTAB 00000000 2496e4 000050 10 4 2 4
[ 4] .strtab STRTAB 00000000 249734 000061 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
And Image-2.6.18.elf can't be used for oprofile (which require the vmlinux).

vmlinuz (= bzImage)

vmlinuz Definition
http://www.linfo.org/vmlinuz.html

vmlinuz is the name of the Linux kernel executable.

A kernel is a program that constitutes the central core of a computer operating system. It is the first thing that is loaded into memory (which physically consists of RAM chips) when a computer is booted up (i.e., started), and it remains in memory for the entire time that the computer is in operation. An executable, also called an executable file, is a file that can be run as a program.

vmlinuz is a compressed Linux kernel, and it is bootable. Bootable means that it is capable of loading the operating system into memory so that the computer becomes usable and application programs can be run.

vmlinuz should not be confused with vmlinux, which is the kernel in a non-compressed and non-bootable form. vmlinux is generally just an intermediate step to producing vmlinuz.

vmlinuz is located in the /boot directory, which is the directory that contains the files needed to begin booting the system. The file named vmlinuz might be the actual kernel executable itself, or it could be a link to the kernel executable, which might bear a name such as /boot/vmlinuz-2.4.18-19.8.0 (i.e., the name of the specific version of the kernel). This can be easily determined by using the ls command (whose purpose is to list the contents of a specified directory) with its -l option (which tells ls to provide detailed information about each object in the specified directory) as follows:

ls -l /boot


If vmlinuz is an ordinary file (including an executable), the information about it in the first column will begin with a hyphen. If it is a link, it will begin with the letter l.

The Linux kernel is compiled by issuing the following command:

make bzImage

This results in the creation of a file named bzImage in a directory such as /usr/src/linux/arch/i386/linux/boot/.

Compilation is the conversion the kernel's source code (i.e., the original form in which the kernel is written by a human) into object code (which is understandable directly by a computer's processor). It is performed by a specialized program called a compiler, usually one in the GCC (GNU Compiler Collection).

bzImage is then copied using the cp (i.e., copy) command to the /boot directory and simultaneously renamed vmlinuz with a command such as

cp /usr/src/linux/arch/i386/linux/boot/bzImage /boot/vmlinuz

vmlinuz is not merely a compressed image. It also has gzip decompressor code built into it. gzip is one of the most popular compression utilities on Unix-like operating systems.

A compiled kernel named zImage file is created on some older systems and is retained on newer ones for backward compatibility. Both zImage and bzImage are compressed with gzip. The difference is that zImage decompresses into low memory (i.e., the first 640kB), and bzImage decompresses into high memory (more than 1MB). There is a common misconception that bzImage is compressed with the bzip2 utility; actually, the b just stands for big.

The name vmlinuz is largely an accident of history. The kernel binary on the original UNIX as developed at Bell Labs was called unix. When a new kernel containing support for virtual memory was subsequently written at the University of California at Berkeley (UCB), the kernel binary was renamed vmunix.

Virtual memory is the use of space on a hard disk drive (HDD) to simulate additional RAM (random access memory) capacity. It was supported by the Linux kernel almost from Linux's inception, in contrast to some other popular operating systems in use at the time, such as MS-DOS.

Thus, it was a natural progression for the Linux kernel to be called vmlinux. And because the Linux kernel executable was made into a compressed file and compressed files typically have a z or gz extension on Unix-like systems, the name of the compressed kernel executable became vmlinuz.
http://en.wikipedia.org/wiki/Vmlinux
http://en.wikipedia.org/wiki/Vmlinux#bzImage

The bzImage (big zImage) format was developed to overcome this limitation by cleverly splitting the kernel over discontiguous memory regions.

(.........................)

No specific tool exists to unpack the bzImage file, but there exists a script named extract-ikconfig, which decompresses the image and extracts build configuration directives from the image. One may modify it to get the decompressed image directly. Some distributions (e.g. Red Hat and clones) may come with a kernel-debuginfo RPM that contains the vmlinux file for the matching kernel RPM, it typically gets installed under /usr/lib/debug/lib/modules/`uname -r`/vmlinux


There is no bzImage on some architecture (like arm).
linux-2.6.16/arch/arm/Makefile
# Convert bzImage to zImage
bzImage: zImage

zImage Image xipImage bootpImage uImage: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@


linux-2.6.16/arch/i386/Makefile
zImage bzImage: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)

Linux Image Generation

2008年8月13日 星期三

Samba Performance Issue Debug Note

Linux Kernel Sendfile() 的提升 Server 效能之路
http://fred-zone.blogspot.com/2011/03/linux-kernel-sendfile-server.html

Kernel 2.6.25 gets splice TCP read support.
http://lists.samba.org/archive/samba-technical/2008-February/057844.html

[Samba] Samba write performance in kernel
http://lists.samba.org/archive/samba/2008-August/143128.html

(Same thread, but continued at Sept,2009)
http://lists.samba.org/archive/samba/2008-September/143362.html

recvfile by linux splice
http://lists.samba.org/archive/samba-technical/2008-September/061408.html


Finally, the file size issue is fixed.
Index: lib/recvfile.c
===================================================================
--- lib/recvfile.c (revision 198)
+++ lib/recvfile.c (working copy)
@@ -148,10 +148,13 @@
static bool try_splice_call = true;
size_t total_written = 0;

+ int pipefd[2];
+ ssize_t ret;
+
DEBUG(10,("sys_recvfile: from = %d, to = %d, "
- "offset=%.0f, count = %lu\n",
+ "offset=%.0f, count = %lu, try_splice_call=%s\n",
fromfd, tofd, (double)offset,
- (unsigned long)count));
+ (unsigned long)count,try_splice_call?"true":"false"));

if (count == 0) {
return 0;
@@ -171,18 +174,27 @@
count);
}

- while (total_written < count) {
- ssize_t ret = splice(fromfd,
- NULL,
- tofd,
- &offset,
- count,
- 0);
+ if((ret=pipe(pipefd))){
+ DEBUG(0,("pipe creation failed,ret=%d(%x)\n",ret,ret));
+ return 0;
+ }
+ while (count!=0) {
+ //splice socket to pipe
+ if((ret = splice( fromfd, NULL,
+ pipefd[1],NULL,
+ count,SPLICE_F_NONBLOCK))>=0){
+ //splice pipe to file
+ ret = splice( pipefd[0], NULL,
+ tofd, &offset,
+ ret, SPLICE_F_NONBLOCK);
+ }
if (ret == -1) {
- if (errno != EINTR) {
+ if (errno != EINTR&&errno!=EAGAIN) {
if (total_written == 0 &&
(errno == EBADF || errno == EINVAL)) {
try_splice_call = false;
+ close(pipefd[0]);
+ close(pipefd[1]);
return default_sys_recvfile(fromfd,
tofd,
offset,
@@ -201,11 +213,15 @@
if (drain_socket(fromfd, count-total_written) !=
count-total_written) {
/* socket is dead. */
+ close(pipefd[0]);
+ close(pipefd[1]);
return -1;
}
errno = saved_errno;
}

+ close(pipefd[0]);
+ close(pipefd[1]);
return total_written;
}
#else

I repeat the test to really going to network and into file, and it success...

# ./splice-fromnet 2001 | ./splice-out -m testfile
# cat bigfile | netcat 2001

So I rewrite the splice-fromnet (splice-fromnet-tofile), and it stuck too.
--- splice-fromnet.c 2007-06-22 21:25:02.000000000 +0800
+++ splice-fromnet-tofile.c.0 2008-09-24 19:55:36.000000000 +0800
@@ -21,6 +21,9 @@
static unsigned int splice_flags;
static int wait_for_poll;

+static char* outputfile="receivedfile";
+static int outputfd;
+static long written_size=0;
static int usage(char *name)
{
fprintf(stderr, "%s: [-s splice size] [-w wait for poll] [-n non-blocking] port\n", name);
@@ -29,8 +32,11 @@

static int splice_from_net(int fd)
{
+ int pipefd[2];
+ if(pipe(pipefd)) return error("pipe");
+
while (1) {
- int ret;
+ int ret,ret2;

if (wait_for_poll) {
struct pollfd pfd = {
@@ -47,9 +53,9 @@
if (!(pfd.revents & POLLIN))
continue;
}
-
- ret = ssplice(fd, NULL, STDOUT_FILENO, NULL, splice_size, 0);
-
+ ret = ssplice(fd, NULL, pipefd[1], NULL, splice_size, 0);
+ ret2 = ssplice(pipefd[0], NULL, outputfd, NULL, ret , 0);
+ written_size+=ret2;
if (ret < 0)
return error("splice");
else if (!ret)
@@ -89,7 +95,7 @@
{
int c, index = 1;

- while ((c = getopt(argc, argv, "s:w:n")) != -1) {
+ while ((c = getopt(argc, argv, "s:w:f:n")) != -1) {
switch (c) {
case 's':
splice_size = atoi(optarg);
@@ -99,6 +105,10 @@
wait_for_poll = atoi(optarg);
index++;
break;
+ case 'f':
+ outputfile = atoi(optarg);
+ index++;
+ break;
case 'n':
splice_flags |= SPLICE_F_NONBLOCK;
index++;
@@ -121,12 +131,12 @@
if (argc < 2)
return usage(argv[0]);

- if (check_output_pipe())
- return usage(argv[0]);
-
index = parse_options(argc, argv);
if (index == -1 || index + 1 > argc)
return usage(argv[0]);
+ outputfd=open(outputfile,O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ if(outputfd<0) return error("open");
+

port = atoi(argv[index]);


I make the following changes to samba-3.2.2. Now splice worked for small file ( <500kB), but larger files might failed (>800kB).
Index: lib/recvfile.c
===================================================================
--- lib/recvfile.c (revision 198)
+++ lib/recvfile.c (working copy)
@@ -148,10 +148,13 @@
static bool try_splice_call = true;
size_t total_written = 0;

- DEBUG(10,("sys_recvfile: from = %d, to = %d, "
- "offset=%.0f, count = %lu\n",
+ int filepipe[2];
+ ssize_t ret;
+
+ DEBUG(0,("sys_recvfile: from = %d, to = %d, "
+ "offset=%.0f, count = %lu, try_splice_call=%s\n",
fromfd, tofd, (double)offset,
- (unsigned long)count));
+ (unsigned long)count,try_splice_call?"true":"false"));

if (count == 0) {
return 0;
@@ -171,13 +174,18 @@
count);
}

- while (total_written < count) {
- ssize_t ret = splice(fromfd,
- NULL,
- tofd,
- &offset,
- count,
- 0);
+ if(pipe(filepipe)) return 0;
+
+ while (count!=0) {
+ //splice socket to pipe
+ if((ret = splice( fromfd, NULL,
+ filepipe[1],NULL,
+ count,0))>=0){
+ //splice pipe to file
+ ret = splice( filepipe[0], NULL,
+ tofd, &offset,
+ ret, 0);
+ }
if (ret == -1) {
if (errno != EINTR) {
if (total_written == 0 &&


sys_splice -> do_splice returns -EINVAL

do_splice would check that one of in and out fd have to be a PIPE(FIFO), however, both parameter (fromfd, tofd) that samba sent with splice failed the check, so do_splice returns -EINVAL.

linux-2.6.26.5/include/linux/stat.h
  29#define S_ISFIFO(m)     (((m) & S_IFMT) == S_IFIFO)

linux-2.6.26.5/fs/splice.c
1084
1085/*
1086 * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
1087 * location, so checking ->i_pipe is not enough to verify that this is a
1088 * pipe.
1089 */
1090static inline struct pipe_inode_info *pipe_info(struct inode *inode)
1091{
1092 if (S_ISFIFO(inode->i_mode))
1093 return inode->i_pipe;
1094
1095 return NULL;
1096}
1097
1098/*
1099 * Determine where to splice to/from.
1100 */
1101static long do_splice(struct file *in, loff_t __user *off_in,
1102 struct file *out, loff_t __user *off_out,
1103 size_t len, unsigned int flags)
1104{
1105 struct pipe_inode_info *pipe;
1106 loff_t offset, *off;
1107 long ret;
1108
1109 pipe = pipe_info(in->f_path.dentry->d_inode);
1110 if (pipe) {
1111 if (off_in)
1112 return -ESPIPE;
1113 if (off_out) {
1114 if (out->f_op->llseek == no_llseek)
1115 return -EINVAL;
1116 if (copy_from_user(&offset, off_out, sizeof(loff_t)))
1117 return -EFAULT;
1118 off = &offset;
1119 } else
1120 off = &out->f_pos;
1121
1122 ret = do_splice_from(pipe, out, off, len, flags);
1123
1124 if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
1125 ret = -EFAULT;
1126
1127 return ret;
1128 }
1129
1130 pipe = pipe_info(out->f_path.dentry->d_inode);
1131 if (pipe) {
1132 if (off_out)
1133 return -ESPIPE;
1134 if (off_in) {
1135 if (in->f_op->llseek == no_llseek)
1136 return -EINVAL;
1137 if (copy_from_user(&offset, off_in, sizeof(loff_t)))
1138 return -EFAULT;
1139 off = &offset;
1140 } else
1141 off = &in->f_pos;
1142
1143 ret = do_splice_to(in, off, pipe, len, flags);
1144
1145 if (off_in && copy_to_user(off_in, off, sizeof(loff_t)))
1146 ret = -EFAULT;
1147
1148 return ret;
1149 }
1150
1151 return -EINVAL;
1152}
1153
(..............................)
1486asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
1487 int fd_out, loff_t __user *off_out,
1488 size_t len, unsigned int flags)
1489{
1490 long error;
1491 struct file *in, *out;
1492 int fput_in, fput_out;
1493
1494 if (unlikely(!len))
1495 return 0;
1496
1497 error = -EBADF;
1498 in = fget_light(fd_in, &fput_in);
1499 if (in) {
1500 if (in->f_mode & FMODE_READ) {
1501 out = fget_light(fd_out, &fput_out);
1502 if (out) {
1503 if (out->f_mode & FMODE_WRITE)
1504 error = do_splice(in, off_in,
1505 out, off_out,
1506 len, flags);
1507 fput_light(out, fput_out);
1508 }
1509 }
1510
1511 fput_light(in, fput_in);
1512 }
1513
1514 return error;
1515}
1516


Doesn't work even up to 2.6.27-rc5.
http://bbs.chinaunix.net/viewthread.php?tid=1079572
要到2.6.25以後?



Samba 3.2.2 has support for splice for receive file, but it doesn't work yet.

samba-3.2.2/source/lib/recvfile.c
#if defined(HAVE_LINUX_SPLICE)

/*
* Try and use the Linux system call to do this.
* Remember we only return -1 if the socket read
* failed. Else we return the number of bytes
* actually written. We always read count bytes
* from the network in the case of return != -1.
*/


ssize_t sys_recvfile(int fromfd,
int tofd,
SMB_OFF_T offset,
size_t count)
{
static bool try_splice_call = true;
size_t total_written = 0;

DEBUG(10,("sys_recvfile: from = %d, to = %d, "
"offset=%.0f, count = %lu, try_splice_call=%s\n",
fromfd, tofd, (double)offset,
(unsigned long)count,try_splice_call?"true":"false"));

if (count == 0) {
return 0;
}

/*
* Older Linux kernels have splice for sendfile,
* but it fails for recvfile. Ensure we only try
* this once and always fall back to the userspace
* implementation if recvfile splice fails. JRA.
*/

if (!try_splice_call) {
return default_sys_recvfile(fromfd,
tofd,
offset,
count);
}

while (total_written < count) {
ssize_t ret = splice(fromfd,
NULL,
tofd,
&offset,
count,
0);
if (ret == -1) {
if (errno != EINTR) {
if (total_written == 0 &&
(errno == EBADF || errno == EINVAL)) {
try_splice_call = false;
return default_sys_recvfile(fromfd,
tofd,
offset,
count);
}
break;
}
continue;
}
total_written += ret;
count -= ret;
}

if (total_written < count) {
int saved_errno = errno;
if (drain_socket(fromfd, count-total_written) !=
count-total_written) {
/* socket is dead. */
return -1;
}
errno = saved_errno;
}

return total_written;
}
#else

/*****************************************************************
No recvfile system call - use the default 128 chunk implementation.
*****************************************************************/

ssize_t sys_recvfile(int fromfd,
int tofd,
SMB_OFF_T offset,
size_t count)
{
return default_sys_recvfile(fromfd, tofd, offset, count);
}
#endif
and enable the option in smb.conf
min receivefile size=1

man smb.conf.5
       min receivefile size (G)

This option changes the behavior of smbd(8) when processing SMBwriteX calls. Any incoming SMBwriteX call on a non-signed SMB/CIFS connection
greater than this value will not be processed in the normal way but will be passed to any underlying kernel recvfile or splice system call (if
there is no such call Samba will emulate in user space). This allows zero-copy writes directly from network socket buffers into the filesystem
buffer cache, if available. It may improve performance but user testing is recommended. If set to zero Samba processes SMBwriteX calls in the
normal way. To enable POSIX large write support (SMB/CIFS writes up to 16Mb) this option must be nonzero. The maximum value is 128k. Values
greater than 128k will be silently set to 128k.

Note this option will have NO EFFECT if set on a SMB signed connection.

The default is zero, which diables this option.

Default: min receivefile size = 0



Linux has splice support since 2.6.17
http://lists.samba.org/archive/samba/2006-December/127887.html
http://kerneltrap.org/node/6505.
http://lwn.net/Articles/181170/




linux-2.6.16/net/socket.c

/*
* Socket files have a set of 'special' operations as well as the generic file ones. These don't appear
* in the operation structures but are done directly via the socketcall() multiplexor.
*/

static struct file_operations socket_file_ops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.aio_read = sock_aio_read,
.aio_write = sock_aio_write,
.poll = sock_poll,
.unlocked_ioctl = sock_ioctl,
.mmap = sock_mmap,
.open = sock_no_open, /* special open code to disallow open via /proc */
.release = sock_close,
.fasync = sock_fasync,
.readv = sock_readv,
.writev = sock_writev,
.sendpage = sock_sendpage
};




kernel question
1. packet收到後放在哪? (socket裡的queue?)
2. socket如何收 (sys_read socket?)

userspace
1. call sys_read socket到sys_write disk的過程



Samba write file
call frequency 1>2>>3>4

1. smbd calling sys_read socket to get received data
__arch_copy_to_user
copy_to_user
memcpy_toiovec
skb_copy_datagram_iovec
tcp_rcv_established
tcp_v4_do_rcv
release_sock
tcp_recvmsg
sock_common_recvmsg
sock_aio_read
do_sync_read
vfs_read
sys_read
ret_fast_syscall

2. smbd writes received data to disk
__arch_copy_from_user
__copy_from_user
generic_file_buffered_write
__generic_file_aio_write_nolock
generic_file_write
vfs_write
sys_write
ret_fast_syscall

3. sys_fcntl
__arch_copy_from_user
copy_from_user
fcntl_getlk
do_fcntl
sys_fcntl
ret_fast_syscall

4. Unknow, what is it reading???
__arch_copy_to_user
__copy_to_user
file_read_actor
do_generic_mapping_read
__generic_file_aio_read
generic_file_read
vfs_read
sys_read
ret_fast_syscall



./arch/arm/lib/uaccess.S (not built, no obj file)
ENTRY(__arch_copy_to_user)
stmfd sp!, {r2, r4 - r7, lr}
cmp r2, #4
blt .Lc2u_not_enough
ands ip, r0, #3
bne .Lc2u_dest_not_aligned


./arch/arm/lib/copy_to_user.S
ENTRY(__arch_copy_to_user)

#include "copy_template.S"

.section .fixup,"ax"
.align 0
copy_abort_preamble
ldmfd sp!, {r1, r2, r3}
sub r0, r0, r1
rsb r0, r0, r2
copy_abort_end
.previous


./include/asm-arm/uaccess.h
extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n);
extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n);

(............................................)

static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
{
if (access_ok(VERIFY_READ, from, n))
n = __arch_copy_from_user(to, from, n);
else /* security hole - plug it */
memzero(to, n);
return n;
}

static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
{
return __arch_copy_from_user(to, from, n);
}

static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n))
n = __arch_copy_to_user(to, from, n);
return n;
}

static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
{
return __arch_copy_to_user(to, from, n);
}

2008年8月12日 星期二

Openmoko Freerunner 台灣 團購 開始了 (8/17截止)

http://lists.openmoko.org/pipermail/community/2008-July/024597.html
http://lists.openmoko.org/pipermail/community/2008-July/024631.html
http://wiki.openmoko.org/wiki/GroupSales#Taipei

Schedule

8/17: last day to gather order

I'll send request to openmoko, then we should know an exact figure (in NTD).

payment: 1 week after the exact figure is known, paid by bank remittance (I'll mail my account latter)

  • If the number of phones is over but not exactly 10s (some of the phone couldn't have 10-pack price), I would like all of phones share the discount.
  • But the order does matter, since there might be no traveler’s pouch and headset for these not in 10-pack group.


How to take:

  • face to face: in HsinChu
  • mail


FAQ:

Q: Is it GSM900 or GSM850?

A: Openmoko can provide either GSM900 or GSM850 as required.


Q: Is this group sale include gifts descriptive in http://us.direct.openmoko.com/products/neo-freerunner ?

A: Yes.


Q: When will they arrive?

A: I don't actually know, but I hope we can get them before end of August.


Q: What about Invoice(發票)?

A: There won't be a invoice for everyone, but one only. I would copy the invoice for each one of you. But if you do need a separate invoice for your order, tell me first, and openmoko could handle that.


Q: Are you Taiwanese?

A: yes, we can discuss in Chinese if you want.


http://moto.debian.org.tw/viewtopic.php?t=13022

wireless traffic have higher priority than eth0 traffic on linux-2.6.16

Situation:

test0

bridge eth0+ra0(ap mode), vsftp+IDE HD, linux-2.6.16,
wireless client access ftp server on LAN (wireless->bridge->eth0, bridge traffic, all in kernel mode)
3 client from eth0 access ftp server on the DUT (eth0->bridge->localhost, localhost traffic, user mode involved)

Wireless traffic seems have high priority to those from eth0. Wireless traffic takes all the bandwidth that it need, eth0 traffic can only take the rest.


test1
wireless client access ftp server on the DUT => all traffic are localhost traffic. But wireless traffic seems have the same problem.


test2: Redo test0 and test1 with linux-2.6.24.
test0: wireless traffic is higher than eth0 traffic, but not all.
test1: wireless and eth0 traffic share the traffic bandwidth averagely.


It's seems like some kind of scheduling problem, that 2.6.24 doesn't have.
But share all bandwidth averagely is not what our customer want, they want the localhost access get the hightest priority.

Solution
user mode
an user mode application to limit the wireless data rate to some point with respect to the number of ftp server access count of localhost.

reference netmon-0.2, sysmon-0.1

kernel mode
Queue the bridge traffic, let the localhost traffic go directly. Transmit the packets in the queue ONLY IF we have spare bandwidth.

reference
linux-2.6.16/net/core/netpoll.c
static void queue_process(void *p)
{
unsigned long flags;
struct sk_buff *skb;

while (queue_head) {
spin_lock_irqsave(&queue_lock, flags);

skb = queue_head;
queue_head = skb->next;
if (skb == queue_tail)
queue_head = NULL;

queue_depth--;

spin_unlock_irqrestore(&queue_lock, flags);

dev_queue_xmit(skb);
}
}

static DECLARE_WORK(send_queue, queue_process, NULL);

2008年8月11日 星期一

Hex/Dec conversion

0x 400 => 1K
0x 1000 => 4K
0x 8000 => 32K
0x 2 0000 ==> 128K
0x 4 0000 ==> 256K
0x 8 0000 ==> 512K
0x 10 0000 ==> 1M
0x 1000 0000 ==> 256M
0x 4000 0000 ==> 1G
0x 8000 0000 ==> 2G
0x c000 0000 ==> 3G
0x 1 0000 0000 (0x ffff ffff) ==> 4G

2008年8月7日 星期四

RO/電解水

電解水: 調身體的酸鹼性, 省水, 省電, 負電位
RO: 純水, 有廢水
濾水器:



電解水的魔術....
http://www.mobile01.com/topicdetail.php?f=168&t=723308&p=1&cache=0

最近在找濾水器...
晚上去了松下(panisonic)去逛了一下

店員表演了幾個"魔術".....讓我有點想不透

pi能量水, 波動電解水
酒變甘純了?
店員先是拿兩個玻璃杯各自裝RO水與pi能量水,然後各自再拿一個白色塑膠杯,放點Whisky,然後一個玻璃杯放一個,不到10秒的時間,他請我試喝看看,的確pi能量水的那杯較甘、順口。但是水並沒有接觸到酒阿??

冰塊在pi波動金屬上會迅速溶解!?
ㄧ般冰塊從冰庫拿出來不論是放在桌上(類似廚房桌面)或水槽金屬部份,它的溶化速度並不明顯。但是一旦放在那塊pi波動金屬上,溶化速度非常明顯,一下子就溶光了。

量子訊息水,手指變長了的把戲
那店員先是讓我雙手合掌,在中指上食指的位置與大姆指的根部各做了一個記號,之後拿了一杯 量子訊息水 放在我的左手,之後拿個亞鈴要我用右手食中指拎著(大約8磅左右的啞鈴),要我上下移動。之後他重複把我左手的水拿走、再還我,的確是感到有取水時,啞鈴較不重。完成後,他讓我再度雙手和掌,大姆指根部的記號對齊,此時發現左手中指(記號)長度竟然比右手(記號)長了0.7cm左右!! 之後慢慢的就又恢復過來變成一樣長了。

回家以後試著舉類似重量的東西,並不會有長短的變化發生啊

看完後真的感覺非常神奇,有衝動買回來用
不過看完 逆滲透、電解水、pi水哪一種好 http://www.mobile01.com/topicdetail.php?f=168&t=82325&p=3

又覺得那是騙人的東西
但是又實在想不通....
尤其是那手指......說魔術還真不為過....


剛剛聯絡了另一家賣國際電器的商家
發現國際(Panasonic)的代理怪怪的

昨天去的專賣淨水器的叫作 松下淨化科技
http://www.purewater.com.tw/
http://www.0800290290.com.tw/
總公司:桃園市經國路597號 TEL:03-3571151 FAX:03-3582999

網站上有提到 磁化水 兀水 (波動水)
但是沒有提到 量子信息 的東西

他們說淨水的部分都是由他們處理


另外是 台灣松下集團
http://panasonic.com.tw/
一般賣電器(冷氣冰箱)的都是以他做總公司...
但是他們列的電解水機少的可憐
http://pcst.panasonic.com.tw/frontend/product/PSPCcycle.aspx?id=44

我在 松下淨化科技 問到的 TK7808-ZTA 在 電器行說那應該是水貨??
台灣松下集團 並沒有進這樣的機型...??

http://www.mobile01.com/topicdetail.php?f=168&t=723308&p=1&cache=0#7453612

將頻果切片
1.一片放入離子水,泡一下拿出(10秒即可)
2.一片放入一般冷開水,泡一下拿出(10秒即可)
3.一片直接放,桌上不泡水
哪一片會先變色答案是2與3
喝酒前喝一杯離子水(500.cc)隔天比較不會宿醉
以供各位參考

前有恆隆行但現在代理權已收回由台松電器販賣
來做銷售販賣

松下電工機型這4年來並未再引進

外盒與說明書與上須有,台松電器販賣股份有限公司
保證書上須有,台灣松下電器股份有限公司,台松電器販賣股份有限公司
才為日本松下母公司,授權台灣松下的機種



http://www.twd.gov.tw/news/200509/p04.htm
常見的濾水器的不實推銷手法

http://www.espring.com/ZH-TW/products/comparison.aspx
(eSpring)與其他水質處理技術比較

http://www.pidc.org.tw/C1/NSF-Taiwan/Pages/NSF%E6%A8%99%E6%BA%96%E4%B8%80%E8%A6%BD.aspx
NSF 標準一覽

水的科學與偽科學
http://chem.ncue.edu.tw/huch/water/water.htm
水看、聽得懂人的訊息?
http://chem.ncue.edu.tw/huch/water/%E6%B0%B4%E7%B5%90%E6%99%B6.htm
血液、汗水及緩衝溶液: 運動中的 pH 調節作用
http://chem.ncue.edu.tw/huch/water/pH%20Buffers%20in%20the%20Blood.htm
磁化水、 p水迷思
http://chem.ncue.edu.tw/huch/water/magnetic.htm

http://www.mobile01.com/topicdetail.php?f=168&t=197519&p=1
請大家給個淨水器的建議一下吧

http://www.mobile01.com/topicdetail.php?f=168&t=82325&p=3
逆滲透、電解水、pi水哪一種好
也許很多人不知道,電解水機或鈣離子水機是日本人發明的,這些飲用水機在日本是列入「醫療器材管制」,是治療腸胃疾病所用,根本不能在市面上隨便賣,以日本某名牌電解水機而言,已經標示出「主要功能為改善腸胃疾病,並必須依照醫師指示使用,也必須有階段性的調整使用」才可以。但是台灣商人卻胡亂進口大力推銷,政府又不取締,實在令人頭痛。
(.....................)
行政院環境保護署飲用水全球資訊網
http://ivy2.epa.gov.tw/out_web/j/drinkwater/index-4.htm

在安全飲用水的專區內,曾經看過一篇測試濾水器的文章,期結論是:用一般三段式濾水器(好像是粗濾網+活性炭+細濾網)過濾後再加煮開消毒,就可以安心飲用,當然濾心記得要定期更換。

該網站並不鼓勵用電解水,因為無實際報告可證明喝電解水有療效,如果該地區水源有重金屬污染用電解裝置可能會更嚴重。

(.....................)
關於理由一:套用呂教授最重視的「邏輯」來看。理由與結論要具有邏輯性的相關性,還必須要看立論者是以什麼「假設」做為立論基礎。呂教授認為「因為純水中完全不含任何礦物質,人體需要的鈣、鉀和鎂統統不見了,長期飲用會對人體造成血管疾病、心臟病、骨質疏鬆症。」要能成立的前提或假設有二,第一個假設是:是單一的「礦物質缺乏」是這些慢性病致病因子。但事實上是如此嗎?馬偕紀念醫院營養師趙強指出,這些慢性疾病是「生活形態不健康」所造成的疾病,致病的因子複雜,並不能用單一的「礦物質缺乏」來解釋。台大醫院內科醫師,中華民國骨質疏鬆症學會理事長蔡克嵩表示,純水會造成骨質疏鬆的說法並不可信。他指出,造成骨質疏鬆的原因很多,人體每天需要的鈣質,飲用水所能提供的不過百分之一。「少這百分之一會有什麼影響嗎?」台北大學附設醫院營養師麥素娟也指出,水並不是所有礦物質的來源,目前也沒有研究證明骨質疏鬆與飲用純水有關係。
(.....................)
因為我是看了一些實驗才買的,令人驚奇。
他可以讓植物長得更好,例如簡單的室內小擺飾的花原本可能一至二週就會枯掉了
但是使用了之後可以延續將近一個月喔。
另外,使用兩個容器,一個裝Ω水,另一個裝普通水,然後將紅酒分別到入兩個玻璃杯裡面,之後將玻璃杯分別放到那兩個容器中(當然賣給我的人還刻意要將兩個容器隔一段距離,說啥避免效果不明顯),過了五分鐘之後,我拿兩杯紅酒試了一下,
口感完全不同,嚇到,主要是Ω水經過活化之後,具備微量元素(礦物質)以及遠紅外線的效果(小弟認為有點向竹碳的效果),含有磁化Ω化的效果
水喝起還真的跟一般煮沸的水,或是啥電解水、RO、純水、蒸餾水不同
(.....................)
看裡mobile01有在討論水,真是感動。談談最近一年來使用金xx磁化(能量?)水的感想吧!原來是使用RO小孩子出生泡奶也是RO,並沒有前述專家所講的副作用。這些水專家為了推銷,什麼推論都做得出來,真是佩服。為何會用金xx?就如同普普眾生一樣,家裡有人病了,經由人介紹,就裝了。廠商說明為了有效果,可以生飲,.....。結果半年內就復發了。五,六年前也曾病過,這喝五,六年以來喝RO都沒事。但為何改用了以後這麼快?另一件疑惑是,小孩這一年以來幾乎是每個月都在生病,甚至是每星期,以前不會用RO不會這樣。
覺得不對勁,見一家人雖經過金xx但還是燒開比較好,為了這個事情還吵了一架,最後長輩出面,再加上發現友人的真面目,開始懷疑金xx的生水療效(水溶性礦物質,能量)後,開始將過濾過的水燒開。
神奇的事,小孩子就比較不容易生病了。
當初燒開以後發現一堆白色粉末的沈澱物,還打電話問總公司,他說那是礦物質結晶,不是石灰質沈澱(茶垢)。茶垢會結成硬塊,不容易洗掉。
我要告訴大家,那個粉末就是石灰質,不是什麼對身體有益的礦物質結晶。因為燒水次數多了,一樣就有硬塊的沈澱。不好洗。
台灣地窄人稠,說實在不像歐美,有那樣的本錢,可以保護水資源達到生飲的境界。
那個水源保護區的上游不住人?
還是燒開比較安全。
我的朋友(不是賣水的那位),有西醫師(非牙醫),有中醫師。西醫是RO,中醫師用RO+電解。縱使如此,他們還是把水燒開。
水乾淨最重要,至於磁化增加氧分子,...水溶性礦物質,....。沒有公正機關的科學證據,證明對人體吸收有用或不能從食物等乾淨的管道取得這些營養之前,聽聽就好。
例如金xx如果不算不銹鋼外殼的成本,其實他所號稱的功效,在大賣場,花不到4000塊就可以組得起來,結果機器卻要賣40000。我本身就是在研發磁鐵的相關工怍,永久磁鐵,他們公司的人不會有我熟。陶瓷濾心,活性炭,磁化棒,這些大賣場都有賣。

如果她的機器只賣一萬多,我也不會跳出來,但賣到4萬,覺得離譜。況且他所謂的專利,有查過(除非我漏掉),也不過是新式樣專利。這種專利不過十年,而且很容易申請。例如磁化棒內,你把磁塊轉個角度,造成不一樣的磁場,你也可以請新式樣。只是法律保障的程度比較差。
而且他所謂的生飲,最好不要,我們已經發生後遺症了。這也是出來呼籲大家,不要像我們一樣。
(.....................)

那電解水沒用囉?未必!!
合理的答案在日本人林秀光先生的著作之中 (sorry 書名我忘了),
它,根本不是酸性鹼性的作用,而是氧化與抗氧化的作用。
我們所飲用的電解水,應該正名為『負電位水』
鹼性,只是它附帶的一項不重要的特性。

為什麼負電位水有抗氧化作用?
一方面它含有解離氫,另一方面它含有多餘的負電 (電子),
自由基在破壞物質時,會掠奪電子,也會掠奪氫,
負電位水提供這兩個會被掠奪的東西,用以中和自由基。
自由基減少了,健康就拉近了
(剩下的,就是它的作用是多還是少的問題了,這點,我就沒有數據了)

(.....................)
很簡單的PH值實驗,但很多人根本只喜歡用聽來的…囧
用測紙試是呈紅色的,檸檬汁是酸性pH=2
只是因為被人吃下肚消化後,它們含的有機酸
人體可以新陳代謝﹐所以是「鹼性食品」。
(.....................)

"檸檬"是酸性沒錯
不過高中還是國中的化學課或生物課就有學過
食物的酸鹼性是燃燒過後的灰的酸鹼反應才代表食物真正的酸鹼性
(燃燒過類似食物在身體中被消化吸收的過程)
所以"檸檬食品"是鹼性沒有錯
(.....................)
以上兩位講的沒錯
不過我個人認為應該正名為[鹼性灰份食物]
單單講[鹼性食物],會有許多人以為檸檬可以中合胃酸
無言
(這檸檬中合胃酸的講法在各討論區都出現過)
也一直有人神秘兮兮語氣的講...
其實檸檬是鹼性的哦.

另外這種以高溫燃燒
取得灰份來測酸鹼值的方法,
並不能完全代表體內氧化的型態,
舉例像糙米,灰份測出來是酸性很強,
但是你相信糙米會是對人體不好的酸性灰份食物?

鹼性健康的指標
只是"鈉 鉀 鎂 鈣"四個需求量較大的礦物質
在體內型式正確,以及濃度適當而已.
(.....................)
但是關於這段"而不同的水分子團是有不同的滲透力的,這點有實驗可以測試(試試用電解冷水泡茶的效果看看)."我想有點問題.

你要證明你所謂的不同的水分子團有不同的滲透力,應該是拿不同大小的分子團的水來做實驗(假設真的有的話),但是你後面竟然是說,試試用電解水來泡茶看看;基本上,電解水出來的PH值偏鹼性或酸性,這對物質的溶解度本來就會有影響(請參閱各版本高中化學課本),等於是問A然後拿B變因來做實驗? 我想這在邏輯上有很大的問題.
(.....................)
電解機內加鈣 是因為日本水質都為軟水 而非硬水
台灣水質普遍都為硬水 不需加鈣 即可電解
水質很重要喔 也是補充礦物質來源之一
喝RO 之前聽一個醫生說 不是很好
我在家理都是喝 自來水 除雜質(棉纖維) 除臭(活性碳)除毒物(樹酯) 除大腸菌(陶瓷) 加礦物質(麥飯石) 然後過電解機 ^^
泡咖啡也很好喝哦
PS:一般處理過的水 泡茶 泡咖啡很難喝
下面是我家的飲用水來源
(.....................)
(.....................)


水分子團、水結構的垃圾科學
http://chem.ncue.edu.tw/huch/water/%E6%B0%B4%E5%88%86%E5%AD%90%E5%9C%98.htm

http://ecaaser3.ecaa.ntu.edu.tw/weifang/water/%B9q%B8%D1%A4%F4%B0%F2%C2%A6%AC%E3%A8s.htm
電解水基礎研究

http://www.wa-water.com/productiveunit.htm
電解水基礎研究
http://www.wa-water.com/a1_leadin.htm
電解水簡介
http://www.wa-water.com/history.htm
電解還原水的由來
http://www.wa-water.com/abouttummy.htm
About有關電解還原水會稀釋胃液之說
http://www.wa-water.com/theory.htm
電解水生成原理
http://www.wa-water.com/triphenylmethylradical.htm
自由基醫學探討
http://www.wa-water.com/proofs.htm
真憑實據 實驗篇


http://www.cna62.net/cna@usa/health_care/84sixroot06.htm
逆滲透水與蒸餾水最不能喝

http://hospital.kingnet.com.tw/essay/essay.html?pid=8422&category=%B9D%C5%A5%A4%A3%B6%EE%BB%A1
逆滲透水與蒸餾水最不能喝?

蘇老師化學黑白講-懂2點化學很有用
http://www.bookzone.com.tw/Publish/book.asp?bookno=WS062&type=preface
在一個淒風苦雨、雷電交加的夜晚,我聽見門鈴響。開門一看,有位穿著很正式的陌生人站在門廊上。他有禮貌的問了我一個耐人尋味的問題:「先生,您注重健康嗎?」我當時有股衝動想對他說:「不!我情願受凍、挨餓、生病。」並讓他吃閉門羹。但外頭天氣實在太差,我有點同情這位老兄。我心想,對人還是好一點吧,何不聽聽他葫蘆裡賣些什麼膏藥?於是請他進來坐。

他坐定後,立刻顯露出敏銳的觀察力,開口說道:「我注意到你們家是飲用自來水的,是吧?」我承認家裡的確裝了自來水。雖然飲用井水可能更自然些,但誰願意在冰天雪地的北國寒冬,還拿著水桶跑到外頭的水井汲水?他接著說:「你不會真的飲用從水管流出來的水吧?你真的喝這種水嗎?」我好像做了什麼虧心事給逮到一樣,支支吾吾的表示,不但我們家人飲用自來水,我還給貓咪喝自來水呢。

他聽了我這番話,立刻露出憂心忡忡的表情,說道:「你應該知道的,自來水裡有許多有害的化學物質。」我聽了這話,沒顯露出驚恐的表情,讓他有點受挫。他可能覺得陳述的分量要加重些才行,於是進一步解釋說:「水裡面充滿了看不見的化學物質。」這時,我終於明白他的意圖,知道接下來他會表演什麼把戲了。但時機未到,還不是告訴他,化學物質並沒有那麼見不得人的時候。況且,也該讓他把該表演的戲碼都秀完吧。

他問我:「你瞧過這些看不見的化學物質嗎?」我很想反問他,既然是「看不見的」又怎麼「瞧」呢?但不等我有機會答腔,他就打開手提箱,拿出一些設備來。這套裝備讓人印象深刻,是一些電氣設備、搭配一對金屬電極棒。接著他要求我從水龍頭裡接一杯水給他。

他用鼻子嗅一下這杯水,露出一副水裡充滿有毒物質的表情,然後把電極插進水裡。他大喊一聲:「注意看!」就把器材的插頭插入牆上的插座裡。大概30秒之後,清澈的水變混濁,過了約1分鐘,水裡就出現討人厭的黃色渣渣。「你看!」這個人得意的表示,當水通電後,水裡面討人厭的化學物質就會給逼出來。看起來,這些毒素好像平常都躲在水裡,等到通電後才紛紛現出原形。

接下來,就到了就是他此行的目的,也是今晚的重頭戲。他從口袋裡拿出一個過濾器套在水龍頭上,然後再接水,又玩一遍上述的把戲──把電極插入水裡通電。這次的結果截然不同。我那原本「充滿毒素」的自來水,不再出現黃色的渣垢。他告訴我,那些看不見的有毒化學物質,都經他的過濾器除掉了。

當然,與我們全家人的健康相較,幾百塊錢的過濾器開銷根本微不足道。推銷員告訴我,如果到這個地步,我仍半信半疑,還有很多文獻資料,可以支持他的說法。說著說著,他就拿出一堆剪報,內容不外是說自來水裡暗藏很多危險因子,包括消毒過程使用的氯氣(Cl2)在內。資料裡還提到,氯氣就是用於第一次世界大戰,那個惡名昭彰的毒氣。接著他又伸手進入袋子裡拿東西。我猜他可能會拿出防毒面具來,這是很合理的推論──他怎能毫無防護裝備,就曝露在致命的自來水之前!不過這次我倒是猜錯了。他拿出來的,是化學藥劑聯鄰甲苯胺([CH3(NH2)C6H3]2)。他告訴我,這是一種試劑,把它滴進水裡,如果水中有氯就會出現黃色。不用說,我家的自來水裡也有氯。

接下來,他要求我放幾根手指到杯子裡。過了幾分鐘,他又用聯鄰甲苯胺試劑來測試,可真奇怪,氯都不見了。他很肯定的告訴我,這些水裡的氯,都由我的皮膚吸收進入體內了。想想看我在洗澡的時候,身體吸收了多少有毒的氯,而且還經年累月的在吸收!但是別擔心,人當然不能不洗澡。他也有專門配合蓮蓬頭使用的過濾器,可以把雜七雜八的髒東西都濾掉,氯當然也包括在內。經過這麼精彩的表演之後,我被迫接受的這堂毒物學暨化學課總算告一段落。

對我而言,忍受這種江湖術士並不容易。但我仍咬緊牙根看他演完全程。尤其當他在高談闊論什麼「致癌率節節高升」、「身體負擔的毒素愈來愈多」、「科學家專門製造致命化學物」之類的鬼話時,我更是面無表情。我只是輕描淡寫的指出,人的平均壽命其實是逐年增加的,雖然有些癌症的發生率增加,但有的也在下降。我甚至沒有提醒他,在自來水裡加氯消毒,其實可算是公共衛生史上最偉大的創舉,不知造福了多少人。現在總算輪到我了。該我來為他上一堂化學課了。

首先,我拿起那杯經過電解,有黃色渣渣的水仔細端詳,水裡的渣渣清晰可見。在他還來不及出聲阻止之前,我把它拿到嘴邊喝了一口。這時,他的臉色變得像杯裡的水那樣黃。他大概以為我瘋了,企圖自殺。但我心裡有數,知道自己一點危險也沒有。我理解整個過程。那些黃色渣渣並不是什麼溶解在水裡的化學物質,它其實來自電極。電解是基本的化學實驗,把兩個電極浸在水裡,通上電流後,水(H2O)經由電解,會解離成氫氣(H2)與氧氣(O2)。如果其中有一個電極是鐵做的,鐵會與水作用產生氫氧化鐵(Fe(OH)3),俗稱鐵鏽,也就是那些看得見的黃色沉澱物。

因此,我充其量只是喝到一點點鐵鏽而已,沒有什麼好擔心的。不是有人吃鐵劑補充營養嗎?我對充滿疑懼的推銷員稍微解釋了一下,接著要求借用他過濾後的那杯水。我在水裡灑幾粒食鹽,再插入電極、通上電。片刻後,水裡又出現黃色的鏽垢。推銷員滿臉疑惑,猜不透我究竟在玩什麼把戲,他完全讓我給搞糊塗了。

我告訴他,純水不會導電,水裡有離子時才會導電。他的過濾器把水中的離子全濾掉了。等我加些食鹽進去,水中有了離子,又可以導電了。因此,鐵製的電極棒又會開始產生鐵銹。為了證明我的說法,我拿來一根鋁釘,請他用鋁釘代替鐵棒當電極,果然就沒有黃色的鐵鏽沉澱物了。
接下來,我們處理氯的問題。我接了兩杯自來水放在桌上,然後把我自己的手指伸入其中的一杯,要求推銷員握著另一杯水。幾分鐘之後,我把聯鄰甲苯胺試劑滴入兩杯水中,結果兩杯都沒有氯了。我告訴他,氯並不是被皮膚吸收進入身體,而是揮發進入空氣中了。我不知道自己說明與示範的效果如何。推銷員指出,自來水電解之後會產生鐵銹,過濾後的水卻不會,因此,過濾器一定有某種效用。我無法駁斥這個邏輯。

當然,我並不是第一次聽到這種亂七八糟的化學故事,也不是初次接觸這些令人頭昏眼花的危言聳聽。看起來,那些透過書籍、報紙、廣播與電視的科學教育普及工作,還有待加強。近二十年來,有許多人打著各種企業的名號,到家裡或辦公室來拜訪我。有的要求我對某種號稱具有「神奇療效」的東西表示意見;有的則請我投資那種「不會有損失」的冒險事業。我聽過與見過的東西真是五花八門、千奇百怪,幾乎什麼都有。例如:水晶、磁石、金字塔、數不清的食品添加劑、各式各樣的減肥術、特殊的油、氧化的液體、去氧的液體、除臭劑、芳香劑、神奇果汁、離子手鐲、草木精華素、各種抗氧化劑、驅蟲藥、有療效的水杯、食物保鮮劑、磁化水、健康毛毯、讓屁不臭的活性碳內衣褲等等。

我碰到過的所有人,包括那些人以後還會繼續碰到的人,絕大部分都是好人,並沒有想欺騙別人的意思。但是他們對這個世界的運作方式,都同樣抱持一種不切實際、過度簡化又一廂情願的想法。他們隨意濫用「有毒」、「化學劑」與「有害」這類名詞,卻對所謂「自然物質」有過度的錯誤幻想。他們大多數對「分子」、「化學反應」與「科學方法」只有很模糊的概念。他們不瞭解安慰劑對身體的效果;而且也不明白,過於相信傳聞的神奇療效,有時可能會搞得一團亂。當然,科學並不是萬能的,它無法回答所有的問題,科學家也會犯錯。但是科學方法,仍是我們最好的選擇。
我寫這本《蘇老師化學黑白講》與之前的《蘇老師掰化學》,都是想是讓讀者有機會用科學的眼光,瞧瞧這個複雜世界的運作方式。我希望藉由對普通現象的說明,使讀者對科學方法的功能有些體會。同時對很多事,以堅實的基礎知識進行批判性思考。

當然在我面對這個濾水器推銷員時,上述的那些想法只停留在我的腦海裡,並沒有說出來。西諺有云:「我們可以把馬拉到水邊,卻不能強迫牠飲水!」在這次類似的經驗裡,我的確把推銷員請到了自來水邊,但我能說服他喝我家的水嗎?看起來我的說明與示範還算有些效果。因為我請他喝咖啡時,他欣然同意,也不在意我是用水龍頭流出來的水煮的。

我覺得自己折磨這個可憐的推銷員夠久了,為了獎勵他全程聽我說明、看我示範,在他準備起身告辭的時候,我表示願意買濾水器。當然我的決定並不是由於他那些不對題的示範,而是我正準備買個類似的玩意兒。濾水器的確能除掉一些在水處理過程中產生的,我們不想要的物質,例如三鹵甲烷(CHCl3、CHBrCl2、CHClBr2、CHBr3)之類的化合物。

在自來水裡加氯,固然拯救了數百萬人的生命,但我們還是得付出一些代價。氯會與溶解在水裡的微量有機化合物作用,形成三鹵甲烷這類致癌物。活性碳過濾器能濾除三氯甲烷以及很多汙染物。當然,與我們在現實生活中面對的許多風險相較,飲用自來水的風險可說是微不足道,而用一個好的過濾器,可以把飲用自來水的風險又降低許多。此外,沒有殘氯的水也比較好喝。

因此,我簽了一張支票,並送給這位新朋友一本初級化學課本,希望我們這次的見面對他有些幫助。我想,對他來說,今晚不但外面是淒風苦雨、雷電相加,他的心情也像是在洗三溫暖一樣,忽冷忽熱的。當他勇敢的走入風雨中,向下一個目標前進時,我從窗戶看著他的背影。我看他停下片刻,好像在釋放壓力,重新振作。這個一直擔心自來水中的化學物質會危害健康的人,居然從口袋裡拿出一包菸,點了一根,抽了起來。



http://forum.palmislife.com/archiver/tid-78839.html
電解水生成器有用嗎?

http://department.tpa.edu.tw/medical/new_page_23.htm
http://goods.ruten.com.tw/item/show?11080725890146
喝水 簡單的就好
中時電子報

http://www.epa.gov.tw/
http://tsm.epa.gov.tw/drinkwater/
http://tsm.epa.gov.tw/drinkwater/safewater/index.html
http://tsm.epa.gov.tw/drinkwater/safewater/ch3.pdf
安全飲用水手冊(第四版)

http://tsm.epa.gov.tw/drinkwater/inform/report/default.htm
第一篇 認識「機能」飲用水
作者:立法院 郝龍斌委員
第三篇 安全飲用水的要件
作者:台北醫學院生化學科 張怡怡教授
第四篇 硬度對人體健康及口感之影響
作者:中興大學環境工程研究所 陳秋楊教授
第五篇 認識磁能活化水真相
作者::台灣大學公共衛生學系 王根樹教授
第六篇 淨水器的種類及設置時機
作者:成功大學環境工程研究所 林財富教授
第七篇 淨水器的維護管理注意事項
作者:成功大學環境工程研究所 林財富教授
第八篇 購置淨水器應注意事項
作者:中華民國淨水協會 王騰謙理事長

http://www.klepb.gov.tw/business-ep-work-4-drink-data03.htm
電解水機療效廣告真相 郝龍斌委員
認識磁能活化水真相 台灣大學公共衛生學系 王根樹教授
淨水器的種類及設置時機 成功大學環境工程研究所  林財富教授
各種淨水器可去除之污染物及其購置、維護條件

http://www.wcis.itri.org.tw/
http://www.wcis.itri.org.tw/library/quarterly_.asp?id=2000
http://www.wcis.itri.org.tw/Upload/QUART1/000242/19-7.pdf
http://www.ecaa.ntu.edu.tw/weifang/water/%E8%AA%8D%E8%AD%98%E9%9B%BB%E8%A7%A3%E6%B0%B4.htm
認識電解水
詹舒斐/工研院能資所節水團

2008年8月6日 星期三

Qt and Qtopia

http://doc.trolltech.com/4.2/qtopiacore.html

Qtopia Core is a C++ framework for GUI and application development for embedded devices. It runs on a variety of processors, usually with Embedded Linux. Qtopia Core provides the standard Qt API for embedded devices with a lightweight window system.



QT、QPE、Qtopia、Qt/Embedded、Qtopia Core 究竟是什麼?
http://leterboy.wordpress.com/2007/03/19/qt%E3%80%81qpe%E3%80%81qtopia%E3%80%81qtembedded%E3%80%81qtopia-core-%E7%A9%B6%E7%AB%9F%E6%98%AF%E4%BB%80%E9%BA%BC/


http://jserv.sayya.org/qtopia/doc/qte.txt
Qt/Embedded 中文處理實戰

2008年8月5日 星期二

ferrite beads

Kill GSM radio buzz with $1 ferrite beads
http://gadgets.boingboing.net/2008/08/02/kill-gsm-radio-buzz.html


http://en.wikipedia.org/wiki/Ferrite_bead
Ferrite bead


http://lists.openmoko.org/pipermail/community/2008-August/025173.html

The ferrite is increasing the common mode inductance of the cable because the
ferrite has a better magnetic permeability than air. Taping the ferrite to
the cable is a bit like a half turn on a ferrite rod. It will still affect
the inductance, but not as much as if it went through a ferrite ring.

2008年8月4日 星期一

Openmoko links

http://wiki.openmoko.org
http://bugzilla.openmoko.org
http://lists.openmoko.org
http://planet.openmoko.org
http://projects.openmoko.org

http://wiki.openmoko.org/wiki/MokoMakefile
http://wiki.openmoko.org/wiki/Toolchain

http://www.opensourcefood.com

Openmoko Documentation and Development Trac
http://docs.openmoko.org/trac/

Clock vs Boud Rate

Boud Rate(BR)
Divisor (DIV)
Clock (CLK)

CLK = BR * 16 * DIV

why?

http://www.intel.com/design/mcs96/manuals/272238/
http://www.intel.com/design/mcs96/technote/2673.htm
http://www.eel.tsint.edu.tw/teacher/hykuo/arm_exp/EX5_UART.pdf
http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/multiport/manual/vxc_customized_baudrate_chinese.pdf
http://www.pjrc.com/tech/8051/autobaud.html