Hello,
I am working with 32bit version of RPiOS (kernel version 5.10.103) on raspberry pi 4. I am tying to add a new system call that will first simply print hello world. On the internet i have found many guids but most of them are for x86 architecture.
Nevertheless i tried to follow the steps from
https://www.linuxbnb.net/home/adding-a- ... hitecture/
and did the following:
1.
In include/uapi/asm-generic/unistd.h i added the following:
#define __NR_process_hello 441
__SYSCALL(__NR_process_hello, sys_hello)
and modified the counter by adding one to it:
#undef __NR_syscalls
#define __NR_syscalls 442
2.
In include/linux/syscalls.h. i added the following line:
asmlinkage long sys_hello(void);
3. In kernel/sys.c i added the implementation of the sys call:
SYSCALL_DEFINE0(hello)
{
printk("Hello world\n");
return 0;
}
Still the system call is not working and returns -1, what am I doing wrong?
I am working with 32bit version of RPiOS (kernel version 5.10.103) on raspberry pi 4. I am tying to add a new system call that will first simply print hello world. On the internet i have found many guids but most of them are for x86 architecture.
Nevertheless i tried to follow the steps from
https://www.linuxbnb.net/home/adding-a- ... hitecture/
and did the following:
1.
In include/uapi/asm-generic/unistd.h i added the following:
#define __NR_process_hello 441
__SYSCALL(__NR_process_hello, sys_hello)
and modified the counter by adding one to it:
#undef __NR_syscalls
#define __NR_syscalls 442
2.
In include/linux/syscalls.h. i added the following line:
asmlinkage long sys_hello(void);
3. In kernel/sys.c i added the implementation of the sys call:
SYSCALL_DEFINE0(hello)
{
printk("Hello world\n");
return 0;
}
Still the system call is not working and returns -1, what am I doing wrong?