2008年7月28日 星期一

RE: 850 sold out, 900 delayed, connection?

080804
誤打誤撞組成台灣團購團...
這下什麼抱怨都沒有了~~~ ^^



這信最後沒寄出去,有點抱怨
貼在自己的blog洩恨一下可以吧....


So there won't be a 900 on the openmoko webshop?

To answer the question on the webshop: "buy from a distributor near you", I'm in Taiwan.
yes, where Openmoko is located, but still, I have to buy one from US or India....
I try to buy one from koolu, but gave up at last step.

I start to wondering: dose it worth?

For weeks, I keep refreshing the webshop manually, following the mailing list, trying to build openmoko, and now it seems all wasted.

I'm not angry, but depressed.

Best Regards,
Mac Lin

> From: steve@openmoko.com
> To: community@lists.openmoko.org
> Date: Sun, 27 Jul 2008 15:29:29 -0700
> Subject: RE: 850 sold out, 900 delayed, connection?
>
> Please check the distributors as folks
>
> -----Original Message-----
> From: community-bounces@lists.openmoko.org
> [mailto:community-bounces@lists.openmoko.org] On Behalf Of MKL23
> Sent: Friday, July 25, 2008 6:14 AM
> To: 'List for Openmoko community discussion'
> Subject: RE: 850 sold out, 900 delayed, connection?
>
> I saw them appear on 24th, and removed this morning (25) ....
>
>
> Best Regards,
> Mac Lin
>
>
>> -----Original Message-----
>> From: community-bounces@lists.openmoko.org
>> [mailto:community-bounces@lists.openmoko.org] On Behalf Of Crane,
>> Matthew
>> Sent: Friday, July 25, 2008 8:42 PM
>> To: List for Openmoko community discussion
>> Subject: RE: 850 sold out, 900 delayed, connection?
>>
>>
>> Were any 850s available on the 25th? Or did it just remain sold out
>> from previously. Maybe there will be some delay due to rework and
>> testing changes for the gps + sd fix.
>>
>> -----Original Message-----
>> From: community-bounces@lists.openmoko.org
>> [mailto:community-bounces@lists.openmoko.org] On Behalf Of MKL23
>> Sent: Friday, July 25, 2008 8:29 AM
>> To: 'List for Openmoko community discussion'
>> Subject: RE: 850 sold out, 900 delayed, connection?
>>
>>
>> Hi,
>> It's 25th, and the 850 is sold out, again.
>> Is there any information or schedule of 900 ??
>>
>> Best Regards,
>> Mac Lin
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: community-bounces@lists.openmoko.org
>> [mailto:community-bounces@lists.openmoko.org] On Behalf Of steve
>> Sent: Saturday, July 12, 2008 10:20 AM
>> To: 'List for Openmoko community discussion'
>> Subject: RE: 850 sold out, 900 delayed, connection?
>>
>>
>> No, the guy who put up the 15th just made a mistake. I told him the
>> 25th ( best case) and he put up 15.th.
>>
>> , when we hit an inventory status of 36 units of 850, I checked the
>> website, found the mistake and said.
>>
>> While you are fixing this date, get ready for the next shocker, we
>> sold out the 850.
>>
>>
>> Another build is coming so hang in there.
>>
>>
>>
>>
>>
>> ________________________________
>>
>> From: community-bounces@lists.openmoko.org
>> [mailto:community-bounces@lists.openmoko.org] On Behalf Of Alexander
>> Frøyseth
>> Sent: Thursday, July 10, 2008 10:53 PM
>> To: List for Openmoko community discussion
>> Subject: 850 sold out, 900 delayed, connection?
>>
>>
>> Hey
>> I just wonder why the 900 was delayed with ten days when the 850 ten
>
>> pack was sold out?
>>
>> I was so happy to see that I was going to order my 10 pack of 900 on
>
>> Monday, but suddenly the date was 25th instead 15th.
>> When I saw that the 850 ten packs was sold out, I also saw that the
>> 900 was delayed.
>>
>> Is the a connection here?
>>
>> And why are the 900 delayed?
>>

2008年7月26日 星期六

Openmoko mailing list thread

there are too many mails per day, and I got almost overwhelmed for even a morning.
Just to keep track of the thread I'm intrested.



Freerunner's GSM Calypso Modem Firmware Upgrade...
http://comments.gmane.org/gmane.comp.handhelds.openmoko.community/30737

The Lost Openmoko Community‏
Openmoko Om 2008.8 Release‏
Weekly Engineering News 31/2008‏
Openmoko on Design
Request for help: Would like community applications to showanddiscuss at LinuxWorld
FSO - FSO is a API collection which is closely connected to ASU
ASU
850 sold out, 900 delayed, connection?
trying to buy a freerunner in taipei
Should setup sale-center in china mainland

2008年7月24日 星期四

skb_buff methods

skb_push, skb_pull, skb_trim, skb_put

* I draw the call sequence diagram one year ago based on linux-2.4.27, but it should be alike in 2.6.

Linux network drive receive path



* I draw the call sequence diagram one year ago based on linux-2.4.27, but it should be alike in 2.6.

Linux bridge transmit/ receive path





* I draw the call sequence diagram one year ago based on linux-2.4.27, but it should be alike in 2.6.

* __dev_queue_push_xmit in 2.4.27 ==> br_dev_queue_push_xmit in 2.6.16
* __br_forward_finish in 2.4.27 ==> br_forward_finish in 2.6.16
* there is no __br_dev_xmit in 2.6.16
*br_pass_frame_up_finish calls netif_receive_skb instead of netif_rx

2008年7月23日 星期三

PRI parameter of ps and top

static priority: 100~139,用來計算dynamic priority與time quantum。可使用nice()/setpriority()改變,nice value -20~19對應到static priority 100~139
dynamic priority: 由sleep time與static priority計算出來,是scheduler實際使用的priority
realtime priority: for realtime process, another story...



發信人: kenduest.bbs@bbs.cs.nctu.edu.tw (小州), 看板: Linux
標 題: Re: [問題] top/ps 顯示 priority的問題
發信站: 交大資訊次世代BS2 (Sat Jul 26 16:53:29 2008)
轉信站: ptt!ctu-reader!ctu-peer!news.nctu!csnews.cs.nctu!news.cs.nctu!BS2

※ 引述《mkl0301.bbs@ptt.cc (mkl)》之銘言:
> 再解釋一下我的問題...
> top/ps顯示的nice(NI)值都很正常...
> renice的值 ps的PRI top的PR
> -20 39 0
> 0 19 20
> 19 0 39
> 可是priority的值就怪怪的...
> 尤其是ps..怎麼priority越高,PRI越大呢??
> (priority不是應該值越小priority越高嗎?)

ps -o 是使用 priority, 不是 pri 這個字而已, 輸出的意義用途
不大一樣

|cmd_ni ps_pririty ps_opri ps_pri ps_ni top_pr top_ni
|-20 0 60 39 -20 0 -20
| 0 20 80 19 0 20 0
| 19 39 99 0 19 39 19

root@test-laptop:~# renice -20 -p $pid
9238: old priority 19, new priority -20
root@test-laptop:~# ps -o "pid pri priority opri nice" $pid
PID PRI PRI PRI NI
9238 39 0 60 -20
root@test-laptop:~# renice 0 -p $pid
9238: old priority -20, new priority 0
root@test-laptop:~# ps -o "pid pri priority opri nice" $pid
PID PRI PRI PRI NI
9238 19 20 80 0
root@test-laptop:~# renice 19 -p $pid
9238: old priority 0, new priority 19
root@test-laptop:~# ps -o "pid pri priority opri nice" $pid
PID PRI PRI PRI NI
9238 0 39 99 19
root@test-laptop:~#




080724
static priority ranging from 100 to 139 (from ULK)

使用renice是會改到process的priority的,只是為什麼ps與top的結果都怪怪的...
真要說的話,至少top的結果是"正常"的,ps的根本反過來了....


剛剛在試renice,發現renice改的不只是nice值
連priority都會被改到? 而且ps與top的結果不一樣???

cmd_ni ps_pr ps_ni top_pr top_ni
-20 39 -20 0 -20
0 19 0 20 0
19 0 19 39 19
cmd_ni=ps_ni=top_ni
ps_pr=19-cmd_ni
top_pr=20+cmd_ni

root@test-laptop:/# pid=6415;
root@test-laptop:/#
root@test-laptop:/# renice -20 -p $pid;
6415: old priority 19, new priority -20
root@test-laptop:/# ps -o "pid pri ni" $pid;
PID PRI NI
6415 39 -20
root@test-laptop:/# top -n 1 -p $pid;

top - 01:51:40 up 2:21, 2 users, load average: 0.40, 0.27, 0.27
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0%us, 2.3%sy, 0.5%ni, 83.4%id, 0.6%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 2066408k total, 1423656k used, 642752k free, 52852k buffers
Swap: 2000084k total, 0k used, 2000084k free, 821060k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6415 test 0 -20 337m 179m 27m S 4 8.9 24:07.43 firefox

root@test-laptop:/# renice 0 -p $pid;
6415: old priority -20, new priority 0
root@test-laptop:/# ps -o "pid pri ni" $pid;
PID PRI NI
6415 19 0
root@test-laptop:/# top -n 1 -p $pid;

top - 01:51:46 up 2:21, 2 users, load average: 0.36, 0.26, 0.27
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0%us, 2.3%sy, 0.5%ni, 83.4%id, 0.6%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 2066408k total, 1423716k used, 642692k free, 52860k buffers
Swap: 2000084k total, 0k used, 2000084k free, 821060k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6415 test 20 0 337m 179m 27m S 10 8.9 24:07.82 firefox

root@test-laptop:/# renice 19 -p $pid;
6415: old priority 0, new priority 19
root@test-laptop:/# ps -o "pid pri ni" $pid;
PID PRI NI
6415 0 19
root@test-laptop:/# top -n 1 -p $pid;

top - 01:51:49 up 2:21, 2 users, load average: 0.33, 0.26, 0.27
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0%us, 2.3%sy, 0.5%ni, 83.4%id, 0.6%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 2066408k total, 1423968k used, 642440k free, 52868k buffers
Swap: 2000084k total, 0k used, 2000084k free, 821052k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6415 test 39 19 337m 179m 27m S 4 8.9 24:08.05 firefox

root@test-laptop:/#

Add a new system call in Linux

Linux 內核解讀入門
http://fanqiang.chinaunix.net/a1/b1/20010421/181102_b.html

Linux 2.6.11 System Calls Table (LSCT)
http://www.jollen.org/blog/2006/10/linux_2611_system_calls_table.html

2008年7月22日 星期二

OpenMoko GPS + SD issue

Re: GPS rework: Please test and report on software fix priorto attempting any hardware fix
cat /dev/ttySAC1 | grep GPGGA

#!/bin/sh
PASSES=10
TTFF=""

get_ttf() {
echo "1" > /sys/bus/platform/devices/neo1973-pm-gps.0/pwron
TTFF=`(time grep "GPRMC,[0-9\.]*,A," -m 1 /dev/ttySAC1) 2>&1 |grep real`
echo "0" > /sys/bus/platform/devices/neo1973-pm-gps.0/pwron
echo $DRIVESTRENGTH $IDLECLK $TTFF
sleep 20
}

echo d i time
until [ $PASSES -eq 0 ]
do
for DRIVESTRENGTH in 0 1 2 3
do
for IDLECLK in 0 1
do
#echo testing drive strength $DRIVESTRENGTH and clock idle $IDLECLK
echo $DRIVESTRENGTH > /sys/module/glamo_mci/parameters/sd_drive
echo $IDLECLK > /sys/module/glamo_mci/parameters/sd_idleclk
touch /media/card/gpstest
sync
get_ttf
done
done
PASSES=$(($PASSES-1))
done



The Openmoko Freerunner have a long TTFF with the SD card in the phone. So it takes a long time (10min+) before you get your first GPS data

Solution:
SW/:The software just disables the SD card when the GPS tries to get it's first fix
SW/Andy: crank up the voltage a bit for the GPS unit
HW/Openmoko: http://wiki.openmoko.org/wiki/Main_Pagewiki/Image:Gta02_gps_10pf_rework_sop.pdf


Mailing List threads
Reason for GPS problems found!
GTA02 GPS rework for SD card interference issue
Reason for GPS problems found! / more patches
GPS problems, summary

http://wiki.openmoko.org/wiki/GTA02_GPS_Problems
GPS Problems


http://wiki.openmoko.org/wiki/FreeRunner_GPS_Software_Fix_TTFF_Measurement_Test
FreeRunner GPS Software Fix TTFF Measurement Test

OpenMoko Guy on List

Sean Moss-Pultz
sean@openmoko.com

steve@openmoko.com

Tick Chen
tick@openmoko.com

Michael Shiloh
michael@openmoko.org

hardware
Joerg Reisenweber
joerg@openmoko.org

Andy Green
andy@openmoko.com

customer support
Neng-Yu Tu (Tony Tu)
tony@openmoko.com


Marek Lindner
marek@openmoko.com

Willie
willie_chen@openmoko.com

eastern marketing
jollen
jollen@openmoko.org


Michael 'Mickey' Lauer
mickey@openmoko.org

Holger Freyther
zecke@openmoko.org

2008年7月18日 星期五

Tx Path

ret_fast_syscall
sys_sendfile
do_sendfile
generic_file_sendfile
do_generic_mapping_read
file_send_actor
sock_sendpage
tcp_sendpage
tcp_push_one
tcp_transmit_skb
ip_queue_xmit
ip_output

dev_queue_xmit
br_dev_xmit
br_deliver
dev_queue_xmit


it seems that control flow (commands, login, ..., etc) would go through tcp_sendmsg,
data flow goes through tcp_sendpage



tcp_sendmsg -------> dev_queue_xmit




There are 2 places that invoke qdisc_run: dev_queue_xmit and net_tx_action.
Whenever dev_queue_xmit is called, it would call qdisc_run to transmit packet. If the transmission fails, the packet would be queue, and transmitted latter by net_tx_action.

dev->enqueue=pfifo_fast_enqueue

bridge dev has no enqueue defined, so the transmission has to be successful.





linux-2.6.16/net/core/dev.c
/**
* dev_queue_xmit - transmit a buffer
* @skb: buffer to transmit
*
* Queue a buffer for transmission to a network device. The caller must
* have set the device and priority and built the buffer before calling
* this function. The function can be called from an interrupt.
*
* A negative errno code is returned on a failure. A success does not
* guarantee the frame will be transmitted as it may be dropped due
* to congestion or traffic shaping.
*
* -----------------------------------------------------------------------------------
* I notice this method can also return errors from the queue disciplines,
* including NET_XMIT_DROP, which is a positive value. So, errors can also
* be positive.
*
* Regardless of the return value, the skb is consumed, so it is currently
* difficult to retry a send to this method. (You can bump the ref count
* before sending to hold a reference for retry if you are careful.)
*
* When calling this method, interrupts MUST be enabled. This is because
* the BH enable code must have IRQs enabled so that it will not deadlock.
* --BLG
*/

int dev_queue_xmit(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct Qdisc *q;
int rc = -ENOMEM;

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

/* Disable soft irqs for various locks below. Also
* stops preemption for RCU.
*/
local_bh_disable();

/* Updates of qdisc are serialized by queue_lock.
* The struct Qdisc which is pointed to by qdisc is now a
* rcu structure - it may be accessed without acquiring
* a lock (but the structure may be stale.) The freeing of the
* qdisc will be deferred until it's known that there are no
* more references to it.
*
* If the qdisc has an enqueue function, we still need to
* hold the queue_lock before calling it, since queue_lock
* also serializes access to the device queue.
*/

q = rcu_dereference(dev->qdisc);
#ifdef CONFIG_NET_CLS_ACT
skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS);
#endif
if (q->enqueue) {
/* Grab device queue */
spin_lock(&dev->queue_lock);

rc = q->enqueue(skb, q);
qdisc_run(dev);

spin_unlock(&dev->queue_lock);
rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc;
goto out;
}

/* The device has no queue. Common case for software devices:
loopback, all the sorts of tunnels...

Really, it is unlikely that xmit_lock protection is necessary here.
(f.e. loopback and IP tunnels are clean ignoring statistics
counters.)
However, it is possible, that they rely on protection
made by us here.

Check this and shot the lock. It is not prone from deadlocks.
Either shot noqueue qdisc, it is even simpler 8)
*/
if (dev->flags & IFF_UP) {
int cpu = smp_processor_id(); /* ok because BHs are off */

if (dev->xmit_lock_owner != cpu) {

HARD_TX_LOCK(dev, cpu);

if (!netif_queue_stopped(dev)) {
if (netdev_nit)
dev_queue_xmit_nit(skb, dev);

rc = 0;
if (!dev->hard_start_xmit(skb, dev)) {
HARD_TX_UNLOCK(dev);
goto out;
}
}
HARD_TX_UNLOCK(dev);
if (net_ratelimit())
printk(KERN_CRIT "Virtual device %s asks to "
"queue packet!\n", dev->name);
} else {
/* Recursion is detected! It is possible,
* unfortunately */
if (net_ratelimit())
printk(KERN_CRIT "Dead loop on virtual device "
"%s, fix it urgently!\n", dev->name);
}
}

rc = -ENETDOWN;
local_bh_enable();

out_kfree_skb:
kfree_skb(skb);
return rc;
out:
local_bh_enable();
return rc;

}

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


static void net_tx_action(struct softirq_action *h)
{

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

if (sd->output_queue) {
struct net_device *head;

local_irq_disable();
head = sd->output_queue;
sd->output_queue = NULL;
local_irq_enable();

while (head) {
struct net_device *dev = head;
head = head->next_sched;

smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_SCHED, &dev->state);

if (spin_trylock(&dev->queue_lock)) {
qdisc_run(dev);
spin_unlock(&dev->queue_lock);
} else {
netif_schedule(dev);
}
}
}
linux-2.6.16/include/net/pkt_sched.h
static inline void qdisc_run(struct net_device *dev)
{
while (!netif_queue_stopped(dev) && qdisc_restart(dev) < 0)
/* NOTHING */;
}


linux-2.6.16/net/sched/sch_generic.c
/*
dev->queue_lock serializes queue accesses for this device
AND dev->qdisc pointer itself.

dev->xmit_lock serializes accesses to device driver.

dev->queue_lock and dev->xmit_lock are mutually exclusive,
if one is grabbed, another must be free.
*/


/* Kick device.
Note, that this procedure can be called by a watchdog timer, so that
we do not check dev->tbusy flag here.

Returns: 0 - queue is empty.
>0 - queue is not empty, but throttled.
<0 - queue is not empty. Device is throttled, if dev->tbusy != 0.

NOTE: Called under dev->queue_lock with locally disabled BH.
*/

int qdisc_restart(struct net_device *dev)
{
struct Qdisc *q = dev->qdisc;
struct sk_buff *skb;

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

if (!netif_queue_stopped(dev)) {
int ret;
if (netdev_nit)
dev_queue_xmit_nit(skb, dev);

ret = dev->hard_start_xmit(skb, dev);
if (ret == NETDEV_TX_OK) {
if (!nolock) {
dev->xmit_lock_owner = -1;
spin_unlock(&dev->xmit_lock);
}
spin_lock(&dev->queue_lock);
return -1;
}
if (ret == NETDEV_TX_LOCKED && nolock) {
spin_lock(&dev->queue_lock);
goto collision;
}
}

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

}
linux-2.6.16/net/sched/sch_generic.c

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

static struct Qdisc_ops pfifo_fast_ops = {
.id = "pfifo_fast",
.priv_size = PFIFO_FAST_BANDS * sizeof(struct sk_buff_head),
.enqueue = pfifo_fast_enqueue,
.dequeue = pfifo_fast_dequeue,
.requeue = pfifo_fast_requeue,
.init = pfifo_fast_init,
.reset = pfifo_fast_reset,
.dump = pfifo_fast_dump,
.owner = THIS_MODULE,
};

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

static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc)
{
struct sk_buff_head *list = prio2list(skb, qdisc);

if (skb_queue_len(list) < qdisc->dev->tx_queue_len) {
qdisc->q.qlen++;
return __qdisc_enqueue_tail(skb, qdisc, list);
}

return qdisc_drop(skb, qdisc);
}




2008年7月17日 星期四

七成科技新貴薪水將變薄

七成科技新貴薪水將變薄
http://www.businessweekly.com.tw/webarticle.php?id=33713&p=3

雖然大部分公司預期員工不會跳槽,但仍會準備另一筆「預備金」。因為能分的籌碼有限,未來老闆會等員工上門談離職的時候,才會拿出另一筆鉅額的股票分紅收入吸引員工留下來

一○四人力銀行副總經理晉麗明分析,但這個時候就算拿到股票,也是分階段拿。常見的狀況是,要員工簽約四年,一年一年發,如果員工半途離職,就領不到未來的股票紅利,等於增加員工跳槽的機會成本。

景氣不佳,讓薪資發球權更緊握在老闆手中。有的企業趁此調整組織結構,例如某IC設計公司,七月三日就開會公布,公司內將多一個設計部門。「這個部門的薪資,就可能會比其他部門高,」該公司員工表示。

你是職場上的贏家還是輸家,在這波寧靜革命中,很快見分曉。

選自己專長的技術領域,比選公司還重要。」這是一位IC設計業的中階主管給新鮮人的建議。因為目前各企業都已經是用放大鏡來檢查你的價值,你不能再依循過去,以為努力工作,就可以公平分到股票的心態,盲目投入企業工作。

當沒人能保證你進入高科技公司就變成新貴時,你能做的,就是選對適合自己的舞台,讓自己的價值再放大。

2008年7月15日 星期二

Benchmarking hardware RAID vs. Linux kernel software RAID

http://www.linux.com/feature/140734
Benchmarking hardware RAID vs. Linux kernel software RAID

For the hardware test I used an $800 Adaptec SAS-31205 PCI Express 12-port hardware RAID card. For software RAID I used the Linux kernel software RAID functionality of a system running 64-bit Fedora 9. The test machine was an AMD X2 running at 2.2GHz equipped with 2GB of RAM.

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

For RAID-10 using a smaller block size such as 256KB you get a noticeable
difference between hardware and software in rewrite performance. Hardware
beats out software substantially in output for parity RAID, with hardware
being 66% faster for block output and 20% faster for rewrite performance in
a 256KB chunk RAID-6. Therefore if you want performance and the capability
to sustain multiple drive failure at the same time you should investigate
hardware RAID solutions
. Aside from the benchmarks, the hardware RAID card
also supports hot-plug replacement, mitigating downtime to swap out dead
drives. Based on these test results you might consider buying some cheaper
SATA ports and stripe two software RAID-6 arrays instead of buying a
hardware RAID card with the same budget
.


http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks
RAID

http://en.wikipedia.org/wiki/Standard_RAID_levels
Standard RAID levels

Improve performance of Bridging devices of different capabilities

Adding wireless interface to bridge would drastically decrease throughput, even if there is no traffic on wireless.

eth0: 90Mbps
br0=eth0 80Mbps
br0=eth0+ath0 53Mbps (only accessed from eth0)

throughput is calculated by accessing vsftpd on DUT.




br_features_recompute get the minimal, common subset of the features supported by the enslaved devices
linux-2.6.16/net/bridge/br_if.c
/*
* Recomputes features using slave's features
*/
void br_features_recompute(struct net_bridge *br)
{
struct net_bridge_port *p;
unsigned long features, checksum;

features = br->feature_mask &~ NETIF_F_IP_CSUM;
checksum = br->feature_mask & NETIF_F_IP_CSUM;

list_for_each_entry(p, &br->port_list, list) {

if (!(p->dev->features
& (NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)))
checksum = 0;
features &= p->dev->features;
}

br->dev->features = features | checksum | NETIF_F_LLTX;
}
While bridging a device w/ NETIF_F_IP_CSUM supported(e1000) and one w/o NETIF_F_IP_CSUM (Atheros wireless), the bridge features would become w/o NETIF_F_IP_CSUM. Packets sent to e1000 (tcp_sendmsg) through bridge might be checksumed by software instead of hardware, which cause low throughput.

linux-2.6.16/include/net/sock.h
static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
{
__sk_dst_set(sk, dst);
sk->sk_route_caps = dst->dev->features;
if (sk->sk_route_caps & NETIF_F_TSO) {
if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len)
sk->sk_route_caps &= ~NETIF_F_TSO;
}
}


linux-2.6.16/net/ipv4/tcp.c
int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t size)
{
(...................................)
if (sk->sk_route_caps &
(NETIF_F_IP_CSUM | NETIF_F_NO_CSUM |
NETIF_F_HW_CSUM))
skb->ip_summed = CHECKSUM_HW;
skb_entail(sk, tp, skb);
copy = size_goal;
}

/* Try to append data to the end of skb. */
if (copy > seglen)
copy = seglen;

/* Where to copy to? */
if (skb_tailroom(skb) > 0) {
/* We have some space in skb head. Superb! */
if (copy > skb_tailroom(skb))
copy = skb_tailroom(skb);
if ((err = skb_add_data(skb, from, copy)) != 0)
goto do_fault;
(...................................)

linux-2.6.16/include/linux/skbuff.h
static int skb_add_data(struct sk_buff *skb,
char __user *from, int copy)
{
const int off = skb->len;

if (skb->ip_summed == CHECKSUM_NONE) {
int err = 0;
unsigned int csum = csum_and_copy_from_user(from,
skb_put(skb, copy),
copy, 0, &err);
if (!err) {
skb->csum = csum_block_add(skb->csum, csum, off);
return 0;
}
} else if (!copy_from_user(skb_put(skb, copy), from, copy))
return 0;

__skb_trim(skb, off);
return -EFAULT;
}





But there is code handling the situation that packets which assigned to use some hardware function but the device used to send doesn't support it.
linux-2.6.16/net/core/dev.c
int dev_queue_xmit(struct sk_buff *skb)
{
(........................................)
/* Fragmented skb is linearized if device does not support SG,
* or if at least one of fragments is in highmem and device
* does not support DMA from it.
*/
if (skb_shinfo(skb)->nr_frags &&
(!(dev->features & NETIF_F_SG) || illegal_highdma(dev, skb)) &&
__skb_linearize(skb, GFP_ATOMIC))
goto out_kfree_skb;

/* If packet is not checksummed and device does not support
* checksumming for this protocol, complete checksumming here.
*/
if (skb->ip_summed == CHECKSUM_HW &&
(!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) &&
(!(dev->features & NETIF_F_IP_CSUM) ||
skb->protocol != htons(ETH_P_IP))))
if (skb_checksum_help(skb, 0))
goto out_kfree_skb;


So in br_features_recompute, instead of getting minimal subset features, the bridge device should get the maximum feature union, at least it is true for NETIF_F_HW_CSUM and NETIF_F_SG. Upper layer could facilitate the hardware offload function if the device suport it, and dev_queue_xmit would fix it if it doesn't.

It can be done likewise in 2.6.24.

linux-2.6.24/net/bridge/br_if.c
void br_features_recompute(struct net_bridge *br)
{
struct net_bridge_port *p;
unsigned long features;

features = br->feature_mask;

list_for_each_entry(p, &br->port_list, list) {
features = netdev_compute_features(features, p->dev->features);
}

br->dev->features = features;
}



linux-2.6.24/net/core/dev.c
/**
* netdev_compute_feature - compute conjunction of two feature sets
* @all: first feature set
* @one: second feature set
*
* Computes a new feature set after adding a device with feature set
* @one to the master device with current feature set @all. Returns
* the new feature set.
*/
int netdev_compute_features(unsigned long all, unsigned long one)
{
/* if device needs checksumming, downgrade to hw checksumming */
if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
all ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;

/* if device can't do all checksum, downgrade to ipv4/ipv6 */
if (all & NETIF_F_HW_CSUM && !(one & NETIF_F_HW_CSUM))
all ^= NETIF_F_HW_CSUM
| NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;

if (one & NETIF_F_GSO)
one |= NETIF_F_GSO_SOFTWARE;
one |= NETIF_F_GSO;

/* If even one device supports robust GSO, enable it for all. */
if (one & NETIF_F_GSO_ROBUST)
all |= NETIF_F_GSO_ROBUST;

all &= one | NETIF_F_LLTX;

if (!(all & NETIF_F_ALL_CSUM))
all &= ~NETIF_F_SG;
if (!(all & NETIF_F_SG))
all &= ~NETIF_F_GSO_MASK;

return all;
}
EXPORT_SYMBOL(netdev_compute_features);

2008年7月11日 星期五

Cross-compiling madwafi for ARM

svn checkout http://svn.madwifi.org/madwifi/trunk madwifi
make KERNELPATH=`pwd`/kernels/linux-2.6.16-current ATH_RATE="ath_rate/sample" TARGET="armv4-le-elf" TOOLPREFIX="arm-linux-" DESTDIR="`pwd`/target" STRIP=arm-linux-strip modules
make KERNELPATH=`pwd`/kernels/linux-2.6.16-current ATH_RATE="ath_rate/sample" TARGET="armv4-le-elf" TOOLPREFIX="arm-linux-" DESTDIR="`pwd`/target" STRIP=arm-linux-strip install

Since rev1711 ( new HAL v0.9.18.0), including madwifi-0.9.4, until 2413, building with arm toolchain without VFP would have the following problem. It is fixed by adding "LDOPTS += --no-warn-mismatch" at rev2414. Revision before 1710 and after 2414 has no this problem.
# make KERNELPATH=`pwd`/kernels/linux-2.6.16-current ATH_RATE="ath_rate/sample" TARGET="armv4-le-elf" TOOLPREFIX="arm-linux-" DESTDIR="`pwd`/target" STRIP=arm-linux-strip modules
ARGET="armv4-le-elf" TOOLPREFIX="arm-linux-" DESTDIR="`pwd`/target" modules
Checking requirements... ok.
Checking kernel configuration... ok.
make -C./kernels/linux-2.6.16-current SUBDIRS=/home/mac/star/madwifi-0.9.4 modules
make[1]: Entering directory `./kernels/linux-2.6.16-current'
CC [M] ./madwifi-0.9.4/ath/if_ath.o
In file included from ./madwifi-0.9.4/ath/../include/compat.h:138,
from :17:
include/linux/skbuff.h: In function `__dev_alloc_skb':
include/linux/skbuff.h:1053: warning: ISO C90 forbids mixed declarations and code
CC [M] /home/mac/star/madwifi-0.9.4/ath/if_ath_pci.o
In file included from ./madwifi-0.9.4/ath/../include/compat.h:138,
from :17:
include/linux/skbuff.h: In function `__dev_alloc_skb':
include/linux/skbuff.h:1053: warning: ISO C90 forbids mixed declarations and code
LD [M] ./madwifi-0.9.4/ath/ath_pci.o
CC [M] ./madwifi-0.9.4/ath_hal/ah_os.o
In file included from ./madwifi-0.9.4/ath_hal/../include/compat.h:138,
from :16:
include/linux/skbuff.h: In function `__dev_alloc_skb':
include/linux/skbuff.h:1053: warning: ISO C90 forbids mixed declarations and code
HOSTCC ./madwifi-0.9.4/ath_hal/uudecode
UUDECODE ./madwifi-0.9.4/ath_hal/armv4-le-elf.hal.o
LD [M] ./madwifi-0.9.4/ath_hal/ath_hal.o
arm-linux-ld: ERROR: ./madwifi-0.9.4/ath_hal/armv4-le-elf.hal.o uses VFP instructions, whereas ./madwifi-0.9.4/ath_hal/ath_hal.o does not
arm-linux-ld: failed to merge target specific data of file ./madwifi-0.9.4/ath_hal/armv4-le-elf.hal.o
make[3]: *** [./madwifi-0.9.4/ath_hal/ath_hal.o] Error 1
make[2]: *** [./madwifi-0.9.4/ath_hal] Error 2
make[1]: *** [_module_./madwifi-0.9.4] Error 2

3.8 Options to Request or Suppress Warnings
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options
-Werror
Make all warnings into errors.

2008年7月10日 星期四

root directory of vsftpd

在passwd檔加入user ftp, vsftp會使用該user的root directory設定

http://linux.vbird.org/linux_server/0410vsftpd.php

vsFTPd 檔案伺服器

local_enable=YES (NO)
這個設定值必須要為 YES 時,在 /etc/passwd 內的帳號才能以實體用戶的方式登入我
們的 vsftpd 主機喔!
(...............................................)
# 你可以使用 anonymous 這個匿名帳號或其他實體帳號 (/etc/passwd) 登入;
# anonymous 的家目錄在 /var/ftp ,且無上傳權限,亦已經被 chroot 了;
# 實體用戶的家目錄參考 /etc/passwd ,並沒有被 chroot ,可前往任何有權限可進
入的目錄中;
# 任何於 /etc/vsftpd.ftpusers 內存在的帳號均無法使用 vsftpd ;
(...............................................)
# 一般來說, FTP 上面共有三個群組,分別是實體用戶、訪客與匿名登入者(real,
guest, anonymous);
# 可以藉由修改 /etc/passwd 裡面的 Shell 欄位,來讓使用者僅能使用 FTP 而無法
登入主機;

OpenStreetMap JOSM

apt-get install sun-java6-jre josm
wget http://josm.openstreetmap.de/download/josm-latest.jar
sudo mv -v josm-latest.jar /usr/share/java/
java -jar /usr/share/java/josm-latest.jar


wget http://josm.openstreetmap.de/browser/trunk/images/logo.png
sudo mv -v logo.png /usr/share/pixmaps/josm.png


Installing JOSM
http://ubuntuforums.org/showthread.php?t=499978

2008年7月9日 星期三

Porting eCos

TOPDIR=`pwd`

  1. Duplicate the baseline (excalibur --> str8100)
    1. copy the package related to the baseline, then change file name and contents
      TOPDIR=`pwd`
      #CYGPKG_HAL_ARM_ARM9_EXCALIBUR
      cd ${TOPDIR}/ecos/packages/hal/arm/arm9;

      #copy
      cp excalibur str8100 -a;
      find str8100 -name CVS -exec rm {} -rf \;
      cd str8100/current;

      #change the file name and contents

      for a in `find . -name *excalibur* `; do echo a=$a ; b=`echo $a | sed 's/excalibur/str8100/'`;echo b=$b ;mv $a $b -v;done;
      grep excalibur . -rHiIn | cut -d ":" -f 1|unique list; for a in `cat list` ; do echo $a;sed $a -e 's/excalibur/str8100/g' -e 's/EXCALIBUR/STR8100/g' -e 's/Excalibur/Str8100/g' > tmp; mv $a old; mv tmp $a;rm old tmp; done;

      #verify script, nothing should be found
      grep excalibur . -rHiIn;find . -name *excalibur*



      #CYGPKG_DEVS_FLASH_ARM_EXCALIBUR
      cd ${TOPDIR}/ecos/packages/devs/flash/arm;

      #copy
      cp excalibur str8100 -a;
      find str8100 -name CVS -exec rm {} -rf \;
      cd str8100/current;

      #change the file name and contents
      for a in `find . -name *excalibur* `; do echo a=$a ; b=`echo $a | sed 's/excalibur/str8100/'`;echo b=$b ;mv $a $b -v;done;
      grep excalibur . -rHiIn | cut -d ":" -f 1|unique list; for a in `cat list` ; do echo $a;sed $a -e 's/excalibur/str8100/g' -e 's/EXCALIBUR/STR8100/g' -e 's/Excalibur/Str8100/g' > tmp; mv $a old; mv tmp $a;rm old tmp; done;

      #verify script, nothing should be found
      grep excalibur . -rHiIn;find . -name *excalibur*

      cd ${TOPDIR};

    2. duplicate entries in ecos.db. Duplicate every "block" that has the keyword "excalibur", a target, a HAL package, and a FLASH package in this case.
      cd ${TOPDIR};
      vi ecos/packages/ecos.db

  2. Test build
  3. Customize

    console init procedure

    由於我是由u-boot load ecos的,所以console已經被initial好了
    只要直接寫入0x78000000,就會直接印出來了,之後再來寫console init的部份


    似乎ㄧ開始就link到0x30000的位置...
    在哪裡define的呢?

    ./packages/hal/arm/arm9/str8100/current/include/pkgconf/mlt_arm_arm9_str8100_ram.ldi
    SECTION_rom_vectors (ram, 0x30000, LMA_EQ_VMA)


    現在只要ㄧcall HAL_DCACHE_ENABLE 就ㄧ整個怪
    所有memory都抓不到,似乎MMU開了

    ref linux/include/asm/system.h:33
    /*
    * CR1 bits (CP#15 CR1)
    */
    #define CR_M (1 << 0) /* MMU enable */
    #define CR_A (1 << 1) /* Alignment abort enable */
    #define CR_C (1 << 2) /* Dcache enable */
    #define CR_W (1 << 3) /* Write buffer enable */
    #define CR_P (1 << 4) /* 32-bit exception handler */
    #define CR_D (1 << 5) /* 32-bit data address range */
    #define CR_L (1 << 6) /* Implementation defined */
    #define CR_B (1 << 7) /* Big endian */
    #define CR_S (1 << 8) /* System MMU protection */
    #define CR_R (1 << 9) /* ROM MMU protection */
    #define CR_F (1 << 10) /* Implementation defined */
    #define CR_Z (1 << 11) /* Implementation defined */
    #define CR_I (1 << 12) /* Icache enable */
    #define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
    #define CR_RR (1 << 14) /* Round Robin cache replacement */
    #define CR_L4 (1 << 15) /* LDR pc can set T bit */
    packages/hal/arm/arm9/var/current/src/arm9_misc.c
    void hal_hardware_init(void)
    {

    // Perform any platform specific initializations
    plf_hardware_init();

    // Set up eCos/ROM interfaces
    hal_if_init();

    #ifndef CYG_HAL_STARTUP_RAM
    // Invalidate caches
    HAL_DCACHE_INVALIDATE_ALL();
    HAL_ICACHE_INVALIDATE_ALL();
    #endif
    // Enable caches
    #ifdef CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP
    HAL_DCACHE_ENABLE();
    #endif
    #ifdef CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP
    HAL_ICACHE_ENABLE();
    #endif
    }
    packages/hal/arm/at91/var/current/include/hal_cache.h
    #define HAL_ICACHE_ENABLE()                                             \
    CYG_MACRO_START \
    asm volatile ( \
    "mrc p15,0,r1,c1,c0,0;" \
    "orr r1,r1,#0x1000;" \
    "orr r1,r1,#0x0003;" /* enable ICache (also ensures */ \
    /* that MMU and alignment faults */ \
    /* are enabled) */ \
    "mcr p15,0,r1,c1,c0,0" \
    : \
    : \
    : "r1" /* Clobber list */ \
    ); \
    CYG_MACRO_END

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

    // Enable the data cache
    #define HAL_DCACHE_ENABLE() \
    CYG_MACRO_START \
    asm volatile ( \
    "mrc p15,0,r1,c1,c0,0;" \
    "orr r1,r1,#0x000F;" /* enable DCache (also ensures */ \
    /* the MMU, alignment faults, and */ \
    /* write buffer are enabled) */ \
    "mcr p15,0,r1,c1,c0,0" \
    : \
    : \
    : "r1" /* Clobber list */ \
    ); \
    CYG_MACRO_END
    HAL_DCACHE_ENABLE enable 0xf
    HAL_ICACHE_ENABLE enalbe 0x1003
    都會enable MMU....
    這時候enable MMU對嗎?不是應該在後面hal_MMU_init做的嗎?
    eCos image應該這麼早就enable MMU嗎????


    use ROMRAM instead of RAM (in cdl)
    hal_arm_arm9_str8100.cdl
    cdl_component CYG_HAL_STARTUP {
    display "Startup type"
    flavor data
    default_value {"RAM"}
    legal_values {"RAM" "ROM" "ROMRAM" "REDBOOT" }
    用ecosconfig import
    cdl_component CYG_HAL_STARTUP {
    user_value ROMRAM
    };

    enables後trace32沒辦法load elf file, 出現
    bus error generated by CPU


    try enalbe LED function first...
    ./packages/hal/arm/arch/current/src/vectors.S
    // CYGHWR_LED_MACRO can be defined in hal_platform_setup.h. It's free to
    // use r0+r1. Argument is in "\x" - cannot use macro arguments since the
    // macro may contain #-chars and use of arguments cause these to be
    // interpreted as CPP stringify operators.
    // See example in PID hal_platform_setup.h.
    #ifndef CYGHWR_LED_MACRO
    #define CYGHWR_LED_MACRO
    #endif

    .macro LED x
    CYGHWR_LED_MACRO
    .endm
    packages/hal/arm/arm9/str8100/current/include/hal_platform_setup.h
    #define nDEBUG
    (............................)
    #ifdef DEBUG
    #define CYGHWR_LED_MACRO \
    ldr r0,=(STR8100_UART0_BASE+_UART_TD); \
    mov r1,#((\x) + 0x61); \
    str r1,[r0];
    #endif
    packages/hal/arm/arm9/str8100/current/include/str8100.h
    #define STR8100_BASE STR8100_REGS_PHYS_BASE
    (...................................)
    #define STR8100_REGS_PHYS_BASE 0x7fffc000
    (...................................)
    #define STR8100_UART0_BASE (STR8100_BASE+0x0280)




    ARM9
    __exception_handlers(./packages/hal/arm/arch/current/src/vectors.S)
    -reset_vector(./packages/hal/arm/arch/current/src/vectors.S)
    --hal_hardware_init(./ecos/packages/hal/arm/arm9/var/current/src/arm9_misc.c)
    ---HAL_DCACHE_ENABLE(./packages/hal/arm/arm9/var/current/include/hal_cache.h)
    ---HAL_ICACHE_ENABLE(./packages/hal/arm/arm9/var/current/include/hal_cache.h)
    --hal_ctrlc_isr_init
    --cyg_hal_invoke_constructors
    --cyg_start





    zzz










腳踏車發電

鑫元鴻實業股份有限公司
http://www.leisuretaiwan.com.tw/zh_TW/exh/info.html?id=965B3C4692162B22D0636733C6861689
www.formulahubs.com

DAHON: BioLogic Joule II Dynamo Hub
http://www.dahon.com/accessories/2009/biologic-joule-ii-dynamo-hub

HGW HUB dynamo
http://www.wretch.cc/blog/HUBHGW/

merida hfS 1000-D(2010版) 美利達96至尊 (16吋)
http://tw.myblog.yahoo.com/jw!vmfteJSQCQ4ja.8XEvUXWw--/article?mid=111&prev=-1&next=105

[問題] 電系改裝
http://www.play01.com/topicdetail.php?f=318&t=1588545&p=1

[請益] 單車自製發電設備!!!
http://www.mobile01.com/topicdetail.php?f=318&t=1006250&r=5



http://health-tech.diytrade.com/sdp/652068/3/pd-3383706/3636851-0.html
發電機系統 Z-1500


http://www.mobile01.com/topicdetail.php?f=268&t=380032
腳踏發電機


http://tw.myblog.yahoo.com/johnny_nien/article?mid=22&sc=1
腳踏車發電機 - ( 回答小飛俠 )
腳踏車發電機, 風力, 太陽能..等所產生的電壓確實會有電壓不穩定的情形,
電路上可以以穩壓電路克服, 建議是用電流源, 轉速快慢只會改變充電電流,
但是還要限流, 限定充電電流以免損壞電瓶. 其實這部份較好處理.

充電電路設計是否嚴謹關係著電瓶壽命, 以市售充電器為例,
有些充電電池用沒多久就壞了, 問題多半出在充電器,
當然正確使用充電電池也是關鍵.

也是為何我一直在探討如何處置電能 (或說能量) 的最佳利用,
節能產品最近忽然爆增, 良莠不齊, 我曾拆解一手動發電手電筒,
赫然發現發電是假的, 裡面竟藏著一顆水銀電池.

LED 手電筒也是如此, LED 規格註明只能使用 2 顆電池,
廠商就是要設計成 3 顆, 當然他的比別人亮, LED 壽命也就短了許多.


http://zhidao.weeqoo.com/showQuestion-102200.html
逆变器
有关发电机问题

请看以下网站:
http://detail.china.alibaba.com/buyer/offerdetail/45829440.html?keywords=%C8%CB%C1%A6%B7%A2%B5%E7#contactInfo
这个网站(有关人力脚踏发电机)的产品介绍说到:"";它可藉由脚踏发电,提供能源给12V/24AH的电池及运转300W以内的家用电器。您只要将现有直流12V或220V的电器,直接插入为您提供的可移动式电源箱内,即可运行。""
---我想问一颗12V的电池如何驱动220V的电器?它们的电压相差哪么大,为什么仍然可以驱动电器呢?谢谢

最佳答案 - 由投票者2个月前选出

电压相差很大那不是问题,用逆变原理可以把低压升至你所想要的高电压,用UPK2436该集成块来接成逆变器那是最快不过的了,线路既简单效率又高。脚踏发电机发出来的电能首先给蓄电池,然后接上逆变器就可以输出高压220V给别的电器供电了,风力发电机也是这个原理,都是先把发电机发出来的电能先蓄起来先。。。。。。升压原理经常用到的,比如电警棍,捕兔器,电猫,电子捕鱼机,电视机高压包,霓虹灯的电子变压器等等都是逆变升压原理


「詢問」訓練台發電討論及請教
http://5i01.com/topicdetail.php?f=318&t=645980&last=6463104
我講一個最簡單的方法給您參考(三千元加上diy應可搞定), 買一個電動腳踏車的輪鼓馬達, 這種馬達大約在60rpm下就有12V的三相交流電(有三條電線喔), 透過三相整流器即可得12V直流電.(我用自己的電動腳踏車試過).

或者買"有刷"的輪鼓馬達, 直接就輸出直流電了. (不用整流)


練習台發電機 Bicycle Trainer Generator
http://fserow.blogspot.com/2006/08/bicycle-trainer-generator.html

練習台發電機 Bicycle Trainner Generator 1.1
http://fserow.blogspot.com/2006/09/bicycle-trainner-generator-11.html

自行車專用拖車!不想再用馬鞍袋環島了!

http://www.mobile01.com/topicdetail.php?f=268&t=550191&p=3

1.利奇發電花鼓
  EB-990/991發電花鼓,利用花鼓帶動發電不同於以往利用摩擦帶動,省去摩擦時的能量損耗,因此有高效率的發電性能。通過德國交通部(KBA)的審核取得K-MARK(K489)認證,更是對其穩定且高性能的表現以及安全上的肯定。不須使用電池即可提供您自行車的電力,免除電池替換的不便而輕量化的設計以及低轉動扭力的表現更可帶給您騎乘時的舒適感。
2.久裕興業股份有限公司


http://www.wheelgiant.com.tw/Bmu/ch/html/bmu_85/BMUCH852602.HTM
美利達助鐵馬家庭圓夢
磨電機 東林


http://blog.yam.com/BlogArticle.php?BLOG_ID=pintau&ARTICLE_ID=9426912&page=2&limit=30
開站強檔專輯-小蜜蜂傳奇
1. 磨電機:可提供12V,5W以上的電量,缺點是靠摩擦發電,有磨損輪胎和降低速度的副作用。
2. 發電花鼓:可提供6V 3W左右的電量,非接觸式,沒有動能損耗,但價格貴,安裝難度較高,且6V對一般電器產品的銜接性較差,轉成12V又要花一番功夫。不過話說回來,如果能搞到一顆當作波動砲的充電電源,我還是很樂意的啦。
3. 太陽能:可提供12V 1W-10W不等的電量,但高功率的單晶太陽能板體積大,安裝不易,適合裝在腳踏車上的成品大多是非晶板,體積約為標準鍵盤的2/3大小,日照充足時大約能提供12V,150ma的微弱電量

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

配件:

1. 12V 1.5W非晶太陽能板x2:效率不算好,因為台北難得陽光普照。這板子在有陽光時的電壓才足以高過電池電壓而對之充電,大多時候都處於「心有餘而力不足」的狀態。也許可以靠昇壓電路把陰天時浪費的能量集結起來充到電瓶裡,但那已經超過我的程度太多了。太陽能板本身有防逆流的裝置,正面封裝防水,購自Y購。

2. 太陽能充放電控制器:電池滿時切斷太陽能板的供電、太陽能板電壓低時防止電池反向對太陽能板充電、電池電壓低於10.5V時切斷負載,防止電池過度放電。購自Y拍。太陽能板有供電時,Charge燈亮起,輸出端接上負載時,Load燈亮起,紅色Led為電量指示,滿格為3

3. 12V 7AH免保養鉛酸電池:原先用4.5AH,考慮續航力和重量後改用7AH的,在家可用15V整流器充飽電,戶外則靠太陽能板補充。購自光華商場。


磁浮發電器安裝示範
http://tw.truveo.com/%E7%A3%81%E6%B5%AE%E7%99%BC%E9%9B%BB%E5%99%A8%E5%AE%89%E8%A3%9D%E7%A4%BA%E7%AF%84/id/1217573377


腳踏車【永久免用電池】速人磁浮發電器、前燈、砲管燈、座管燈、擋泥板左右後燈
$800, love_dear0205
http://goods.ruten.com.tw/item/qa?11080303984322#detail
歐殷萬
02-2987-2240
三重後竹圍街205巷14號


腳踏車【免用電池】速人磁浮發電器/砲管燈/座管燈/天心拆卸器
$1100, aione
http://goods.ruten.com.tw/item/show?11080104506208
請問磁浮發電器的輸出電壓與電流為何?謝謝!有沒有詳細發電規格說明可以參考。
您好,(V消耗功率=電流×電壓),發電器經線圈廠商測試慢踩約10V,快踩約20V,電流約=28MA(0.028安培),謝謝


單車-BB 軸心發電機(磁浮燈)(補上尾燈.. 再加上頭燈照片)
http://www.suv.idv.tw/modules/newbb/viewtopic.php?topic_id=20457&forum=21&jump=1


How to make a bike charger for your iPod (iPod 腳踏車充電器)
http://geektechnique.org/projectlab/511

How to hand crank power your iPod (用手搖發電驅動iPod)
http://geektechnique.org/projectlab/236

how-to make a ‘usb battery’
http://hackaday.com/2005/01/20/how-to-make-a-usb-battery/

how-to: ‘usb battery’ v2
http://hackaday.com/2005/01/28/how-to-usb-battery-v2/

Switch Mode Altoids iPOD Charger using 3 'AA' batteries
http://www.instructables.com/id/Switch-Mode-Altoids-iPOD-Charger-using-3-_AA_-batt/

USB Bike Charger
http://fablab.waag.org/content/usb-bike-charger

How to Charge Any USB Device by Riding Your Bike
http://www.instructables.com/id/How-to-Charge-Any-USB-Device-by-Riding-Your-Bike/

Charge Your USB Device by Breathing
http://www.treehugger.com/files/2007/11/if_you_can_brea.php

太陽能充電板
http://www.solartechnology.co.uk/products/Solar_Chargers/Globetrotter_green.asp

手搖發電【腳踏車燈/手電筒/充電器】
http://shopping.pchome.com.tw/?mod=item&func=exhibit&IT_NO=DEAF05-A17488057


請問有辦法用腳踏車發電給GPS or 手機充電嗎?
http://5i01.com/topicdetail.php?f=318&t=660704&last=6732925
http://www.mobile01.com/print.php?f=318&t=660704&p=1
幽浮輪

Shimano發電花鼓DH-3N71

Shimano Dynamo Front Hub
DH-3N71
http://bike.shimano.com/publish/content/global_cycle/en/us/index/products/0/nexus/product.-code-DH-3N71.-type-.html
DH-3D71
http://bike.shimano.com/publish/content/global_cycle/en/us/index/products/0/nexus/product.-code-DH-3D71.-type-.html
Voltage 6V
Power Output 3.0W


Shimano 發電花鼓
http://www.shimano-china.com/catalog/cycle/products/group.jsp?JSESSIONID=HJkhvpvDhhF020ppgZQtKWQb1FJh1dv1kZgtjpnGr9nMjH4LzVJn!6194086&FOLDER%3C%3Efolder_id=2534374302039822&ASSORTMENT%3C%3East_id=1408474395181415&bmUID=1205101665656&bmLocale=zh

发电花鼓 DH-3N71
http://www.shimano-china.com/catalog/cycle/products/component.jsp?JSESSIONID=Jhb2lTgjfKwl5P41ppq0pF5JhC07WWNyHGVQMqnX2NQv5WlCGhGh!1836743867&PRODUCT%3C%3Eprd_id=845524441776486&FOLDER%3C%3Efolder_id=2534374302039823&ASSORTMENT%3C%3East_id=1408474395181415&bmUID=1234852663177&bmLocale=zh

发电花鼓 DH-3D71
http://www.shimano-china.com/catalog/cycle/products/component.jsp?JSESSIONID=Jhb2lTgjfKwl5P41ppq0pF5JhC07WWNyHGVQMqnX2NQv5WlCGhGh!1836743867&PRODUCT%3C%3Eprd_id=845524441776487&FOLDER%3C%3Efolder_id=2534374302039823&ASSORTMENT%3C%3East_id=1408474395181415&bmUID=1234852663177&bmLocale=zh



嘉兴光元电机科技有限公司
http://www.uvn.cn/business/Opp_act_detail_oid_1371764.jhtml
供应300W脚踏发电车


http://detail.china.alibaba.com/buyer/offerdetail/45829440.html
供应人力脚踏发电机

http://www.trade15.com/co-74437-12815.html
健身脚踏发电机
1) Input: AC 120V 60Hz ,AC 230V 50Hz ,AC 240V 50Hz
2) Output: AC or DC 3.0-36V, 100-3,500mA


http://www.aladdinpower.com/apStepCharger.html
STEPCHARGER

http://www.windstreampower.com/Human_Power_Generator.php
Human Power Generator
12V 60W
$550 USD



勝騰實業股份有限公司 > apower 300
http://www.apower.biz/F00/new_F00.php
http://store.pchome.com.tw/apower/M00643593.htm
$16800NTD



[wiki] Regenerative brake
http://en.wikipedia.org/wiki/Regenerative_braking

[wiki] 再生制動
http://zh.wikipedia.org/wiki/%E5%86%8D%E7%94%9F%E5%88%B6%E5%8B%95

2008年7月8日 星期二

Check for web page changes

Check4Change 1.6
https://addons.mozilla.org/en-US/firefox/addon/3028

Update Scanner 2.2.3
https://addons.mozilla.org/en-US/firefox/addon/3362

Building the Openmoko Note

http://svn.openmoko.org/trunk/src/target/OM-2007.2/

OpenEmbedded: Getting Started
http://wiki.openembedded.net/index.php/Getting_Started

  1. Required Applications
    apt-get install bitbake monotone help2man diffstat texi2html texinfo cvs python-psyco

  2. Preparation
    sudo bash -c "echo 0 > /proc/sys/vm/mmap_min_addr";
    BASE=`pwd`;export BBPATH=${BASE}/build:${BASE}/org.openembedded.dev;
    SERVER=org.openembedded.dev;
    SERVER=git.openmoko.org;
  3. wget http://www.openembedded.org/snapshots/OE.mtn.bz2;
    bunzip2 -d OE.mtn.bz2;

  4. Checkout OE
    mtn --db=${BASE}/OE.mtn checkout --branch=org.openembedded.dev;
    Update OE
    mtn --db=${BASE}/OE.mtn pull monotone.openembedded.org org.openembedded.dev
    cd ${BASE}/org.openembedded.dev && mtn update
    cd ${BASE}/org.openembedded.dreambox && mtn update
  5. mkdir build/conf -p;
    cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf;

  6. Edit ${BASE}/build/conf/local.conf, change the variables to their relative values.(TOPDIR=${BASE}/build )
    DL_DIR = "${TOPDIR}/sources"
    BBFILES = "${TOPDIR}/../org.openembedded.dev/packages/*/*.bb"
    DISTRO = "angstrom-2008.1"
    MACHINE = "om-gta01"
    and remove (comment) the folloing line
    REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"
    not required but it could make faster with SMP
    PARALLEL_MAKE = "-j 4"

  7. cd ${BASE}/build;
    bitbake nano;
    bitbake world
    NOTE: preferred version 1.2.3 of xf86-input-joystick not available (for item xf86-input-joystick)
    NOTE: Resolving any missing task queue dependencies
    ERROR: Required build target 'python-pycap' has no buildable providers.
    Missing or unbuildable dependency chain was: ['python-pycap', 'libnet-1.1.1']


    bitbake task-base
    bitbake gpe-image
    | arm-angstrom-linux-gnueabi-libtool: link: arm-angstrom-linux-gnueabi-gcc -march=armv4t -mtune=arm920t -shared .libs/gdk-pixbuf.o .libs/gdk-pixbuf-animation.o .libs/gdk-pixbuf-data.o .libs/gdk-pixbuf-io.o .libs/gdk-pixbuf-loader.o .libs/gdk-pixbuf-scale.o .libs/gdk-pixbuf-simple-anim.o .libs/gdk-pixbuf-scaled-anim.o .libs/gdk-pixbuf-util.o .libs/gdk-pixdata.o .libs/gdk-pixbuf-enum-types.o -Wl,--whole-archive pixops/.libs/libpixops.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib -L/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/.libs -L/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libgmodule-2.0.so -ldl /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libgobject-2.0.so /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libglib-2.0.so -lm -march=armv4t -mtune=arm920t -Wl,-rpath-link -Wl,/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib -Wl,-O1 -Wl,-soname -Wl,libgdk_pixbuf-2.0.so.0 -Wl,-version-script -Wl,.libs/libgdk_pixbuf-2.0.ver -o .libs/libgdk_pixbuf-2.0.so.0.1200.3
    | /home/prj/om2/build/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.2.4/../../../../arm-angstrom-linux-gnueabi/bin/ld:.libs/libgdk_pixbuf-2.0.ver:2: ignoring invalid character `\001' in script
    | /home/prj/om2/build/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.2.4/../../../../arm-angstrom-linux-gnueabi/bin/ld:.libs/libgdk_pixbuf-2.0.ver:2: syntax error in VERSION script
    | collect2: ld returned 1 exit status
    | make[4]: *** [libgdk_pixbuf-2.0.la] Error 1
    | make[4]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[3]: *** [all-recursive] Error 1
    | make[3]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[2]: *** [all] Error 2
    | make[2]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[1]: *** [all-recursive] Error 1
    | make[1]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3'
    | make: *** [all] Error 2
    | FATAL: oe_runmake failed
    NOTE: Task failed: /home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/temp/log.do_compile.20178
    NOTE: package gtk+-2.12.3-r2: task do_compile: failed
    ERROR: TaskFailed event exception, aborting
    NOTE: package gtk+-2.12.3: failed
    ERROR: Build of /home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb do_compile failed
    ERROR: Task 1171 (/home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb, do_compile) failed
    NOTE: Tasks Summary: Attempted 911 tasks of which 525 didn't need to be rerun and 1 failed.
    ERROR: '/home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb' failed
    test@test-laptop:/home/prj/om2/build$
    bitbake opie-image
    | FATAL: Configuring qte failed. EXTRA_OECONF was -system-jpeg -system-libpng -system-zlib -no-qvfb -no-xft -no-vnc -gif -xplatform linux-gnueabi-arm-g++ -qconfig qpe -depths 8,16,32 -static -thread
    NOTE: Task failed: /home/prj/om2/build/tmp/work/om-gta01-angstrom-linux-gnueabi/qte-mt-static-2.3.10-r8/temp/log.do_configure.6469
    NOTE: package qte-mt-static-2.3.10-r8: task do_configure: failed
    ERROR: TaskFailed event exception, aborting
    NOTE: package qte-mt-static-2.3.10: failed
    ERROR: Build of /home/prj/om2/build/../org.openembedded.dev/packages/qte/qte-mt-static_2.3.10.bb do_configure failed
    ERROR: Task 2572 (/home/prj/om2/build/../org.openembedded.dev/packages/qte/qte-mt-static_2.3.10.bb, do_configure) failed
    NOTE: Tasks Summary: Attempted 366 tasks of which 339 didn't need to be rerun and 1 failed.
    ERROR: '/home/prj/om2/build/../org.openembedded.dev/packages/qte/qte-mt-static_2.3.10.bb' failed
    test@test-laptop:/home/prj/om2/build$ \
    bitbake openmoko-devel-image
    | arm-angstrom-linux-gnueabi-libtool: link: arm-angstrom-linux-gnueabi-gcc -march=armv4t -mtune=arm920t -shared .libs/gdk-pixbuf.o .libs/gdk-pixbuf-animation.o .libs/gdk-pixbuf-data.o .libs/gdk-pixbuf-io.o .libs/gdk-pixbuf-loader.o .libs/gdk-pixbuf-scale.o .libs/gdk-pixbuf-simple-anim.o .libs/gdk-pixbuf-scaled-anim.o .libs/gdk-pixbuf-util.o .libs/gdk-pixdata.o .libs/gdk-pixbuf-enum-types.o -Wl,--whole-archive pixops/.libs/libpixops.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib -L/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/.libs -L/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libgmodule-2.0.so -ldl /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libgobject-2.0.so /home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib/libglib-2.0.so -lm -march=armv4t -mtune=arm920t -Wl,-rpath-link -Wl,/home/prj/om2/build/tmp/staging/arm-angstrom-linux-gnueabi/usr/lib -Wl,-O1 -Wl,-soname -Wl,libgdk_pixbuf-2.0.so.0 -Wl,-version-script -Wl,.libs/libgdk_pixbuf-2.0.ver -o .libs/libgdk_pixbuf-2.0.so.0.1200.3
    | /home/prj/om2/build/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.2.4/../../../../arm-angstrom-linux-gnueabi/bin/ld:.libs/libgdk_pixbuf-2.0.ver:2: ignoring invalid character `\001' in script
    | /home/prj/om2/build/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.2.4/../../../../arm-angstrom-linux-gnueabi/bin/ld:.libs/libgdk_pixbuf-2.0.ver:2: syntax error in VERSION script
    | collect2: ld returned 1 exit status
    | make[4]: *** [libgdk_pixbuf-2.0.la] Error 1
    | make[4]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[3]: *** [all-recursive] Error 1
    | make[3]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[2]: *** [all] Error 2
    | make[2]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3/gdk-pixbuf'
    | make[1]: *** [all-recursive] Error 1
    | make[1]: Leaving directory `/home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/gtk+-2.12.3'
    | make: *** [all] Error 2
    | FATAL: oe_runmake failed
    NOTE: Task failed: /home/prj/om2/build/tmp/work/armv4t-angstrom-linux-gnueabi/gtk+-2.12.3-r2/temp/log.do_compile.18963
    NOTE: package gtk+-2.12.3-r2: task do_compile: failed
    ERROR: TaskFailed event exception, aborting
    NOTE: package gtk+-2.12.3: failed
    ERROR: Build of /home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb do_compile failed
    ERROR: Task 1459 (/home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb, do_compile) failed
    NOTE: Tasks Summary: Attempted 907 tasks of which 880 didn't need to be rerun and 1 failed.
    ERROR: '/home/prj/om2/build/../org.openembedded.dev/packages/gtk+/gtk+_2.12.3.bb' failed
    test@test-laptop:/home/prj/om2/build$
    bitbake -b /stuff/org.openembedded.dev/packages/blah/blah.bb




Building Openmoko from scratch
Openmoko2007.2
http://wiki.openmoko.org/wiki/Building_Openmoko_from_scratch#Build_host_prerequisites

http://downloads.openmoko.org/OE/snapshots/OE.mtn.bz2 is no longer valid
please make sure to use git.openmoko.org as monotone server (I don't know how to specify the monotone server, so nothing is changed. and with following changes, downloads are from downloads.openmoko.org)
  1. Edit ${TOPDIR}/build/conf/local.conf, change the value of following variable:
    BBFILES = "${TOPDIR}/../org.openembedded.dev/packages/*/*.bb"

    MACHINE = "om-gta01"
    DISTRO = "openmoko"

    ENABLE_BINARY_LOCALE_GENERATION = "1"
    GLIBC_GENERATE_LOCALES = "en_GB.UTF-8"
  2. bitbake openmoko-devel-image
    | checking for BSD-compatible nm... /usr/bin/nm -B
    | /home/prj/om2/build/tmp/work/i686-linux/gmp-native-4.2.1-r2/gmp-4.2.1/configure: line 11007: syntax error near unexpected token `,'
    | /home/prj/om2/build/tmp/work/i686-linux/gmp-native-4.2.1-r2/gmp-4.2.1/configure: line 11007: `_LT_DECL(, AS, 0, Assembler program)'
    | FATAL: oe_runconf failed
    NOTE: Task failed: /home/prj/om2/build/tmp/work/i686-linux/gmp-native-4.2.1-r2/temp/log.do_configure.23714
    NOTE: package gmp-native-4.2.1-r2: task do_configure: failed
    ERROR: TaskFailed event exception, aborting
    NOTE: package gmp-native-4.2.1: failed
    ERROR: Build of /home/prj/om2/build/../org.openembedded.dev/packages/gmp/gmp-native_4.2.1.bb do_configure failed
    ERROR: Task 838 (/home/prj/om2/build/../org.openembedded.dev/packages/gmp/gmp-native_4.2.1.bb, do_configure) failed
    NOTE: Tasks Summary: Attempted 137 tasks of which 137 didn't need to be rerun and 1 failed.
    ERROR: '/home/prj/om2/build/../org.openembedded.dev/packages/gmp/gmp-native_4.2.1.bb' failed
Images generated by building package groups like opie-im.mtnage or pivotboot-image are placed in the build/tmp/deploy/glibc/images/om-gta01/ directory. Individual ipkg packages are put in build/tmp/deploy/glibc/ipk.
OpenEmbbeded: Adding Packages

1. Create bbfile.
2. Try building it locally.
3. Fix eventual problems.
4. Send .bbfile or an OePatch to the openembedded mailing list.


Building Openmoko from scratch (pre-BBT)
http://wiki.openmoko.org/wiki/Building_Openmoko_from_scratch_(pre-BBT)

sudo apt-get install subversion quilt monotone diffstat git python-psyco


OMDIR=`pwd`;export OMDIR;
export BBPATH=$OMDIR/build:$OMDIR/openmoko/trunk/oe:$OMDIR/openembedded;

svn co -r 887 https://svn.openmoko.org/ openmoko

wget http://www.openembedded.org/snapshots/OE.mtn.bz2
bunzip2 OE.mtn.bz2
mtn --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev
mtn --db=OE.mtn checkout --branch=org.openembedded.dev -r e2dbb52fe39df7ef786b6068f6178f29508dfded openembedded

Update
cd $OMDIR/openembedded && mtn update

mkdir -p sources build/conf
cat <<EOF >build/conf/local.conf
MACHINE = "fic-gta01"
DISTRO = "openmoko"
BUILD_ARCH = "`uname -m`"
EOF



fixes
cd $OMDIR/sources
mkdir -p ../build/tmp/stamps/armv4t-linux

wget http://ftp.mozilla.org/pub/mozilla.org/js/older-packages/js-1.5.tar.gz
touch ../build/tmp/stamps/armv4t-linux/js-1.5-r0.do_fetch

wget http://us4.samba.org/samba/ftp/stable/samba-3.0.14a.tar.gz
touch ../build/tmp/stamps/armv4t-linux/samba-3.0.14a-r15.do_fetch

perl -pi.orig -e 's/ *$//;s/\r//g' \
../openembedded/packages/gcc/gcc-4.1.1/gcc-4.1.1-pr13685-1.patch




cd $OMDIR
ln -s openmoko/trunk/oe .

cd $OMDIR/build
bitbake openmoko-devel-image
NOTE: Handling BitBake files: \ (4254/4320) [98 %]ERROR: Could not inherit file classes/image_ipk.bbclass while parsing /home/prj/moko/oe/packages/images/openmoko-sdk-image.bb
ERROR: Could not inherit file classes/image_ipk.bbclass while parsing /home/prj/moko/oe/packages/images/openmoko-image.bb
ERROR: Could not inherit file classes/image_ipk.bbclass while parsing /home/prj/moko/oe/packages/images/openmoko-devel-image.bb
NOTE: Handling BitBake files: | (4302/4320) [99 %]ERROR: Error in executing:
ERROR: Exception: Message:'FetchData' object has no attribute 'tag'
ERROR: Printing the environment of the function
ERROR: 'FetchData' object has no attribute 'tag' while parsing /home/prj/moko/oe/packages/uboot/uboot-qt2410_0.0+cvs20061030.bb
NOTE: Handling BitBake files: - (4305/4320) [99 %]ERROR: Error in executing:
ERROR: Exception: Message:'FetchData' object has no attribute 'tag'
ERROR: Printing the environment of the function
ERROR: 'FetchData' object has no attribute 'tag' while parsing /home/prj/moko/oe/packages/uboot/uboot-gta01_0.0+cvs20061030.bb
NOTE: Handling BitBake files: / (4320/4320) [100 %]
NOTE: Parsing finished. 4117 cached, 0 parsed, 184 skipped, 0 masked.
ERROR: Parsing errors found, exiting...
test@test-laptop:/home/prj/moko/build$





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

sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip
sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev
# To prevent errors in host validation
sudo apt-get install ca-certificates
# For Openmoko 2007.2 using BitBake-1.8.8:
sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg
# For building faster
sudo apt-get install quilt python-psyco ccache
# For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.
sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools
# On Ubuntu 8.04, the following was required instead of cogito
sudo apt-get install git-core
# Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh

# This may be needed only for ASU
sudo apt-get install libxtst-dev

mkdir mokomake ; cd mokomake;
wget http://www.rwhitby.net/files/openmoko/Makefile;
Or
wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile

make setup

Edit Makefile, change OM_GIT_BRANCH to one of the following:
OM_GIT_BRANCH := org.openmoko.dev # OM2007.2 (default)
OM_GIT_BRANCH := org.openmoko.asu.dev # ASU
OM_GIT_BRANCH := org.openmoko.asu.stable # ASU stable
OM_GIT_BRANCH := org.openembedded.dev # FSO

make setup-machine-freerunner

make openmoko-devel-image



Distributions
http://wiki.openmoko.org/wiki/Distributions

http://wiki.openmoko.org/wiki/OpenEmbedded

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


OpenEmbedded
http://wiki.openmoko.org/wiki/OpenEmbedded


OEandYourDistro
http://wiki.openembedded.net/index.php/OEandYourDistro#Using_OpenEmbedded_on_Linux_systems

(maybe outdated and not complete)

git.openmoko.org
downloads.openmoko.org
buildhost.openmoko.org



http://blog.leggewie.org/?p=39
apt-get’able Openembedded

echo deb http://oss.leggewie.org/oe/deb ./ >> /etc/apt/sources.list;
apt-get update;
apt-get install openembedded-sonkei;

oe-setup-sonkei dev
OR
oe-setup-sonkei stable

MACHINE=spitz bitbake nano

2008年7月7日 星期一

VirtualBox的切換Terminal

VirtualBox純文字模式的Linux還是有terminal可以切換的
Alt+ left/right arrorw - 切換前後terminal

Install X in Debian

  1. apt-get install x-window-system icewm
    then, start X by:
    # startx
    configuration is at /etc/X11/xorg.conf
  2. to start X from boot
    apt-get install xdm

2008年7月6日 星期日

終於找到寬螢幕的用法了

Acer Aspire 4720Z沒什麼大缺點
但是我就是不喜歡它的14.1"寬螢幕
以前一直以為寬螢幕code可以看長一點
但沒想到 左右一寬 上下就扁
長是長了,但是能看的行數就少了

昨天晚上一面跟 綸綸 玩,一面看些document (非常不專心的把拔)
document都是A4的pdf,在寬螢幕上更更更難看....
突然突發奇想....把它倒過來吧....
嘿...還不錯呢,一整頁的字還都能看的清楚
不用翻來翻去,直接下一頁上一頁就好了....
只是...一台長長的NB站的高高的,心裡毛毛的.... :p

Zotero

十大拒絕使用Zotero的理由 :: ten reasons for not using Zotero
http://yamje.blogspot.com/2007/10/zotero-ten-reasons-for-not-using-zotero.html


Zotero + Amazon:個人數位資料庫
http://www.chunmin.com/archives/46


[Firefox] 論文網路引用資料救星!Zotero
http://www.wretch.cc/blog/yellowbird54/8563291

http://www.zotero.org/

http://www.zotero.org/videos/tour/zotero_tour.htm

2008年7月5日 星期六

Install VMware Server Linux client package

VMware Server Linux client package is supposed to be installed at HOST side!!!

  1. require killall (psmisc), unzip(unzip), make(??, by apt-get build-dep linux-headers-`uname -r`)
  2. unzip VMware-server-linux-client-1.0.6-91891.zip ==>
    • Linux VMware Server Console
      • VMware-server-console-1.0.6-91891.i386.rpm
      • VMware-server-console-1.0.6-91891.tar.gz ==> vmware-server-console-distrib
    • Programming API: VMware-vix-1.0.6-91891.tar.gz ==> vmware-vix-distrib
    • Perl scripting API for Linux: VMware-VmPerlAPI-1.0.6-91891.tar.gz ==> vmware-api-distrib
  3. in vmware-server-console-distrib, run
    vmware-install.pl
  4. In vmware-api-distrib,
    vmware-install.pl
  5. In vmware-vix-distrib, run
    vmware-install.pl


How to install VMware Server on Linux
http://webcollab.wordpress.com/2007/01/11/how-to-install-vmware-server-on-linux/

VMware Server Linux client package裡的VMware Server Console就是我們直接跑vmware出來的那個東西,只是獨立出來提供遠端PC連到這台VMware Server來開啟VirtualMachine的工具。我把VMware Server Linux client package跟VMware Tools搞錯了...
在Fedora Core 5上安裝VMware Server
(................................................................................)
三、VMware Server Console安裝

於Windows平台安裝用以連接VMware Server的圖形化Console,亦有Linux版本,但鑒於Fedora Core 5只安裝文字模式,故以Windows為管理端。

* 下載VMware-server-win32-client-1.0.1-29996.zip
* 安裝壓縮檔內的VMware-console-1.0.1-29996.exe
* 執行程式集裡的VMware Server Console,填入安裝VMware Server的Linux的Host name、User name、Password即可。

Installing VirtualBox Guest Additions For Linux

Installing Guest Additions For Ubuntu Guests in VirtualBox
http://ubuntu-tutorials.com/2007/10/13/installing-guest-additions-for-ubuntu-guests-in-virtualbox/

Install VirtualBox Additions for an Ubuntu 8.04 Guest
http://tombuntu.com/index.php/2008/05/23/install-virtualbox-additions-for-an-ubuntu-804-guest/
***Additional Steps required for Ubuntu 8.04 guests

My Linux Guest is Debian 4.0 r0 i3

  1. Start up your Linux guest
  2. [Devices] -> [Install Guest Additions]
    if the Guest Additions iso image is not available, VirtualBox may prompt you to download the image.
  3. following steps is for Guest OS
    [Devices] -> [Mount CD/DVD-ROM] -> [CD/DVD-ROM image...] -> (Select VBoxGuestAdditions.iso)
    Your virtual Linux should recognize a new CD, mount the CD, for example:
    mount cdrom
  4. some packages are required
    • kernel header, kbuild, make, gcc,..., for building modules. Or try:
      apt-get build-dep linux-headers-`uname -r`
    • x window: require X.org or XFree86 to be installed, or there would be error:
      Could not find X.org or XFree86 on the guest system. The X Window drivers will not be installed
      and the some related to X won't be installed. But, the VirtualBox Guest Additions module and share folder support kernel module will be installed anyway.
  5. goto /media/cdrom(or wherever the CD is mounted) to install the Guest Additions,
    sudo sh /media/cdrom/VBoxLinuxAdditions.run
    sudo /media/cdrom/VBoxLinuxAdditions.run WON'T WORK in Debian with following error:
    # sudo /media/cdrom/VBoxLinuxAdditions.run
    bash: /media/cdrom/VBoxLinuxAdditions.run: /bin/sh: bad interpreter: Permission denied
  6. The installer should prompt you that it’s time to restart the virtual machine once it’s done. Just logging out and back in should work.
  7. Devices->Share Folders...->[add a new share name]
  8. mount.vboxsf [share name] [mounted directory]
  9. Add to Boot Process
    Due to the vboxvfs.ko is inserted AFTER /etc/fstab is mounted, adding to fstab WON'T WORK. It is suggested to add the mount script to /etc/init.d/vboxvfs, around:
    start() {
    (...........................)
    }
    ADD_SCRIPT_HERE
    mount -t vboxsf files /home/files

    succ_msg
    return 0
    }




on Windows Guest: \\vboxsrv\the_dir_name_you_set

2008年7月4日 星期五

eCos Building Note

http://ecos.sourceware.org/build-toolchain.html
Building a toolchain for use with eCos

  1. wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos/ecos-install.tcl
  2. sh ecos-install.tcl


Anonymous CVS Access
http://ecos.sourceware.org/anoncvs.html


TOPDIR=`pwd`
ECOS_REPOSITORY=${TOPDIR}/ecos/packages ; export ECOS_REPOSITORY;
  1. Preparation
    apt-get install automake autoconf2.13 texinfo cvs tcl tcl-dev tk tk-dev

  2. Checkout eCos base repository
    1. mkdir -p ${TOPDIR};cd ${TOPDIR};
    2. cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org/cvs/ecos co -P ecos ecos-host;
      Checkout
      cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos
      cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -r last-rhepl -P ecos
      Update
      cvs -z3 update -d -P
      cvs -z3 update -r last-rhepl -d -P
  3. Build ecosconfig
    1. mkdir -p ${TOPDIR}/ecos-host;cd ${TOPDIR}/ecos-host;
    2. ../ecos/configure --host=i686-linux-gnu -with-tcl-version=8.4;
      if failed(Ubuntu), try:
      TCL_INC_DIR=/usr/include/tcl8.4 ../ecos/configure --host=i686-linux-gnu --with-tcl-version=8.4;
    3. make CFLAGS="-march=i686" CXXFLAGS="-march=i686";
  4. Check eCos support list
    1. cd ${TOPDIR}/ecos
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig list
  5. Install Toolchain
    1. cd ${TOPDIR};
    2. wget ftp://ecos.sourceware.org/pub/ecos/gnutools/i386linux/ecoscentric-gnutools-arm-elf-1.4-2.i386linux.tar.bz2
    3. tar xf ecoscentric-gnutools-arm-elf-1.4-2.i386linux.tar.bz2
    4. export PATH=${TOPDIR}/gnutools/arm-elf/bin/:${PATH}
  6. Build RedBoot
    1. mkdir -p ${TOPDIR}/ecos-build-redboot; cd ${TOPDIR}/ecos-build-redboot;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 redboot;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig import ${TOPDIR}/ecos/packages/hal/arm/arm9/excalibur/current/misc/redboot_RAM.ecm;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-redboot/install/bin/redboot.elf
      ${TOPDIR}/ecos-build-redboot/install/bin/redboot.bin
  7. Build kernel core
    1. mkdir -p ${TOPDIR}/ecos-build-kernel; cd ${TOPDIR}/ecos-build-kernel;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 kernel;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-kernel/install/lib/target.ld
      ${TOPDIR}/ecos/packages/hal/arm/arch/current/src/arm.ld
  8. Build network stack
    1. mkdir -p ${TOPDIR}/ecos-build-net; cd ${TOPDIR}/ecos-build-net;
    2. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 net;
      an file named ecos.ecc is generated.
    3. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve;
    4. ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree;
    5. make;
      ${TOPDIR}/ecos-build-network/install/lib/target.ld
      ${TOPDIR}/ecos/packages/hal/arm/arch/current/src/arm.ld
  9. Building eCos hello Application
    1. rm ${TOPDIR}/hello-app;mkdir -p ${TOPDIR}/hello-app; cd ${TOPDIR}/hello-app;
    2. cp ${TOPDIR}/ecos/examples/hello.c ${TOPDIR}/ecos/examples/build_Makefile
    3. ${TOPDIR}/ecos/examples/build_Make.params . -v;
    4. chmod +x build_Makefile build_Make.params ;
    5. SRCS=hello.c DST=hello ./build_Makefile ../ecos-build-net;
    6. make && arm-elf-objcopy -O srec hello hello.srec -v && arm-elf-objcopy -O binary hello hello.bin -v;
  10. Building eCos httpd Application
        KERN_TARGET=httpd-kernel;\
    APP_TARGET=httpd-app;\
    IMG_TARGET=httpd;\
    ADD_PKG=" HTTPD ";\
    CP_LIST=" ${TOPDIR}/ecos/packages/net/httpd/current/tests/httpd1.c ${TOPDIR}/ecos/examples/build_Makefile ${TOPDIR}/ecos/examples/build_Make.params";\
    SRCS=httpd1.c;\
    rm ${TOPDIR}/$${KERN_TARGET} ${TOPDIR}/$${APP_TARGET} -rf;\
    mkdir -p ${TOPDIR}/$${KERN_TARGET}; cd ${TOPDIR}/$${KERN_TARGET};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig new excalibur_arm9 net ${FAILEXIT};\
    for a in $${ADD_PKG} ; do ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig add CYGPKG_$$a ${FAILEXIT};done;\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig resolve ${FAILEXIT};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig check ${FAILEXIT};\
    ${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig tree ${FAILEXIT};\
    make ${FAILEXIT};\
    mkdir -p ${TOPDIR}/$${APP_TARGET}; cd ${TOPDIR}/$${APP_TARGET};\
    cp $${CP_LIST} ${TOPDIR}/$${APP_TARGET} -v ${FAILEXIT};\
    chmod +x build_Makefile build_Make.params ${FAILEXIT};\
    SRCS=$${SRCS} DST=$${IMG_TARGET} ./build_Makefile ${TOPDIR}/$${KERN_TARGET} ${FAILEXIT};\
    make && arm-elf-objcopy -O srec $${IMG_TARGET} $${IMG_TARGET}.srec -v && arm-elf-objcopy -O binary $${IMG_TARGET} $${IMG_TARGET}.bin -v ${FAILEXIT};\
    echo ================;\
    ls ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET} ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET}.srec ${TOPDIR}/$${APP_TARGET}/$${IMG_TARGET}.bin -al;\
    echo ================;










[1] ftp://mirrors.rcn.net/pub/sourceware/ecos
[2] http://mirrors.rcn.net/pub/sourceware/ecos
[3] ftp://mirror.ac.uk/sites/sources.redhat.com/ftp/ecos
[4] http://www.mirror.ac.uk/sites/sources.redhat.com/ftp/ecos
[5] ftp://sources-redhat.mirror.redwire.net/pub/sources.redhat.com/ecos
[6] http://sources-redhat.mirror.redwire.net/ecos
[7] ftp://mirrors.kernel.org/sources.redhat.com/ecos
[8] http://mirrors.kernel.org/sources.redhat.com/ecos
[9] ftp://planetmirror.com/pub/sourceware/ecos
[10] http://planetmirror.com/pub/sourceware/ecos
[11] ftp://gd.tuwien.ac.at/opsys/ecos
[12] http://gd.tuwien.ac.at/opsys/ecos
[13] ftp://sunsite.ms.mff.cuni.cz/MIRRORS/sources.redhat.com/pub/ecos
[14] ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/ecos
[15] ftp://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[16] http://ftp.gwdg.de/pub/misc/sources.redhat.com/ecos
[17] ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[18] http://ftp-stud.fht-esslingen.de/pub/Mirrors/sources.redhat.com/ecos
[19] http://www.carfield.com.hk/mirror/sources.redhat.com/ecos
[20] ftp://ftp.unina.it/pub/Unix/cygnus/ecos
[21] http://ftp.unina.it/pub/Unix/cygnus/ecos
[22] ftp://ftp.chg.ru/pub/sourceware/ecos
[23] ftp://ftp.sun.ac.za/mirrorsites/sourceware.cygnus.com/pub/ecos
[24] http://ftp.sun.ac.za/ftp/mirrorsites/sourceware.cygnus.com/pub/ecos
[25] ftp://ftp1.sinica.edu.tw/pub3/GNU/CYGNUS/ecos
[26] ftp://ecos.sourceware.org/pub/ecos



On Ubuntu 8.04
checking for Tcl installation... configure: error: unable to locate Tcl header file tcl.h
configure: error: ../../../ecos/host/libcdl/configure failed for libcdl
configure: error: ../../ecos/host/configure failed for host

there is no such error in Debian

Re: [ECOS] Tcl install problem with current CVS
http://www.mail-archive.com/ecos-discuss@ecos.sourceware.org/msg07684.html

The issue exists for modern Tcl distributions. eCos's configure system
(look at acsupport/acinclude.m4) belives in that a TCL_INC_DIR variable
presents in tclConfig.sh. But, a new one: TCL_INCLUDE_SPEC had been
entered in modern tclConfig.sh and nowadays it replaces old variable.
So, try to build ecosconfig as
TCL_INC_DIR=/usr/include/tcl8.4 ../host/configure --with-tcl-version=8.4
or add TCL_INC_DIR variable in your site's tclConfig.sh.
Sergei



080706
Debian+VBox
I installed a Debian 4.0 r0 i3 on VirtualBox, and also the share folder support, and trying to access the shared folder on my Ubuntu /home, but some error occurred. I was root in Debian, but I was like normal user on the shared folder. Even if I I can create file, I failed whenever I try to checkout the eCos source with cvs
# cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org/cvs/ecos co -P ecos ecos-host;
cvs [checkout aborted]: cannot open CVS/Entries.Log: Invalid argument
And ls -al ecos/CVS:
# ls ecos/CVS -al
drwxr-xr-x 1 root root 4096 2008-07-05 13:40 .
drwxr-xr-x 1 root root 4096 2008-07-05 13:40 ..
-rw------- 1 root root 0 2008-07-05 13:40 Entries
-rw------- 1 root root 3753948160 2008-07-05 13:40 Entries.Log
-rw------- 1 root root 5 2008-07-05 13:40 Repository
-rw------- 1 root root 47 2008-07-05 13:40 Root
Even if I checkout code from host, I failed at configuration:
# ../ecos/configure --host=i686-linux-gnu --with-tcl-version=8.4
(.........................................................)
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... c++
checking whether the C++ compiler (c++ ) works... yes
checking whether the C++ compiler (c++ ) is a cross-compiler... yes
checking whether we are using GNU C++... yes
(.........................................................)
checking for a 64 bit data type... long long
checking size of int *... configure: error: can not run test program while cross compiling
configure: error: ../../../ecos/host/infra/configure failed for infra
configure: error: ../../ecos/host/configure failed for host
while it is OK on Debian+PC.


080708
I tried again in a samba shared folder.
  • checkout eCos: No error occurred, just slooooooooow....
  • eCos configuration can be ran successfully. Neither the cross-compiler identification error has occurred.

I already stop trying to build eCos on virtual machine, because I finally fixed the building problem on Ubuntu. Refer to the above steps.


cat > x.ecm << __eof
cdl_component CYG_HAL_STARTUP {
user_value ROMRAM
};
cdl_option CYGBLD_GLOBAL_CFLAGS {
user_value "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O1 -gdwarf-2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority"
};

cdl_option CYGBLD_GLOBAL_LDFLAGS {
user_value "--no-target-default-spec -Wl,--gc-sections -Wl,-static -g -O1 -nostdlib"
};

__eof
${TOPDIR}/ecos-host/host/tools/configtool/standalone/common/ecosconfig import x.ecm;
rm x.ecm -fv;