2013年8月1日木曜日

Impression of "The secret garden"


Well, the topic of today is "The secret garden".

I don't mean the famous band of  "secret  garden" even though I like them quite much, I mean the classic novel "The Secret Garden". I got a kindle version from amazon, while it probably little old fashion, It is a pretty and lovely book, and it is free.

There are no much difficult vocabularies at this book, sentences are plain but attractive, Reading the book, you cannot help becoming to little Mary, feeling lonely, sorry, worry and happy as the little girl did in the book. I were impressive of the beauty words describing moor, you can smell the fresh wind was blowing from the moor when reading the describing of moor's season changing. For example, there is a describing of chapter 7,  "The high, deep, blue sky arched over Misselthwaite as well as over the moor, and she kept lifting her face and looking up into it, trying to imagine what it would be like to lie down on one of the little snow-white clouds and float about. ", can you feel that? The sky, the cloud and the little Mary consist of a brilliant picture in readers mind. Just only one sentence. I hope someday I can write the words like this.

As a novel, it should keep giving reader a emotion active rather than a beautiful static scenery. The book provide a main clue the secret garden, not scary at all but mysterious enough. Although you can say that all story just is an adventure of a little girl, you would find that is really amazing even more attractive than those such as vampires, star wars, and batman and so on.

At last, that is a story which teacher you how to love. Nowadays, a increasing number of children like to stay in home, playing video game, chatting through the Internet day after day. They had forget how to talk with others, have no idea what is the nature, living in a virtual world lonely. They closed their heart and to be quite contrary. How such is like the little Mary? She were such a girl when she arrived at Misselthwaite Manor as she had never know what the love is. When she pursuit the secret of secret garden, she gradually changed herself by getting help of her friends robin, Martha, Dickon, finally she got strong enough and helped her cousin.

Everyone can read himself/herself from the story, everyone have a secret garden in his/her heart. Let's find it.

2010年1月20日水曜日

Debug in Qemu

Now it is time to try the debug in qemu.

1. Start the qemu use the switch "-s"
$ qemu-system-arm -s -kernel uImage --nographic -serial stdio -M mini2440

2. Run the gdb with the uboot, and then connect to the port 1234
$ arm-none-linux-gnueabi-gdb ~/mini2440/bootldr/mini2440/u-boot
(gdb) target remote localhost:1234

all right, you can debug the uboot now ^_^

Reference url:
http://www.h7.dion.ne.jp/~qemu-win/qemu-doc-ja.html#SEC29
http://www.technochakra.com/gdb-debugging-in-assembly/
http://wiki.linuxmce.com/index.php/Mini2440

2010年1月16日土曜日

Qemuでmini2440の試験環境構築

一、nfsとtftpの機能を使いたいので、先日作成したバッチファイルを使ってネット環境を設定
$ sudo bridge.sh eth0
$ ifconfig
br0 Link encap:Ethernet HWaddr 00:0a:e4:25:4e:5c
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20a:e4ff:fe25:4e5c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13185 errors:0 dropped:0 overruns:0 frame:0
TX packets:14223 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:541714 (541.7 KB) TX bytes:8957464 (8.9 MB)

eth0 Link encap:Ethernet HWaddr 00:0a:e4:25:4e:5c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


二、バッチファイルによってQemuを起動する
$ sudo qemu-boot.sh nfs uImage 192.168.2.1 /home/arm/mini2440/rootfs mini2440
U-Boot 1.3.2-mini2440 (Oct 6 2009 - 12:51:09)

I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: Bad block table not found for chip 0
Bad block table not found for chip 0
64 MiB
*** Warning - bad CRC or NAND, using default environment

USB: S3C2410 USB Deviced
In: serial
Out: serial
Err: serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot: 0
MINI2440 #


三、u-bootでipaddrとserveripを設定
MINI2440 # setenv ipaddr 192.168.2.2
MINI2440 # setenv serverip 192.168.2.1


四、kernelをtftpで30008000にダウンロード
MINI2440 # tftpboot 30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
TFTP from server 192.168.2.1; our IP address is 192.168.2.2
Filename 'uImage'.
Load address: 0x30008000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
###########
done
Bytes transferred = 2051788 (1f4ecc hex)

MINI2440 # md 30008000
30008000: 56190527 243ee462 e986514b 8c4e1f00 '..Vb.>$KQ....N.
30008010: 00800030 00800030 e7051465 00020205 0...0...e.......

五、
nfsでrootfsをマウントするように、起動パラメータを設定
MINI2440 # setenv bootargs console=ttySAC0,115200 noinitrd init=/sbin/init mini2440=1tb ip=192.168.2.2 root=/dev/nfs rw nfsroot=192.168.2.1:/home/arm/mini2440/rootfs

六、kernelを起動
bootm 30008000


参考URL:
http://wiki.linuxmce.org/index.php/Mini2440





2010年1月15日金曜日

Qemu.mini2440

Got sources by git, use the commands as follow:

$ git clone git://repo.or.cz/qemu/mini2440.git
$ cd mini2440
$ ./configure --target-list=arm-softmmu --disable-kvm
$ make
$ sudo make install

put your u-boot.bin into "./mini2440/", and then

$ qemu-system-arm -kernel uImage --nographic -M mini2440
( Carefully, we didn't specific the path of u-boot.bin, because the path had been fix in sources,

image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));
if (image_size <>
image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));
if (image_size > 0) {
if (image_size & (512 -1)) /* round size to a NAND block size */
image_size = (image_size + 512) & ~(512-1);
mini2440_printf("loaded override u-boot (size %x)\n", image_size);
s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated */
}
so, you should put the u-boot.bin into mini2440 folder first )

ok, now is u-boot time

S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded default u-boot from NAND
QEMU mini2440_reset: loaded override u-boot (size 38c00)
QEMU mini2440_reset: loaded uImage (size 1f5000)
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=48
S3C: CLK=304 HCLK=304 PCLK=304 UCLK=48
S3C: CLK=304 HCLK=101 PCLK=50 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=405 HCLK=101 PCLK=50 UCLK=48


U-Boot 1.3.2-mini2440 (Jan 13 2010 - 19:40:10)

I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: Bad block table not found for chip 0
Bad block table not found for chip 0
64 MiB
*** Warning - bad CRC or NAND, using default environment

USB: S3C2410 USB Deviced
ERROR: usbd_device_event_irq(), 613: (3401cd88,1) NULL device or device->bus
ERROR: usbd_device_event_irq(), 613: (3401cd88,2) NULL device or device->bus
ERROR: usbd_device_event_irq(), 613: (3401cd88,3) NULL device or device->bus
In: serial
Out: serial
Err: serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot: 0
MINI2440 #



2010年1月14日木曜日

Fedoraでmini2440のQemu環境構築

① sudoの時、PATHが変わってしまうので、下記の命令が.bashrcに追加して解決できた。
alias sudo='sudo env PATH=$PATH'

② Qemuを使う前、bridgeの設定がバッチファイルにまとめ
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: `basename $0` {network interface name}."
exit
fi

# get ipaddress from ifconfig
IPADDR=`/sbin/ifconfig $1 | grep "inet addr" | awk '{ print $2}' | awk 'BEGIN { FS=":" } {print $2}'`
# get netmask from ifconfig
NETMASK=`/sbin/ifconfig $1 | grep "Mask" | awk '{ print $4}' | awk 'BEGIN { FS=":" } {print $2}'`

if [ -z $IPADDR ]; then
echo "Not found the ip address"
exit
elif [ -z $NETMASK ]; then
echo "Not found the netmask"
exit
fi

sudo /sbin/ifconfig br0 down
sudo /usr/sbin/brctl delbr br0
sudo /usr/sbin/brctl addbr br0
sudo /usr/sbin/brctl addif br0 $1
sudo /sbin/ifconfig br0 up
sudo /sbin/ifconfig $1 0.0.0.0 up
sudo /sbin/ifconfig br0 $IPADDR netmask $NETMASK

③起動と終了のスクリプト
[arm@localhost images]$ more ~/tools/qemu-ifup
#! /bin/sh
/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addif br0 $1

[arm@localhost images]$ more ~/tools/qemu-ifdown
#! /bin/sh
/usr/sbin/brctl delif br0 $1
/sbin/ifconfig $1 down

④Qemuの命令が長いので、バッチファイルを作ろう
#! /bin/sh
METHOD=$1
SCRIPTPATH="/home/arm/tools"
SCRIPT="$SCRIPTPATH/qemu-ifup"
DOWNSCRIPT="$SCRIPTPATH/qemu-ifdown"
NETFLAG="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$SCRIPT,downscript=$DOWNSCRIPT "

if [ $METHOD == "file" ]; then

MACHINE=$4
KERNEL=$2
ROOTFS=$3
EXPECTED_ARGS=3

if [ $# -ge $EXPECTED_ARGS ]; then

if ! [ -f "$KERNEL" ];then
echo "not found kernel file"
exit
elif ! [ -f "$ROOTFS" ];then
echo "not found rootfs file"
exit
elif [ -z "$MACHINE" ];then
MACHINE=versatileab

fi

qemu-system-arm -M $MACHINE -kernel $KERNEL -append root=/dev/sda1 $ROOTFS $NETFLAG
exit
fi

elif [ $METHOD == "nfs" ]; then

MACHINE=$5
NFSPATH=$4
KERNEL=$2
HOSTIP=$3
EXPECTED_ARGS=4

if ! [ -f "$KERNEL" ];then
echo "not found kernel file"
exit
elif [ -z "$MACHINE" ];then
MACHINE=versatileab
fi

qemu-system-arm -M $MACHINE -kernel $KERNEL -append root="/dev/nfs nfsroot=$HOSTIP:$NFSPATH rw ip=dhcp" $NETFLAG
exit
fi

echo "Usage: `basename $0` (file/nfs) Kernel (Rootfs/(Hostip Nfspath) [Machine]"


2009年9月16日水曜日

xclexeのリリース

I made the program for clipboard extension of Linux

everything xclexe can do is just keep watching the clipboard , and throw it to specific application by the rule.
Don't worry about you are no idea of the rule. Just execute it, and then you will get the sample under the $HOME/.xclexe

[global]
#x=50
#y=50
#width=840
#height=70
#border_width=2

[exec]
#PATH=/usr/bin/ed2k
#KEYWORD=ed2k:
#FLAG=1

There are 2 section in rule file, The first one is [global], you can define the windows size and position at here.
And second one is [exec], you can define the specific application rule at here. if you have one more rule just need to append a new [exec] section.

For example.
[exec]
PATH=/usr/bin/ed2k
KEYWORD=ed2k:
FLAG=1

PATH means specific application path.
KEYWORD means the keyword of clipboard content.
FLAG means searching rule, 1 means check the content head, 2 means check the content end, 0 - means search the keyword.

The sample means keep check the clipboard content, if the content begin with "edk2:" string,
Then clipboard content would be the first parameter execute by the /usr/bin/ed2k.
Translate to the comand line is:
/usr/bin/ed2k

BTW, # means comment out.

enjoy it!

you can download the sources from the URL
http://file7.brsbox.com/download.php?sid=cd48f0bb55ece2d19cb4329a866bfbab&fc=e63d5a4a126d0ad675631a5688bdf375/xclexe.tar.gz