1. 編寫hello.c放到內核drivers/char/目錄下
2. 進入char目錄
1). 在Kconfig文件中添加如下語句:
#add
config HELLO
tristate "hello module"
depends on ARM
default m
#end add
2). 在Makefile中添加:
#add
#obj-m += hellomodule.o
obj-$(CONFIG-HELLO) += hello.o
#end add
3. 圖形配置
make menuconfig ARM=arm CROSS_COMPILE=arm-none-linux-gnueabi-
在Device Drivers -> Character Device 中,找到 “hello module"模塊,按 "y",表示將該模塊編進內核
4. 編譯內核
make ARM=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage
生成內核鏡像:uImage