相关疑难解决方法(0)

什么是create_proc_entry()的替代方案

由于create_proc_entry功能已被弃用,它的替代品是什么?我试图创建一个简单的proc条目,create_proc_entry但得到了这个错误:

错误:函数'create_proc_entry'的隐式声明

我create_proc_entry在proc_fs.h中抓了一下但是没找到它.有什么东西我缺少或有替代方法吗?

linux-kernel procfs

11
推荐指数
1
解决办法
2万
查看次数

我们对用户程序和Linux内核模块之间的通信有什么选择?

我是Linux内核模块编程的新手.从我到目前为止阅读的材料中,我发现用户程序有3种方式来请求服务或与Linux内核模块通信

  1. / dev中的设备文件
  2. / proc文件系统中的文件
  3. ioctl()调用

问题:我们还有哪些其他选项可用于用户程序和Linux内核模块之间的通信?

kernel-module linux-device-driver linux-kernel

7
推荐指数
2
解决办法
1651
查看次数

如何修复错误:从不兼容的指针类型传递“proc_create”的参数 4

我正在尝试将内容加载到我的内核中,以了解如何添加内容!

我这里有两个文件!

下面是skynet.c:

#include <linux/module.h>    // included for all kernel modules
#include <linux/kernel.h>    // included for KERN_INFO
#include <linux/init.h>      // included for __init and __exit macros

#include <linux/proc_fs.h>   // file operations
#include <linux/seq_file.h>  // seq_read, ...

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Dr. Dyson");
MODULE_DESCRIPTION("Global Information Grid");

static int skynet_show(struct seq_file *m, void *v);

static int skynet_open(struct inode *inode, struct  file *file);

static const struct file_operations skynet_fops = {
  .owner = THIS_MODULE,
  .open = skynet_open,
  .read = seq_read,
  .llseek = seq_lseek,
  .release = single_release,
}; …
Run Code Online (Sandbox Code Playgroud)

c kernel linux-kernel

4
推荐指数
1
解决办法
1640
查看次数