Re: Inserting code from userspace to kernel space

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Helge Hafting
Date: Thursday, May 22, 2008 - 7:31 am

Bosko Radivojevic wrote:
Consider telling exactly what you want to do, what is this for?
Perhaps there is a better/more standard way of doing it.

Looks like your end users are capable of compiling ordinary code
but not kernel modules? If this is so, consider just automating
the kernel module part for them. I.e. provide a module that call
a function, they can then make that function and you can make a script
that link their function with your kernel module. Then they won't need
to know much about kernel modules.

But the kernel module can't use libc (and what would you want to
use libc for anyway? libc mostly helps userspace communicate
with the kernel, no _need_ for that when your code is in the
kernel already.)

Or do you merely need your kernel code to run a user supplied program
now and then?  The kernel code can't call userspace code directly,
but you could make a device driver for this purpose.

The userspace code can read from the device, and block. When the kernel
need to run userspace code, it unblocks the userspace program.  If you
need to transfer data to userspace, simply let the userpace program
read the data from your device. and write stuff back, if needed.




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Inserting code from userspace to kernel space, Bosko Radivojevic, (Thu May 22, 5:41 am)
Re: Inserting code from userspace to kernel space, Jan Engelhardt, (Thu May 22, 6:06 am)
Re: Inserting code from userspace to kernel space, Helge Hafting, (Thu May 22, 7:31 am)
Re: Inserting code from userspace to kernel space, Shuduo Sang, (Thu May 22, 9:04 am)
Re: Inserting code from userspace to kernel space, Alex Belits, (Sat May 24, 10:44 pm)
Re: Inserting code from userspace to kernel space, Bart Van Assche, (Sun May 25, 12:18 am)
Re: Inserting code from userspace to kernel space, Geert Uytterhoeven, (Sun May 25, 11:48 pm)
Re: Inserting code from userspace to kernel space, Jike Song, (Mon May 26, 2:54 am)