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 ...
随机推荐
- 浅谈strtok
原型:char *strtok(char *s, char *delim); 功能:分解字符串为一组标记串.s为要分解的字符串,delim为分隔符字符串. 说明:首次调用时,s必须指向要分解的字符串, ...
- FPGA位宽的转换和定义
数字表达式的定义<位宽><进制><数字>,这是一种全面的描述方式 例如:如果我要定义一个变量counter = 5000 0000 ,10进制数:那么他的位宽应该是 ...
- OO之观察者模式
以下为观察者模式详解: 引子: 假设有这样一个问题,有一条河经过一个山谷,山谷下有一个村庄,人们在山谷处修建了一个水库,并安排专人管理,当水库的水位过高时要通知下游居民注意水库的开闸放水,当水库的水温 ...
- React Native Android配置部署踩坑日记
万事开头难 作为一只进入ECMAScript世界不久的菜鸟,已经被React Native的名气惊到了,开源一周数万星勾起了我浓烈的兴趣.新年新气象,来个HellWorld压压惊吧^_^(故意少打个' ...
- POJ - 1741 Tree
DescriptionGive a tree with n vertices,each edge has a length(positive integer less than 1001).Defin ...
- eclipse/MyEclipse 日期格式、注释日期格式、时区问题
eclipse/MyEclipse 日期格式.注释日期格式.时区问题 在eclipse/MyEclipse中,如果你的注释或是运行System.out.print(new java.util.Date ...
- nginx+ tomcat集群+动静资源分离
不知道为什么这个随便删不掉,写了也值显示一半一半不显示, 我把重新写了一遍: nginx + tomcat集群和动静资源分离
- [转载]jQuery 1.9 移除了 $.browser 的替代方法获取浏览器类型
jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support . 在更新的 2.0 版本中,将不再支持 IE 6/7/8. ...
- PAT-乙级-1034. 有理数四则运算(20)
1034. 有理数四则运算(20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 本题要求编写程序,计算2个有理 ...
- win8系统中PL/SQL Developer连接Oracle出现的问题
注意:所有软件最后不要安装在program files (x86)下 PL/SQL Developer显示Not logged on 以管理员的身份打开PL/SQL Developer 2. t ...