More Related Content
Similar to U boot 程式碼打掃計畫 (20)
U boot 程式碼打掃計畫
- 3. 什麼是 u-boot
“u-boot”就是德語的”潛艇”,英文其實是u-boat
u-boot是一種歷史悠久的open source (GPLv2)
boot loader,很多嵌入式系統都在用。
• 支援x86, arm, mips, avr32, nds32等等CPU
• u-boot其實是Universal Boot Loader的意思
u-boot project wiki:
• http://www.denx.de/wiki/U-Boot/
u-boot source code:
• git://git.denx.de/u-boot.git
- 5. 為什麼要打掃u-boot
u-boot歷史悠久,很多程式碼都很舊,過
時的寫法,以及風格不統一等等的歷史包
袱,造成維護和開發上的困難。
• u-boot於Oct 22, 1999首次release
• Linux 於 Oct 5, 1991年首次release
- 6. 為什麼要打掃u-boot
程式風格不統一造成的維護困難:
• 新加入的開發者無所適從
送出來的patch造成review的人閱讀困難
Patch的程式碼格式不對,經常會退件要求開發者
重寫
• 增加許多不必要得開發時間和書信往返
舊的程式碼變數和函式命名大小寫不一致,導致除
錯上的困難
Compiler的技術演進,對於語法檢查會更嚴謹。某
些舊式的macro寫法在新的compiler上有相容性問
題,需要做修正。
- 13. git commit -s
git format-patch
git send-email
git rebase -i
git commit -s
git format-patch
git send-email
git rebase -i
git commit -s
git format-patch
git send-email
git rebase -i
- 21. 先讀一下 u-boot 的 coding style
Coding style
• http://www.denx.de/wiki/U-
Boot/CodingStyle
Patch rules
• http://www.denx.de/wiki/U-Boot/Patches
- 22. 再按照這份文件step-by-step的方法
http://www.slideshare.net/macpaul/u-
boot-source-clean-up-project-howto
最後用 git 送出你對 u-boot 的第一個
patch