Reputation: 13759
I want to implementing my own system call. (See below link)
http://www.tldp.org/HOWTO/html_single/Implement-Sys-Call-Linux-2.6-i386/
But adding new system call requires kernel compilation.
How to implement my own system call without recompiling the Linux kernel?
Upvotes: 9
Views: 3226
Reputation: 4024
Sure, you can.
In short, you'll need to patch the running kernel.
There are at least 2 ways to add a new syscall:
sys_call_table
and ia32_sys_call_table
) and patch system call limit check instruction (usally cmp
on x86) at any of the system call entries (system_call
, ia32_system_all
etc...)call
on x86) to point to table's copy and patch system call limit check instruction at any of the system call entries.See this anwers for details:
Implementing Linux System Call using LKM
How do 32-bit applications make system calls on 64-bit Linux?
:)
Upvotes: 4
Reputation:
You can't.
Without recompiling the kernel, all you can do is build and load kernel modules, and kernel modules cannot add new system calls.
Upvotes: 15