相关文章  
  • linux入门教程第1章系统简介
  • 教程/操作系统手把手教你装Linux系统
  • Linux办公一条龙之初识OpenOffice(无图)
  • 基于Linux操作系统--构建路由器的方法
  • Linux服务器上的备份和恢复(上)
  • 建立针对arm-linux的交叉编译环境
  • Linux服务器上的备份和恢复(下)
  • Linux系统初学者的常见问题解决集结
  • 综合辅导:如何选用linux
  • 大学考试的LINUX试题参考答案(3)
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    入门文章:教你学会编写Linux设备驱动之三2

    fs.h里定义 */

    struct file_operations asdf_fops = {

    open: asdf_open,

    release: asdf_release,

    read: asdf_read,

    write: asdf_write,

    llseek: asdf_lseek,

    };


    static int asdf_major; /* 用来保存申请到的主设备号 */

    static u8 asdf_body[4096]="asdf_body\n"; /* 设备 */


    static int

    init_module

    (){

    printk ("Hi, This' A Simple Device File!\n");

    asdf_major = register_chrdev (0, "A Simple Device File", &asdf_fops); /* 申请字符设

    页码:[1] [2] [3] [4] [5]2页、共5页

         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved