利用KGDB调试Linux kernel
创建时间:2010-01-27
作者:Steven Yang
E-mail:mqyoung@gmail.com
为了高效的对kernel进行调试,作者在实验室利用已有的资源进行环境配置。首先是硬件环境,我有两个PC,
一个是P III,Debian(Target)
一个是AMD 64,Ubuntu(Developer)
要通过Developer调试Target,这就需要给Target重编内核,并进行串口调试相关设置,而Developer需要装一个32位的虚拟机用作调试。如下为详细的配置过程。
1 KGDB Introduction
KGDB is a debugger for the Linux kernel. It requires two machines
that are connected via a serial connection. The serial connection may
either be an RS-232 interface using a null modem cable, or via the
UDP/IP networking protocol (KGDB over Ethernet, KGDBoE).
KGDB was originally implemented as a patch to Linux kernel, but it has
been included in the official kernel in 2.6.26. The target machine (the
one being debugged) runs the patched kernel and the other (host)
machine runs gdb. The GDB remote protocol is used between the two
machines.
KGDB is available for the following architectures: x86, x86-64, PowerPC, ARM, MIPS, and S390.
It is free software released under the terms of the GNU General Public
License. Until 2006 kgdb was maintained by Linsyssoft Technologies.,
after which Jason Wessel at Wind River Systems, Inc. took over as the
official maintainer.
Ingo Molnar and Jason Wessel created a slimmed-down and cleaned up
version of KGDB which was called "kgdb light" (without Ethernet support
and many other hacks). This was the one merged into the 2.6.26
kernel.[1] The version of kgdb in the 2.6.26 kernel supports only rs232
using a driver which can split debugger inputs and console inputs such
that only a single rs232 port is required.
Jason Wessel created a kgdb test suite which was merged into the 2.6.26
kernel in order to regression test the kgdb core as well as to aid in
the validation of future architecture support for kgdb.
from: http://en.wikipedia.org/wiki/KGDB
Refer: http://kgdb.linsyssoft.co
相关文档:
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
原文地址:http://hi.baidu.com/linuxlife/blog/item/0d3e302ae2384d3a5343c1b1.html
Linux下的动态库以.so为后缀,我也是初次在Linux下使用动态库,写一点入门步骤,以便以后能方便使用。
第一步:编写Linux程序库
文件1.动态库接口文件
//动态库接口文件getmaxlen.h
#ifndef _GETMAXLEN_H_
#define _GETMAXLEN_H_
......
安装篇
首先获取以下三个安装包 (安装不成功有提示 ,就是bind-libs-9.2.4-16.EL4被bind-9.2.4-16.EL4依赖)
bind-libs-9.2.4-16.EL4.rpm
bind-9.2.4-16.EL4.rpm
bind-devel-9.2.4-16.EL4.rpm
安装完成通过命令查看
rpm -qa|grep bind
结果如下所示就安装成功!
bind-libs-9.2.4-16.EL4
bind-9.2.4-16.EL4
bind- ......
将应用程序加到文件系统中打包后一起下载方法总结如下:
假设ramdisk.gz存放在/home/cvtech/jx2410/root/下面,则操作如下:
$cd /home/cvtech/jx2410/root/
$mkdir rd
$gunzip ramdisk.gz
上述操作后已将ramdisk.gz解压成ramdisk系统映像文件。
$mount -o loop ramdisk rd/
$cd rd/
其中命令mount的-o参数loop表示 ......
防火墙相应端口没有打开。
打开方法如下:
vi /etc/sysconfig/iptables
加入如下的一行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
重启iptables:
/etc/init.d/iptables restart
查看端口是否真的打开:
/etc/init.d/iptables status ......