无需源代码构建linux模块 [英] Build a linux module without source code

查看:82
本文介绍了无需源代码构建linux模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道是否有可能在没有源代码的情况下构建/插入模块.假设我已经下载了openSuse操作系统,但内核源代码没有随附.如何在不重新编译内核的情况下编译模块并插入模块?

I just wonder, whether it is possible to build/ to insert a module without the source code. Say I have downloaded an openSuse operating system, and the kernel source code did not come with it. How can I compile a module and insert the module without recompiling the kernel?

对于没有内核源代码的openSuse来说,很难找到完全相同版本的源代码.即使内核的配置不同,也无法将模块插入当前的openSuse中.

For openSuse without kernel source code, it is really hard to find exactly the same version of the source code. Even if the configuration of the kernel is different you cannot insert the module inside the current openSuse.

但这在业界不可能发生,对吗?我们无法编写驱动程序,而不能让用户下载最新版本的源代码并找出正确的配置.

But this could not happen in the industry, could it? We cannot write a driver and let a user download the newest version of the source code and figure out the correct configuration.

该问题如何在行业中解决?我好奇.我对此还比较陌生.

How is this problem solved in the industry? I am curious. I am relatively new to this.

推荐答案

要构建模块,您需要内核标头而不是整个源代码. NVidia以这种方式重建其内核模块,因此这将是业界解决该问题的一种方式. Linux对仅二进制模块不是很友好,实际上,内核开发人员过去经常更改ABI和结构以破坏仅二进制模块.

To build a module you need the kernel headers not the entire source code. NVidia rebuilds it's kernel module this way, so this would be one way of how the industry has solved the problem. Linux is not very friendly to binary only modules and in fact the kernel developers used to routinely change ABIs and structures to break binary only modules.

这篇关于无需源代码构建linux模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆