writing linux driver

来源:互联网 发布:长虹电视软件下载 编辑:程序博客网 时间:2024/05/02 01:38

1. Set up build environment

    >aptitude install build-essential

    >aptitude install linux-kernel-headers

 

2. Write sample code

 

 

3. Makefile

 

 

4. After excute command make, the files will looks like this:

 

 

5. Then install/remove this module,you will look the message output by the driver.

 

    >insmod mydrv.ko

    >Mydrv init ok!

    >rmmod mydrv.ko

    >Mydrv exit ok!

 

    If you can not see it, please use this method:

    >dmesg | tail



#END

 

原创粉丝点击