首页 | 本学科首页   官方微博 | 高级检索  
     

Linux中用户空间与内核空间的通信实现
引用本文:杨宇音 李志淮. Linux中用户空间与内核空间的通信实现[J]. 微机发展, 2005, 15(5): 75-76,130
作者姓名:杨宇音 李志淮
作者单位:大连海事大学计算机科学与技术学院 辽宁大连116026(杨宇音),大连海事大学计算机科学与技术学院 辽宁大连116026(李志淮)
摘    要:在Linux环境下开发程序时,有时需要交换用户空间与内核空间的数据,以及对用户空间和内核空间的数据进行通信等处理。一般情况下.比较常用的两种方法为创建/proc文件与注册字符设备驱动文件。文中在实验的基础上对这两种方法的实现框架进行了研究,对它们各自的优缺点做了深入的分析。实验结果显示,两者的效率与性能上/proc要略高于字符设备文件。最后得出如下结论:设备驱动文件模块化程度高,容易掌握,也是比较常见的方法,而/proc文件则比较灵活,同时也比较复杂,一般用来读取内核的信息。

关 键 词:/proc文件 字符设备 用户空间 内核空间
文章编号:1005-3751(2005)05-0075-02

Realization of Communication of User Space Data with Kernel Space Data in Linux
YANG Yu-yin,LI Zhi-huai. Realization of Communication of User Space Data with Kernel Space Data in Linux[J]. Microcomputer Development, 2005, 15(5): 75-76,130
Authors:YANG Yu-yin  LI Zhi-huai
Abstract:At the procedure of developing under the environment of Linux, exchanging datum of user space and kernel space is needed, and their communication is needed to deal with. There are two methods often used, that are registering char equipment device file and setting up /proc file. This article carries on research on the realization frames of these two kinds of methods on the basis of experiment, and has made deep analysis to their pluses and minuses. The experimental result shows that the efficiency and performance of /proc file is higher than that of character equipment file. The following conclusion must happen finally: the char device file is more modularized, easy to master, it is a more common method too, /proc file is more flexible, more complicated too at the same time, used for reading information of kernel generally.
Keywords:proc file  char device  user space  kernel space  
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号