Linux内核中的系统调用表在哪里? [英] Where is the system call table in linux kernel?

查看:349
本文介绍了Linux内核中的系统调用表在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Robert Love的Linux Kernel Development,他所做的练习之一是创建系统调用(第106页).问题是我无法在v3.9的x86_32体系结构中找到系统调用表文件.我知道他正在使用2.6.xx版本,但我不知道该版本是否可以与我使用的发行版一起使用,因为它已经很老了,所以我更喜欢v3.9.

I'm reading Linux Kernel Development by Robert Love and one of the exercises he does is to create a system call (page 106). The problem is that I am unable to find the system call table file in v3.9 for the x86_32 architecture. I know that he's using the version 2.6.xx but I don't know if that version will work with the distribution that I'm using as it is pretty old so I would rather prefer v3.9.

更多信息: 我正在讲的练习如下: 在系统调用表的末尾添加一个条目,这需要对支持系统调用的每种体系结构(对于大多数调用而言,是所有体系结构)进行此操作.syscall在表中的位置从零开始,是它的系统电话号码.例如,列表中的第十个条目被分配了系统调用编号9.

More information: The exercise of which I am speaking is the following: Add an entry to the end of the system call table.This needs to be done for each architecture that supports the system call (which, for most calls, is all the architectures).The position of the syscall in the table, starting at zero, is its system call number. For example, the tenth entry in the list is assigned syscall number nine.

使用以下方法解决: 对于x86体系结构,系统调用表位于arch/x86/syscalls/syscall_32.tbl中.感谢Sudip Mukherjee的帮助.

Solved using the following approach: The system call table is located in arch/x86/syscalls/syscall_32.tbl for the x86 architecture. Thanks to Sudip Mukherjee for his help.

以下是另一种方法: http://lists.kernelnewbies.org/pipermail/kernelnewbies/2013-July /008598.html 还要感谢Srinivas Ganji的帮助.

Another approach is the following: http://lists.kernelnewbies.org/pipermail/kernelnewbies/2013-July/008598.html Thanks to Srinivas Ganji for his help too.

推荐答案

从linux内核4.2开始,系统调用表已从

From linux kernel 4.2, the system call table has been moved from arch/x86/syscalls/syscall_64.tbl to arch/x86/entry/syscalls/syscall_64.tbl

这是相应的提交:

commit 1f57d5d85ba7f1f467173ff33f51d01a91f9aaf1
Author: Ingo Molnar <mingo@kernel.org>
Date:   Wed Jun 3 18:36:41 2015 +0200

    x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/

    The build time generated syscall definitions are entry code related, move
    them into the arch/x86/entry/ directory.

这篇关于Linux内核中的系统调用表在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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