seq_file学习(1)—— single_open】的更多相关文章

span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }.cm-searchi…
li {list-style-type:decimal;}ol.wiz-list-level2 > li {list-style-type:lower-latin;}ol.wiz-list-level3 > li {list-style-type:lower-roman;}blockquote {padding:0 12px;padding:0 0.75rem;}blockquote > :first-child {margin-top:0;}blockquote > :last-…
转自:http://blog.csdn.net/mumufan05/article/details/45803219 学习笔记与个人理解,如有错误,欢迎指正. 温馨提示:建议跟着注释中的编号顺序阅读代码 测试方法:cat /proc/abc_proc echo 任意字符串 >/proc/abc_pro(需root权限) /************************************************* 使用seq_file接口实现可读写proc文件的例子 适用于3.10以后的内…
目录 . 进程相关数据结构 ) struct task_struct ) struct cred ) struct pid_link ) struct pid ) struct signal_struct ) struct rlimit . 内核中的队列/链表对象 ) singly-linked lists ) singly-linked tail queues ) doubly-linked lists ) doubly-linked tail queues . 内核模块相关数据结构 ) st…
Introduction the naive "scull" 首先.什么是scull? scull (Simple Character Utility for Loading Localities). scull is a char driver that acts on a memory area as though it were a device. 和第一个C程序Hello world一样.他什么都不能干,却能非常好的阐释怎么一步步进阶的去写驱动 blog的最后,我会给出这对于s…
seq相关头文件linux/seq_file.h,seq相关函数的实现在fs/seq_file.c.seq函数最早是在2001年就引入了,但以前内核中一直用得不多,而到了2.6内核后,许多/proc的只读文件中大量使用了seq函数处理. 由于procfs的默认操作函数只使用一页的缓存,在处理较大的proc文件时就有点麻烦,并且在输出一系列结构体中的数据时也比较不灵活,需要自己在read_proc函数中实现迭代,容易出现Bug.所以内核黑客们对一些/proc代码做了研究,抽象出共性,最终形成了se…
1. 先看下超级块支持的函数列表,文件路径\4412_SCP精英版\Android源码\iTop4412_Kernel_3.0_20140521\iTop4412_Kernel_3.0\include\linux struct super_operations { struct inode *(*alloc_inode)(struct super_block *sb); void (*destroy_inode)(struct inode *); void (*dirty_inode) (str…
简介 Reptile是github上一个很火的linux lkm rootkit,最近学习了一些linux rootkit的内容,在这里记录一下. 主要是分析reptile的实现 Reptile的使用 安装命令: sudo ./setup.sh install 然后执行下面的命令 /reptile/reptile_cmd show 接着就可以看到/reptile目录下的一些东西了,这是项目安装在系统中的一些文件,在安装完成后,默认是隐藏的.具体的执行命令就不再这里赘述了 会出现下面这些程序 Re…
在需要创建一个由一系列数据顺序组合而成的/proc虚拟文件或一个较大的/proc虚拟文件时,推荐使用seq_file接口. 数据结构struct seq_fille定义在include/linux/seq_file.h struct seq_file { char *buf;     //seq_file接口使用的缓存页指针 size_t size;   //seq_file接口使用的缓存页大小 size_t from;   //从seq_file中向用户态缓冲区拷贝时相对于buf的偏移地址 s…
Linux字符型设备驱动之初体验 文章目录 Linux字符型设备驱动之初体验 前言 框架 字符型设备 程序实现 cdev kobj owner file_operations dev_t 设备注册过程 申请设备号 注册设备 register_device 如何构建 模块编译 内核编译 Makefile Kconfig 总结 参考 前言 驱动总共分为字符型设备驱动,块设备驱动,网络设备驱动.对于字符型设备驱动的资料,网上比较多,<Linux Kernel Driver>这本书可以了解一下,对于学…