Run a program in kernel space on Linux

If I want to execute a user program (and not a kernel module) in the Linux kernel space, what parameters do I have?

I looked at KML (linux linux mode), but that concerns the IA-32 architecture. I want a solution that is cross-platform and can work on embedded Linux systems.

+6
linux-kernel kernel embedded-linux
source share
6 answers

User programs are not executed in kernel space - which makes them user programs.

If you want to execute code in kernel space, you have two options: insert it into the kernel or load it using the kernel module.

+5
source share

In another question, you wrote that you are new to kernel programming. Using KML is very unconventional and will be much more complicated than doing it in the usual way. This will make your training much more difficult. I would suggest that your best option is to overestimate why you want to run the application for user space in kernel space and find a way to not do this.

There may be a good reason to do this, but I don’t understand what the reason is. One thing that you must understand when developing a kernel is that just because something is possible is not necessarily what needs to be done.

If you really want to use a cross-platform solution, you will have to write it yourself. The only architectures supported by KML are IA32 and AMD64.

+4
source share

Kernel programming is largely determined by the specifics of the platform, since the kernels for different platforms are different.

+3
source share

Take a look at FemtoLinux . Basically, it is KML for embedded systems and embedded processors such as ARM and MIPS

+3
source share

call_usrmodehelper

+3
source share

If you want to run a user program from kernel space, take a look at run_init_process (). This is how the kernel starts the init program.

0
source share

All Articles