从哪里开始使用Linux内核模块? [英] Where to start with Linux Kernel Modules?

查看:106
本文介绍了从哪里开始使用Linux内核模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一点背景知识,我是操作系统课程的CMPE学生.我有一些C编码的基本知识,但是对C ++较为满意(大约花了3个学期).除此之外,再也没有任何其他编码方面的正式培训.另外,我对linux环境有基本的了解.

A little background, I'm a CMPE Student currently in an Operating Systems class. I have some basic knowledge of C coding but am more comfortable with C++ (taken about 3 semesters of that). Other than that, never had any other formal training in coding. Also, I've got a basic understanding of the linux environment.

我正在从事一个项目,该项目需要我和我的团队编写一个可以执行以下操作的linux内核模块:

I am working on a project that requires me and my team to code a linux kernel module that can do the following:

  • 通过将接收到的数据打印到内核日志中,以回显从用户级进程传递来的数据
  • 能够将数据从一个用户进程传递到另一个用户进程.
  • 必须有可能将内核模块用作进程间通信抽象.该模块应提供发送方向其发送数据但没有接收方等待的情况.该模块必须涵盖接收方要求数据但无可用数据的情况.
  • 模块必须涵盖接收方要求数据但没有可用数据的情况.
  • 必须限制模块中的缓冲区容量.

现在,我不知道对于那些有编程背景的人来说,这看起来有多困难,但是对于我这个位置的人来说,这似乎是一件不可能完成的任务.

Now I don't know how difficult this seems to those with a background in programming, but this seems like an impossibly complicated task for someone in my position.

这是我到目前为止所做的:

Here's what I've done so far:

  1. 已成功编码,编译,插入和删除了基本的"hello world" Linux内核模块
  2. 通读《 Linux内核模块编程指南》的前4或5章. /a>
  3. 通读一些stackoverflow帖子,似乎都无法将我定向到需要去的地方.

所以最后这是我的问题:有人可以指出我需要这样做的方向吗?我什至不知道在哪里可以找到用于读取用户级过程数据的命令,因此我需要一个开始的地方. TLPD非常适合用于该主题的见解,但并不能帮助我达到一个可行的项目上交的位置.过去,我将学习阅读源代码和逆向工程,可以在任何地方找到我找到类似的东西?任何帮助都将受到赞赏.

So finally here's my question: Can someone please point me in the direction that I need to go with this? I don't even know where to being to find commands to use for reading in user-level process data and I need somewhere to start me off. TLPD was great for insight on the topic but isn't helping me get to the point where I will have a workable project to turn in. In the past, I would learn off of reading source code and reverse engineering, is there anywhere I can find something like that? Any and all help is appreciated.

-将

推荐答案

您所描述的内容与管道.

阅读 Linux设备驱动程序的第三章. (但不要只复制 scull管道示例…)

Read chapter three of Linux Device Drivers. (But don't just copy the scull pipe example …)

这篇关于从哪里开始使用Linux内核模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆