I'll walk you through step by step
First I edit 3 files in my Linux kernel directory
Open
LINUX_DIRECTORY/arch/x86/syscalls/syscall_64.tbland add the custom calls i'm implementing – using the appropriate formatDeclare them here:
LINUX_DIRECTORY/include/linux/syscalls.h– using the appropriate format:Open
LINUX_DIRECTORY/Makefileand add the directory I'm storing my new system calls to thecore-yline:core-y := usr/ my_system_call_directory/
Here's where I'm having issues. Inside LINUX_DIRECTORY/my_system_call_directory I add a C file with my custom system call definitions and its corresponding Makefile. I leave the definitions empty because inside the C file for my kernel module I declare an extern function (my custom system call) and define a separate function which is set to my extern function:
extern long (*start_shuttle)(void);
long my_start_shuttle(void) {
// stuff here
}
int init_module(void) {
// stuff here
start_shuttle = my_start_shuttle;
// more stuff
}
After recompiling the kernel I try to make the kernel module and get a no definition for start_shuttle error.
Is this because I left the definition for start_shuttle blank in my_system_call_directory? Should it match exactly the my_start_shuttle I defined in the kernel module or is there something special I'm supposed to add? I'm asking dumb questions in advance because it takes so long for my machine to recompile Linux and I'm not sure what to change. Thanks