bochs+gdb调试linux0.11环境搭建

环境准备

Centos6.8_x86

bochs-2.2.1.tar.gz

linux0.11源码

linux0.11源码

安装bochs

复制代码
tar zxvf bochs-2.2.1.tar.gz
cd bochs-2.2.1
./configure --enable-plugins --enable-disasm --enable-gdb-stub
make

ERROR1

.../bochs.h: In member function 'char* iofunctions::getaction(int)':

.../bochs.h:342: warning: deprecated conversion from string constant to 'char*'

.../bochs.h:342: warning: deprecated conversion from string constant to 'char*'

.../bochs.h:342: warning: deprecated conversion from string constant to 'char*'

.../bochs.h:342: warning: deprecated conversion from string constant to 'char*'

In file included from iodev.h:531,

from devices.cc:30:

.../iodev/harddrv.h: At global scope:

.../iodev/harddrv.h:290: error: extra qualification 'sparse_image_t::' on member 'get_physical_offset'

.../iodev/harddrv.h:295: error: extra qualification 'sparse_image_t::' on member 'set_virtual_page'

devices.cc: In constructor 'bx_devices_c::bx_devices_c()':

devices.cc:50: warning: deprecated conversion from string constant to 'char*'

make[1]: *** [devices.o] Error 1

make[1]: Leaving directory `/root/package/bochs-2.2.1/iodev'
解决

注释掉继续make

ERROR2

g++ -shared -nostdlib /usr/lib/gcc/i686-redhat-linux/4.4.7/.../.../.../crti.o /usr/lib/gcc/i686-redhat-linux/4.4.7/crtbeginS.o .libs/x.o -lSM -lICE -lX11 -lXpm -L/usr/lib/gcc/i686-redhat-linux/4.4.7 -L/usr/lib/gcc/i686-redhat-linux/4.4.7/.../.../... -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i686-redhat-linux/4.4.7/crtendS.o /usr/lib/gcc/i686-redhat-linux/4.4.7/.../.../.../crtn.o -Wl,-soname -Wl,libbx_x.so.0 -o .libs/libbx_x.so.0.0.0

/usr/bin/ld: cannot find -lXpm

collect2: ld returned 1 exit status

make[1]: *** [libbx_x.la] Error 1

make[1]: Leaving directory `/root/package/bochs-2.2.1/gui'
解决

yum install -y libXpm libXpm-devel

继续make

复制代码
make install

成功

试运行

复制代码
bochs -q -f bochsrc-hd.bxrc

ERROR3

复制代码
dlopen failed for module 'x': file not found

解决

复制代码
yum -y groupinstall "KDE Desktop"

至此,bochs已经可以运行linux0.11了

相关推荐
零号全栈寒江独钓2 小时前
基于c/c++实现linux/windows跨平台获取ntp网络时间戳
linux·c语言·c++·windows
左手厨刀右手茼蒿2 小时前
Linux 内核中的进程管理:从创建到终止
linux·嵌入式·系统内核
geinvse_seg2 小时前
中小团队如何低成本搭建项目管理系统?基于 Ubuntu 的 Dootask 私有化部署实战
linux·运维·ubuntu
CSCN新手听安2 小时前
【linux】高级IO,以ET模式运行的epoll版本的TCP服务器实现reactor反应堆
linux·运维·服务器·c++·高级io·epoll·reactor反应堆
丶伯爵式2 小时前
Ubuntu 24.04 更换国内软件源指南 | 2026年3月26日
linux·运维·ubuntu·国内源·升级
左手厨刀右手茼蒿2 小时前
Linux 内核中的 DMA 管理:从缓冲区到传输
linux·嵌入式·系统内核
Java后端的Ai之路3 小时前
Linux端口进程查找与终止教程
linux·运维·服务器
北山有鸟5 小时前
【学习笔记】MIPI CSI-2 协议全解析:从底层封包到像素解析
linux·驱动开发·笔记·学习·相机
mounter6255 小时前
深度解析:Linux 内核为何要移除“直接映射” (Direct Map)?
linux·运维·服务器·security·linux kernel·direct mem map
bugu___6 小时前
Linux系统、网络知识点回顾1
linux·网络