按照linux device driver 3版, 第一个hello world程序的编译
编译环境:
安装
build-essential
linux-header-......(你自己使用的内核版本,可以用uname -r查看)
linux-source-...
下载ldd的example,解压, 到其中的misc-modules目录下有 hello.c和Makefile
直接make就可以了
生成了hello.ko
然后终端运行
sudo insmod hello.ko
按照ldd的说法,此时是没有输出的, 输出在/var/log/kern.log中, 你可以看到Hello World
卸载内核模块类似
[分享]编译内核模块
-
- 帖子: 95
- 注册时间: 2006-07-07 16:49