Linux Today: Linux News On Internet Time.

More on LinuxToday

Invoking user-space applications from the kernel

Feb 20, 2010, 12:03 (0 Talkback[s])
(Other stories by M. Tim Jones)


Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers

"Invoking specific kernel functions (system calls) is a natural part of application development on GNU/Linux. But what about going in the other direction, kernel space calling user space? It turns out that there are a number of applications for this feature that you likely use every day. For example, when the kernel finds a device for which a module needs to be loaded, how does this process occur? Dynamic module loading occurs from the kernel through the usermode-helper process.

"Let's begin with an exploration of usermode-helper, its application programming interface (API), and some of the examples of where this feature is used in the kernel. Then, using the API, you'll build a sample application to better understand how it works and its limitations.

"The usermode-helper API

"The usermode-helper API is a simple API with a well-known set of options. For example, to create a process from user space, you commonly provide the name of the executable, the options for the executable, and a set of environment variables (refer to the man page for execve). The same applies for creating a process from the kernel. But because you're starting the process from kernel space, a few additional options are available."

Complete Story

Related Stories: