如何从主机装置使一个内核函数调用?
How to make a kernel function which callable from both the host and device?
现在我们看看其他能挂钩的内核函数。
Now let's look at some of the other kernel functions that you can hook.
这个表列举了几种探针类型,包括调用内核函数和从内核函数返回。
This table enumerates several probe types, including calling a kernel function and returning from a kernel function.
其次,定义您的探针,它是一个探测内核函数sys_sync的条目。
Next, define your probe, which is an entry probe into the kernel function sys_sync.
系统调用或内核函数(link、sethostname、mkdir)。
System calls or kernel functions (link, sethostname, mkdir).
其结果是您可以使用它们的名字来调用内核函数,就像其他任何系统调用一样。
But the result is that you can call your kernel functions using their names, just like any other system call.
表2中还有一些简化函数,它们封装了的几个内核函数(用一个调用代替多个调用)。
Also in this table are a couple of simplification functions that encapsulate the kernel functions in table 2 (requiring a single call instead of multiple calls).
当调用内核函数sys_delete_module(将要删除的模块的名称作为参数传入)之后,第一步便是确保调用方具有权限。
When the kernel function sys_delete_module is invoked (with the name of the module to be removed, passed in as the argument), the first step is to ensure that the caller has permissions.
在一个驱动程序中,mmap函数通过remap _ pfn_range内核函数实现,它提供设备内存到用户地址空间的线性映射。
Within a driver, the mmap function is implemented through the remap_pfn_range kernel function, which provides a linear mapping of device memory into a user's address space.
当调用内核函数sys_init _ module时,会开始一个许可检查,查明调用者是否有权执行这个操作(通过capable函数完成)。
When the kernel function sys_init_module is called, it begins with a permissions check to see whether the caller can actually perform this operation (through the capable function).
为了提高支持向量机(SVM)的识别性能,提出了在常用内核的基础上构造一个组合内核函数,然后用拟牛顿算法对其超参数进行优化的方法。
To improve the performance of support vector machines (SVM), a hybrid kernel is constructed from the existing common kernels, and the hyper-parameters are optimized by using a quasi-Newton method.
首先,类似于将用户空间应用程序和内核函数连接起来的系统调用,一个通常可用的虚拟化调用(hapercall, hypervisor对操作系统进行的系统调用)层允许来宾系统向宿主操作系统发出请求。
First, similar to system calls that bridge user-space applications with kernel functions, a hypercall layer is commonly available that allows guests to make requests of the host operating system.
exec*的这些版本只是内核函数execve() (int execve(constchar *filename, char *constargv [], char *constenvp[])) 的各种调用接口。
These versions of exec* are just various calling interfaces for core function execve(): int execve(const char *filename, char *const argv [], char *const envp[]).
这个函数通常用于调试,但是它在内核中还有许多其他用途。
This function is commonly used for debugging, but it has many other USES within the kernel.
这个工具分析内核代码的覆盖率,并报告哪些行、函数和分支被覆盖以及它们被访问了多少次。
This tool analyzes the coverage of the kernel, and reports what lines, functions, and branches are covered and how many times they were hit.
这被内核中一些依赖于架构的信号量函数使用。
This is used by some of the architecture-dependent semaphore functions in the kernel.
该函数简单检查地址可能是在用户空间,而不是内核。
This function simply checks that the address is likely in user space, not in the kernel.
一旦装入内核并给予其控制,就首先调用这些函数,然后初始化系统的其余部分。
These functions are called first once the kernel is loaded and given control, then the rest of the system is initialized.
内核向相关设备的选择函数注册这个进程 /线程,并让这个进程 / 线程睡眠。
The kernel registers the process/thread with the associated device's select function and puts the process/thread to sleep.
请参见参考资料详细了解内核列表函数。
您还可以手工修改内核源代码来导出另外的函数,用于重新编译并加载新内核后的测试。
You can also manually modify the kernel source to export additional functions for test after rebuilding and rebooting the new kernel.
还可以在内核中添加新函数;新函数在原来的内核中没有对等的实现。
You can also add new functions to augment the kernel; new functions simply have no counterparts in the original kernel.
sci层提供了某些机制执行从用户空间到内核的函数调用。
The SCI is a thin layer that provides the means to perform function calls from user space into the kernel.
但是理解任何内核的最关键要素是内核的映射,它提供符号信息(比如函数、变量以及它们的地址)。
But an important element of understanding any kernel is the map of the kernel, which provides symbol information (such as functions and variables as well as their addresses).
Linux内核提供了几个函数,可以用来将系统调用参数移动到用户空间中,或从中移出。
The Linux kernel provides several functions that you can use to move system call arguments to and from user-space.
注意此处printk的用法:这是内核的printf函数。
Note the use of printk here: this is the kernel printf function.
printk函数和dmesg方法都是用来进行内核调试的常用方法。
The printk function and dmesg methods are common means for kernel debugging.
在安装函数内部,调用了kzalloc(分配内核内存并清零)。
Internal to the setup function, there's a call to kzalloc (which allocates kernel memory and zeroes it).
因为这个用户空间程序将执行ioctl,内核模块必须注册proc _ ioctl函数来处理ioctl请求。
Because the user-space program will do an ioctl, the function proc_ioctl must be registered by the kernel module to handle ioctl requests.
函数 start_kthread通过调用内核API kernel_thread 来启动这个线程。
The function start_kthread launches the thread by calling kernel API kernel_thread.
应用推荐