eclips调试linux内核,使用Eclipse调试Qemu及Linux Kernel

1. 下载Qemu代码

1. 下载版本

下载qemu-2.6.0版本代码,下载地址

2. 解压tar jxvg qemu-2.6.0.tar.bz2

3. 配置

配置命令如下./configure –prefix=/home/fantasy/opt/qemu –target-list=”arm-softmmu i386-softmmu x86_64-softmmu arm-linux-user i386-linux-user x86_64-linux-user”

注: Qemu相关的操作到此为止

2. 下载Eclipse for C/C++工具

用于C/C++的Eclipse下载地址

下载完后,直接解压,运行其中的Eclipse文件即可。

3. Eclipse中导入Qemu源码。

1. 打开Eclipse后,执行File->import->C/C++ -> Existing Code as Makefile Project. 点击Next

2. 选择Qemu源码所在的目录,工具链选择Linux GCC. 如下图

01c51811d4010b7dfb61487fd7857750.png

3. 然后在进行build project

可能会出现找不到autoreconf工具,那么安装如下package即可。sudo apt-get install autoconf libtool

4. 构建完成在,在Qemu源码目录下的arm-softmmu和x86_64-softmmu下生成对应的qemu可执行文件qemu-system-arm和qemu-system-x86_64

4. 相关错误

1. 错误1

在编译Linux kernel 4.6版本时,出现如下错误:

scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory

compilation terminated.

scripts/Makefile.host:91: recipe for target 'scripts/sign-file' failed

make[1]: *** [scripts/sign-file] Error 1

Makefile:552: recipe for target 'scripts' failed

make: *** [scripts] Error 2

解决方法:

> sudo apt-get install libssl-dev

2. 错误2

qemu-system-x86_64运行kernel时,只出现一条打印“VNC server running on `127.0.0.1:5900’”

解决方法:

需要安装libsdl1.2-devsudo apt-get install libsdl1.2-dev

然后重新在qemu源代码下configure下,并进行重新编译。

5. 参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值