- 2
- 0
- 约1.6千字
- 约 26页
- 2017-04-19 发布于四川
- 举报
设备管理和模块机制ppt
设备管理与模块机制;基本概念;基本概念;基本概念;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 file_operations * fops;
};
static struct device_struct chrdev
原创力文档

文档评论(0)