About

Jumat, 01 April 2011

Linux Kernel Module

Share this history on :
Understanding the Linux Kernel Module
Linux kernel module is part of the Linux kernel that can be compiled, was summoned and removed separately from other parts of the kernel when needed. Kernel module can add functionality the kernel without rebooting the system. In theory there is nothing to limit what can be done by the kernel module. Kernel modules can be implemented such as device drivers, file systems, network protocols.
Linux kernel module allows other parties to improve the functionality of the kernel without having to make a monolithic kernel and add the functionality they need directly into the image of the kernel. In addition it will make the kernel size becomes larger, other shortcomings are they must build and reboot the kernel every time want to add new functionality. With the module then each party can easily write new functions and even distribute themselves, outside of the GPL.
The kernel module also provides other benefits that make Linux systems can be switched with a minimum standard kernel, without additional device drivers that come summoned. Device drivers that needed to be called then explicitly or automatically when needed.
There are three components to support the Linux kernel module. The third component is the management module, the registration driver, and mechanisms for conflict resolution. The following will discuss these three supporting components.Linux Kernel Module Management
Management module will set the calling module into memory and communicate with other parts of the kernel. Calling a module does not only include the contents of binaries into the kernel memory, but also must ensure that any referral made by the module into the kernel or any symbol of the input point is updated to point to the correct location in the kernel address. Linux makes an internal symbol table in the kernel. This table does not contain all the symbols are defined at kernel compilation time, but the symbols must be exported explicitly by the kernel. All this is necessary for the handling of referrals made by the module of symbols.
The invitation to the module is done in two stages. First, the utility will ask the caller module kernel to reserve a place in the virtual memory kernel for the module. The kernel will provide the address of allocated memory and the utility can use it to enter the machine code of the module to call the appropriate address. Next system calls will bring the module, following each table is about to exported symbols, to the kernel. Thus, the module will be in the address that has been allocated and the kernel's symbol table will be updated.
Another component of management module is requesting module. The kernel defines a communication interface that can be contacted by the module management programs. Once a connection is created, the kernel will inform the management process whenever a process requesting device drivers, file system, or network services that have not been called and give managers the opportunity to call the service. Demand for services will be completed when the module was called. Manager process will periodically check whether the module is still in use, and will remove them when no longer needed.Driver Registration
To create a new kernel module called function, another part of the kernel must be aware of the existence and the new functionality. Kernel create a dynamic table that contains all the drivers that have been learned and provides a series of routines to add and remove drivers from the table. These routines are responsible for registering the new module functions.
The things that enter in the registration table is:

    
device drivers

    
file system

    
network protocol

    
binary format
Conflict Resolution
Diversity computer hardware configuration and drivers who may have on a personal computer has become a problem in itself. Hardware configuration problem has become more complex due to support for a modular device drivers, because the devices are active at any one time varies.
Linux provides a mechanism for solving problems to help the arbitration of access to certain hardware. The purpose of this mechanism is to prevent access to a scramble module hardware, preventing autoprobes disturbing presence of the existing drivers, resolve conflicts between a number of drivers who try to access the same hardware.
Kernel make a list of the hardware resource allocation. When a driver about to access resources via the M / K ports, line interrupts, or DMA channel, then the driver is expected to reserve the resources in the database kernel first. If the reservation is rejected due to unavailability of the requested resource, then the module must decide what to do next. If unable to continue, then the module can be deleted.

0 komentar:

Posting Komentar