3

I'm trying to add new System Call to Linux Kernel(x86_64). Based on this article which explained how to add System Call to Kernel(x86). The article says I need to define my System Call name in a file called syscall_table_32.S which is located in src/arch/x86/syscall_table_32.S.

But in my case, there is no file named syscall_table_32.S or syscall_table_64.S in the kernel source! There isn't even a directory for x64 System Call table in src/arch/.

So, where is syscall_table_64.S defined in kernel 3.13.0-14-generic (x86_64) ? Where can I define a new system call?

Braiam
  • 1
  • 11
  • 47
  • 78
Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
  • Possible duplicate of [Where is the system call table in linux kernel?](https://stackoverflow.com/questions/17652555/where-is-the-system-call-table-in-linux-kernel) – Evan Carroll Feb 04 '18 at 04:11

2 Answers2

8

Version 3.3 onward are different from 2.X that the guide use. You should look for the syscalls directory, in the arch/x86/ directory. So is:

cd /kernel-src/arch/x86/syscalls/syscall_64.tbl

kernel-src being the directory where your kernel sources resides. A good idea would be reading this answer in SO and compare it with your resource.

Community
  • 1
  • 1
Braiam
  • 1
  • 11
  • 47
  • 78
0

I'm using kernel version 4.9.329 and syscall_32.tbl directory was ./arch/×86/entry/syscalls/syscall_32.tbl. It also tested on kernel version 6.2.1.