LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can a user application run entirely in kernel-mode? (https://www.linuxquestions.org/questions/linux-general-1/can-a-user-application-run-entirely-in-kernel-mode-776539/)

pmil 12-17-2009 05:28 PM

Can a user application run entirely in kernel-mode?
 
Hi all,

I have a question regarding application/process execution and it's the following:

Is it possible a user application (which will regularly be executed at user-space) to be re-written as a kernel-module to allow the entire execution to be under kernel-mode (i.e. no system calls should be needed)? I am not saying that this is the right thing to do; I am just asking if it's doable.

Thanks in advance.

raju.mopidevi 12-17-2009 07:06 PM

To enable Kernel Mode Linux, say Y in Kernel Mode Linux field of kernel configuration, build and install the kernel, and reboot. Then, all executables under directory /trusted are executed in kernel mode in current Kernel Mode Linux implementation. For example, to execute a program named "cat" in kernel mode, copy the program to directory /trusted and execute it as follows (if the /trusted directory does not exist, mkdir it first):

Code:

/trusted/cat
To know about Kernel mode linux click it.

pmil 12-18-2009 05:53 AM

Thanks very much for the reply.

I know that with KML you can do that but I was wondering if you can write a user application as a kernel module. Is this something that you can do, or there are limitations on doing that?

Thanks a lot.

raju.mopidevi 12-18-2009 05:57 AM

You are welcome !!:hattip: gud luck

sundialsvcs 12-18-2009 07:52 AM

Actually, that answer is misleading.

True kernel mode is a special execution environment that exists for only one purpose: to control the hardware, and thereby to create the environment in which ordinary applications expect to run. That's the only reason why we have a "Linux kernel," and so, that's the only reason why there is a "kernel mode" of execution.

"Kernel mode Linux" is a technique for mapping kernel-space memory so that it is accessible to an otherwise-ordinary (but highly trusted) user process. This is a great way to shoot yourself in the foot, but for certain (i.e. real time) apps it might avoid the overhead of system calls, which might in those very rare cases be important enough to put the entire system at great risk of crashing.


All times are GMT -5. The time now is 10:12 AM.