我的任务非常简单,向服务器发送http/https请求,获取HTML,JSON或XML并处理数据.
据我所知,有2个模块可以完成模块部分.nodejs.org/api/http.html和 https://www.npmjs.com/package/request
我想请求更先进.除此之外,2之间有什么区别,这使得一个更合适或更不适合我说的任务?
在我搜索 Linux 内核开发的任何地方,我都会得到创建 Linux 内核模块的答案。例子
 /*
* hello?1.c ? The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}
Run Code Online (Sandbox Code Playgroud)
在这里,有 init_module 和 cleanup_module 函数,我了解它们包含在内核初始化和清理时要执行的内容。通过在 makefile 中添加 obj-m += hello-1.c 来制作。
但我不想要这个。我想添加一个内置程序,而不是驱动程序,基本上是一个服务,以方便从内核级别云上传一些数据。编译内核时,我不想要程序的模块选项。
我只理解我应该使用 obj-y 而不是 obj-m 的程序。但是没有编写此类程序的手册。为什么?我错过了什么吗?即使这些程序不是模块,它们是否也具有 init_module 和 …
我在德州仪器(TI)的本教程之后,在早期版本(4.4)中向Android Framework添加了一个新的系统服务
但是当我尝试在Android Lollipop中做类似的事情时,SELinux政策拒绝我这样做.这是logcat的输出.
05-11 15:49:51.362   248   248 I SystemServer: Test Service Starting
05-11 15:49:51.364   248   248 I TestManagerService: Started Test Manager Service
05-11 15:49:51.370    54    54 E SELinux : avc:  denied  { add } for service=TestManagerService scontext=u:r:system_server:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager
05-11 15:49:51.371    54    54 E ServiceManager: add_service('TestManagerService',28) uid=1000 - PERMISSION DENIED
05-11 15:49:51.378   248   248 E SystemServer: Failure starting TestManagerService
05-11 15:49:51.378   248   248 E SystemServer: java.lang.SecurityException
05-11 15:49:51.378   248   248 E SystemServer:  at android.os.BinderProxy.transactNative(Native Method)
05-11 15:49:51.378 …Run Code Online (Sandbox Code Playgroud)