Re: Inserting code from userspace to kernel space

From: Alex Belits
Date: Sun May 25 2008 - 02:18:24 EST


On Thu, 22 May 2008, Bosko Radivojevic wrote:

I'm looking for a way to insert code from user space to the kernel
space, but without using kernel module. Actually, we are working on a
system that has to allow end user to change part of code (one or two
functions) that is executed from the kernel space.

For now we have two different kernel modules, one exporting a function
which another module uses. Process of compiling kernel module is quite
ineligible for standard end user (along with the requirement to
support multi platform cross compiling) compared to just cross
compiling a simple code that doesn't use any libraries than libc.

Why? You don't have to recompile everything, just link a module before loaing it -- a part containing the function can be one object file, the rest of the module (a wrapper) is compiled once for a particular kernel version, and both are linked together, producing a module valid for a particular kenel version.

This is how most of proprietary drivers are distributed, and Ubuntu has a whole infrastructure around that mechanism that simplifies transition between versions.

--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/