kernel hexdump分析 (2.0)
有的时候print_hex_dump_bytes循环打印很多信息的时候(大于1K)
用UART串口打印的信息总是会有丢失,估计是printk缓冲区的问题把,具体原因不是太清楚
于是自己写了个比较笨的dump函数,问题得到解决:
//每次打印128个字节(当然你也可以打印更多),只调用一次printk ,
// 而 print_hex_dump_bytes 则 最多32个字节 就调用一次printk
static void dumpBuf(void * buf)
{
unsigned char * temp; temp=(char *)buf; int i=0;
printk(KERN_ERR "[%s] \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n",__func__, \
temp[i+0],temp[i+1],temp[i+2],temp[i+3],temp[i+4],temp[i+5],temp[i+6],temp[i+7], \
temp[i+8],temp[i+9],temp[i+10],temp[i+11],temp[i+12],temp[i+13],temp[i+14],temp[i+15],\
temp[i+16],temp[i+17],temp[i+18],temp[i+19],temp[i+20],temp[i+21],temp[i+22],temp[i+23],\
temp[i+24],temp[i+25],temp[i+26],temp[i+27],temp[i+28],temp[i+29],temp[i+30],temp[i+31],\
temp[i+32],temp[i+33],temp[i+34],temp[i+35],temp[i+36],temp[i+37],temp[i+38],temp[i+39],\
temp[i+40],temp[i+41],temp[i+42],temp[i+43],temp[i+44],temp[i+45],temp[i+46],temp[i+47],\
temp[i+48],temp[i+49],temp[i+50],temp[i+51],temp[i+52],temp[i+53],temp[i+54],temp[i+55],\
temp[i+56],temp[i+57],temp[i+58],temp[i+59],temp[i+60],temp[i+61],temp[i+62],temp[i+63],\
temp[i+64],temp[i+65],temp[i+66],temp[i+67],temp[i+68],temp[i+69],temp[i+70],temp[i+71],\
temp[i+72],temp[i+73],temp[i+74],temp[i+75],temp[i+76],temp[i+77],temp[i+78],temp[i+79],\
temp[i+80],temp[i+81],temp[i+82],temp[i+83],temp[i+84],temp[i+85],temp[i+86],temp[i+87],\
temp[i+88],temp[i+89],temp[i+90],temp[i+91],temp[i+92],temp[i+93],temp[i+94],temp[i+95],\
temp[i+96],temp[i+97],temp[i+98],temp[i+99],temp[i+100],temp[i+101],temp[i+102],temp[i+103],\
temp[i+104],temp[i+105],temp[i+106],temp[i+107],temp[i+108],temp[i+109],temp[i+110],temp[i+111],\
temp[i+112],temp[i+113],temp[i+114],temp[i+115],temp[i+116],temp[i+117],temp[i+118],temp[i+119],\
temp[i+120],temp[i+121],temp[i+122],temp[i+123],temp[i+124],temp[i+125],temp[i+126],temp[i+127]);
//}
kernel hexdump分析 (2.0)的更多相关文章
- kernel hexdump分析
驱动调试中,很多时候是二进制的,这个时候hexdump就是个非常有用的工具了. 不要再自己去实现类似的功能,kernel代码里面就有: 参考: kernel/lib/hexdump.c // 0Xxx ...
- u-boot bootz 加载kernel 流程分析
u-boot 加载 kernel 的流程分析. image重要结构体头文件 // include/image.h * * Legacy and FIT format headers used by d ...
- Minix2.0操作系统kernel文件分析
详细分析 MINIX消息机制的核心: mpx386.s start.c proc.c 保护模式分析: src/kernel/exception.c src/kernel/protect.c src/ ...
- Linux kernel kfifo分析【转】
转自:https://zohead.com/archives/linux-kernel-kfifo/ 本文同步自(如浏览不正常请点击跳转):https://zohead.com/archives/li ...
- 结合 category 工作原理分析 OC2.0 中的 runtime
绝大多数 iOS 开发者在学习 runtime 时都阅读过 runtime.h 文件中的这段代码: struct objc_class { Class isa OBJC_ISA_AVAILABILI ...
- 分析easyswoole3.0源码,协程连接池(五)
连接池的含义,很多都知道,比如mysql的数据库连接是有限的,一开始连接mysql创建N个连接,放到一个容器里,每次有请求去容器中取出,取出用完再放回去. es3demo里,有mysql的连接池. E ...
- 分析easyswoole3.0源码,体验es3(三)
demo在手,总得去试试看效果吧.我们先把默认的服务改成webserver,并且添加数据库的配置. 建立数据库,github里面有相关内容 CREATE TABLE `user_list` ( `us ...
- 分析easyswoole3.0源码,服务启动为例(二)
以下内容需要结合es的源码,不然可能会觉得跳跃.先描述下es启动的大致流程.es启动的时候注册异常处理函数以及加载配置文件.根据位置文件的设置选择启动哪种swoole服务.然后用一个事件注册类,注册s ...
- 分析easyswoole3.0源码,服务启动为例(一)
swoole已经升级到4了,主要的特性是更好的支持协程,easyswoole也为了更好支持协程推出了es3.我本地环境是php7.2.9 centos7 在github下载最新的3.0的demo.地址 ...
随机推荐
- Hibernate MySQL 数据库 使用别名 报 Column * Not Found
使用Hibernate 查询MySQL数据表的时候报 Column Not Found ,原因是MySQL的驱动不支持别名, 解决方案如下,在连接参数中加上 useOldAliasMetadataBe ...
- bresenham算法的FPGA的实现1
接着上一篇的 计算实现给出屏幕上任意两个点,求出这两个点之间直线上的所有的点.http://www.cnblogs.com/sepeng/p/4042464.html 这种直接算法的确是被鄙视了 强大 ...
- 为什么国内的网盘公司都在 TB 的级别上竞争,成本会不会太高?(还有好多其它回复)
作者:杜鑫链接:http://www.zhihu.com/question/21591490/answer/18762821来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处 ...
- MySQL分组数据
分组 理解分组能够看例如以下一个样例,首先我们打印出products表例如以下 从上面的表中能够看出.每一个vendor都有若干个产品,那么怎么一次统计每一个vendor有多少个产品呢? 这里就能够使 ...
- freemarker报错之八
1.错误描写叙述 freemarker.core.ParseException: Encountered "string" at line 21, column 21 in typ ...
- VMware Workstation 9.0 安装苹果Mac OS X10.9系统
摘自:http://www.wuwenhui.cn/3133.html 一.安装所需要的软件: 1.VMware Workstation 9.0 点击下载 2.unlock-all-v110.zip ...
- mysql设置root密码
1.停止mysql服务.可以在windows服务管理器设置,运行->services.msc->停止mysql服务 2.跳过权限验证: mysqld -nt --skip-grant-ta ...
- swift 自定义TabBarItem
1.效果图 2.NewsViewController.swift // // NewsViewController.swift // NavigationDemo // // Created ...
- GridView点击空白地方事件扩展
我们通常在ListView或者GridView响应点击Item事件,但很多时候我们同样也 希望监听到点击空白区域的事件来做更多的处理.本文以GridView为例给出一个实现 的方法,扩展GridVie ...
- GCC 编译使用动态链接库和静态链接库的方法
1 库的分类 依据链接时期的不同,库又有静态库和动态库之分. 静态库是在链接阶段被链接的.所以生成的可执行文件就不受库的影响了.即使库被删除了,程序依旧能够成功执行. 有别于静态库,动态库的链接是在程 ...