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 ...
随机推荐
- NET Reflector 8 使用
一,把杀毒软件停掉 二,把原机器上的 Reflector 文件删除 三,找到C:\Users\Administrator\AppData\Local\Red Gate这个目录,将里面的东西删除 四,v ...
- P3381: [Usaco2004 Open]Cave Cows 2 洞穴里的牛之二
这题..思维上远没有上一题复杂,是一个裸的RMQ..利用倍增就可以解决了. var n,q,i,j,f,t,c:longint; a:array[..,..] of longint; function ...
- parsing html in asp.net
http://stackoverflow.com/questions/5307374/parsing-html-page-in-asp-net http://htmlagilitypack.codep ...
- 开源YYKit-b
转自 ibireme的博客,大家可以去他博客看看,有很多开发过程的一些调研和评测. YYModel 类似 Mantle/JSONModel 的工具,性能比 Mantle 高一个数量级,有更好的容错性, ...
- 遍历并修改dictionary的值
var dictionary = clb_Select.Items.Cast<object>().ToDictionary(item => item.ToString(), item ...
- JavaScript里最有效率的功能特征检测方法
代码执行效率对于程序员和程序来说都是至关重要的,尤其是遇到了那些需要大量调用.反复调用的函数方法.在很多Javascript框架里你都能看到有反复调用的函数.当在使用这些框架时,我们必须小心翼翼的尽量 ...
- Akka的fault tolerant
要想容错,该怎么办? 父actor首先要获知子actor的失败状态,然后确定该怎么办, “怎么办”这回事叫做“supervisorStrategy". // Restart the st ...
- Unity3d + NGUI 的多分辨率适配(黑边)
原地址:http://www.2cto.com/kf/201310/250921.html 一.当下移动设备的主流分辨率(数据来自“腾讯分析移动设备屏幕分辨率分析报告”) 1.1 iOS设备的分辨率主 ...
- 【C++基础】内存操作 getMemory改错
内存操作的考察点:①指针 ②变量生存期及作用范围 ③动态内存申请和释放 笔试题************************************************************* ...
- linux fork函数与vfork函数
一.fork1. 调用方法#include <sys/types.h>#include <unistd.h> pid_t fork(void);正确返回:在父进程中返回子进程的 ...