键盘键盘损坏 1~4键无法使用,基于i8042 修改驱动使用F1~F4 替换
2015-08-30 00:11
399 查看
事件:刚上海,让家里把台式机寄过来,拿到到时候发现机箱变形,键盘也莫名其妙的1到4键无法使用本来想直接拆开 修修但苦于没有工具在身于是直接修改驱动层使用F1~F4键替代使用
OS:redhat 内核版本3.16
CODE:/home/sdk/linux-3.16/drivers/input/serio/i8042.c
直接来硬的基于中断处理函数替换
static void i8042_key_replace(unsigned char * data) //直接实现keycode替换
在i8042_interrupt中断处理函数中调用 上述 函数替换 data
/*
482 * i8042_interrupt() is the most important function in this driver -
483 * it handles the interrupts from the i8042, and sends incoming bytes
484 * to the upper layers.
485 */
486
487 static irqreturn_t i8042_interrupt(int irq, void *dev_id)
.
.
.
559 i8042_key_replace(&data);
560 port = &i8042_ports[port_no];
561 serio = port->exists ? port->serio : NULL;
562
563 dbg("%02x <- i8042 (interrupt, %d, %d%s%s)\n",
OS:redhat 内核版本3.16
CODE:/home/sdk/linux-3.16/drivers/input/serio/i8042.c
直接来硬的基于中断处理函数替换
static void i8042_key_replace(unsigned char * data) //直接实现keycode替换
在i8042_interrupt中断处理函数中调用 上述 函数替换 data
/*
482 * i8042_interrupt() is the most important function in this driver -
483 * it handles the interrupts from the i8042, and sends incoming bytes
484 * to the upper layers.
485 */
486
487 static irqreturn_t i8042_interrupt(int irq, void *dev_id)
.
.
.
559 i8042_key_replace(&data);
560 port = &i8042_ports[port_no];
561 serio = port->exists ? port->serio : NULL;
562
563 dbg("%02x <- i8042 (interrupt, %d, %d%s%s)\n",
相关文章推荐
- Delphi的字符串与16进制的相互转换函数的汇编代码
- 【原创】leetCodeOj --- Binary Search Tree Iterator 解题报告
- Cocos Studio images文件与CSB的路径相对关系
- 工科男的金融学笔记
- 《机器学习实战》学习笔记:k-近邻算法实现
- JavaScript 技巧总结
- 动态生成图片 保存到OutputStream
- MD5文件加密
- 中文乱码的问题
- 【Tomcat】tomcat简单介绍,安装以及启动(一)
- NSString类方法同步请求、使用NSData方法同步请求 下载图片、数据
- 【Tomcat】tomcat简单介绍,安装以及启动(一)
- ambari领域对象关系图
- word生成目录
- Cocos2d-x坐标系理解
- Dede织梦SEO优化及设置教程
- 信息系统运维资质与ITSS运维标准浅析
- iOS9允许广告拦截 苹果或为推广自家新闻客户端
- 存储过程示例以及jdbc调用存储过程
- java实现快速排序