14 Dec 2019

  • December 14, 2019
  • Amitraj
kernel modules 

• Sections of kernel code that can be compiled, loaded, and
unloaded independent of the rest of the kernel.

• A kernel module may typically implement a device driver, a file
system, or a networking protocol.

• The module interface allows third parties to write and
distribute, on their own terms, device drivers or file systems
that could not be distributed under the GPL.

• Kernel modules allow a Linux system to be set up with a
standard, minimal kernel, without any extra device drivers built
in.

• Three components to Linux module support:

1. The module management allows modules to be loaded into memory and to talk to the rest of the kernel.

2. The driver registration allows modules to tell the rest of the kernel that a new driver has become available.

3. A conflict-resolution mechanism allows different device drivers to reserve hardware resources and to protect those resources from accidental use by another driver



1. Module Management

• Supports loading modules into memory and letting them talk to
the rest of the kernel.

• Module loading is split into two separate sections:

–> Managing sections of module code in kernel memory

–> Handling symbols that modules are allowed to reference

• The module requestor manages loading requested, but
currently unloaded, modules; it also regularly queries the
kernel to see whether a dynamically loaded module is still in

use, and will unload it when it is no longer actively needed.




2. Driver Registration

• Allows modules to tell the rest of the kernel that a new driver
has become available.

• The kernel maintains dynamic tables of all known drivers, and
provides a set of routines to allow drivers to be added to or
removed from these tables at any time.

• Registration tables include the following items:

–> Device drivers
–> File systems
–> Network protocols
–> Binary format




3. Conflict Resolution

• A mechanism that allows different device drivers to reserve
hardware resources and to protect those resources from
accidental use by another driver.

• The conflict resolution module aims to:

–> Prevent modules from clashing over access to hardware
resources
–> Prevent autoprobes from interfering with existing device
drivers
–> Resolve conflicts with multiple drivers trying to access the

same hardware

Translate

Popular Posts