發表文章

目前顯示的是 2月, 2015的文章

vim + cscope + ctags + nerdtree + taglist + SrcExpl+trinity, c ya source Insight.

圖片
 Bought a MACbook air installed ubuntu+LXDE, time to say good bye to windows & source Insight. I tried eclipse to develop C about 1 month before, eclipse is nice tool to trace code, but somehow I still feel eclipse a bit laggy.        Finally, I use VIM, because both of MAC OS X and Linux have VIM.      website:  The NERD tree : A tree explorer plugin for navigating the filesystem download NERD_tree.zip unzip NERD_tree.zip  mkdir -p ~/.vim/plugin  mv plugin/NERD_tree.vim ~/.vim/plugin  vim ~/.vimrc add this line: nnoremap :NERDTree same producer to install taglist,  trinity,  and SrcExpl.  You may need a script to generate cscope and ctags index files. CSCOPE_FILE=cscope.out if [ -n "$1" ]; then  echo "Source code directory: " $1  echo "Create file map : " $CSCOPE_FILE  find $1 -name "*.c" -o -name "*.c" -o -name "*.h" -o -name "*.c" -o -name "*.S" >    $CSCOPE_FI

自己動手做OS之Raspberry Pi interrupt example 筆記

圖片
Happy Chinese New Year!!  希望我年假,有更多時間好好學習作業系統...T_T 這是個學習筆記,還未整理好,看起來很亂,但是我會盡量把該注意的重點寫下。 Interrupt example Raspberry Pi source code: https://github.com/tzuCarlos/RaspberryPi/tree/master/labInterrupt 這範例中,我們使用timer 產生IRQ,執行時,可以看到,每隔一小段時間,就會印出IRQ_handler,在IRQ_handler()中,先關掉了IRQ再印出IRQ_handler,接著啟動IRQ,這是一個簡單的範例,但不是有效率的處理IRQ方式,以後我們來討論巢式中斷。 當IRQ發生時,硬體會自動跳到0x18的位址上去執行程式,但我們系統是掛在0x10000上,跳到0x18時並沒有東西,這時有幾個解決方式,1是利用mmu把0x18 mapping 至 0x10018上,或是設定CP15,跳轉到正確的中斷處理向量表上。 ARM的官方網站有很好說明,值得一看。 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203j/Cacbhjjj.html 以下是節錄  陳鐘誠老師的網站( http://sp1.wikidot.com/arm ) ------------------------------------------------------------------------------------------------------------------------- ARM 的可存取暫存器為 R0-R15,其中 R13為堆疊指標 SP (Stack Pointer),R14 為連結暫存器 LR (Link Register),R15 為程式計數器 PC (Program Counter)。 ARM的狀態暫存器有 CPSR (Current Processor Status Register) 與 SPSR (Saved Processor Status Register)。其中 SPSR 乃是在中斷時用來自動儲存CPSR的暫存器。