没有合适的资源?快使用搜索试试~ 我知道了~
首页Understanding The Linux Kernel Initcall Mechanism
资源详情
资源评论
资源推荐
Understanding The Linux Kernel Initcall Mechanism
Creating Dynamic Function-Pointer Call Tables
Trevor Woerner
Understanding The Linux Kernel Initcall Mechanism: Creating Dynamic Function-Pointer
Call Tables
by Trevor Woerner
Copyright © 2003, 2006 Trevor Woerner
Copyright (c) 2003, 2006 Trevor Woerner
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of this document and all related source code must retain
the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Trevor Woerner nor the names of any contributors may
be used to endorse or promote products derived from this document or
related software without specific prior written permission.
THIS DOCUMENT AND RELATED SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS DOCUMENTATION OR RELATED SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
[Standard BSD License, see www.opensource.org
1
for more information]
Revision History
Revision 0.1 26 August 2003 Revised by: tlw
Document start.
Revision 1.0 23 September 2003 Revised by: tlw
Document completed and released.
Revision 1.1 11 October 2006 Revised by: tlw
Updated to latest
Table of Contents
Abstract................................................................................................................................... i
1. Introduction .......................................................................................................................1
Date and Version ..........................................................................................................1
Notation.........................................................................................................................1
Architecture...................................................................................................................1
Tools ...............................................................................................................................1
"objdump -t" output format ..............................................................................1
2. Motivation..........................................................................................................................7
3. Background Information.................................................................................................9
Executable File Formats...............................................................................................9
Linker ...........................................................................................................................10
Compiler......................................................................................................................10
4. Simple Examples.............................................................................................................11
Before/After main() ...................................................................................................11
Section and Object Layout ........................................................................................11
Putting Objects into their own ELF Sections..........................................................19
5. How the Linux Kernel initcall Mechanism Works...................................................25
6. From the Kernel To Stand-Alone Code ......................................................................29
7. References ........................................................................................................................31
iii
iv
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 hap-
pening. 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.
Please direct any useful observations or comments to (remove spaces and adjust the
formatting): twoerner.k AT gmail DOT com
i
剩余37页未读,继续阅读
orchid20082
- 粉丝: 1
- 资源: 40
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0