第6章 Linux编程基础教学资料-.pptVIP

  • 7
  • 0
  • 约2.14万字
  • 约 109页
  • 2019-01-06 发布于江苏
  • 举报
4.字符型驱动编程示例-源代码 驱动程序源代码文件drivertst.c和测试应用程序源代码文件chartest.c。 /* drivertst.c */ #include linux/kernel.h #include linux/module.h #include linux/fs.h #include linux/types.h #include linux/init.h #include asm/segment.h #include asm/uaccess.h #define SUCCESS 0 #define DEVICE_NAME char_driver_test #define BUF_LEN 80 static char Message[BUF_LEN];//定义内核空间的缓冲区 4.字符型驱动编程示例-源代码 static int device_open(struct inode *inode, struct file *file) { return SUCCESS; } static int device_release(struct inode *inode, struct file *file) { return 0; } 4.字符型驱动编程示例-源代码 static ssize_t device_write(struct file *file,con

文档评论(0)

1亿VIP精品文档

相关文档