2007年4月21日 星期六

bug fixed and release

v4.0 相當的不錯,應該是把問題解掉了。
經過四十次的驗證,應該沒有問題。
而且明確找到原因啦。

2007年4月19日 星期四

status of debian arm versatile qemu(4/19)

Applied my patches, I found
1. system work or kernel page error.
2. debian installation always work without kernel hang.
in that case, blue screen without anything.
3. I guess it is hardware model error.

But we need more systematic method to solve problem.

I try to debug by the follow steps.

First, I saw the kernel error in screen.
Because I use pyvnc2swf, I can saw all screen information in installation.

It show that

sym_evaluate_dp 0xa4/0x178
sym_compute_residual 0x78/0xe4
sym_interrupt 0xf0/0x18d8
sym53c8xx_intr 0x3c/0x6c
handle_IRQ_event 0x44/0x84

and then I use arm-elf-objdump -S to dump all of vmlinux > log
vmlinux has debug information, but vmlinuz not.
hence, you will get only assembly code if you dump vmlinuz.

and then you will find the memory error happen address in C code.


and then analysis these code
1. SYM_CONF_MAX_SG is 96. but (r0 = 0x1c8)
so that, some thing is wrong.

Another method is to enable debug mode in emulator,
and trace what happen inside. we can monitor all of transaction,
and find the problem.

for example above, we find the problem is happened in SCSI ISR.
Because of some mismatches, the ISR can not handle it correct.

2007年4月12日 星期四

Debian Arm Versatile Qemu stability

  • Always work
    • without vnc viewer
    • with vnc recoder pyvnc2swf
    • with vnc viewer -viewonly
  • Sometimes work
    • remote vnc viewer
I guess there are bugs in vnc server.

2007年4月10日 星期二

debian auto installation timeout


loop
sleep 10s
check the job status
if already wait 5000s
kill the job
else
continue wait
endloop

2007年4月8日 星期日

debian etch is released

my debian arm qemu version v2.8 is also released.(4/8)

Now, stability testing is running.

No, this version is not stable enough.(4/9)
apply vnc patch.
v3.0 is under testing.

v3.0 is work under 26 times continuous installation testing.(4/10 14:50)

v3.0 in ubuntu is under testing.(4/10 7:50)
v3.0 is also work under 6 times testing(4/10 14:50)

2007年4月7日 星期六

qemu upstream

原先我們一直出新的patch給upstream用,以為qemu的upstream主要在穩定,但是系統太複雜,核心的patch會更動到所有的架構,今天來個irq patch, arm就不會動了,所以目前是給一個qemu cvs snapshot的版本,然後再上patch,這樣比較不會有問題啦........跟upstream還有點煩...

ps. 這個bug花點時間也找到了...

2007年4月4日 星期三

lsi_scsi still have bug!

在一次網路不穩定(apt-proxy)的狀況下出現了下面的問題.正常狀況下似乎不會發生
lsi_scsi: error: Unimplemented message 0x0d
lsi_scsi: error: Unimplemented message 0x0c
lsi_scsi: error: Reselect with pending DMA
lsi_scsi: error: Reselect with pending DMA
lsi_scsi: error: Reselect with pending DMA

QEMU看起來還不錯用啦

debian ARM versatile QEMU
angstrom ARM versatile QEMU
兩個環境相當的不錯!!
目前在我的環境 x86 debian sarge or debian etch都蠻穩的,系統沒有什麼問題.

ps.但是debian installer在別的環境下不行, 連ubuntu都會掛!!!Fedora是一定掛........
但是我個人覺得這個應該是debian installer software的bug,硬體應該沒問題。
看debian etch installer 的bug list還真多問題。

ps.後來覺得debian installer software應該沒有問題。是hardware model的bug.(4/10)
ps.我不知道什麼時候會再反過來

2007年3月25日 星期日

qemu arm versatile bug hunting

  1. lsi scsi bug patch -> upstream merged
  2. smc network patch -> upstream merged
  3. dhcp server: option interface-mtu 1500; debian arm versatile installer send size > 1500 packet to network, but the host network MTU is 1500. /sbin/ifconfig will indidate the host network MTU -> not real problem?
  4. install apt-cacher(not apt-proxy) to get network more stable.
  5. tun/tap: /etc/network/interfaces : bridge_fd 1
  6. the vnc server in qemu is not so robust. you must disconnect normally. real vnc viewer F8 will pop the menu, and then click "quit viewer"
  7. DNS server is not stable. 140.113.250.135 is nctu primary DNS server and assign ip address for mirror site
  8. RTC not implement, delay will be infinite delay(I guess debian installer hang)
  9. apt-proxy sometimes need restart because the connections are not normal termination or the mirror site synchronization problems. If information show "some package can not got", you need to restart apt-proxy. (you should change to apt-cacher)
I don't know if the fixed is useful.
But I can install arm debian in qemu 30 times automatically without problem.
The version is debian-v2.4. the version is a private version control number not link with upstream.

Wang Cheng Yeh is me.

2007年3月23日 星期五

linux debug under qemu

之前說qemu系統不穩,所以需要debug,
當你發現系統hang住了,你可以進到qemu monitor: ctrl-alt-2,
來個log in_asm,exec,cpu ...,
再繼續cont....
你就可以看到kernel的部分在搞什麼鬼,
再來你需要去看kernel的System.map就會知道是哪個function出問題,
之後就看個人修行啦!!
這樣的debug是kernel level debug,
目前versatile qemu最大的問題是debian installation裝不起來,
ctrl-alt-2 and sendkey ctrl-alt-f1 ~ f4可以切換到console看看debian出甚問題,
這樣可以看到gui的後面installer在做什麼.

2007年2月5日 星期一

qemu uart console

`-nographic'
Normally, QEMU uses SDL to display the VGA output. With this option, you can totally disable graphical output so that QEMU is a simple command line application. The emulated serial port is redirected on the console. Therefore, you can still use QEMU to debug a Linux kernel with a serial console.

所以只要輸入到uart就可以對應到console

2007年1月27日 星期六

debian qemu : usb

系統不穩定,常常就不會動,或者當掉。
但是embedded system angstrom的就沒有這個問題。debian installer常常partition的建立會出問題。

1. 目前是disk image type raw size 2G and file system ext2
2. 安裝的時候不要上tap/tun網路
這樣似乎就沒有問題....不知道那裡出問題了.....

usb非常重要,缺什麼,就把usb的device買來就可以裝上去,
可是debian etch的kernel package居然沒有usb,所以rebuild kernel是必須的,
還好debian's way的方法在x86上有接觸過,
build linux kernel in debian


install kernel image version XXX
download kernel-source version XXX package
cd /usr/src
tar jxvf kernel-source-XXX
ln -s kernel-source-XXX linux
cd linux
make xconfig
in GUI

load configuration from file
/boot/config-XXX

save and exit

fakeroot make-kpkg clean
fakeroot make-kpkg --append-to-version=.cywang --initrd kernel_image



動作
1. download debian org.tgz and versatile patch
2. tar org.tgz and patch gz
3. cd linux-2.6.18;patch -p1 < patchfile
4. apt-get install kernel-package fakeroot libncurses5-dev
5. dpkg-buildpackage -rfakeroot
rebuild
debian qemu
rebuild

2007年1月21日 星期日

gcc 4.1 v.s. gcc 3.4

familiar 0.8.4目前使用gcc3.4
angstrom 2007.1現在使用gcc4.1
gcc之前有自己extend c/c++ language,現在要拿掉了,所以有些語法會出問題,這部份會變得比較麻煩,所以現在gcc是越新版的就會越嚴格,這也是沒有辦法的,但是對於distribution就是大麻煩。目前我的規劃是build兩套distribution,familiar比較舊但是功能完整,angstrom比較新但是功能比較少。但是這是遲早要解決的問題,只要angstrom都沒有問題,我想就只build angstrom.

2007年1月15日 星期一

linux under embedded system

手持式裝置如果要使用linux,就需要整套完整的distribution,就如同桌上型的電腦以及伺服器一樣,都需要整套distribution,redhat,debian就是這樣的一整套系統,而手持式裝置只是另一種資源更加缺乏的系統而已。就好像比較舊的電腦,比較小的螢幕。但是這樣也需要修改很多東西才能適合在手持式裝置上面運行。目前這個環境並不統一,每個計畫玩自己的,比較共通的有幾點,都是debian出來的,使用ipkg作為套件管理,使用cross compile的方式來編譯。HP有HP的支持群,Sharp有Sharp的支持群。
familiar主要是HP的device,->發展久,但還沒有qemuarm,要修改
openzaurus主要是sharp的device,->發展久也沒有qemuarm,要修改
angstrom是openzaurus的繼承者,宣稱要支援各家的device.->剛發展不久,有qemuarm
總之在openembedded環境下不要使用generic distribution因為那會變成三不管地帶,build會error!
debian如果你有硬碟,或者有夠大的flash而且cpu,dram,也要夠力,也可以的啦..
現在arm cpu可以上到1GHz了,以前的問題變得小很多,除了power之外,其他都還好啦。
其實angstrom與familiar最後會非常接近,就好像debian v.s. ubuntu,原先他們也要合併,後來好像又沒有。

qemuarm to familiar
familiar/packages/linux/linux-rp-2.6.18 -> kernel
familiar/conf/machine/qemuarm.conf -> config
setup/build-env.sh -> GUI config
看起來狀況不錯,
上面所說的都是GPE的部份,OPIE的部份因為現在是戰國時期,所以不建議使用,新的Qtopia 4系列已經出來,而且與OPIE不相容,似乎是要把OPIE丟掉,trolltech這家公司把OPIE的開發人員挖過來,OPIE大失血,再加上版本不相容,所以現在不要去碰OPIE啊!
ps. 玩了三天的一些小體驗

所以目前規劃是familiar angstrom debian

2007年1月14日 星期日

output function validation

Audio -> PCM data -> ffmpeg convert from PCM to WAV
ffmpeg -f s16le -ar 48000 -ac 2 -i xxx.pcm xxx.wav

-f force format
s16le -> signed 16 bit little endian
-ar is your sample rate in Hz
-ac is how many channels. Stereo is, of course, 2
-i input file name

Video -> R G B matrix -> octave show image

GPE QEMU

1) mount xxx.ext2 /xxx -o loop
2) remove /xxx/etc/X11/Xinit.d/30xTs_Calibate
comment "keylaunch -f /etc/X11/gpe-login.keylaunchrc &"
in /xxx/etc/X11/gpe-login.setup

3) umount /xxx

4) qemu-system-arm -M versatilepb -kernel zImage.bin -hda xxx.ext2 -append "root=/dev/sda"

5) resize harddrive to 1G
/sbin/resize2fs xxx.ext2 1000000
-> file size is too large

6) change file system(qcow environment is not ready: resize, loop mount...)
qemu-img convert xxx.ext2 -O qcow xxx.qcow


ps initrd.gz file format cramfs: gunzip initrd.gz; mount -t cramfs -o loop initrd d

2007年1月8日 星期一

QEMU & develop environment & arm linux distribution

openembedded is very good
http://www.openembedded.org/
以前弄gcc cross compile就快要瘋掉,現在只要下個指令就做好了,因為patch都是別人在上的啦.
再來就是整合到qemu的模擬環境.
http://folks.o-hand.com/richard/qemu.html
qemu如果要用NFS root的話,NFS server必需要在別台機器上,不能同台機器的不同網路卡,而且網路要在一開始就能work,這樣才可以正常開機.還有檔案的權限要開,chmod -R 777 /nfs_root_file.

QEMU network

一台機器兩張網路卡,一張是主機網路,另一張是虛擬機器的網路,兩個獨立的IP。雖然在網路端最後是合併,但是這樣相當簡單。然後經由bridge把一張網路卡連上虛擬機器的網路裝置,因此設定虛擬機器的網路跟主機網路設定相當類似,只是IP不同而已。
詳細狀況如下
/etc/network/interfaces
auto eth0
...
是主機網路設定

br0是bridge一端是接eth1

auto br0
iface br0 inet static
address 140.113.x.a
network 140.113.x.0
netmask 255.255.255.255
broadcast 140.113.x.255
gateway 140.113.x.254
bridge_ports eth1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
再來是qemu啟動的時候的設定

使用下面的script可以把另一端的網路裝置連上bridge
#!/bin/sh
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
sudo /usr/sbin/brctl addif br0 $1
sleep
但是這部份是在qemu啟動的時候,才會出現另一個網路裝置,
所以script是"qemu -net tap,script=script_file"的部份所設定的

所以qemu網路部份是 qemu-system-arm -net nic -net tap,script=script_file

這樣模擬環境的虛擬網路已經設定完成,

再來是模擬器上的arm linux網路設定
ifconfig eth0 addr 140.113.x.a
ifconfig eth0 netmask 255.255.255.0
ping 140.113.1.1
-> network is unreachable
ip route add default via 140.113.x.254

小故事一則,一個狗窩有兩隻狗,一隻大狗一隻小狗,主人就做了兩個狗門,大狗走大門小狗走小門。人家就問他為什麼不只做一個大門,給兩隻狗走。

但是我們的機器就是有兩張網路卡阿,也就是他本來就有兩個門幹麼不用呢。

ps

If you get an error message like warning: could not open /dev/net/tun: no virtual network emulation, install vtun package, run it ( /etc/init.d/vtun start) and set /dev/net/tun universally read-writable (chmod a+rw /dev/net/tun).