auto make System.map to C header file
#!/bin/bash # auto make System.map to C header file
# 说明:
# 该脚本主要是将Linux内核生成的System.map文件中的符号、地址存入结构体中,
# 目前认为也许可以在内核驱动中直接调用对应的函数。以前在学习裸板开发中就有
# 使用Uboot中提供的printf来写程序的先例,那么这里应该也是可以的,不过这里没
# 有什么实用性,因为5W个函数,但这个结构体就要用掉进200kByte空间。
#
# -- 深圳 南山平山村 曾剑锋 if [ $# -ne ]; then
echo "USAGE:"
echo " systemMap.sh <your system.Map file>"
exit -
fi cat > systemMap.h << EOF
#ifndef __SYSTEM_MAP_H__
#define __SYSTEM_MAP_H__ typedef struct System_header {
EOF cat $ | awk '{print "\t unsigned int "$3";"}' | sort | uniq | grep -v "[\.&]" >> systemMap.h cat >> systemMap.h << EOF
} System_header; System_header system_header = {
EOF cat $ | awk '{print $3 " \t= " "0x"$1","}' | sort -n -k1 | uniq | grep -v "[\.&]" | sed -e "s/^/\\t\./g" >> systemMap.h cat >> systemMap.h << EOF
};
#endif // __SYSTEM_MAP_H__
EOF # cat systemMap.h
# #ifndef __SYSTEM_MAP_H__
# #define __SYSTEM_MAP_H__
#
# typedef struct System_header {
# unsigned int a_aidl_bdis_tmr;
# unsigned int aalg_list;
# unsigned int ablkcipher_decrypt;
# unsigned int ablkcipher_decrypt_done;
# unsigned int ablkcipher_encrypt;
# unsigned int ablkcipher_encrypt_done;
# ......
# } System_header;
#
# System_header system_header = {
# .a_aidl_bdis_tmr = 0xc0a62660,
# .aalg_list = 0xc09f2a28,
# .ablkcipher_decrypt = 0xc04c3568,
# .ablkcipher_decrypt_done = 0xc04c1480,
# .ablkcipher_encrypt = 0xc04c34d4,
# .ablkcipher_encrypt_done = 0xc04c14f0,
# ......
# };
# #endif // __SYSTEM_MAP_H_
auto make System.map to C header file的更多相关文章
- 进度记录 和 安装imagick时Cannot locate header file MagickWand.h错误的解决
修改php.ini文件,已使php支持扩展的功能 [root@localhost imagick-2.2.2]# ./configure --with-php-config=/usr/local/ph ...
- System.map详解
system.map内容格式为:线性地址类型符号 具体内容如下: 00100000 A phys_startup_32 c0100000 T startup_32 c0100000 A _text ...
- 内核编译之vmlinuz vmlinux system.map initrd
一.vmlinuz vmlinuz是可引导的.压缩的内核.“vm”代表“Virtual Memory”.Linux 支持虚拟内存,不像老的操作系统比如DOS有640KB内存的限制.Linux能够使用 ...
- System.map
System.map是一个特定内核的内核符号表.它是你当前运行的内核的System.map的链接. 内核符号表是怎么创建的呢? System.map是由“nm vmlinux”产生并且不相关的符号被滤 ...
- 原文:I don’t want to see another “using namespace xxx;” in a header file ever again
http://stackoverflow.com/questions/5849457/using-namespace-in-c-headers http://stackoverflow.com/que ...
- System.map文件【转】
转自:http://blog.csdn.net/david104/article/details/7194185 当运行GNU链接器gld(ld)时若使用了"-M"选项,或者使用n ...
- System.BadImageFormatException: Could not load file or assembly
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe C:\_PRODUKCIJA\Debug\DynamicHtmlT ...
- 【iOS】The differences between Class Extension and Header File 类扩展与头文件的区别
. As the name suggests, they extend the class. A class continuation is another name. The class exten ...
- c++预编译问题:fatal error C1083: Cannot open precompiled header file: 'Debug/DllTest.pch': No such file or d
1)单独编译StdAfx.cpp 2)编译所有(即按Ctrl+F7) 这时因为该模块没有包括预编译头文件“stdafx.h”的缘故.VC用一个stdafx.cpp包含头文件stdafx.h,然后在st ...
随机推荐
- unity3d 延迟处理方法
Invoke("方法名", 多少秒后执行); InvokeRepeating("方法名", 多少秒后执行,开始执行后隔多长时间再次执行一次); CancelIn ...
- PAT乙级真题1005. 继续(3n+1)猜想 (25)(解题)
原题: 卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情况稍微有些复杂. 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数.例如对n=3进行验证 ...
- 数据结构二叉树的递归与非递归遍历之java,javascript,php实现可编译(1)java
前一段时间,学习数据结构的各种算法,概念不难理解,只是被C++的指针给弄的犯糊涂,于是用java,web,javascript,分别去实现数据结构的各种算法. 二叉树的遍历,本分享只是以二叉树中的先序 ...
- nodejs的模块系统(实例分析exprots和module.exprots)
前言:工欲善其事,必先利其器.模块系统是nodejs组织管理代码的利器也是调用第三方代码的途径,本文将详细讲解nodejs的模块系统.在文章最后实例分析一下exprots和module.exprots ...
- JavaScript技巧45招
原文:45 Useful JavaScript Tips, Tricks and Best Practices作者:Saad Mousliki 在这篇文章里,我将分享一些JavaScript的技巧.秘 ...
- Linux:crontab命令学习
一.crond简介 crond是linux下用来周期性的执行某种任务或等待处理某些事件的一个守护进程,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动cro ...
- 修改radio、checkbox、select默认样式的方法
样式 radio select checkbox 兼容性 现在前端页面效果日益丰富,默认的input组件样式显然已经不能满足需求.趁着这次开发的页面中有这方面的需求,在这里整理一下修改radio.ch ...
- HIBERNATE一对一双向外键联合主键关联
HIBERNATE一对一双向外键联合主键关联: 一. 创建主键类:这个主键必须实现serializedable接口和重写其中的hashCode方法和equals方法:为主键类添加一个叫做@Embedd ...
- PAT-乙级-1042. 字符统计(20)
1042. 字符统计(20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 请编写程序,找出一段给定文字中出现最 ...
- chardet安装
1.下载 chardet-2.2.1.tar.gz (md5) https://pypi.python.org/pypi/chardet#downloads 2.解压至C:\Python27\Li ...