1、check the kernel version

$ uname -r
3.2.--amd64

  2、install the source code

$ sudo apt-get install linux-source-3.2

  then there would be a file in /usr/src

$ ls /usr/src | grep linux-source
linux-source-3.2.tar.bz2

  3、decompress the .bz2

$ sudo tar xvf linux-source-3.2.tat.bz2

  4、configure the files.

$ sudo make oldconfig
// or try the following method
$ sudo make menuconfig
$ sudo make xconfig

  5、compile the kernel

$ sudo make bzImage

  6、compile the modules

$ sudo make modules

  7、install the modules

$ sudo make modules_install

  8、reboot

$ sudo shutdown -r now

  9、try a helloworld module

//hello.c
#include <linux/init.h>
#include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); static int hello_init(void)
{
printk(KERN_ALERT "Hello,world\n");
return ;
} static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye cruel world\n");
} module_init(hello_init);
module_exit(hello_exit);

  Makefile

//Makefile
obj-m := hello.o
KERNELDIR := /lib/modules/3.2.46/build
PWD := $(shell pwd) modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

  then enter make

$ sudo make

  if the file hello.ko created, continue.

  10、test the module.

$ sudo insmod hello.ko
$ sudo rmmod hello.ko
$ cat /var/log/syslog | tail -
Jun :: Debian NetworkManager[]: <info> Activation (eth0) Stage of (IPv6 Configure Timeout) started...
Jun :: Debian NetworkManager[]: <info> Activation (eth0) Stage of (IPv6 Configure Timeout) complete.
Jun :: Debian ntpdate[]: adjust time server 59.66.173.165 offset 0.222044 sec
Jun :: Debian kernel: [ 347.185953] Hello,world
Jun :: Debian kernel: [ 351.580155] Goodbye cruel world
 

  more tips look at

http://hi.baidu.com/sgnkdomnrrejowr/item/5154dec4b94e4ddbef183b7c

Set up the environment for driver compiling in Debian的更多相关文章

  1. Hadoop生态圈-Sqoop部署以及基本使用方法

    Hadoop生态圈-Sqoop部署以及基本使用方法 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Sqoop(发音:skup)是一款开源的工具,主要用于在Hadoop(Hive)与 ...

  2. IBM CLI 和 ODBC

    Installing and Configuring DB2 Clients Running CLI/ODBC Programs The DB2 Call Level Interface (CLI) ...

  3. Warensoft Stock Service Api客户端接口说明

    Warensoft Stock Service Api客户端接口说明 Warensoft Stock Service Api Client Reference 可使用环境(Available Envi ...

  4. 基于Spring的Appium配置应用

    本文主要是讲述,使用Spring框架,优化Appium的Driver调用,并将写在代码里的大量配置参数定义到配置文件当中,还可灵活的控制调用AndroidDriver还是IOSDriver. Spri ...

  5. nova file injection的原理和调试过程

    file injection代码 file injection原理来讲是比较简单的,在nova boot命令中,有参数--file,是将文件inject到image中 nova boot --flav ...

  6. Linux(Ubuntu) OpenGL 开发环境

    Linux(Ubuntu) OpenGL 开发环境 在 PC 平台上开发 OpenGL 可以使用的辅助工具有很多选择,这里我主要参考了 learnopengl 的配置,使用 GLFW 和 GLAD. ...

  7. [转]Ubuntu16.04下ralink rt3290驱动安装

    出处:https://askubuntu.com/questions/253632/how-do-i-get-a-ralink-rt3290-wireless-card-working 解决为问题:L ...

  8. Learn golang: Top 30 Go Tutorials for Programmers Of All Levels

    https://stackify.com/learn-go-tutorials/ What is Go Programming Language? Go, developed by Google in ...

  9. 利用Warensoft Stock Service编写高频交易软件--客户端驱动接口说明

    Warensoft Stock Service Api客户端接口说明 Warensoft Stock Service Api Client Reference 本项目客户端驱动源码已经发布到GitHu ...

随机推荐

  1. EAS系统环境的搭建

    (一)应用服务器配置 1.先建立好程序需要部署的文件夹,如D:\AppServer\,此目录下包含如下几个子目录: XClient(客户端升级程序放置的目录,此目录下应包含Config和Files子目 ...

  2. Solr相似度算法二:Okapi BM25

    地址:https://en.wikipedia.org/wiki/Okapi_BM25   In information retrieval, Okapi BM25 (BM stands for Be ...

  3. Navicat 连接阿里云RDS

    背景: Navicat 是一个非常优秀与易用的数据库可视化管理软件,相信很多人都用过.这次服务器升级,数据库用了阿里云的RDS,阿里云自带的数据库管理面板功能有限,用不习惯.所以还是想着用 Navic ...

  4. Jenkins Pipeline+sonar构建质量平台

    前提: Jenkins JDK 目录: 1.安装sonar插件:SonarQube Scanner for Jenkins 2.安装SonarQube 3.安装sonar-scanner ++++++ ...

  5. uwp获取版本信息win10 VersionInfo

    using Windows.System.Profile; Después vamos a agregar una propiedad que va a contener un mensaje con ...

  6. WPF 卡顿调试经验

    1. 问题 最近的一个项目,正常调试情况下,运行一切正常,但是有某个用户登录后,出现界面卡顿2-3mins后,才正常运行. 2.解决问题方法 (1)首先由于是必现问题,就想在vs的工作环境下调试一下, ...

  7. linux的mount命令详解

    最近在操作京东云服务器,挂在硬盘,分区等操作,重新温习了一下mount命令: linux下挂载(mount)光盘映像文档.移动硬盘.U盘.Windows和NFS网络共享. linux是个优秀的开放源码 ...

  8. Java多线程学习(一)

    在Java多线程应用中,队列的使用率很高,多数生产消费模型的首选数据结构就是队列.Java提供的线程安全的Queue可以分为阻塞队列和非阻塞队列,其中阻塞队列的典型例子是BlockingQueue,非 ...

  9. [CSS3] 边栏导航动画

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. Lucene7.4学习和简单使用

    简述: 前面从新回顾学习了Solr,正好也借此机会顺便学习一下Lucene. 一.什么是Lucene? 全文检索的一个实现方式,也是非结构化数据查询的方法.应用场景:在数据量大,数据结构不固定的时候, ...