Can a user application run entirely in kernel-mode?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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):
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.