关于我安装运行bochs2.6.9的各种问题 2019.6.28
作者:互联网
2019.6.28
在阅读《一个64位操作系统的设计与实现》过程中,搭建实验环境遇到的诸多困难
1、安装bochs
下载各个版本的bochs传送门:https://sourceforge.net/projects/bochs/files/
为了与书本实验环境一致在kail linux操作系统下,我选择2.6.8版本
下载解压:
在含有comfigure文件的目录下打开命令行输入:
./configure --with-wx --with-x11 --enable-debugger --enable-disasm --enable-all-optimizations --enable-readline --enable-long-phy-address --enable-x86-64 --enable-ltdl-install --enable-idle-hack --enable-plugins --enable-a20-pin --enable-smp --enable-cpu-level=6 --enable-large-ramfile --enable-repeat-speedups --enable-fast-function-calls --enable-handlers-chaining --enable-trace-linking --enable-configurable-msrs --enable-show-ips --enable-cpp --enable-debugger-gui --enable-iodebug --enable-logging --enable-assert-checks --enable-fpu --enable-vmx=2 --enable-svm --enable-3dnow --enable-alignment-check --enable-monitor-mwait --enable-avx --enable-evex --enable-x86-debugger --enable-pci --enable-usb --enable-voodoo
等待结束后,输入命令:
make
此处根据个人编译环境不同可能报错如下:
1、 出现
1“ERROR: X windows gui was selected, but X windows libraries were not found.
解决办法:
sudo apt-get install libx11-dev xserver-xorg-dev xorg-dev
2、 出现
1 “ERROR: pkg-config was not found, or unable to access the gtk+-2.0 package. Install pkg-config and the gtk+ development package, or disable the gui debugger, or the wxWidgets display library (whichever is being used).” 2 ERROR: pkg-config was not found, or unable to access the gtk+-2.0 package.Install pkg-config and the gtk+ development package,or disable the gui debugger, or the wxWidgets display library (whichever is being used)
解决办法:
sudo apt-get install libgtk2.0-dev
(3) 出现
1 checking for C compiler default output file name… configure: error: C compiler cannot create executables
解决⽅法:
sudo apt-get install libc6-dev
(4) 出现
1 configure: error: C++ preprocessor "/lib/cpp" fails sanity check
解决⽅法
sudo apt-get install build-essential
(5) 出现
1 X windows gui was selected, but X windows libraries were not found.
解决⽅法:
sudo apt-get install xorg-dev
⼤家在解决完⼀项之后再次输⼊:./configure .......
等待完成输入:
make
如果提⽰:
/usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined reference to symbol pthread_create@@GLIBC_2.1 //lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error:ld returned 1 exit statusmake: *** [bochs]
解决⽅法:
在⽂件管理器的搜索栏⾥搜索:makefile
会搜出很多名叫“makefile”的⽂件,找到⼤⼩为29kb的那个“makefile”,注意,有的图标上会带着⼀个锁,
有的没有,我们找不带锁的那个,打开后下拉到90⾏左右,内容为:
LIBS = -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype
在这条指令后⾯加上:-lz -lrt -lpthread,完整的如下:
LIBS = -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lz -lrt -lpthread
保存后退出,此时再次在命令⾏⾥输⼊:
make
如果出现:
make: *** No rule to make target 'misc/bximage.cc', needed by 'misc/bximage.o'. Stop.
解决方法:
cp misc/bximage.cpp misc/bximage.cc cp iodev/hdimage/hdimage.cpp iodev/hdimage/hdimage.cc cp iodev/hdimage/vmware3.cpp iodev/hdimage/vmware3.cc cp iodev/hdimage/vmware4.cpp iodev/hdimage/vmware4.cc cp iodev/hdimage/vpc-img.cpp iodev/hdimage/vcp-img.cc cp iodev/hdimage/vbox.cpp iodev/hdimage/vbox.cc
继续出现:
1 export CC=egcs 2 export CXX="$CC" 3 export CFLAGS="-Wall -O2 -m486 -fomit-frame-pointer -pipe" 4 export CXXFLAGS="$CFLAGS"
标签:enable,1.0,2019.6,28,bochs2.6,iodev,cpp,2.0,hdimage 来源: https://www.cnblogs.com/Brandon0807/p/11104328.html