Sunday, January 28, 2024

[SOLVED] Where is located syscall_table in kernel x86_64?

Issue

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?


Solution

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.



Answered By - Braiam
Answer Checked By - David Goodson (WPSolving Volunteer)