【问题标题】:How can I map a memory of bytes from a kernel module to user space app?如何将字节内存从内核模块映射到用户空间应用程序?
【发布时间】:2012-08-02 19:52:01
【问题描述】:

我想在内核模块中声明一个数组并在用户空间应用程序中访问它。我该怎么做?

我如何内存映射它以通过用户空间使用,以便用户可以使用它?

【问题讨论】:

    标签: c memory linux-kernel kernel


    【解决方案1】:

    您很可能需要实现一个字符设备。然后在您的struct file_operations 实例中实现mmap function

    【讨论】:

      【解决方案2】:

      我猜你这里什么都有:http://www.scs.ch/~frey/linux/memorymap.html

      顺便说一下,Google 上的第一个结果。

      【讨论】:

        【解决方案3】:

        Linux Device Driver 3th 第15章。讲了mmap。第 3 章和第 6 章讨论 char 设备。

        【讨论】:

          【解决方案4】:

          也许用户空间 I/O 系统会帮助你:https://www.osadl.org/?id=321

          【讨论】:

            猜你喜欢
            • 2012-02-05
            • 2016-03-10
            • 1970-01-01
            • 2014-06-10
            • 1970-01-01
            • 2012-08-19
            • 2017-01-12
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多