This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

2012年4月8日 星期日

縮減 QEMU ,KERNEL code base



荒廢很久的blog今天心血來潮 ,就來個一篇吧 .
最近無聊在縮減code base,其實也不是很厲害的工作,就是看到很多project被移植到各種平台所以code base的大小明顯很大,當然那些開發團隊也會寫出很強大的building system,問題如果只是一個業餘喜者好來玩玩看,各種平台的code反而會造成困擾,所以我的目標很簡單就是把跟自己想看架構相關的code留著就好,其他都刪除,這個目標很容易實現不是在做最佳化的工作只是在做苦工...

這邊我以QEMU for i386為例:
1.先用官方QEMU 1.0.1 編譯出一個i386的執行檔,然後把過程都紀錄下來
./configure --target-list="i386-softmmu" --enable-debug-tcg --disable-user --disable-pie --disable-smartcard --disable-libiscsi --disable-smartcard-nss --disable-guest-agent --enable-debug --disable-kvm --disable-blobs --disable-linux-user --disable-xen
make V=1 > trace.txt
2.慢慢 parse trace.txt的內容把每的檔案的編譯,連結都過程都搞定在另外寫一個makefile,就可以收工了
3.測試工具用 cloc [
http://cloc.sourceforge.net/]
有圖有真像
改造前:











改造後:









可以看到結果減少了70萬左右的程式碼,所以改造大成功 !! XD
我的成果放在 :https://github.com/wayling/i386QEMU 可以參考一下摟!!


目前kernel還沒完成但初步結果很嚇人,大概是從1000萬降到100萬左右吧~我的測試平台是beaglebone.
這結果很正常,有時聽到別人說kernel幾百萬行,別被嚇到了,因為有九成的程式碼都跟你無關的 !!不過如果你是維護者可能就另當別論了 XD


ps.現在大概一年一篇文章,所以明年見摟...Orz

2011年2月9日 星期三

BT on OverSim

因為想模擬BT 找到可以用的好像就Bt on OverSim
作者提供的有點小問題~要到討論區挖解答跟DEBUG











[reference]
A BitTorrent Module for the OMNeT++ Simulator

2010年8月27日 星期五

qemu 測試linux kernel

用qemu來測試kernel的行為其實蠻適合的
最近把console導到serial在導到終端機裡,看起來順眼許多

#qemu -kernel arch/x86/boot/bzImage -append console=ttyS0 -serial stdio

2010年8月23日 星期一

linux 2.6 book [英文版]

無聊收集一下目前有哪些linux 2.6的書[英文版]!!
其他相關
1. 中文版不是翻譯書,
2. 驅動的書,
3. linux 2.4
4 舊版linux,
5. 雜項書籍
...有機會在補
網路方面我實在不熟沒在收集~

有漏的話將來在改!



[2.6.7]有繁體














[2.6.10]有繁體












[2.6.11]有繁體















[2.6.24]有簡體















[2.6.30]















有機會的話最好每本都看~
反正可以只看你想看的主題

如果一定要推荐的話會是ULK吧
這本最適合入門跟參考

Linux Kernel in a Nutshell

Linux Kernel in a Nutshell




















這本很少頁,但對新手開發驅動其實很有用,算是經驗談
由其是第7章,值得看看,教你如何移除不需要的驅動,跟找到合適的驅動
其中有兩個工具
1. find_all_modules.sh
2. get-driver.sh

非常有用!!

2010年7月12日 星期一

LinSched: The Linux Scheduler Simulator

Linsched[http://www.cs.unc.edu/~jmc/linsched/]

最近看了幾篇scheduler的論文, 發現有很多拿 linux kernel做實驗的論文,其中一篇把linux kernel的scheduling subsystem直接移到user space感覺不賴!!可見作者對kernel有一定程度的理解,把其他不需的的很多都移掉了.

以下是作者把kernel很多部份移除後還能動的部份.

2010年7月7日 星期三

[BFS] Brain_Fuck_Scheduler

最近在看Scheduler的東西 , 找到幾篇文章寫關於SD vs CFS的故事

蠻有趣的!

這故事還有續集但好像沒人提過!

幾篇文章都說Ingo Molnar的CFS擊敗Con Kolivas(ck)的SD 成為主線

scheduler,然後ck退黨消失!

故事的後續就是ck於2009捲土重來, 用他的Brain FuckScheduler(BFS)跟主流CFS分庭抗禮!!

LKML上又再次槓上Ingo Molnar~果然刺激阿!

我程度不夠無法比較出誰好!

所以列出參考資料讓有興趣人人看看

BFS wiki
[http://en.wikipedia.org/wiki/Brain_Fuck_Scheduler]

ck的BFS
[http://users.on.net/~ckolivas/kernel/]