- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在驱动程序中,我经常看到使用这三种类型的 init 函数。
module_init()
core_initcall()
early_initcall()
最佳答案
module_init
用于标记要用作 Linux 设备驱动程序入口点的函数。
它被称为
do_initcalls()
期间(对于内置驱动程序)*.ko
模块)module_init()
每个驱动模块。
*_initcall()
函数通常用于设置函数指针以初始化各种子系统。
do_initcalls()
within Linux kernel source code包含对各种 initcall 列表的调用以及在 Linux 内核启动期间调用它们的相对顺序。
early_initcall()
core_initcall()
postcore_initcall()
arch_initcall()
subsys_initcall()
fs_initcall()
device_initcall()
late_initcall()
内置模块结束modprobe
或 insmod
的 *.ko
模块。 module_init()
在设备驱动程序中是
equivalent to registering a device_initcall()
.
*.o
)的顺序很重要;它决定了它们在运行时被调用的顺序。
*_initcall
functions of the same level
will be called during boot in the order they are linked.
drivers/scsi/Makefile
中 SCSI 驱动程序的链接顺序将更改检测 SCSI Controller 的顺序,从而更改磁盘的编号。
关于linux-kernel - module_init() 与 core_initcall() 与 early_initcall(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18605653/
我目前正在研究内核模块。这是一个重现我的问题的简约模块。 main_module.c: #include #include #include #include #include "other_
我编写了一个简单的模块代码,试图理解当我们从 module_init 函数调用 Schedule() 时会发生什么。 #include #include #include
我试图让我的模块显示一个printk。我是新手,所以我可能会遇到一些编程错误。这是我的模块 C 文件: #include #include #include asmlinkage long sy
我正在编写一个简单的字符设备驱动程序。我们传递给 module_init() 的函数在模块安装时被调用。 当我们使用 insmod 命令插入模块时,传递给 module_init() 的函数被调用。
在编写可加载内核模块时,需要使用 module_init 和 module_exit 等宏吗?另外,为什么我们使用像 __init 或 __exit 这样的宏。即使我们可以在不使用它们的情况下完成这项
module_init 和有什么区别和 subsys_initcall在初始化驱动程序时? 最佳答案 差异与时间有关,或者更准确地说,与执行顺序有关。即声明为subsys_initcall的过程保证在
在驱动程序中,我经常看到使用这三种类型的 init 函数。 module_init() core_initcall() early_initcall() 我应该在什么情况下使用它们? 另外,还有其他的
我正在开发一个要在路由器上运行的内核模块。路由器型号为 Netgear 的 DGN2200v2。它在 MIPS 上运行 Linux 2.6.30。我的问题是,当我加载我的模块时,似乎我的 module
我一直在尝试移植一些 linux 驱动程序,并意识到 linux 内核版本 2.4 和 2.6 之间存在很大差异。 在2.4版本内核中,模块编程如下- #define MODULE #include
我是一名优秀的程序员,十分优秀!