找不到SYS_CALL_TABL
我正在编写一个内核模块,它可以使用 Linux 内核中 kallsyms.h 中定义的 kallsyms_lookup_name() 函数读取 sys_call_table 地址。我已经看到使用此方法获取 sys_call_table 地址的示例代码,但在我所附的代码中,我从它返回 0。我已在 Linux 配置中启用 CONFIG_KALLSYMS=y 以包含调试信息。
void set_sct_addr(void) { sct_address = (void*)kallsyms_lookup_name("sys_call_table"); printk(KERN_ALERT "表的基址是%lx\n",sct_address); sys_call_table
地址在 /proc/kallsyms 文件中也看不到。我尝试 grep 但没有运气。我想知道在 Linux 中编写这个模块时缺少什么。
谢谢。
sys_call_table 地址将从 kallsyms.h 中定义的函数中获取
I am writing a kernel module which can read the sys_call_table address using kallsyms_lookup_name() function defined at kallsyms.h in linux kernel. I have seen sample codes which use this methods to get the sys_call_table address but in my code as attached I am getting 0 returned from it. I have enabled CONFIG_KALLSYMS=y in linux configuration to include debug informations.
void set_sct_addr(void) { sct_address = (void*)kallsyms_lookup_name("sys_call_table"); printk(KERN_ALERT "The base address of the table is %lx\n",sct_address); }
The sys_call_table address is also not seen in the /proc/kallsyms file too. I tried to grep but had no luck in that. I would like to know what I am missing while writing this module in linux.
Thanks.
The sys_call_table address is to be taken from the function defined in kallsyms.h
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论