The Linux Kernel Module Programming Guide
Chapter 1. Introduction
1.1. What Is A Kernel Module?
So, you want to write a kernel module. You know C, you’ve written a few normal programs to run as processes, and now you want to get to where the real action is, to where a single wild pointer can wipe out your file system and a core dump means a reboot.
What exactly is a kernel module? Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system.
Without modules, we would have to build monolithic kernels and add new functionality directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring us to rebuild and reboot the kernel every time we want new functionality.
1.2. How Do Modules Get Into The Kernel?
You can see what modules are already loaded into the kernel by running lsmod, which gets its information by reading the file /proc/modules. How do these modules find their way into the kernel? When the kernel needs a feature that is not resident in the kernel, the kernel module daemon kmod[1] execs modprobe to load the module in. modprobe is passed a string in one of two forms:
· A module name like softdog or ppp.
· A more generic identifier like char-major-10-30.
If modprobe is handed a generic identifier, it first looks for that string in the file /etc/modprobe.conf.[2] If it finds an alias line like:
alias char-major-10-30 softdog it knows that the generic identifier refers to the module softdog.ko.
Download file here
Related PDF Manuals Guide:
Teaching Linux Kernel Programming
CrossGrid Developer Manual Guide
Parallels Helm 4.1 Python for Microsoft IIS 7 Module Guide
Plesk 8.3 for Linux/Unix Kaspersky Antivirus Module Administrator’s Guide
Powerware 9170+ UPS User’s Guide
Python Guide for the Systems Biology Workbench
Using the PlayStation 3 Controller Manual PDF
Moodle Teacher Guide: Getting Started with Moodle
You can leave a response, or trackback from your own site.