How to implement your own system call without recompiling the Linux kernel?

I want to implement my own system call. (See link below)

http://www.tldp.org/HOWTO/html_single/Implement-Sys-Call-Linux-2.6-i386/

But adding a new system call requires kernel compilation.

How to implement your own system call without recompiling the Linux kernel?

+8
c linux linux-kernel system-calls
source share
2 answers

You can not.

Without recompiling the kernel, all you can do is build and load the kernel modules, and the kernel modules cannot add new system calls.

+15
source share

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?

:)

+3
source share

All Articles