Invoking user-space applications from the kernel
Feb 20, 2010, 12:03 (0 Talkback[s])
(Other stories by M. Tim Jones)
"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:
- Using QEMU for cross-platform development(Feb 18, 2010)
- Scripting the Vim editor, Part 4: Dictionaries(Feb 17, 2010)
- Virtio: An I/O virtualization framework for Linux(Feb 10, 2010)
- An introduction to XML(Feb 03, 2010)
- Using gnuplot to display data in your Web pages(Feb 03, 2010)
- Scripting the Vim editor, Part 3: Built-in lists(Feb 02, 2010)
- Forking vs Threading(Jan 27, 2010)
- Location-aware search with Apache Lucene and Solr(Jan 14, 2010)
- Anatomy of the libvirt virtualization library(Jan 11, 2010)
- Java development 2.0: Gaelyk for Google App Engine(Jan 06, 2010)
- 10 important Linux developments everyone should know about(Dec 20, 2009)
- IBM developerWorks looks back on 10 years of Linux(Dec 20, 2009)