在driver目錄下,新建hello資料夾,進入資料夾,建立兩個檔案hello.h和hello.c,在hello資料夾下新增kconfig和makefile兩個檔案。
1,kconfig檔案內容
config hello
tristate "first android driver"
default n
help
this is the first android driver
2,makefile檔案內容
obj-$(config_hello) += hello.o
在kconfig檔案中,tristate表示hello模組支援以模組內建和不編譯三種方法,在makefile中個呢句不同的hello值,執行不同的編譯方法。
3,修改arch/arm/kconfig和dirver/kconfig兩個檔案,加入source "driver/hello/kconfig"
修改driver/makefile檔案,新增obj-$(config_hello) += hello/
linux核心中匯流排驅動模型
最近學習了linux系統的匯流排驅動模型,在這就簡單的講一下自己對於其中的理解 在這個驅動模型中由幾個重要的概念 匯流排 這個 匯流排 不是我們通常所說的傳輸資料的匯流排,而是將裝置和驅動聯絡起來的乙個中介軟體,在這個匯流排上掛載了許多裝置,在註冊驅動模組的時候,它就會根據某種固定的匹配規則找到你想...
Linux核心中LED驅動框架
朱有鵬老師驅動開發學習筆記 1 讀寫led裝置屬性檔案 led裝置屬性的show和store方法 led裝置驅動程式 操作led硬體裝置 2 led classdev結構體定義 struct led classdev 3 編寫led驅動程式其實就是填充led classdev結構體內的成員,並在模組...
新增linux核心驅動
1.將核心驅動.ko放入 lib modules 3.2.0 23 generic kernel drivers 目錄下 2.執行depmod a來解決依賴 掃瞄driver下的驅動依賴關係 命令執行完成後,會自動生成modules.dep 和modules.alias。dep為依賴關係。3.更新當...