Linux实用教程 Linux设备管理与模块机制.pptxVIP

  • 3
  • 0
  • 约1.98千字
  • 约 27页
  • 2021-11-08 发布于江苏
  • 举报

Linux实用教程 Linux设备管理与模块机制.pptx

设备管理与模块机制;根本概念;根本概念;根本概念;VFS中的文件;(1) llseek(file, offset, whence):修改文件的读写指针。 (2) read(file, buf, count, offset):从设备文件的offset 处开始读出count个字节,然后增加*offset的值。 (3) write(file, buf, count, offset):从设备文件的offset处写入count个字节,然后增加*offset的值。 (4) ioctl(inode, file, cmd, arg):向一个硬件设备发命令,对设备进行控制。 (5) mmap(file, vma):将设备空间映射到进程地址空间。 (6) open(inode, file):翻开并初始化设备。 (7) release(inode, file):关闭设备并释放资源。 (8) fsync(file, dentry):实现内存与设备之间的同步通信。 (9) fasync(file, on):实现内存与设备之间的异步通信。;fs/devices.c struct device_struct { const char * name; struct * fops; }; static struct device_struct chrdevs[MAX_CHRDEV];

文档评论(0)

1亿VIP精品文档

相关文档