Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the system call table in linux kernel?

Tags:

linux

kernel

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.

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.

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.

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

like image 952
Iker Avatar asked Jul 15 '13 10:07

Iker


1 Answers

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

Here is the corresponding commit:

commit 1f57d5d85ba7f1f467173ff33f51d01a91f9aaf1
Author: Ingo Molnar <[email protected]>
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.
like image 135
Ortomala Lokni Avatar answered Sep 17 '22 08:09

Ortomala Lokni