Warning
You should also give some thought to where you do your module experimentation, development, and testing. We have done our best to make our example modules safe and correct, but the possibility of bugs is always present. Faults in kernel code can bring about the demise of a user process or, occasionally, the entire system. They do not normally create more serious problems, such as disk corruption. Nonetheless, it is advisable to do your kernel experimentation on a system that does not contain data that you cannot afford to lose, and that does not perform essential services. Kernel hackers typically keep a "sacrificial" system around for the purpose of testing new code. 您还应该考虑在哪里进行模块实验、开发和测试。 我们已尽最大努力使我们的示例模块安全且正确,但始终存在错误的可能性。 内核代码中的错误可能会导致用户进程或偶尔会导致整个系统的消亡。 它们通常不会产生更严重的问题,例如磁盘损坏。 尽管如此,建议您在不包含您无法承受丢失的数据并且不执行基本服务的系统上进行内核实验。 为了测试新代码,内核黑客通常会保留一个“牺牲”系统。
So, if you do not yet have a suitable system with a configured and built kernel source tree on disk, now would be a good time to set that up. We'll wait. Once that task is taken care of, you'll be ready to start playing with kernel modules. 因此,如果您还没有一个合适的系统,在磁盘上配置并构建了内核源代码树,那么现在是设置它的好时机。 我们会等的。 一旦完成了该任务,您就可以开始使用内核模块了。