linux driver
1991年 當Linus Torvalds 還是赫爾辛基大學的學生時,發表了最初的Linux,並在同年8月在 comp.os.unix上發了一篇公告
出處:http://www.thelinuxdaily.com/2010/04/the-first-linux-announcement-from-linus-torvalds/
Linux 的source code 的官方網站是https://www.kernel.org/ 可以用git或wget下載原始碼
現在就讓我們開始吧~
實驗環境:
首先先安裝必要的package
下載source code
The latest stable
下載好了之後我們先來看看 directory 裡有什麼東西吧
文件 | 說明 |
---|---|
arch | 包含各種處理器架構的程式碼 |
block | holds code for block-device drivers |
certs | |
crypto | Linux kernel的加密API |
Documentation | Linux kernel的說明文件 |
drivers | 驅動程式 |
firmware | |
fs | filesystem code |
include | 標頭檔 |
init | 核心初始化 |
ipc | Inter-Process Communication |
kernel | Kernel level code 和system call code |
lib | 函式庫 |
mm | High level memory management code |
net | The high-level networking code |
scripts | 建立kerenel 會用到的scripts |
security | Code for different Linux security models |
sound | 音效卡 |
tools | kernel tools |
usr |
安裝cross compile tool
可以自己設定或選擇預設的設定
defconfig 的內容可以利用 make ARCH=arm help 查看
自己設定.config
config 設定好了後就來compile linux kernel
把V=1 打開是為了可以觀察詳細的指令輸出情形
然後稍待片刻
待補:
a. uImage: 給 uboot 用的 binary format
b. dtbs: 編譯 device tree
c. 針對make target解釋