Size: 1459
Comment:
|
Size: 1457
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
by Trevor Woerner (twoerner AT gmail DOT com) | by [wiki:Self:TrevorWoerner Trevor Woerner] |
Understanding the Linux Kernel Initcall Mechanism
Creating Dynamic Function-Pointer Call Tables
by [wiki:TrevorWoerner Trevor Woerner]
Abstract
While browsing through the Linux kernel, I came upon a technique for creating a segment of function pointers which can be called at a later time in the order that they are inserted into the segment. The kernel uses this mechanism to call device driver initialization routines at boot-up. I had a hard time finding clear information about what was going on and how it worked. After much googling (and some code doodling) I understand what is happening. This paper is an attempt at putting what I understand of this process down on paper so others may hopefully find it useful.
NOTE: This technique depends on, and requires the use of, the GNU compiler and linker tools. Additionally, the ELF binary executable format must be used. This is not a general-puropse ANSI-C compliant technique.
Table of Contents
[wiki:InitcallMechanism/Introduction Introduction]
[wiki:InitcallMechanism/Motivation Motivation]
[wiki:InitcallMechanism/BackgroundInformation Background Information]
[wiki:InitcallMechanism/SimpleExamples Simple Examples]
[wiki:InitcallMechanism/HowItWorks How It Works]
[wiki:InitcallMechanism/KernelToCode From the Kernel to Stand-Alone Code]
[wiki:InitcallMechanism/References References]