Of course you can.
In short, you need to fix the running kernel.
There are at least two ways to add a new syscall:
- Expand existing system call tables (
sys_call_table and ia32_sys_call_table ) and instructions for checking the limit on a system call (usually cmp on x86) in any of the system call records ( system_call , ia32_system_all , etc.) ...) - Copy the existing system call tables, expand them as necessary, the system call manager instructions (usually
call on x86) to indicate the command to copy the table and fix the system calls to any of the system call records.
See this questionnaire for more details:
Implement Linux system call using LKM
How do 32-bit applications make system calls on 64-bit Linux?
:)
Ilya Matveychikov
source share