<?php xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0">
<channel>
<title><![CDATA[愛做夢的蘆薈]]></title>
<link>http://daydreamer.idv.tw/</link>
<description><![CDATA[Day Dreamer&#39;s Blog]]></description>
<language>utf-8</language>
<copyright><![CDATA[CopyRight 2006 F2Blog.com All Rights Reserved.]]></copyright>
<webMaster><![CDATA[jemicheng@gmail.com]]></webMaster>
<generator>F2blog 1.2 build 03.01</generator> 
<image>
	<title>愛做夢的蘆薈</title> 
	<url>http://daydreamer.idv.tw/attachments/8181119891.jpg</url> 
	<link>http://daydreamer.idv.tw/</link> 
	<description>愛做夢的蘆薈</description> 
</image>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-67.html</link>
	<title><![CDATA[Android on QT2410-自己搞自己]]></title>
	<author>Joey</author>
	<category><![CDATA[嵌入式系統]]></category>
	<pubDate>2010-02-04 17:41</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-67.html</guid>	
	<description><![CDATA[<p><font size="2">Android已經推出一段時間了,我本來猜測這個東西應該在2410系列的平台應該有數不清的resource和成品供我測試,結果發現google到的教學很多,但system image卻很少,就算有,也不能運行在2410上,不然就是運行到一半就crash,我本想抱著淺嘗則止的心情去試android,結果後來欲罷不能,把kernel和android rootfs的source全抓下來自己編,整整玩(or 被玩)了一個星期才搞到android在qt2410上可以動,image可以在這邊下載,包含kernel及android rootfs</font></p><p><font size="2"><!--more--><br /><a href="http://homepage8.seed.net.tw/web@5/jemic/android.part1.rar">image 1</a></font><br /><font size="2"><a href="http://homepage8.seed.net.tw/web@5/jemic/android.part2.rar">image 2</a></font><br /><font size="2"><a href="http://homepage8.seed.net.tw/web@5/jemic/android.part3.rar">image 3</a></font><br /><font size="2"><a href="http://homepage8.seed.net.tw/web@5/jemic/android.part4.rar">image 4</a></font></p><p>運行圖片如下</p><p><img style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/201002/5157694344.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/201002/5157694344.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/201002/5157694344.jpg" /></p><p><img style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/201002/9593894597.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/201002/9593894597.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/201002/9593894597.jpg" /><br /><font size="2">中間的心酸我想以後有時間再慢慢把心得post在這裡,包含build android,更改linux driver,校準touch screen,但我比較遺憾的是改double frame buffer失敗,關於framebuffer的控制我還要在想想,為什麼flipping會失敗,也希望有這方面經驗的人路過此地能給小弟一點建議</font></p><p><font size="2">小弟目前的framebuffer pan_display的架構如下,</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-66.html</link>
	<title><![CDATA[Regular expression-跟brainfuck差不多的東西]]></title>
	<author>Joey</author>
	<category><![CDATA[程式設計]]></category>
	<pubDate>2009-11-13 15:37</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-66.html</guid>	
	<description><![CDATA[<p><font size="2">最近好像有點流行短碼或符號語言之類的程式寫法,市面上也出了幾本書,</font><a href="http://zh.wikipedia.org/wiki/Brainfuck"><font size="2">brainfuck</font></a><font size="2">也是符號語言的代表之一,看完wiki上的brainfuck程式,我真他x的想吐血,我不曉得工作上交接這種東西會有誰願意,小弟最近也是陷入類似brain fuck的regular expression地獄,regular expression又臭又長就算了,連GNU的regex library也這麼的不堪用,一些簡單的case也無法處理</font></p><p><!--more--></p><p><font size="2">小弟一開始先拿unsigned integer去試GNU regex library,範例如下,unsigned的regular expression可以在</font><a href="http://regexlib.com/Search.aspx?k=unsigned&amp;c=3&amp;m=5&amp;ps=20"><font size="2">Regular expression library</font></a><font size="2">找到,其表達示為&rdquo; ^\d*$&rdquo;</font></p><p>&lt;coolcode lang=&quot;cpp&quot;linenum=&quot;off&quot;&gt; int regGNUunsigned(char *num) <br />{ <br />regex_t preg; <br />char errbuf[256]; <br />int errcode; <br /><br />char *regex=&quot;^\</p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-65.html</link>
	<title><![CDATA[Reading file in kernel-簡單但實用]]></title>
	<author>Joey</author>
	<category><![CDATA[程式設計]]></category>
	<pubDate>2009-10-13 15:18</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-65.html</guid>	
	<description><![CDATA[<p><font size="2">在embedded的設備上,driver需要讀取某些設定檔並根據設定值設定硬體,除了ioctl, file read/write之外,最簡單的方式莫過於直接在kernel space進行設定檔的讀寫,不過通常&rdquo;寫入&rdquo;這個功能很少用到,所以我略過這個東西不提</font></p><p><!--more--></p><p><font size="2">在kernel讀取檔案的方式非常簡單,小弟粗分為三個步驟,這三個步驟後方所列的就是kernel的API<br />1.Open file: filp_open<br />2.Read file: f_op-&gt;read<br />3.Close file: filp_close<br />程式的範例請直接參考下面所列,</font><font color="#ff0000" size="2">程式裡面比較值得一提的是get_fs和set_fs,kernel會根據set_fs的設定值決定要不要檢查讀/寫memory的界限,如果set_fs傳入的參數是kernel_ds,那kernel會bypass memory 界限的檢查</font><font size="2">,經過這樣的設定,才能正確取得檔案資料</font></p><p>&lt;coolcode lang=&quot;cpp&quot;linenum=&quot;off&quot;&gt; #include &lt;linux/kernel.</p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-64.html</link>
	<title><![CDATA[ttysnoop-沒有螺絲起子的日子]]></title>
	<author>Joey</author>
	<category><![CDATA[嵌入式系統]]></category>
	<pubDate>2009-08-25 10:49</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-64.html</guid>	
	<description><![CDATA[<p><font size="2">上個月去VA出差,因為離開辦公室的時候太匆忙,就忘了帶一樣一定會用到的工具-六角螺絲起子,本來以為一定不會慘到要拆盒子看console的下場,沒想到還是這麼好運, 因為拆不開盒子,而且惟一能做的只有telnet, ,所以console log根本看不到,不過還好有ttysnoop的幫忙,讓我渡過debug的難關</font></p><p><!--more--></p><p><font size="2">ttysnoop可以把tty message導到其它的tty裝置,這隻程式分為client端和server端,安裝的步驟如下<br /><font color="#0000ff">1.先到<a href="http://freshmeat.net/projects/ttysnoop/">這個網站</a>抓ttysnoop原始程式碼並cross compile(compile中途有錯請自己修正)<br /></font><font color="#0000ff">2.在目標平台上建立資料夾/var/spool/ttysnoop<br />3.在目標平台上建立檔案/etc/snooptab,而snooptab的內容如下</font></font></p><p>&lt;coolcode lang=&quot;python&quot;linenum=&quot;off&quot;&gt; tty snoop-www.ce type execpgm <br /><br />#tty1 /www.tty7 login /bin/login <br />#tty2 /www.tty8 login /bin/lo</p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-63.html</link>
	<title><![CDATA[Linux file system for dummies-只花你45分鐘]]></title>
	<author>Joey</author>
	<category><![CDATA[程式設計]]></category>
	<pubDate>2009-08-19 15:40</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-63.html</guid>	
	<description><![CDATA[<p><font size="2">小弟其實一直很想跟大家介紹這篇文章&quot;<a href="http://mirrors.ibiblio.org/pub/mirrors/samba/cifs-cvs/ols2007-fs-tutorial-smf.pdf">Linux File Systems in 45 minutes</a>&rdquo;,原文出處是在2006的</font><a href="http://www.linuxsymposium.org/"><font size="2">Linux symposium</font></a><font size="2">的open conference,由NFS和Samba的作者Steve French執筆,而其主要的內容是把linux VFS和file system之間的函式呼叫和使用到的資料結構做一個簡單的介紹</font></p><p><!--more--></p><p><font size="2">Linux file system簡單的架構圖如下</font></p><p><img style="WIDTH: 587px; HEIGHT: 389px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200908/4390102026.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200908/4390102026.jpg" width="400" height="310" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200908/4390102026.jpg" />&nbsp;</p><p><font size="2">假設有一個/mnt的目錄,而在其下有兩個檔案和一個hardlink,從上圖的左上方看到super_block透過register_filesystem而跟kernel的file system type list產生連繫,super_block內記載了root inode的訊息,而root inode也把它的next指標指向dentry object</font></p><p><font size="2">每個dentry object都是double linked list item,藉由此dentry list,可以走遍所有的目錄和其下的檔案,從上圖出可看到file的f_dentry指標皆連至dentry的ha</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-62.html</link>
	<title><![CDATA[OPENSSL-TCP SSL初心者之路]]></title>
	<author>Joey</author>
	<category><![CDATA[程式設計]]></category>
	<pubDate>2009-07-16 15:16</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-62.html</guid>	
	<description><![CDATA[<p><font size="2">最近因為工作的關係,碰到一些加解密的問題,所以藉由這個機會,好好的回頭看了openssl這個只有編過但完全沒用過的library,<a href="https://www.mmlab.cse.yzu.edu.tw/mainmenu/Courses/University/cns/doc/OpenSSL_api.html">還好有網友把整個openssl剖析的很透徹</a>,在學習的過程中幾乎沒碰到太多的問題,因為openssl每組API的使用方式實在太固定了,所以md5 api試過後,後面的數位簽章和RSA都不會太困難,而在openssl裡,SSL framework是我覺得包裝相當漂亮的函式,所以下面的內容都著重在TCP SSL的使用介紹<br /></font></p><p><font size="2">使用http ssl基本上有幾個流程<br />1.&nbsp;Initial socket<br />2.&nbsp;Connect socket<br />3.&nbsp;Initial SSL<br />&nbsp;&nbsp;&nbsp; &lt;1&gt;SSL_library_init:initial SSL library<br />&nbsp;&nbsp;&nbsp; &lt;2&gt;SSL_CTX_new:create a new SSL_CTX object to enable SSL connection<br />&nbsp;&nbsp;&nbsp; &lt;3&gt;SSL_new: cre</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-61.html</link>
	<title><![CDATA[Colasoft packet builder-這年頭什麼東西都有]]></title>
	<author>Joey</author>
	<category><![CDATA[軟體使用]]></category>
	<pubDate>2009-06-08 03:35</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-61.html</guid>	
	<description><![CDATA[<p><font size="2">美國VA這兩天都是好天氣,可惜目前只去了DC晃晃,還沒到VA其它地方,不過我發現DC的規劃不錯,從國會山莊到華盛頓記念碑幾乎是一直線,而且沿途還有數量眾多的博物館讓你逛,根本不用地圖也不會迷路,簡直是觀光客的天堂</font></p><p><font size="2"><a href="http://www.colasoft.com/packet_builder/">Colasoft packet builder</a>是十分實用的軟體,透過它可以讓你快速的測試網路協定,基本上,你可以把它看做是packet generator,你只需要把wireshark的capture log餵給它,你就可以任意修改在log中的封包並傳送</font></p><p><font size="2"><!--more--></font></p><p><font size="2">打開軟體後先import一個packet cap檔</font></p><p><font size="2"><img style="WIDTH: 764px; HEIGHT: 435px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200906/8449706557.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200906/8449706557.jpg" width="400" height="227" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200906/8449706557.jpg" /></font></p><p><font size="2">隨便選擇一個封包然後在下方的editor中編輯欄位如ip,mac&hellip;</font></p><p><img style="WIDTH: 775px; HEIGHT: 390px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200906/1722284310.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200906/1722284310.jpg" width="400" height="335" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200906/1722284310.jpg" /></p><p><font size="2">在封包上點選右鍵選擇傳送,就可以把封包丟到受測平台</font></p><p><img style="WIDTH: 773px; HEIGHT: 497px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200906/4235464548.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200906/4235464548.jpg" width="400" height="321" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200906/4235464548.jpg" /></p><p><font size="2">這套軟體可以節省protocol驗證的時間,不用特別去寫packet generator,更重要的是,它是free tool.</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-60.html</link>
	<title><![CDATA[fw_printenv-control u-boot enviroment variables under linux]]></title>
	<author>Joey</author>
	<category><![CDATA[嵌入式系統]]></category>
	<pubDate>2009-05-12 16:35</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-60.html</guid>	
	<description><![CDATA[<p><font size="2">u-boot可以設定的環境變數,例如tftp server ip, eth ip&hellip;等,如果要在進入linux後還能隨意操縱這些enviroment variable,就必需藉由fw_printenv這個小程式,這支小程式能顯示和設定u-boot的環境變數</font></p><p><font size="2">因為小弟的板子是nand flash,所以我<a href="ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2">下載目前最新的u-boot</a>,並試著用make env指令把fw_printenv編出來(最新板的fw_printenv可以自動切換nand與nor flash的操作方式)</font></p><p><!--more--></p><p><font size="2">接下來就要設定fw_env.config檔案並把它擺在/etc下,因為小弟u-boot的env offset被設定成如下</font></p><p><font size="2">#define CFG_ENV_OFFSET&nbsp;&nbsp;0x020000 <br />#define CFG_NAND_BASE&nbsp;&nbsp;&nbsp; 0x4E000000<br />#define CMD_SAVEENV<br />#define CFG_NAND_LEGACY&nbsp;&nbsp;&nbsp;<br />#define CFG_ENV_SIZE&nbsp;&nbsp;0x10000&nbsp;/</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-59.html</link>
	<title><![CDATA[Seattle Bellevue-A nice place to live]]></title>
	<author>Joey</author>
	<category><![CDATA[旅遊]]></category>
	<pubDate>2009-05-11 18:58</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-59.html</guid>	
	<description><![CDATA[<p><font size="2">Seattle Bellevue是個蠻美的城市,翠綠的森林配上大面積的湖泊,讓它的空氣十分清新,雖然我去的季節不算冷,但對從亞熱帶地區來訪的我們來說,還是得加件外套才能保暖</font></p><p><img style="WIDTH: 553px; HEIGHT: 384px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/5460745138.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/5460745138.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/5460745138.jpg" /></p><p><!--more--></p><p><img style="WIDTH: 557px; HEIGHT: 368px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/6700443327.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/6700443327.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/6700443327.jpg" /></p><p><font size="2">美國給我的第一個感覺是,&rdquo;什麼東西都很大&rdquo;,車子大,馬路大,吃的東西也很多,以前總覺的美國在吃的消費很貴,但看過它們餐點提供的份量,簡直就是吃到飽的規格</font></p><p><img style="WIDTH: 542px; HEIGHT: 604px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/7693852325.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/7693852325.jpg" width="400" height="533" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/7693852325.jpg" /></p><p><font size="2">這次在吃的方面讓我印像最深刻的,就是Dungeness crab,肉多汁甜美,再配上熱熱的香奶油,唉,真人間美味,我們點的是2lb的crab,所以剛剛好夠我們五個人的食量</font></p><p><img style="WIDTH: 548px; HEIGHT: 386px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/4113490970.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/4113490970.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/4113490970.jpg" /></p><p><font size="2">Seattle的市區也十分乾淨,公車都採用電力方式發動,所以幾乎聞不到台灣特有的廢氣</font></p><p><img style="WIDTH: 552px; HEIGHT: 404px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/9584289876.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/9584289876.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/9584289876.jpg" /></p><p><font size="2">而市區著名的Pike place,範販賣各式各樣的雜貨,每走幾步路,都可以看到街頭藝人表演,當然了,我們還去了參觀了俗稱&rdquo;樂在工作&rdquo;的魚市場,和西雅圖夜未眠的拍攝酒館</font></p><p><img style="WIDTH: 560px; HEIGHT: 385px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/9757470801.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/9757470801.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/9757470801.jpg" /></p><p><img style="WIDTH: 562px; HEIGHT: 412px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/1530656539.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/1530656539.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/1530656539.jpg" /></p><p><img style="WIDTH: 545px; HEIGHT: 438px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/9048341974.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/9048341974.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/9048341974.jpg" /></p><p><img style="WIDTH: 547px; HEIGHT: 437px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/7166324899.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/7166324899.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/7166324899.jpg" /></p><p><font size="2">身為宅男的人當然不能錯過Seattle最大的電子商店Frys,裡面的東西真多,認真的逛也要花一兩個小時</font></p><p><img style="WIDTH: 555px; HEIGHT: 418px" style="cursor:pointer;" onclick="open_img(&#39;http://daydreamer.idv.tw/attachments/200905/1158187954.jpg&#39;)" alt="http://daydreamer.idv.tw/attachments/200905/1158187954.jpg" width="400" height="300" src="http://daydreamer.idv.tw/http://daydreamer.idv.tw/attachments/200905/1158187954.jpg" /></p><p><font size="2">不過我實在很討厭時差的問題,如果沒有時差,一切都會很perfect,下一趟出差準備去美國東岸了&helli</font></p>]]></description>
</item>
<item>
	<link>http://daydreamer.idv.tw/rewrite.php/read-58.html</link>
	<title><![CDATA[NAPI與pure interrupt driver的效能比較]]></title>
	<author>Joey</author>
	<category><![CDATA[程式設計]]></category>
	<pubDate>2009-04-29 19:06</pubDate>
	<guid>http://daydreamer.idv.tw/rewrite.php/read-58.html</guid>	
	<description><![CDATA[<p><font size="2">下星期就要出差去美國了,擔心的反而不是豬流感,而是未來一星期的IOT會不會出問題,雖然測試好幾遍了,但工作那麼多年,根據經驗,只要是正式的測試場合,平常不會出trouble的地方全部都會在那時出現,不過這種東西是危機也是轉機,看個人造化</font></p><p><font size="2">NAPI的相關資料可查尋</font><a href="http://www.cookinglinux.org/pub/netdev_docs/napi-howto.php3.html"><font size="2">此網站</font></a><font size="2">,它推出的目的就是為了在interrupt和polling之間取得一個效能平衡,interrupt的缺點就是當封包數目多且中斷頻繁發生時,可能會有upper layer skb queue starvation的情況,嚴重者會造成其它的driver無法取得中斷資源,而polling會耗費大量的cpu time,為了終結以上兩個情況,在2.6的kernel已經把NAPI的相關函式提供給driver programmer,NAPI會在中斷時提供一polling函式把drvier queue裡面的skb一口氣讀出(假設weight為64,就是一次讀取64個skb),這樣不但減輕interrupt對系統造成的負擔,也間接解決drvier資源相競的問題</font></p><p><!--more--></p><p><font size="2">在這邊我寫的NAPI範例是架構在CS8900A上,而重點如下</font></p><p><font size="2"><strong>1. static in</strong></font></p>]]></description>
</item>
</channel>
</rss>