C - kenel模块中的卷曲

时间:2016-04-18 19:39:47

标签: curl linux-kernel kernel-module

我尝试触发键盘LED闪烁,我已经可以基于此示例:http://www.tldp.org/LDP/lkmpg/2.6/html/x1194.html

但不知何故,我需要访问API并使用它的响应。是否可以在Linux内核模块中使用curl?或者我应该怎么做呢?

1 个答案:

答案 0 :(得分:2)

这里有一个可用的内核模块

Isolate Kernel Module to a Specific Core Using Cpuset

这会创建一个设备/dev/toy

要执行您想要的操作,请编辑以下功能以使LED闪烁。

static int toy_open(struct inode *inodep, struct file *filep) {
  ....
  printk(KERN_INFO "open: called\n");
  return 0;
}

要触发该功能,请使用此

cat /dev/toy