LDD3的範例程式無法在最新的(至少2.6.32以後的)kernel編譯,許多人為此付出心力,以下是找到較有用的資源
沒試過。聽說還是要手動改一些東西
http://lwn.net/Articles/58720/
這個work!!
http://blog.superpat.com/2010/05/04/a-simple-block-driver-for-linux-kernel-2-6-31/
沒試過
http://hi.baidu.com/zr1988/blog/item/c98e833d551397ca9e3d6215.html/cmtid/93ea1ffbc0b295186d22eb84
照他的做,不work。
https://github.com/jesstess/ldd3-examples/commit/02e3cdeade235fc27b4902c295bd5167a4b98d59
2011年12月28日 星期三
2011年12月26日 星期一
深入學習!重要文件大集合
以QS的角度觀之,在進入input context前,是scan code + 控制字符(opt、cmd、ctrl);從input context出來後,是單純的NSString/NSAttributedString。
解救QS輸入的關鍵
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
這篇文章詳細講解了Key Binding機制與客製化Key Binding的方法,
甚至可以做到MultiKey binding,即emacs風格的「組合技」。
更甚者,一個binding觸發一連串的methods call,其潛力不可想像。
當然可以用純文字編輯器做到,但令人感激的是,已經有個方便的Key binding編輯器:KeyBindingsEditor。
對治「將奇技淫巧發揮到極致的QS」,要能完成向下相容與中文輸入的艱鉅挑戰,key binding或許是一盞明燈。
2011年12月24日 星期六
更改的原因
為何把keyDown中的
// if ([[theEvent charactersIgnoringModifiers] isEqualToString:@" "]) {
// [self insertSpace:nil];
// return;
// }
註解掉?因為中文輸入法一聲的字要用到空白鍵,因此不能在這裡被攔截。
為何把keyDown中呼叫的handleSlashEvent移走?
因為/代表「ㄥ」。
為何把handleBoundKey移走?
因為.代表「ㄡ」、;代表「ㄤ」。
.會執行transmogrify:
;會執行combine:
這個感覺要走正規解法,看能不能把keyBinding加入系統?
chinese compatible pane1&pane3 issues
issue #1: slash key ('/') functions conflict
slash key在QS原生的設計被賦與兩項功能。
功能一:長按0.25-0.5秒,pane1/pane3顯示root;長按超過0.5秒,pane1/pane3切進root。
功能二:「slash」與「shift + slash(其實是shift + ?)」扮演與「左箭頭」和「右箭頭」等效的功能。
因為中文keyboard layout上,slash代表「ㄥ」,要如何在維持「ㄥ」鍵權益與保留原初設計間取得平衡,是個很重要的議題。
在中文輸入法下,功能二是必定要捨棄的了。
所以考量的點只有,在英文輸入法下要保留功能二(維持原初設計),還是把功能二一併拿掉(保持一致性)?
issue #2: potential tidle key ('`') conflict
tidle key在中文輸入法沒有用到,理論上不成問題,只是擔心萬一哪個國家的keyboard layout用到tidle key,就必須考慮和slash key一樣的問題了。
issue #3: space bug (fixed)
之前發佈的
發現bug#1!Preference->Comman d下,Spacebar behavior請不要設成Normal!
issue #4: 計算機module
發現bug#2. 計算機module變得怪怪的
這個莫名的bug真的讓我頭皮發麻。按下'='鍵會跑去搜尋檔名有'='的檔案,而非交給計算機module處理。
與b63進行觀察比較後,發現這個bug根本的問題在於中文輸入法下根本無法開啟Text Mode,而計算機module僅僅是打開Text Mode罷了。
看了stringForEvent這個method,發現原來是QS自定的,之前還以為是系統函式庫ㄎㄎ。
把handleBoundKey還給keyDown後,就解決了。
但這又引出一個問題:'.'代表的「ㄡ」失效了。
應該把'.'移出DefaultBindings.qskeys嗎?
還是讓它在英文輸入法下繼續適用呢?
可是在DefaultBindings.qskeys中,'.'是唯一一個執行transmogrify:的key。
'"'和'''是conditionalTransmogrify:,或許'.'有它無可取代的地位吧?
issue #5: performance down
這是一個很大的隱憂阿!b63的反應速度十分令人滿意,但改過後會有稍微的延遲,少數勝過Alfred的優勢就少一個了>"<
Index不會變大,推測是花在搜尋的時間變長了。
或許要用profiling tool...?
-----
issue #1與issue #4的問題皆出在QS自定的DefaultBindings.qskeys,這種非官方的key binding實作了很強大的hacking,卻也帶來許多限制。
slash key在QS原生的設計被賦與兩項功能。
功能一:長按0.25-0.5秒,pane1/pane3顯示root;長按超過0.5秒,pane1/pane3切進root。
功能二:「slash」與「shift + slash(其實是shift + ?)」扮演與「左箭頭」和「右箭頭」等效的功能。
因為中文keyboard layout上,slash代表「ㄥ」,要如何在維持「ㄥ」鍵權益與保留原初設計間取得平衡,是個很重要的議題。
在中文輸入法下,功能二是必定要捨棄的了。
所以考量的點只有,在英文輸入法下要保留功能二(維持原初設計),還是把功能二一併拿掉(保持一致性)?
issue #2: potential tidle key ('`') conflict
tidle key在中文輸入法沒有用到,理論上不成問題,只是擔心萬一哪個國家的keyboard layout用到tidle key,就必須考慮和slash key一樣的問題了。
issue #3: space bug (fixed)
之前發佈的
發現bug#1!Preference->Comman
這部份應該很可能修得好,當初改code時沒有太仔細研究原設計處理空白鍵的函式。
Normal的意思就是把空白鍵拿去搜尋,如此而已。keyDown -> insertSpace -> insertText:' '。
這個bug的來源是,insertText 呼叫 insertSpace,insertSpace又呼叫insertText,無窮function call直到stack爆掉為止。在修改insertSpace後,宣告解決。
issue #4: 計算機module
發現bug#2. 計算機module變得怪怪的
這個莫名的bug真的讓我頭皮發麻。按下'='鍵會跑去搜尋檔名有'='的檔案,而非交給計算機module處理。
與b63進行觀察比較後,發現這個bug根本的問題在於中文輸入法下根本無法開啟Text Mode,而計算機module僅僅是打開Text Mode罷了。
看了stringForEvent這個method,發現原來是QS自定的,之前還以為是系統函式庫ㄎㄎ。
把handleBoundKey還給keyDown後,就解決了。
但這又引出一個問題:'.'代表的「ㄡ」失效了。
應該把'.'移出DefaultBindings.qskeys嗎?
還是讓它在英文輸入法下繼續適用呢?
可是在DefaultBindings.qskeys中,'.'是唯一一個執行transmogrify:的key。
'"'和'''是conditionalTransmogrify:,或許'.'有它無可取代的地位吧?
issue #5: performance down
這是一個很大的隱憂阿!b63的反應速度十分令人滿意,但改過後會有稍微的延遲,少數勝過Alfred的優勢就少一個了>"<
Index不會變大,推測是花在搜尋的時間變長了。
或許要用profiling tool...?
-----
issue #1與issue #4的問題皆出在QS自定的DefaultBindings.qskeys,這種非官方的key binding實作了很強大的hacking,卻也帶來許多限制。
2011年12月23日 星期五
Setup git / git 學習資源
Setup
很棒的slide
指令一覽
windows-friendly教學XD
大兜提供的mercurial教學(了解分散式版本控制的好教材)
Git Study (很棒的兩人合作範例)
在找尋解決conflict的解答,發現rebase功能
在"remote branch"有一組簡化指令的工具:git_remote_branch (grb)
不僅方便,其提供的explain還可以教你怎麼用git組合指令完成這項工作呢!
QS的github使用規範(只能pull,不能push。請愛用"pull request" etc...)
pull request
何謂pull request?在github上,大型專案為了避免新人瞎搞,建議大家fork一個專案,這樣push出去的更動會在自己的fork上,而非原本的專案。如果你確定改好了,並且希望把自己的更改加入原專案,就發一個pull request給維護人員,「請他幫你merge。」
相對應的,兩三人的小專案,大家就直接push到remote master。
Git community 中文版
Learning git
內附更多學習資源
Why git is better then X
這種辯論的文章因為很務實所以寫的讓人容易吸收呢。
For Windows
For OSX
很棒的slide
分享 Trac 與 Git 的使用心得 @ 資拓宏宇
上面文章的投影片 (超推!!!!!)
寫給大家的git教學(次推)
我愛Git
Git版本控制系統(1) 一篇介紹git很棒的文章
指令一覽
windows-friendly教學XD
大兜提供的mercurial教學(了解分散式版本控制的好教材)
Git Study (很棒的兩人合作範例)
在找尋解決conflict的解答,發現rebase功能
使用 git rebase 避免無謂的 merge
Git rebase 的應用經驗
git 無法做 pull / push 時的解決方法
在"remote branch"有一組簡化指令的工具:git_remote_branch (grb)
不僅方便,其提供的explain還可以教你怎麼用git組合指令完成這項工作呢!
QS的github使用規範(只能pull,不能push。請愛用"pull request" etc...)
pull request
何謂pull request?在github上,大型專案為了避免新人瞎搞,建議大家fork一個專案,這樣push出去的更動會在自己的fork上,而非原本的專案。如果你確定改好了,並且希望把自己的更改加入原專案,就發一個pull request給維護人員,「請他幫你merge。」
相對應的,兩三人的小專案,大家就直接push到remote master。
Git community 中文版
Learning git
內附更多學習資源
Why git is better then X
這種辯論的文章因為很務實所以寫的讓人容易吸收呢。
2011年12月22日 星期四
突破VirtualBox USB tablet!
擊破vbox的「VirtualBox USB tablet」屏障了!
只要輸入
sudo /etc/init.d/vboxadd stop
停用vbox功能,接著把滑鼠拔掉重插,這個USB mouse就不受virtualbox保護了!!
不過,沒辦法拔掉重插的multi-touch還是被保護著。
不過光是這樣,還是沒辦法看到dprobe插在mousedev_event的探針。
並非沒辦法--按fn+ctrl+option+F1進入命令列模式,這時再動一動滑鼠(要先動multi-touch,再動mouse,否則會抓不到的樣子。另外,我有開gpm。)
然後fn+ctrl+option+F7回到桌面,監視視窗就會顯示探針確實被執行過了!!
ref: https://forums.virtualbox.org/viewtopic.php?f=3&t=37614
只要輸入
sudo /etc/init.d/vboxadd stop
停用vbox功能,接著把滑鼠拔掉重插,這個USB mouse就不受virtualbox保護了!!
不過,沒辦法拔掉重插的multi-touch還是被保護著。
不過光是這樣,還是沒辦法看到dprobe插在mousedev_event的探針。
並非沒辦法--按fn+ctrl+option+F1進入命令列模式,這時再動一動滑鼠(要先動multi-touch,再動mouse,否則會抓不到的樣子。另外,我有開gpm。)
然後fn+ctrl+option+F7回到桌面,監視視窗就會顯示探針確實被執行過了!!
ref: https://forums.virtualbox.org/viewtopic.php?f=3&t=37614
2011年12月21日 星期三
筆記:kprobes_example用到的資料結構
find指令幫了很大的忙呢。
struct kprobe 定義在
linux/include/linux/kprobes.h
struct pt_regs 定義在
linux/arch/x86/include/asm/ptrace.h
pt_regs有超多不同的版本,端看你的CPU是哪種architecture。
看來是可以把暫存器通通印出來呢。雖然不知道印出來可以幹嘛= =
struct kprobe 定義在
linux/include/linux/kprobes.h
struct pt_regs 定義在
linux/arch/x86/include/asm/ptrace.h
pt_regs有超多不同的版本,端看你的CPU是哪種architecture。
看來是可以把暫存器通通印出來呢。雖然不知道印出來可以幹嘛= =
實驗
用kprobe真的很快就可以知道哪些function有被call,哪些沒有。
一個視窗輸入cat /proc/kmsg,等著看輸出;
一個視窗負責卸載、編譯、載入kprobe module;
一個文字編輯程式改kprobe要監視的function。
如果不是kprobe的資料結構必須靜態初始化,否則用module_param動態更改參數可以更快。
另外,用
find . | xargs grep '(struct input_handle *' | grep event
找出可能跑去註冊的event函式,結果如下:
fatsoft0415:drivers mac$ find . | xargs grep '(struct input_handle *' | grep event./char/keyboard.c:static void kbd_event(struct input_handle *handle, unsigned int event_type,
./input/apm-power.c:static void apmpower_event(struct input_handle *handle, unsigned int type,
./input/evbug.c:static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
./input/evdev.c:static void evdev_event(struct input_handle *handle,
./input/input.c:void input_inject_event(struct input_handle *handle,
./input/joydev.c:static void joydev_event(struct input_handle *handle,
./input/mousedev.c:static void mousedev_event(struct input_handle *handle,
fatsoft0415:drivers mac$
一個視窗輸入cat /proc/kmsg,等著看輸出;
一個視窗負責卸載、編譯、載入kprobe module;
一個文字編輯程式改kprobe要監視的function。
如果不是kprobe的資料結構必須靜態初始化,否則用module_param動態更改參數可以更快。
另外,用
find . | xargs grep '(struct input_handle *' | grep event
找出可能跑去註冊的event函式,結果如下:
fatsoft0415:drivers mac$ find . | xargs grep '(struct input_handle *' | grep event./char/keyboard.c:static void kbd_event(struct input_handle *handle, unsigned int event_type,
./input/apm-power.c:static void apmpower_event(struct input_handle *handle, unsigned int type,
./input/evbug.c:static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
./input/evdev.c:static void evdev_event(struct input_handle *handle,
./input/input.c:void input_inject_event(struct input_handle *handle,
./input/joydev.c:static void joydev_event(struct input_handle *handle,
./input/mousedev.c:static void mousedev_event(struct input_handle *handle,
fatsoft0415:drivers mac$
實驗結果是,kbd_event與evdev_event有反應,而且evdev_event對滑鼠和鍵盤都有反應。
偏偏mousedev_event一點動靜都沒有,不論是用multi-touch軌跡板還是外接USB滑鼠都一樣,關掉VirtualBox的滑鼠整合也一樣。這已經是在沒有裝GuestAddition的情況下了。
阿阿阿阿~~~~
-----
話說我發現有裝guestaddition的kernel,用lsmod看會找到3個跟vbox有關的module。其中有兩個說是在使用中,不能卸載呢。
搜尋字串超實用技巧:find | xarg grep 'string'
如果要搜尋某個struct的定義,如'struct probe {'這種含空白字元的字串,spotlight就會找出一拖拉庫的東西,顯得無用了。
是UNIX指令大顯身手的時候了:find | xarg grep 'string'
把string換成你要搜尋的字串吧。
ref: http://webcache.googleusercontent.com/search?q=cache:HNQfK9FDQSYJ:abort.pixnet.net/blog/post/23266493-linux---%E5%A4%9A%E5%80%8B%E6%AA%94%E6%A1%88%E4%B8%AD%E6%90%9C%E5%B0%8B%E5%AD%97%E4%B8%B2+linux+%E5%85%A7%E6%96%87%E6%90%9C%E5%B0%8B&cd=1&hl=zh-TW&ct=clnk&gl=tw
是UNIX指令大顯身手的時候了:find | xarg grep 'string'
把string換成你要搜尋的字串吧。
ref: http://webcache.googleusercontent.com/search?q=cache:HNQfK9FDQSYJ:abort.pixnet.net/blog/post/23266493-linux---%E5%A4%9A%E5%80%8B%E6%AA%94%E6%A1%88%E4%B8%AD%E6%90%9C%E5%B0%8B%E5%AD%97%E4%B8%B2+linux+%E5%85%A7%E6%96%87%E6%90%9C%E5%B0%8B&cd=1&hl=zh-TW&ct=clnk&gl=tw
解決安裝相同kernel版本的問題
從這篇文章學到的。
相同的版本號,如果不做任何區別一定分辨不出來。我目前的例子是還好,就是流水式的開發,沒有樹狀分支。不過即使如此,也會擔心有些東西在安裝完到重開機期間會出包,或者什麼要下指令重新產生一份(dep file之類的),自己會漏掉。
有一個很棒的解法,就是加上自定的版本號。在下編譯指令時用-rev選項指定,例如:
make-kpkg -rev Custom.1 --initrd kernel_image
我自己是下
$ sudo make-kpkg -rev custom.showInput --initrd kernel_image kernel_headers
在打這篇文章時,kernel還在編。等明天早上看結果囉!
------
結果似乎不行哪。
要在menuconfig時自行加上版本。上述方法只能改變.deb的版本而已。
相同的版本號,如果不做任何區別一定分辨不出來。我目前的例子是還好,就是流水式的開發,沒有樹狀分支。不過即使如此,也會擔心有些東西在安裝完到重開機期間會出包,或者什麼要下指令重新產生一份(dep file之類的),自己會漏掉。
有一個很棒的解法,就是加上自定的版本號。在下編譯指令時用-rev選項指定,例如:
make-kpkg -rev Custom.1 --initrd kernel_image
我自己是下
$ sudo make-kpkg -rev custom.showInput --initrd kernel_image kernel_headers
在打這篇文章時,kernel還在編。等明天早上看結果囉!
------
結果似乎不行哪。
要在menuconfig時自行加上版本。上述方法只能改變.deb的版本而已。
usbmouse筆記
http://comments.gmane.org/gmane.linux.arch.general/16703
這篇文章提到,usbmouse與usbkbd是在特殊(如嵌入式)的場合才會用到,一般hid-core就夠了。我想這也是為何在arm與mips及少數arch下的config內才找得到CONFIG_USB_MOUSE的原因吧!
今天有點小小斬獲:在hid-core.c的init function中加入printk,編譯、安裝、卸載、載入後,終於在dmesg後看到印出的訊息了!想要動態觀察,可以用cat /proc/kmsg。
不知為何,並不是出現在/var/log/messages內呢!
另外,usbmouse.c改的東西完全沒有出現。
最後,一個加速編譯的方法:在越深層的資料夾編譯越快,例如在/driver/input下、在/driver/hid下,甚至在/driver/hid/usbhid下。不相干的實在沒有必要等它重編,這個方法節省很多時間,絕對值得學起來。
http://samzhen.blogspot.com/2009/05/linuxusb-hid-device-driver.html
這篇文章教我看Kconfig與Makefile,找出.ko檔是由哪些.o檔組合而成的,從而去找那個_CONFIG在/arch/x86下是否有啟用,來判斷這個.o檔究竟有沒有生效。
這篇文章提到,usbmouse與usbkbd是在特殊(如嵌入式)的場合才會用到,一般hid-core就夠了。我想這也是為何在arm與mips及少數arch下的config內才找得到CONFIG_USB_MOUSE的原因吧!
今天有點小小斬獲:在hid-core.c的init function中加入printk,編譯、安裝、卸載、載入後,終於在dmesg後看到印出的訊息了!想要動態觀察,可以用cat /proc/kmsg。
不知為何,並不是出現在/var/log/messages內呢!
另外,usbmouse.c改的東西完全沒有出現。
最後,一個加速編譯的方法:在越深層的資料夾編譯越快,例如在/driver/input下、在/driver/hid下,甚至在/driver/hid/usbhid下。不相干的實在沒有必要等它重編,這個方法節省很多時間,絕對值得學起來。
http://samzhen.blogspot.com/2009/05/linuxusb-hid-device-driver.html
這篇文章教我看Kconfig與Makefile,找出.ko檔是由哪些.o檔組合而成的,從而去找那個_CONFIG在/arch/x86下是否有啟用,來判斷這個.o檔究竟有沒有生效。
2011年12月19日 星期一
編譯與安裝特定linux module
這實在是太實用了。
只改了mousedev.c,卻要重編全部的modules實在等的很辛苦。
其實只要一行就行了。
make -C /usr/src/linux SUBDIR=$PWD modules
安裝也是同理。
make -C /usr/src/linux SUBDIR=$PWD modules_install
原本要超過三小時的編譯時間,縮減到不到5分鐘就可完成。
感謝Fred. 借轉囉!
ref:
http://fred-zone.blogspot.com/2008/09/linux-module.html
只改了mousedev.c,卻要重編全部的modules實在等的很辛苦。
其實只要一行就行了。
make -C /usr/src/linux SUBDIR=$PWD modules
安裝也是同理。
make -C /usr/src/linux SUBDIR=$PWD modules_install
原本要超過三小時的編譯時間,縮減到不到5分鐘就可完成。
感謝Fred. 借轉囉!
ref:
http://fred-zone.blogspot.com/2008/09/linux-module.html
重新安裝kernel遇到警告:modules.dep要重製
解法:安裝完後立刻重開,然後執行sudo make modules_install
ref:
http://www.linuxquestions.org/questions/linux-newbie-8/modules-dep-needs-to-be-re-built-157041/
ref:
http://www.linuxquestions.org/questions/linux-newbie-8/modules-dep-needs-to-be-re-built-157041/
vboxaddtions會影響gpm
新發現。之前一直納悶為何gpm的游標會卡在螢幕正中間,幾乎失去作用。
回到之前的快照,發現在未安裝guest addition的情況下安裝gpm、並使用
sudo /etc/init.d/gpm force-reload
就能正常叫出gpm。
回到之前的快照,發現在未安裝guest addition的情況下安裝gpm、並使用
sudo /etc/init.d/gpm force-reload
就能正常叫出gpm。
linux觀察event的方法
evbug在/drivers/input/底下,是一個module,它會dump所有的event。
看這些event的方法,是dmesg指令。
# sudo modprobe evbug
動一動滑鼠、按擠下鍵盤之類
# dmesg
通常enter一按下去就會噴一堆訊息,可用
# dmesg | tail
秀出最後的10個event。最後3個input3我認為是那一下enter,也就是鍵盤產生的event。
倒數第四個以上才是我們要看的。用這個方法測出來,滑鼠應該是input6。不論用軌跡板或USB滑鼠都一樣。
滑鼠的點擊(左右鍵都是)屬於input5。
看這些event的方法,是dmesg指令。
# sudo modprobe evbug
動一動滑鼠、按擠下鍵盤之類
# dmesg
通常enter一按下去就會噴一堆訊息,可用
# dmesg | tail
秀出最後的10個event。最後3個input3我認為是那一下enter,也就是鍵盤產生的event。
倒數第四個以上才是我們要看的。用這個方法測出來,滑鼠應該是input6。不論用軌跡板或USB滑鼠都一樣。
滑鼠的點擊(左右鍵都是)屬於input5。
USB學習資源
因為IO這門課有碰到USB driver,又要進入一片未知的大海冒險囉!
這裡有篇不錯的教學
http://fred-zone.blogspot.com/2009/08/usb.html
http://fred-zone.blogspot.com/2009/08/usb_10.html
這是usb.org官方看不完的文件~
http://www.usb.org/developers/docs/
快速瀏覽了下USB3.0的spec,採dual bus,usb3.0 hub中包含超高速hub與USB 2.0 hub。
還看到它分成physical layer、link layer、protocol。跟網路很像呢!後面還有硬體的規格等等,族繁不及備載XD
比較讓我在意的一點是,這份文件的組織跟軟工第一份作業「軟體需求規格書(SRS)」很像。一開始是目錄、簡介與動機、提供一份頭字語的表,接著描述整份文件的架構,然後才依序展開主題。
真是有趣呢!
這裡有篇不錯的教學
http://fred-zone.blogspot.com/2009/08/usb.html
http://fred-zone.blogspot.com/2009/08/usb_10.html
這是usb.org官方看不完的文件~
http://www.usb.org/developers/docs/
快速瀏覽了下USB3.0的spec,採dual bus,usb3.0 hub中包含超高速hub與USB 2.0 hub。
還看到它分成physical layer、link layer、protocol。跟網路很像呢!後面還有硬體的規格等等,族繁不及備載XD
比較讓我在意的一點是,這份文件的組織跟軟工第一份作業「軟體需求規格書(SRS)」很像。一開始是目錄、簡介與動機、提供一份頭字語的表,接著描述整份文件的架構,然後才依序展開主題。
真是有趣呢!
2011年12月18日 星期日
Ubuntu重編kernel問題解決
找到兩派作法,一是沿用之前kpkg、dpkg指令的作法,Ubuntu 10.4需多做一步。因為是最快的作法,我照著做,成功了(痛哭)
sudo update-initramfs -c -k 2.6.32.27
參考網頁如下
http://cheerc.blogspot.com/2011/11/note-ubuntukernel.html
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=36258
另一派則是傳統的
# sudo make
# sudo make modules
# sudo make modules_install
# sudo make install
之後還要再設定一下grub。這個我還沒試。
參考網頁
http://www.wretch.cc/blog/eternalwind/5383026
總之可以動囉~~~感動!
有圖有真相:
sudo update-initramfs -c -k 2.6.32.27
參考網頁如下
http://cheerc.blogspot.com/2011/11/note-ubuntukernel.html
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=36258
另一派則是傳統的
# sudo make
# sudo make modules
# sudo make modules_install
# sudo make install
之後還要再設定一下grub。這個我還沒試。
參考網頁
http://www.wretch.cc/blog/eternalwind/5383026
總之可以動囉~~~感動!
有圖有真相:
kernel panic not syncing vfs unable to mount root fs on unknown-block 0 0
裝完新kernel重開機就變成這樣囉
照著
http://wiki.ubuntu-tw.org/index.php?title=GRUB
http://ahhafree.blogspot.com/2010/11/livecdgrub.html
這兩篇的指示去做,是把grub裝好了。
不過要在3秒內按下esc,進入grub選單。選擇原本的2/6.32.-33-generic,可以像往常一樣正常開機,不過選擇新安裝的的2.6.32.27,就又會進入以上畫面了。
哎呀呀~怎麼辦呢?
2011年12月17日 星期六
VirtualBox調整硬碟大小
Keyword: VBoxManage指令、GParted
範例網站是以window XP做範例,檔案系統是NTFS
我想把Ubuntu的hda重劃成連續的40G,作法是在進入GParted後,把、swap整個往後拉(此時GParted已經警告,如果搬動含/boot的磁區,可能造成boot失敗),再把had拉到40G。
做完後雖能成功開機,卻無法登入。
事實上,在用VBoxManage把磁碟改成40G後開機仍正常,然而一旦用GParted將多出來的空間格式化成ext4檔案系統再開機,就無法登入了。
不懂fdisk等磁碟管理工具真是弱阿!!汗顏>"<
ref:
http://blog.xuite.net/autosun/study/50372704
http://www.my-guides.net/en/content/view/122/26/
範例網站是以window XP做範例,檔案系統是NTFS
我想把Ubuntu的hda重劃成連續的40G,作法是在進入GParted後,把、swap整個往後拉(此時GParted已經警告,如果搬動含/boot的磁區,可能造成boot失敗),再把had拉到40G。
做完後雖能成功開機,卻無法登入。
事實上,在用VBoxManage把磁碟改成40G後開機仍正常,然而一旦用GParted將多出來的空間格式化成ext4檔案系統再開機,就無法登入了。
不懂fdisk等磁碟管理工具真是弱阿!!汗顏>"<
ref:
http://blog.xuite.net/autosun/study/50372704
http://www.my-guides.net/en/content/view/122/26/
在OS X上改變process priority的方法
會想做這件事是因為我在VirtualBox上的Ubuntu編譯linux核心,雖然它已經吃掉大部分的CPU時間,但還是跑了非常之久,我希望藉由提昇VirtualBox的priority來加速。
結論:renice指令
ref:
結論:renice指令
ref:
Changing Process Priority on Mac OS X
Is there any way to set the priority of a process in Mac OS X?
How to change process priority
2011年12月16日 星期五
在Ubuntu上安裝自編kernel的學習資源
為了IO的lab3,在載入重寫過的新mouse driver前要「卸載原本的mouse driver」,
故必須提供一個不把mouse跟kernel編在一起,而是編成獨立module的kernel,那就必須自己編啦!
基於這個理由,要學習編譯並安裝kernel。
Ubuntu 8.04 / linux 2.6.24.3
Ubuntu 7.04 / linux 2.6.22.9
Ubuntu 10.4-11.10 / linux 3.1
先照Ubuntu 8.04 / linux 2.6.24.3這篇做。
因為在這裡找不到Ubuntu 10.4使用的2.6.32-33,我抓的是2.6.32.27,2.6.32系列的最新版。
故必須提供一個不把mouse跟kernel編在一起,而是編成獨立module的kernel,那就必須自己編啦!
基於這個理由,要學習編譯並安裝kernel。
Ubuntu 8.04 / linux 2.6.24.3
Ubuntu 7.04 / linux 2.6.22.9
Ubuntu 10.4-11.10 / linux 3.1
先照Ubuntu 8.04 / linux 2.6.24.3這篇做。
因為在這裡找不到Ubuntu 10.4使用的2.6.32-33,我抓的是2.6.32.27,2.6.32系列的最新版。
一些macbook與sysrq鍵的討論
https://bugs.launchpad.net/mactel-support/+bug/262408
http://ubuntuforums.org/archive/index.php/t-762665.html
http://ubuntuforums.org/archive/index.php/t-762665.html
sysrq鍵是linux在當機時一個緊急處理的指令鍵。
keyfuzz這個工具不知道有沒有用?
另外,直接外接一個USB鍵盤似乎是最經濟實惠的作法。
http://ubuntuforums.org/archive/index.php/t-762665.html
http://ubuntuforums.org/archive/index.php/t-762665.html
sysrq鍵是linux在當機時一個緊急處理的指令鍵。
keyfuzz這個工具不知道有沒有用?
另外,直接外接一個USB鍵盤似乎是最經濟實惠的作法。
strace在mac上的替代品
方才在LDD3 p.99看到Linux上的debug利器--strace。
它可以秀出所有system call和參數、有意義的錯誤訊息。
這個工具mac OS X上是沒有的,但有替代品:dtruss,預設已經安裝好了。
ref:
http://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x
http://humberto.digi.com.br/blog/2008/02/25/strace-on-mac-os-x-leopard/
它可以秀出所有system call和參數、有意義的錯誤訊息。
這個工具mac OS X上是沒有的,但有替代品:dtruss,預設已經安裝好了。
ref:
http://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x
http://humberto.digi.com.br/blog/2008/02/25/strace-on-mac-os-x-leopard/
2011年12月14日 星期三
trie的學習資源
http://www.csie.ntnu.edu.tw/~u91029/String.html
http://tw.myblog.yahoo.com/chiuinan/article?mid=535&prev=536&next=534&l=f&fid=7
http://zh.wikipedia.org/wiki/Trie
http://en.wikipedia.org/wiki/Trie
似乎很快但很耗記憶體的樣子
http://tw.myblog.yahoo.com/chiuinan/article?mid=535&prev=536&next=534&l=f&fid=7
http://zh.wikipedia.org/wiki/Trie
http://en.wikipedia.org/wiki/Trie
似乎很快但很耗記憶體的樣子
2011年12月13日 星期二
程設技巧:linux device driver如何在編譯期/載入期改變變數值
ldd3的scull提供了一個很優秀的範例,終於看懂了。
編譯期(compile time)改變的技巧很簡單,就是在標頭檔定義巨集;實作檔中再對把巨集賦值給目標變數。
這麼做的好處是如果要改,去標頭找就好了。方便集中管理。
如main.c(scull的實作檔)中接近開頭處宣告這些變數
int scull_major = SCULL_MAJOR; int scull_minor = 0; int scull_nr_devs = SCULL_NR_DEVS; /* number of bare scull devices */ int scull_quantum = SCULL_QUANTUM; int scull_qset = SCULL_QSET;
而scull.h(scull的標頭檔)中定義以下巨集
#define SCULL_MAJOR 0 #define SCULL_QUANTUM 10 #define SCULL_QSET 10
而載入期(load time)改變的技巧,是透過module_param這個巨集將宣告的變數釋出,讓insmod指令能夠接受額外參數,達到載入期賦值的效果。細節請參閱insmod的參數。
值得一提的是,該範例將scull_major定義成0,如果沒有在上述兩個期間改變scull_major,driver將動態alloc一個給它。這段寫在scull_init_module()的程式碼如下:if (scull_major) { dev = MKDEV(scull_major, scull_minor); result = register_chrdev_region(dev, scull_nr_devs, "scull"); } else { result = alloc_chrdev_region(&dev, scull_minor, scull_nr_devs, "scull"); scull_major = MAJOR(dev); }
軟工/OOAD資源
看了玩物尚誌的〈再談電子書原始碼製作:程式設計教學篇〉,令人目眩。
姑且不談作者大力推動的電子書自動化產生工具與其令人敬佩的理念,文中提到幾個強大的繪圖工具實在太強,想必會納入我愛不釋手的工具箱中,故誌之。
command-line tool
Graphviz,前文提供繪製png檔案格式UML圖的範例,但它的潛力不止於此。
網頁服務
yUML,使用標記語法線上產生UML圖。
websequencediagrams,使用標記語法線上產生循序圖。
應用程式
ArgoUML,一套與Visual Paradigm類似的開源軟體。附上使用手冊。
姑且不談作者大力推動的電子書自動化產生工具與其令人敬佩的理念,文中提到幾個強大的繪圖工具實在太強,想必會納入我愛不釋手的工具箱中,故誌之。
command-line tool
Graphviz,前文提供繪製png檔案格式UML圖的範例,但它的潛力不止於此。
網頁服務
yUML,使用標記語法線上產生UML圖。
websequencediagrams,使用標記語法線上產生循序圖。
應用程式
ArgoUML,一套與Visual Paradigm類似的開源軟體。附上使用手冊。
insmod的參數
不像一般程式的command line參數,直接加在指令後面;insmod的參數格式長這樣:
insmod 變數=值 變數=值
ldd3中文版p.36有解說與範例,如
insmod howmany=10 whom="mom"
變數是在module中用module_param巨集宣告出來的。
看來用變數名稱辨別的方法,各參數順序並無意義呢。
所以要在load time指定scull的major number的作法是:
sudo ./scull_load scull_major=280
insmod 變數=值 變數=值
ldd3中文版p.36有解說與範例,如
insmod howmany=10 whom="mom"
變數是在module中用module_param巨集宣告出來的。
看來用變數名稱辨別的方法,各參數順序並無意義呢。
所以要在load time指定scull的major number的作法是:
sudo ./scull_load scull_major=280
2011年12月8日 星期四
Mac OS X internals: a systems approach
Mac OS X internals: a systems approach
這本書可以在google圖書上預覽一部分
http://books.google.com.tw/books?id=K8vUkpOXhN4C&pg=PA1362&lpg=PA1362&dq=mac+os+x+devfs&source=bl&ots=OKjiR_RqUw&sig=Rip2IoLb0OnPwaN71Vj8ZzPSy1c&hl=zh-TW&ei=5qbfTr-qLsL0mAWY0tGiBQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CD8Q6AEwAw#v=onepage&q=mac%20os%20x%20devfs&f=false
另外,中央大學也有館藏喔!
http://opac.lib.ncu.edu.tw/search~S0*cht?/YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D/YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D&SUBKEY=MAC+OS+X+Internals%3A+A+Systems+Approach/1%2C24857%2C24857%2CB/frameset&FF=YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D&2%2C2%2C
先筆記之,以後如果有興趣的話可供參考。
這本書可以在google圖書上預覽一部分
http://books.google.com.tw/books?id=K8vUkpOXhN4C&pg=PA1362&lpg=PA1362&dq=mac+os+x+devfs&source=bl&ots=OKjiR_RqUw&sig=Rip2IoLb0OnPwaN71Vj8ZzPSy1c&hl=zh-TW&ei=5qbfTr-qLsL0mAWY0tGiBQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CD8Q6AEwAw#v=onepage&q=mac%20os%20x%20devfs&f=false
另外,中央大學也有館藏喔!
http://opac.lib.ncu.edu.tw/search~S0*cht?/YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D/YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D&SUBKEY=MAC+OS+X+Internals%3A+A+Systems+Approach/1%2C24857%2C24857%2CB/frameset&FF=YMAC+OS+X+Internals%3A+A+Systems+Approach&SORT=D&2%2C2%2C
先筆記之,以後如果有興趣的話可供參考。
用stat檢視device node (device file)
hjkao@hjkao-laptop:~/io/scull_char_driver$ stat /dev/urandom
File: 「/dev/urandom」
Size: 0 Blocks: 0 IO Block: 4096 字元特殊檔案
Device: 5h/5d Inode: 796 Links: 1 Device type: 1,9
Access: (0666/crw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2011-12-07 12:08:48.303169994 +0000
Modify: 2011-12-07 12:08:48.303169994 +0000
Change: 2011-12-07 12:08:48.303169994 +0000
hjkao@hjkao-laptop:~/io/scull_char_driver$ stat /dev/demo
File: 「/dev/demo」
Size: 0 Blocks: 0 IO Block: 4096 字元特殊檔案
Device: 5h/5d Inode: 10218 Links: 1 Device type: fa,0
Access: (0644/crw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2011-12-07 17:41:55.376874406 +0000
Modify: 2011-12-07 17:41:55.376874406 +0000
Change: 2011-12-07 17:41:55.376874406 +0000
Linux driver的major number 與 minor number
根據維基百科http://en.wikipedia.org/wiki/Device_node
Generally, the major number identifies the device driver and the minor number identifies a particular device (possibly out of many) that the driver controls: in this case, the system may pass the minor number to a driver. However, in the presence of dynamic number allocation, this may not be the case (e.g. on FreeBSD 5 and up).
major#分辨driver;minor#分辨一個driver所控制的特定device。
看來是一個driver可以控很多device,所以是以driver:device的方式來分辨每一個不同的device的。
感覺是個不錯的設計!
再回頭看看ldd(第三版)第三章是怎麼寫的:
Generally, the major number identifies the device driver and the minor number identifies a particular device (possibly out of many) that the driver controls: in this case, the system may pass the minor number to a driver. However, in the presence of dynamic number allocation, this may not be the case (e.g. on FreeBSD 5 and up).
major#分辨driver;minor#分辨一個driver所控制的特定device。
看來是一個driver可以控很多device,所以是以driver:device的方式來分辨每一個不同的device的。
感覺是個不錯的設計!
再回頭看看ldd(第三版)第三章是怎麼寫的:
Traditionally, the major number identifies the driver associated with the device. For example, /dev/null and /dev/zero are both managed by driver 1, whereas virtual con- soles and serial terminals are managed by driver 4; similarly, both vcs1 and vcsa1 devices are managed by driver 7. Modern Linux kernels allow multiple drivers to share major numbers, but most devices that you will see are still organized on the one-major-one-driver principle.
The minor number is used by the kernel to determine exactly which device is being referred to. Depending on how your driver is written (as we will see below), you can either get a direct pointer to your device from the kernel, or you can use the minor number yourself as an index into a local array of devices. Either way, the kernel itself knows almost nothing about minor numbers beyond the fact that they refer to devices implemented by your driver.
嗯,還是看的霧煞煞XDDDDDD
2011年12月7日 星期三
IO作業3筆記II
不知是做了什麼讓gmp壞掉了QQ
guest addition? Sublime text?
(是guest addition)
------以下是正題-----
vms與coord.c都寫好編好了gpm也裝好了,最後一步-gpm要對應到哪個event?
/dev/input/event0
/dev/input/event1
/dev/input/event2
/dev/input/event3
/dev/input/event4
/dev/input/event5
/dev/input/event6
/dev/input/mouse0
/dev/input/mouse1
/dev/input/mouse2
是哪個呢?
看到這篇問題的回覆
http://www.linuxforums.org/forum/kernel/155259-virtual-mouse-driver.html
學到hd這個指令。hd 某個event,接著去動相對應的device讓它產生資料,就會印在螢幕上!
用它試試每個event,再動動滑鼠,就知道哪個才是你的滑鼠的event了!
經過實驗,我家的ubuntu 10.4 (VM on macbook) 的
/dev/input/event3 對鍵盤有反應
/dev/input/event4 對滑鼠有反應
--2011/12/21新增,multi-touch與USB mouse的比較實驗。
/dev/input/mice: 兩者都有效
/dev/input/mouse1: 兩者都有效
/dev/input/event4: 兩者都有效,不過有觀察到差別。
以不是有意義的訊息輸出稍嫌可惜,不過還是能觀察出一些不同。雖然我一直很擔心VirtualBox會把各種滑鼠輸出以統一的方式交給VM,不過我在mousedev.c內印出訊息後解開了疑惑。移動multi-touch會去call mousedev_abs_event();USB mouse則會去call mousedev_rel_event()。
multi-touch與USB mouse最大的差別,在於前者產生絕對座標,後者產生相對座標。我想知道這兩者是否對應到不同的device file?
實驗結果顯示,不同的硬體輸入裝置,以滑鼠為例,對應到相同的device file。仔細一想,這樣的設計是很合理的。
---
後來發現,這件事用evbug解最快。它會告訴你現在動的硬體是哪個event。
guest addition? Sublime text?
(是guest addition)
------以下是正題-----
vms與coord.c都寫好編好了gpm也裝好了,最後一步-gpm要對應到哪個event?
/dev/input/event0
/dev/input/event1
/dev/input/event2
/dev/input/event3
/dev/input/event4
/dev/input/event5
/dev/input/event6
/dev/input/mouse0
/dev/input/mouse1
/dev/input/mouse2
是哪個呢?
看到這篇問題的回覆
http://www.linuxforums.org/forum/kernel/155259-virtual-mouse-driver.html
學到hd這個指令。hd 某個event,接著去動相對應的device讓它產生資料,就會印在螢幕上!
用它試試每個event,再動動滑鼠,就知道哪個才是你的滑鼠的event了!
經過實驗,我家的ubuntu 10.4 (VM on macbook) 的
/dev/input/event3 對鍵盤有反應
/dev/input/event4 對滑鼠有反應
/dev/input/mouse1 對滑鼠有反應,但較慢
/dev/input/mice: 兩者都有效
/dev/input/mouse1: 兩者都有效
/dev/input/event4: 兩者都有效,不過有觀察到差別。
![]() |
| 上面是移動multi-touch,下面是移動USB mouse的輸出 |
以不是有意義的訊息輸出稍嫌可惜,不過還是能觀察出一些不同。雖然我一直很擔心VirtualBox會把各種滑鼠輸出以統一的方式交給VM,不過我在mousedev.c內印出訊息後解開了疑惑。移動multi-touch會去call mousedev_abs_event();USB mouse則會去call mousedev_rel_event()。
multi-touch與USB mouse最大的差別,在於前者產生絕對座標,後者產生相對座標。我想知道這兩者是否對應到不同的device file?
實驗結果顯示,不同的硬體輸入裝置,以滑鼠為例,對應到相同的device file。仔細一想,這樣的設計是很合理的。
---
後來發現,這件事用evbug解最快。它會告訴你現在動的硬體是哪個event。
2011年12月2日 星期五
IO作業3筆記
本文重點:
1. Ubuntu如何在GUI mode與command mode間切換(virtual box on mac)
2. 如何在command mode下用gpm開啟滑鼠
根據ref1,按下ctrl-alt-F1切換到文字模式;按下ctrl-alt-F7切換到圖形介面。
但macbook的F1-F12預設是特殊功能,需加上fn鍵才會變成真正的F1-F12,
所以變成fn-ctrl-alt-F1切換到文字模式;fn-ctrl-alt-F7切換到圖形介面。
sudo apt-get install gpm安裝gpm後,執行
sudo /etc/init.d/gpm force-reload
就會看到滑鼠滑過的位置反白了。
reference:
1. Ubuntu圖形/文字介面切換
http://linux.about.com/od/ubuntu_doc/a/ubudg24t8.htm
2. 安裝與開啟gpm教學
http://www.cyberciti.biz/tips/howto-linux-configure-the-mouse-at-a-text-based-terminal-for-copy-and-paste-operation.html
3. gpm的man page
http://linux.about.com/library/cmd/blcmdl8_gpm.htm
1. Ubuntu如何在GUI mode與command mode間切換(virtual box on mac)
2. 如何在command mode下用gpm開啟滑鼠
根據ref1,按下ctrl-alt-F1切換到文字模式;按下ctrl-alt-F7切換到圖形介面。
但macbook的F1-F12預設是特殊功能,需加上fn鍵才會變成真正的F1-F12,
所以變成fn-ctrl-alt-F1切換到文字模式;fn-ctrl-alt-F7切換到圖形介面。
sudo apt-get install gpm安裝gpm後,執行
sudo /etc/init.d/gpm force-reload
就會看到滑鼠滑過的位置反白了。
reference:
1. Ubuntu圖形/文字介面切換
http://linux.about.com/od/ubuntu_doc/a/ubudg24t8.htm
2. 安裝與開啟gpm教學
http://www.cyberciti.biz/tips/howto-linux-configure-the-mouse-at-a-text-based-terminal-for-copy-and-paste-operation.html
3. gpm的man page
http://linux.about.com/library/cmd/blcmdl8_gpm.htm
2011年11月26日 星期六
Developer plugin 的願景
它的功能是Developer Documentation Access,如此。
但原本的功能卻壞掉了,因為該module預設的搜尋資料夾/Developer/ADC Reference Library/Documentation/Cocoa/Reference/已不復存在。
現在我把常用的查詢設定為web search,諸如apple dev、cplusplus等。
但其實os x core 10.6的文件(含cocoa及其他許多文件)其實用Xcode下載,在本機上就有一份了,在沒有網路的情形下也可使用。要如何讓存取文件變得更簡單呢?
想把這個工作統一到Alfred或QS的介面上呢。
另外常用的Unix util 的 man也是呢。
但原本的功能卻壞掉了,因為該module預設的搜尋資料夾/Developer/ADC Reference Library/Documentation/Cocoa/Reference/已不復存在。
現在我把常用的查詢設定為web search,諸如apple dev、cplusplus等。
但其實os x core 10.6的文件(含cocoa及其他許多文件)其實用Xcode下載,在本機上就有一份了,在沒有網路的情形下也可使用。要如何讓存取文件變得更簡單呢?
想把這個工作統一到Alfred或QS的介面上呢。
另外常用的Unix util 的 man也是呢。
2011年11月19日 星期六
Alfred與QS的輸入介面
Alfred在中文上比QS好用的一個原因是,它的輸入介面作為一個"text editor"功能是很完備的。
可以反白、刪除、複製、剪下、貼上,與其他mac應用程式的使用經驗相符。
可以這麼說,它就是一個加上即時搜尋的文字輸入框。
而QS的輸入介面,概念上文字與搜尋到的物件是一體的。
快速是QS的特色,打錯就delete就清空重來,而連按兩下delete將pane1清空更是簡潔有力。
可以反白、刪除、複製、剪下、貼上,與其他mac應用程式的使用經驗相符。
可以這麼說,它就是一個加上即時搜尋的文字輸入框。
而QS的輸入介面,概念上文字與搜尋到的物件是一體的。
快速是QS的特色,打錯就delete就清空重來,而連按兩下delete將pane1清空更是簡潔有力。
2011年11月10日 星期四
bug comes!
在Preference->Command下,若Spacebar behavior設定成Normal,
在pane1隨便打個空白就爆了。我現在是設成Switch to Text Mode。
哭哭。
在pane1隨便打個空白就爆了。我現在是設成Switch to Text Mode。
哭哭。
2011年11月9日 星期三
筆記一下修改的地方
修改完成了。現在QS與中文輸入相容了!
來記錄一下修改的地方吧!
QSObjectView.m
在setSearchString:中加了一行
來記錄一下修改的地方吧!
QSObjectView.m
在setSearchString:中加了一行
NSLog(@"setSearchString: %@", newSearchString);
作為debug用,不影響功能。
QSSearchObjectView.h
拿掉
//- (BOOL)handleSlashEvent:(NSEvent *)theEvent;
//- (BOOL)handleTildeEvent:(NSEvent *)theEvent;
這兩個method,取而代之的是
- (BOOL)handleSlash:(NSString *)aString;
- (BOOL)handleTilde:(NSString *)aString;
另外新增
- (void)processTextCommand:(NSString*)aString;
- (BOOL)handleBoundTextKey:(NSString *)aString;
兩個method。
QSSearchObjectView.h
1. 註解掉performKeyEquivalent:的實作。(目前先不註解,改成印出debug訊息)
2. setMarkedText: selectedRange:只留下空殼,內容都註解掉。(這應該是中文字一定要等打完才看得到的原因)
3. insertText:一開始檢查aString的型別,目的是處理NSAttributedString。後面會call processTextCommand:這個method。
4. 新增processTextCommand:與handleBoundTextKey:兩個method。前者處理slash與tilde鍵,後者處理定義在dict中的指令。最重要的改變是,這些指令從在keyDown就執行延後到insertText:時才執行了。
結果:
handleBoundKey只有在performKeyEquivalent:被call時才有可能執行。
已知bug:
1. 在pane1打「修改」,這時QS找不到東西,但仍可以按tab進入pane2,選Dictionary的話,會卡住。解法是用滑鼠點選pane1,並按兩下delete。
2. 不知名情況下,QS會停住,Xcode會花很久蒐集stack frame。
實驗!
實驗:把- (BOOL)performKeyEquivalent:拿掉,QS還能正常運作嗎?
動機:在QSSearchObjectView中,有兩個method會call handleBoundKey:
就是keyDown與performKeyEquivalent:。
因為現在要把keyDown的部分功能移到insertText:去了,擔心在某些case會被低階的performKeyEquivalent:攔截而去執行handleBoundKey:,故先將其註解掉。
實驗:handleBoundKey處理的key
結果:確定會處理,.;'這四個key,而/`不會。
目前/與`是由獨立的handleSlashEvent:與handleTildeEvent:處理。
我想應該都可以整合到handleRepeaterEvent:吧!
動機:在QSSearchObjectView中,有兩個method會call handleBoundKey:
就是keyDown與performKeyEquivalent:。
因為現在要把keyDown的部分功能移到insertText:去了,擔心在某些case會被低階的performKeyEquivalent:攔截而去執行handleBoundKey:,故先將其註解掉。
實驗:handleBoundKey處理的key
結果:確定會處理,.;'這四個key,而/`不會。
目前/與`是由獨立的handleSlashEvent:與handleTildeEvent:處理。
我想應該都可以整合到handleRepeaterEvent:吧!
快捷鍵問題
中文輸入解決了。接下來要處理快捷鍵問題。
中文與英文的keyboard layout不同,其中ㄝㄡㄥㄤ四個鍵在英文鍵盤都只是標點符號,加上輸入法「一聲」需要的空白鍵共五個鍵,在QS中被拿來當做指令使用。
只要讓這五個鍵「復權」,就能讓QS真的變成中文輸入相容了。
以下是我尚未了解的概念:
keyboard actions
action method
key equivalent
keyboard actions,是NSResponder定義好的。subclass可覆寫之。
key equivalent比key interface control還要早被攔截。
看來必須在insertText:處理囉~
中文與英文的keyboard layout不同,其中ㄝㄡㄥㄤ四個鍵在英文鍵盤都只是標點符號,加上輸入法「一聲」需要的空白鍵共五個鍵,在QS中被拿來當做指令使用。
只要讓這五個鍵「復權」,就能讓QS真的變成中文輸入相容了。
以下是我尚未了解的概念:
keyboard actions
action method
key equivalent
keyboard actions,是NSResponder定義好的。subclass可覆寫之。
key equivalent比key interface control還要早被攔截。
看來必須在insertText:處理囉~
QSSearchObjectView的兩個doCommandBySelector:
我突然懂了為什麼QSSearchObjectView同時需要
doCommandBySelector:
與
textView:doCommandBySelector:
了!
前者是一般用途,而後者是在pane1或pane3進入文字編輯模式時使用的。
例如打一些字->large type,
或者google taiwan->search->打一些字
這種時候會用到後者。
doCommandBySelector:
與
textView:doCommandBySelector:
了!
前者是一般用途,而後者是在pane1或pane3進入文字編輯模式時使用的。
例如打一些字->large type,
或者google taiwan->search->打一些字
這種時候會用到後者。
錯誤訊息
把專案抓下來後編譯,觀察console會發現,
在輸入中文字時會噴錯誤訊息
[NSConcreteMutableAttributedString purifiedString]: unrecognized selector sent to instance 0x14ac8b20原因是NSMutableAttributedString不能回應QS對NSString擴充的purifiedString method所致,案發現場是
4 -[QSSearchObjectView setMarkedText:selectedRange:] (in QSInterface) (QSSearchObjectView.m:1539)把purifiedString拿掉後重新編譯,會噴
-[NSConcreteMutableAttributedString _encodingCantBeStoredInEightBitCFString]: unrecognized selector sent to instance 0x151170e0原因是編碼不能被儲存在8-bitCFString,案發現場是
7 -[QSSearchObjectView setMarkedText:selectedRange:] (in QSInterface) (QSSearchObjectView.m:1541)
launcher隨筆
一個好的launcher究竟應該要具備什麼功能呢?
檢視一下我最常做的事,無非是...
- 打開一個應用程式
- 關掉一個應用程式
- 尋找並打開一個檔案
- 找到某個檔案所在的資料夾
- 播放某首歌(如果我記得歌名的話)
- 打開某個網頁(高鐵時刻表, FB, etc.)
- google搜尋
- 中文wiki搜尋
- 英文wiki搜尋
launcher迷人的地方在於它讓你直接告訴電腦「請幫我做這個!」
單純,乾淨,沒有任何多餘的東西。
GUI世界最大的缺點就是過於花俏華麗,太多不相干的東西不停在吸引、分散人的注意力,不堪其擾。
電腦該是工具而不是玩具,工具幫助人提昇生產力;而玩具吸引你的注意,讓你流連忘返。
我不會看到別的應用程式而手癢去開它,也不會中途看到其他網頁。
我要這個,就給我這個。
那麼Launcher本身也必須單純才行,QS實在有些...太花俏了。
五花八門的plugin讓人愛不釋手呢。
這些額外功能包括計算機(Alfred也有)、文字操作、影像縮放、影像轉檔、壓縮等。
好用的包括在終端機打開某檔案的所在資料夾、把檔案email給某人(結合Mail與通訊錄)等。
冷僻的包括更改桌布、取得dropbox的public link等。
講難聽是奇技淫巧,講的好聽就是用起來很爽。
也許是我還不夠習慣比現在更便捷的操作?或許等我上手了,會覺得本來就應該要這麼方便吧。
接下來想說一些QS跟Alfred之間的差異。
Alfred在搜尋時不會顯示太多雜七雜八的東西,但QS會。雖然你想要的東西一定在前幾名,但不曉得底下那些亂糟糟的東西到底是從哪兒來的...有礙觀瞻!
QS是先編一份catalog,再去這裡搜。好處是快速,但不同步。好在按下Command-R可以重新製作catalog,如果沒有自定過於龐大的路徑,這很快就可以完成。
而Alfred每次搜尋都會去翻Hard Disk,感覺有點傷硬碟?好處是同步,壞處是稍慢,需要等它一下下。
最後,Alfred讓我驚艷的是,它預設會搜尋Things待辦事項,甚至連Mail的信都能搜尋。Mail的信可不是照檔名就搜的到的阿,真是太威了!
而且這是你真的在用的東西。
有次經驗讓我印象至深。那時在找去年服務隊的心得,在Mail的搜尋欄怎麼搜都搜不到,急煞我也。但Alfred卻像時光機一般,挖出深埋信箱的回憶。連雄鷹之歌、男女子大學部歌等,只要曾附件在信中,或者信的標題有提到的,通通挖的出來。實在驚人。
真希望QS可以快點支援中文哪。
2011年11月8日 星期二
重頭戲
NSTextInputClient Protocol Reference
| Adopted by | |
| Framework |
/System/Library/Frameworks/AppKit.framework
|
| Availability |
Available in Mac OS X v10.5 and later.
|
| Declared in |
NSTextInputClient.h
|
Overview
The
NSTextInputClient protocol defines the methods that Cocoa text views must implement in order to interact properly with the text input management system. To create another text view class, you can either subclass NSTextView (and not NSText, for historical reasons), or subclass NSView and implement the NSTextInputClient protocolsetMarkedText:selectedRange:replacementRange:
Replaces a specified range in the receiver’s text storage with the given string and sets the selection. (required)
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
Parameters
- aString
- The string to insert. Can be either an
NSStringorNSAttributedStringinstance. - selectedRange
- The range to set as the selection, computed from the beginning of the inserted string.
- replacementRange
- The range to replace, computed from the beginning of the marked text.
Discussion
If there is no marked text, the current selection is replaced. If there is no selection, the string is inserted at the insertion point.
When aString is an
NSString object, the receiver is expected to render the marked text with distinguishing appearance (for example,NSTextView renders with markedTextAttributes).Availability
- Available in Mac OS X v10.5 and later.
See Also
Declared In
NSTextInputClient.h
Binding Keystrokes
doCommandBySelector:
Invokes the action specified by the given selector. (required)
- (void)doCommandBySelector:(SEL)aSelector
Parameters
- aSelector
-
The selector to invoke.
Discussion
If aSelector cannot be invoked, then doCommandBySelector: should not pass this message up the responder chain. NSResponder also implements this method, and it does forward uninvokable commands up the responder chain, but a text view should not. A text view implementing the NSTextInputClient protocol inherits from NSView, which inherits from NSResponder, so your implementation of this method will override the one in NSResponder. It should not call super.
Availability
- Available in Mac OS X v10.5 and later.
See Also
interpretKeyEvents: (NSResponder)
doCommandBySelector: (NSResponder)
Declared In
NSTextInputClient.h
2011年11月7日 星期一
筆記幾篇重要的文章
介紹selector與target-action機制的文章
http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Chapters/ocSelectors.html
關於key-binding的
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TextEditing/Concepts/KeyBindings.html#//apple_ref/doc/uid/TP40008900-BAJCDFFI
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
http://www.hcs.harvard.edu/~jrus/Site/System%20Bindings.html
http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Chapters/ocSelectors.html
關於key-binding的
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TextEditing/Concepts/KeyBindings.html#//apple_ref/doc/uid/TP40008900-BAJCDFFI
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
http://www.hcs.harvard.edu/~jrus/Site/System%20Bindings.html
QSSearchObjectView實作NSTextViewDelegate的用意
發現,在pane1輸入"."進入文字模式時,
凡按下delete、command-C、tab,都會在console印出"select a command~"
而這是寫在textView:doCommandBySelector:中的除錯訊息。
我的猜想是,進入文字模式時會產生一個NSTextView,而QSSearchObjectView就是它的delegate,有事請找我的感覺。
按下"."會發生什麼事呢?
在initialize這個method,會初始化一個NSDictionary bindingDict,它會去找DefaultBindings.qskeys(如果有user自定的,會再去找KeyBindings.qskeys),並讀入「string與action的對應表」。
凡按下delete、command-C、tab,都會在console印出"select a command~"
而這是寫在textView:doCommandBySelector:中的除錯訊息。
我的猜想是,進入文字模式時會產生一個NSTextView,而QSSearchObjectView就是它的delegate,有事請找我的感覺。
按下"."會發生什麼事呢?
在initialize這個method,會初始化一個NSDictionary bindingDict,它會去找DefaultBindings.qskeys(如果有user自定的,會再去找KeyBindings.qskeys),並讀入「string與action的對應表」。
按下"."後,keyDown: 呼叫 handleBoundKey: ,就在這裡找到這個string有特殊binding。
另外,transmogrifyWithText:這個method,似乎就在做這個「文字模式」。
QSSearchObjectView的keyDown:做了什麼?
先來看原始碼。以下是我刪去除錯訊息和timestamp設定的精簡版程式碼:
回歸正題。
接下來的問題是,如果不重寫keyDown,則重點在於讓input context打doCommandBySelector:回來。要如何讓input context選擇正確的selector呢?
// This method deals with all keydowns. Some very interesting things could be done by manipulating this method可以發現它針對某些狀況做了處理,並把event分派給自定method,諸如:
- (void)keyDown:(NSEvent *)theEvent {
// ***warning * have downshift move to indirect object
if ([[theEvent charactersIgnoringModifiers] isEqualToString:@"/"] && [self handleSlashEvent:theEvent]) return;
if (([[theEvent characters] isEqualToString:@"~"] || [[theEvent characters] isEqualToString:@"`"]) && [self handleTildeEvent:theEvent])
return;
if ([self handleBoundKey:theEvent])
return;
if ([[theEvent charactersIgnoringModifiers] isEqualToString:@" "]) { [self insertSpace:nil];
return;
}
// ***warning * have downshift move to indirect object
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Shift Actions"] && [theEvent modifierFlags] &NSShiftKeyMask
&& ([[theEvent characters] length] >= 1)
&& [[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[[theEvent characters] characterAtIndex:0]] && self == [self directSelector]) {
[self handleShiftedKeyEvent:theEvent];
return;
}
if ([theEvent isARepeat] && !([theEvent modifierFlags] &NSFunctionKeyMask) )
if ([self handleRepeaterEvent:theEvent]) return;
//if (VERBOSE) NSLog(@"interpret");
[self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; return;}
handleSlashEvent
handleTildeEvent
handleBoundKey
insertSpace
以及我不太了解的兩個:
handleShiftedKeyEvent
handleRepeaterEvent
最後,交給
interpretKeyEvents (這個method定義在NSResponder中)
。
補充,關於interpretKeyEvents。
這個函式的說明如下:
Discussion
This method sends the character input in eventArray to the system input manager for interpretation as text to insert or commands to perform. The input manager responds to the request by sendinginsertText:anddoCommandBySelector:messages back to the invoker of this method. Subclasses shouldn’t override this method.
See theNSInputManagerandNSTextInputclass and protocol specifications for more information on input management.
可以發現,其中NSInpitManager用灰體字,也沒有連結;而NSTextInput有。
google NSInpitManager可以找到這份文件:
NSInputManager Class Reference (Not Recommended)
想來處理input有兩種方法,其一是在NSResponder中呼叫interpretKeyEvents;
其二是在NSView打一個handleEvent:給[self inputContext]。
前者使用input manager機制,應該是歷史的產物吧!雖保留但不建議使用;後者使用input context機制,建議使用。
回歸正題。
接下來的問題是,如果不重寫keyDown,則重點在於讓input context打doCommandBySelector:回來。要如何讓input context選擇正確的selector呢?
解析input context與keyDown
首先,它是NSControl的子類別,而非NSTextView的子類別。
不過它實作了NSTextInput protocol。
這樣它還能適用Cocoa Text Editing的規則嗎?
回顧Cocoa Text Editing流程Overview of Text Editing,當中的圖片顯示,
NSTextView會打一個handleEvent:給NSTextInputContext。

那麼,非NSTextView的QSSearchObjectView,應該宣告一個自己的NSTextInputContext property嗎?
經過一番努力,發現每個NSView已經擁有自己的NSTextInputContext。
不過,一如之前所說,不應該去改keyDown。
不過它實作了NSTextInput protocol。
這樣它還能適用Cocoa Text Editing的規則嗎?
回顧Cocoa Text Editing流程Overview of Text Editing,當中的圖片顯示,
NSTextView會打一個handleEvent:給NSTextInputContext。
那麼,非NSTextView的QSSearchObjectView,應該宣告一個自己的NSTextInputContext property嗎?
經過一番努力,發現每個NSView已經擁有自己的NSTextInputContext。
補充一下發現的過程。在查找NSTextInputContext的class reference時,發現它的property "client"的說明:
Discussion
The client (owner) of the input context, typically anNSViewinstance, retains itsNSTextInputContextinstance. TheNSTextInputContextinstance doesn't retain its client.
當中提到NSView會maintain一個NSTextInputContext。從這裡我發現了keyDown的正確改寫方法:
- (void)keyDown:(NSEvent *)theEvent {
// add your code here
[[self inputContext] handleEvent:theEvent];
}做完你想做的處理,還是要把event交給input context處理。
不過,一如之前所說,不應該去改keyDown。
在黑暗中摸索--撰寫delegate
能學會撰寫delegate,要感謝CocoaHeads Taipei在Podcast的演講影片,
看過yllan的「如何用 Cocoa 為現有的 command-line 程式寫圖形介面」演講,以及
google到的用Xcode和Interface Builder寫delegate這篇文章後,跌跌撞撞也終於讓我搞懂了。
教訓一:寫完實作protocol的class,它會出現在IB的「Library」小視窗中(通常是藍色方塊)。
記得要手動把它拖到「MainMenu.xib」小視窗,才能玩連連看哦!
這個搞了我好久(哭哭)
按住control,滑鼠按住視覺元件並拖到小方塊上、放開滑鼠,選擇"delegate",就完成了。
接下來是實驗結果。
我實作NSTextViewDelegate的兩個method:
看過yllan的「如何用 Cocoa 為現有的 command-line 程式寫圖形介面」演講,以及
google到的用Xcode和Interface Builder寫delegate這篇文章後,跌跌撞撞也終於讓我搞懂了。
教訓一:寫完實作protocol的class,它會出現在IB的「Library」小視窗中(通常是藍色方塊)。
記得要手動把它拖到「MainMenu.xib」小視窗,才能玩連連看哦!
這個搞了我好久(哭哭)
按住control,滑鼠按住視覺元件並拖到小方塊上、放開滑鼠,選擇"delegate",就完成了。
接下來是實驗結果。
我實作NSTextViewDelegate的兩個method:
- (void)textDidChange:
- (BOOL)textView: doCommandBySelector
結論是,在text view中打任何字(含中英文及空白),會執行textDidChange。
而舉凡enter(return)、tab、shift-tab、Command-C、Ctrl-C等平常使用的「功能鍵」、「組合鍵」都會跑去執行textView: doCommandBySelector。
所以QS提供的特殊指令,例如按下"."進入純文字模式、按下","啟動comma trick、按下"~"切換到home、長按"/"切換到root等,都不能在textView: doCommandBySelector中處理。
2011年11月5日 星期六
找到好東西了!
Text Editing Programming Guide
Delegate Messages and Notifications
Delegate Messages and Notifications
Although you could alter the text view’s behavior by subclassing the text view and overriding
insertText:replacementRange: and doCommandBySelector:, a better solution is to handle the event in the text view’s delegate. The delegate can take control over user changes to text by implementing the textView:shouldChangeTextInRange:replacementString: method.
To handle keystrokes that don’t insert text, the delegate can implement the
Note: To modify editing behavior, your first resort should be to notification or delegation, rather than subclassing. It may be tempting to start by subclassing
NSTextInputContext
Search Fields
textView:doCommandBySelector: method.Note: To modify editing behavior, your first resort should be to notification or delegation, rather than subclassing. It may be tempting to start by subclassing
NSTextView and overriding keyDown:, but that’s usually not appropriate, unless you really need to deal with raw key events before input management or key binding. In most cases it’s more appropriate to work with one of the text view delegate methods or with text view notifications.NSTextInputContext
Search Fields
Quicksilver讀碼日記(一)
修改QS的初衷,是希望這個軟體能支援中文。
As a app launcher,不需要中文,but, as a desktop search engine,支援中文與否直接決定它的可用性。
感謝Patrick Robertson和Rob McBroom的協助,告訴我應該看QSCollectingSearchObjectView.m和QSInterfaceController.m,
今天研究了下QSCollectingSearchObjectView.m/.h。
這個類別就是Pane1和Pane3,接受user的keyboard input。
它的繼承架構如下:
QSCollectingSearchObjectView
QSSearchObjectView
QSObjectView
NSControl
NSView
NSResponder
NSObject
在QSSearchObjectView.h中宣告如下:
...
}
QSSearchObjectView使用了NSTextInput這個protocol,並實作
insertText:
doCommandBySelector:
等幾個method。
其中doCommandBySelector:只是單純的呼叫
[super doCommandBySelector:aSelector]
。另外,關於doCommandBySelector:我發現一件奇怪的事,那就是
QSSearchObjectView有實作textView:doCommandBySelector:,這是NSTextViewDelegate這個protocol的一個method。不過它在宣告明明用到的是NSTextDelegate而非NSTextViewDelegate耶!?
delegate是什麼我也不太清楚,暫時先記著。
As a app launcher,不需要中文,but, as a desktop search engine,支援中文與否直接決定它的可用性。
感謝Patrick Robertson和Rob McBroom的協助,告訴我應該看QSCollectingSearchObjectView.m和QSInterfaceController.m,
今天研究了下QSCollectingSearchObjectView.m/.h。
這個類別就是Pane1和Pane3,接受user的keyboard input。
它的繼承架構如下:
QSCollectingSearchObjectView
QSSearchObjectView
QSObjectView
NSControl
NSView
NSResponder
NSObject
在QSSearchObjectView.h中宣告如下:
@interface QSSearchObjectView : QSObjectView <NSTextInput
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
, NSTextDelegate
#endif
>
{
...
}
QSSearchObjectView使用了NSTextInput這個protocol,並實作
setMarkedText:selectedRange: insertText:
doCommandBySelector:
等幾個method。
其中doCommandBySelector:只是單純的呼叫
[super doCommandBySelector:aSelector]
。另外,關於doCommandBySelector:我發現一件奇怪的事,那就是
QSSearchObjectView有實作textView:doCommandBySelector:,這是NSTextViewDelegate這個protocol的一個method。不過它在宣告明明用到的是NSTextDelegate而非NSTextViewDelegate耶!?
delegate是什麼我也不太清楚,暫時先記著。
關於Cocoa的文字系統,有幾個重要的方法,根據
http://www.cocoabuilder.com/archive/cocoa/156808-keydown-and-japanese-input-methods.html
這篇文章解釋運作原理似乎是這樣的:
keyDown是進入點,基本上不太該改(QS可是大刀闊斧的改了阿XDD)
因為一不小心就會傷害到你的輸入法(這就是我現在的挑戰!)。
key stroke進入keyDown後會被傳送到key binding system,然後以
setMarkedText:selectedRange:replacementRange:
insertText:replacementRange:
doCommandBySelector:
這三種形式回來。它們都是NSTextInputClient Protocol的method。
但後者在NSResponder中有實作,也可在NSTextInput或NSTextInputClient這兩個protocol覆寫之。
這裡就是我們可以介入的地方了,可以在subclass重寫,或者是delegate(它到底是什麼@@)。
setMarkedText:selectedRange:replacementRange:
insertText:replacementRange:
doCommandBySelector:
這三種形式回來。它們都是NSTextInputClient Protocol的method。
但後者在NSResponder中有實作,也可在NSTextInput或NSTextInputClient這兩個protocol覆寫之。
這裡就是我們可以介入的地方了,可以在subclass重寫,或者是delegate(它到底是什麼@@)。
insertText:replacementRange:可以接收
NSString或是NSAttributedString這兩種object。前者是平常用途,後者在使用某些輸入法時會用到。我想中文就是其中一種吧!
然後這篇文章建議,如果要對enter/return做特別處理,應該要去實作
- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)
aSelector;
aSelector;
這個method。我測了一下,發現QS的這個method雖然有實作,但都沒被call到。
如果要在subclass中做,就把doCommandBySelector:重寫吧。
最後,要知道一個字是不是打完還是打到一半,要用NSTextInput protocol的-hasMarkedText這個method。
2011年11月1日 星期二
IO作業:UART學習資源
IO的第一份作業要trace i-boot-lite,一個bootloader,其中有一題是trace "init_serial()"這個function。
我在serial_xscale.c中找到它,而它使用了許多在start_xscale.h中定義的巨集。
當中有許多看的霧煞煞的詞彙,諸如
FFTHR、FFLCR、FFLSR...等等,故做此記錄。
http://www.lammertbies.nl/comm/info/serial-uart.html
http://babbage.cs.qc.edu/courses/cs343/UART/
另外一份關於C的關鍵字volatile的資料如下:
http://ethanjob.blogspot.com/2007/02/volatile.html
我在serial_xscale.c中找到它,而它使用了許多在start_xscale.h中定義的巨集。
當中有許多看的霧煞煞的詞彙,諸如
FFTHR、FFLCR、FFLSR...等等,故做此記錄。
http://www.lammertbies.nl/comm/info/serial-uart.html
http://babbage.cs.qc.edu/courses/cs343/UART/
另外一份關於C的關鍵字volatile的資料如下:
http://ethanjob.blogspot.com/2007/02/volatile.html
2011年10月26日 星期三
撰寫軟體需求規格書(SRS)的學習資源
http://www.microtoolsinc.com/Howsrs.php
http://www.ehow.com/how_4804549_software-requirements-specifications-srs-document.html
http://www.ehow.com/how_4804549_software-requirements-specifications-srs-document.html
訂閱:
文章 (Atom)


