简体   繁体   English

修改Linux内核中的系统调用并在虚拟机(不是模块)中重新编译

[英]modifying system call in Linux kernel and recompiling in a virtual machine (not a module)

I am trying to modify the sys_write system call in the Linux kernel. 我正在尝试在Linux内核中修改sys_write系统调用。 I have researched and found the source code online, but I don't know how to access the source code in my virtual machine so that I can start changing it. 我已经在线研究并找到了源代码,但是我不知道如何在虚拟机中访问源代码,以便可以开始对其进行更改。 I have looked everywhere in the file system, but all I can find are header files and makefiles. 我在文件系统中到处都看过,但是我只能找到头文件和makefiles。 I am thinking that they made the .c files invisible from within the OS for a reason. 我认为它们使.c文件从OS内部不可见是有原因的。 Does anyone know how I can get to them, or do I have to modify source I download from the internet and recompile from scratch? 有人知道我该怎么做吗,还是我必须修改从互联网下载的资源并从头开始重新编译?

First of all: download and build Linux Kernel. 首先:下载并构建Linux内核。 In internet there is so many tutorials about that. 互联网上有很多有关此的教程。 After that you can try to write own System Call but for every new system call you need to rebuild a kernel. 之后,您可以尝试编写自己的系统调用,但是对于每个新的系统调用,您都需要重建内核。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM