关于我在安装2.6.9版本bochs虚拟机时遇到的问题以及解决过程

更新于:2019.7.2

在阅读《一个64位操作系统的设计与实现》过程中,搭建实验环境遇到的诸多困难。

本人的实验环境:vmware15.0 下安装有kali-liunx虚拟机里进行的安装实验,如果有小伙伴对这款操作系统感兴趣

kail操作系统镜像:

链接:https://pan.baidu.com/s/1jkYI2RQ_lcgCPaENMQwEYg
提取码:94s9

=====================     正文   ======================

1、安装bochs

下载各个版本的bochs:传送门0            bochs的用户使用手册:传送门1              有关configure选项的含义:传送门2

在kail linux操作系统下,我选择bochs-2.6.9.tar.gz,为了实现调试功能我们必须自己下载源码编译。

或者您也可以使用SVN checkout命令获取自2000年3月以来任何版本的Bochs源代码。命令是:

svn co http://svn.code.sf.net/p/bochs/code/tags/tagname/bochs bochs

下载解压:

tar -xvf bochs-2.6.8.tar.gz

在含有comfigure文件的目录下打开命令行输入回车:

./configure --with-x11 --with-wx --enable-plugins --enable-debugger --enable-debugger-gui --enable-readline --enable-disasm --enable-xpm --enable-show-ips --enable-logging --enable-assert-checks --enable-idle-hack --enable-cpu-level=6 --enable-fpu --enable-x86-64 --enable-vmx=2 --enable-svm --enable-avx --enable-x86-debugger --enable-alignment-check --enable-configurable-msrs --enable-long-phy-address --enable-a20-pin --enable-large-ramfile --enable-repeat-speedups --enable-fast-function-calls --enable-handlers-chaining --enable-all-optimizations --enable-pci --enable-iodebug --enable-usb 

下表是文档中相关参数的具体含义,根据该文档我更改了一些参数:

去除掉了:--enable-cpp --enable-smp --enable-3dnow --enable-monitor-mwait --enable-voodoo --enable-ltdl-install --enable-trace-linking --enable-evex

            Table 3-7. Configure Options to Select the Display Library (optional)

Option Comments
--with-x11 Use X windows user interface. On many operating systems, Bochs will use X windows by default.
--with-win32 Use the native Win32 GUI. This is the default on win32 platforms.
--with-carbon Compile for MacOS X with the Carbon GUI. See the .conf.macosx file for the correct MacOS X compile options. WARNING: This Bochs feature is not maintained yet and may fail.
--with-amigaos Compile for Amiga MorphOS. This code is written by Nicholai Benalal.
--with-rfb Enable support for the RFB protocol to talk to AT&T‘s VNC Viewer. Refer to Section 3.4.9 for details.
--with-vncsrv Enable support for an extended RFB(VNC) GUI using the LibVNCServer library. Refer to Section 3.4.10 for details.
--with-sdl Enable support for the SDL 1.2.x GUI interface; see Section 3.4.11.
--with-sdl2 Enable support for the SDL 2.x GUI interface; see Section 3.4.12.
--with-term Use text-only gui with curses library. Almost certainly won‘t work right with the debugger or the textconfig interface.
--with-macos Use Macintosh/CodeWarrior environment. This is for running configure on a platform which supports running configure, so that you may then transfer the configured code over to the real compile environment. WARNING: This Bochs feature is not maintained yet and may fail.
--with-wx Enable support for wxWidgets configuration and display interface; see Section 3.4.13.
--with-svga Use SVGALIB library for Linux. This allows a full-screen text and graphics display without X windows. The SVGALIB port was written by Igor Popik. WARNING: This Bochs feature is not maintained yet and may fail.
--with-nogui No native GUI; just use blank stubs. This is if you don‘t care about having video output, but are just running tests.
--with-all-libs Automatically detect which libraries are installed on your system and enable them. This option is still experimental; it might enable libraries that are not usable and cause the compile to fail. If you have trouble, just list the --with-* options for the specific display libraries that you want.

            Table 3-8. Configure Options (General)

Option Default Comments
--enable-plugins no Plugins are shared libraries that can be loaded on demand. Example: the serial device is implemented as a plugin. In Unix, the serial plugin is called libbx_serial.so. When Bochs reads its configuration file, if the serial device is enabled it loads libbx_serial.so. See the Features section for supported platforms.
--enable-debugger no Compile in support for Bochs internal command-line debugger. This has nothing to do with x86 hardware debug support. It is a more powerful and non-intrusive native debugger. Enabling this will of course slow down the emulation. You only need this option if you know you need it. After you have run ./configure, you may want to edit config.h to customize the debugger further; see Section 8.14 for more information.
--enable-debugger-gui yes if debugger is on Enable support for the gui frontend of the Bochs debugger. This feature is supported on Windows hosts and on hosts with GTK2 installed.
--enable-readline detected by configure Compile the debugger with the GNU readline library, which gives command line editing and history.
--enable-gdb-stub no Enable support for the remote GDB stub. See Using Bochs and the remote GDB stub. NOTE: This feature cannot be used if the Bochs debugger is also enabled. WARNING: This Bochs feature is not maintained yet and may fail.
--enable-disasm yes Compile in support for built-in disassembler. Bochs has a built-in disassembler, which is useful if you either run the built-in debugger (--enable-debugger), or want disassembly of the current instruction when there is a panic in bochs.
--enable-docbook detected Build the docbook documentation in doc/docbook. The configure script will enable this option automatically if you have a program called docbook2html installed.
--enable-instrumentation=directory no Compile in support for instrumentation. This allows you to collect instrumentation data from bochs as it executes code. You have to create your own instrumentation library and define the instrumentation macros (hooks in bochs) to either call your library functions or not, depending upon whether you want to collect each piece of data.
--enable-xpm yes Enables the check for the XPM library. This option is only valid if the x display library is enabled (--with-x11).
--enable-show-ips yes Enables logging of measured IPS, see the ips parameter of the cpu option.
--enable-logging yes By default, Bochs generates logfile output that can be configured with bochsrc options and at runtime. Use --disable-logging to turn off this feature completely.
--enable-assert-checks yes if debugger is on BX_ASSERT event causes a panic on assertion failure if enabled (logging feature must be enabled, too).
--enable-cpp no Use .cpp as C++ suffix. Renames all the .cc files to .cpp for use with compilers which want that, like older MS C++ compilers. Don‘t use this option unless you know you need it.
--enable-idle-hack no Enables Roland Mainz‘s experimental idle code, which is intended to keep Bochs from always using 100% of CPU time. When Bochs is waiting around for an interrupt, the idle code uses a select() loop and some X11 tricks to wait until user input arrives. This is designed to keep Bochs responsive while still yielding to other processes when Bochs is idle. It only works with X11 or term GUI.

            Table 3-9. Configure Options (CPU & Memory)

Option Default Comments
--enable-cpu-level={3,4,5,6} 6 Select which CPU level to emulate. Choices are 3,4,5,6 which mean to target 386, 486, Pentium, or Pentium Pro and later emulation.
--enable-smp no Compile in support for SMP simulation. This allows you to boot Linux and maybe other OSes in SMP mode, and bochs will simulate all the different CPUs and communication between them. Do not expect this option to speed up your simulation! On the contrary, it has to spend extra time simulating the different CPUs (even if they‘re mostly idle) and the communication between them. Use it to try out an SMP OS if you don‘t have an SMP machine, or to debug SMP OS drivers. Refer to Section 8.9 for more details on SMP in Bochs.
--enable-fpu yes If you want to compile Bochs to make use of the FPU emulator written by Stanislav Shwartsman, use this option.
--enable-3dnow no 3DNow! instruction set support (incomplete)
--enable-x86-64 no Add support for x86-64 instruction set, written by Peter Tattam and Stanislav Shwartsman.
--enable-vmx no Intel Virtualization Extensions (VMX) support
--enable-svm no AMD SVM (Secure Virtual Machine) extensions emulation support
--enable-avx no AVX instructions support
--enable-x86-debugger no X86 debugger support. If the software you run in bochs needs to use the x86 hardware debugging facilities such as DR0..DR7, instruction and data breakpoints etc., then you should use this option. Otherwise don‘t use it, as it will slow down the emulation.
--enable-monitor-mwait no MONITOR/MWAIT instructions support (still experimental)
--enable-alignment-check yes if cpu level >= 4 support for alignment check in the CPU and #AC exception
--enable-configurable-msrs no support for user configurations of emulated MSR registers (see example in msrs.def)
--enable-long-phy-address no support for guest physical address larger than 32 bit
--enable-a20-pin yes support for the A20 pin
--enable-large-ramfile yes support for guest memory larger than the host supports
--enable-repeat-speedups no enable support repeated I/O and memory copy speedups
--enable-fast-function-calls no enable support for fast function calls (gcc on x86 only)
--enable-handlers-chaining no enable support for handlers chaining optimization
--enable-all-optimizations no Turn on the enables for all speed optimizations that the developers believe are safe to use: --enable-repeat-speedups, --enable-fast-function-calls, --enable-handlers-chaining.

            Table 3-10. Configure Options (Devices)

Option Default Comments
--enable-cdrom yes Enable use of a real CDROM/DVD drive. The cdrom emulation and the portable ISO image file support are always present. You can use this option to compile in support for accessing the media in your workstation‘s cdrom drive. The supported platforms are Linux, Solaris, FreeBSD, OpenBSD, MacOS X and Windows. For other platforms, a small amount of code specific to your platform must be written.
--enable-sb16 no Enable Sound Blaster emulation. The available lowlevel sound interfaces are autodetected. See section Using Sound for supported platforms and more info. This option also enables the standard PC gameport which is a part of the SB16. If you don‘t want to use it, you might use --disable-gameport.
--enable-es1370 no Enable ES1370 sound emulation. Just like the SB16 option, the available lowlevel sound interfaces are autodetected and the gameport is turned on.
--enable-gameport no Enables the standard PC gameport. This option is only necessary if you want to have a gameport, but no SB16 or ES1370 (see above). The connection to a real joystick is currently supported on Linux and win32 only.
--enable-ne2000 no Enable NE2000 network card support. This requires a low-level component to be written for each OS (supported on FreeBSD, OpenBSD, Linux, and Windows 9x/NT/2K/XP). When enabled and configured, the NE2000 device model can talk to any computer on the network EXCEPT FOR the local host. Exception: Under most circumstances, Bochs can talk to the local host on Windows, and in the ethertap interface for Linux.
--enable-pnic no Enable PCI pseudo NIC (network card) support.
--enable-e1000 no Enable Intel(R) 82540EM Gigabit Ethernet adapter support.
--enable-clgd54xx no Enable Cirrus Logic GD54xx (CL-GD5430 ISA or CL-GD5446 PCI) video card support. For more information see Section 8.20.
--enable-voodoo no Enable experimental 3dfx Voodoo Graphics emulation. Currently only the Voodoo1 model is known to work (Voodoo2 is under construction).
--enable-iodebug yes if debugger is on Dave Poirier has written an experimental interface to the debugger using I/O ports, so that software running in the guest OS can access features of the debugger. You only want this option if you are developing guest OS code for use in Bochs. In other words, most people don‘t. Also, it should only be used with --enable-debugger. See the developer documentation for details.
--enable-pci yes Enable limited i440FX / i430FX PCI support. This is still incomplete, but usable.
--enable-pcidev no Enable PCI host device mapping support. This requires --enable-pci to be set as well as Linux 2.4, 2.6 or 3.x as host. WARNING: This Bochs feature is not maintained yet and may fail.
--enable-usb no Enable i440FX PCI USB support (UHCI). The host controller with 2-port root hub and 8 USB device types are available.
--enable-usb-ohci no Enable USB OHCI support. The host controller with 2-port root hub is available (USB device types: same as UHCI).
--enable-usb-ehci no Enable USB EHCI support. The host controller with 6-port root hub is available (USB device types: same as UHCI).
--enable-usb-xhci no Enable USB xHCI support. The host controller with 4-port root hub is available (USB device types: same as UHCI).
--enable-raw-serial no Enable support for the serial port emulation to access to the host‘s serial port. This feature is partly implemented for Windows hosts only.

等待结束后,输入命令:

make

2、不得不说一下make命令:

我们先要配置好configure文件用于生成makefile文件。然后,make。如果你安装失败需要重新make,建议先运行:make all-clean,最后make install

3、此处根据个人编译环境不同可能报错如下:

<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

<6>如果提?:

/usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined reference to symbol [email protected]@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

<7> 如果你启用了‘--enable-cpp’将会出现:

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

继续出现:

我猜测这是我之前选择 --enable-cpp 搞出来的事情,所以我们还是不要--enable-cpp了,重新configure一下,再来过。

可以看到安装成功后的目录结构:

原文地址:https://www.cnblogs.com/Brandon0807/p/11122234.html

时间: 2024-08-06 23:13:49

关于我在安装2.6.9版本bochs虚拟机时遇到的问题以及解决过程的相关文章

Advanced Installer 安装前卸载旧版本的办法

原文:Advanced Installer 安装前卸载旧版本的办法 Advanced Installer这个工具百度出来的资料太少了. 在我们平常打包的工作中,经常遇到的一个问题是,如何能在安装新版本的时候友好的提示/卸载之前的旧版本,而不是粗暴的直接让用户自行去卸载呢?今天就这个问题给出下面一个具体的解决办法,话不多说,直接开始: 方案一:安装时自动卸载旧版本 第一步:找到并记录下上一个版本的Upgrade Code,此Code在上一个工程中的如下位置: 第二步:在新版本中的Upgrade C

关于安装Xcode7.2以上版本,解决打码卡卡卡的几个方法

记得前段时间,听几个朋友说,安装Xcode7.2以上版本后,就不能愉快的打码了.而且,还长时间得不到解决,甚至安装回7.0版本,依然很卡,严重影响工作.有个朋友给我说了个例子,他在Xcode输入“对面的妹子别乱来”,等了30秒左右,这串文字才姗姗来迟的出现在注释里.种种对Xcode,对OSX,对电脑硬件的怀疑就产生了.本人觉得这不太靠谱,毕竟人家那么大的公司,怎么会搞出这样的问题,那么多精英在,什么问题搞不定.所以我觉得这里应该有使用者的部分原因,综合个人经验,我给出以下几点建议. 一,查看了一

CentOS yum 安装LAMP PHP5.4版本

CentOS yum 安装LAMP PHP5.4版本     [字体:大 中 小] Linux系统版本:CentOS 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源代码编译安装大概需要2个小时,好处在于可以自己配置地址等一些参数,yum安装半个小时搞定,一般不会出错,更新也很方便. 2.我的机器是CentOS release 5.9 64为的系统,一般机器都

Windows下安装Mysql绿色zip版本

以mysql-5.7.4-m14-winx64为例,mysql-5.7.4-m14-winx64.zip下载地址http://dev.mysql.com/downloads/mysql/5.7.html 解压到安装目录D:\mysql-5.7.4-m14-winx64 安装根目录D:\mysql-5.7.4-m14-winx64下创建选项配置文件my.ini [client] port=3306 socket="D:/mysql-5.7.4-m14-winx64/data/mysql.sock&

在Linux系统下安装大于mysql5.5版本的数据库

linux下mysql 5.5的安装方法: 1.安装所需要系统库相关库文件      gcc等开发包,在安装linux系统的时候安装. 2.创建mysql安装目录 # mkdir -p /usr/local/mysql/ 3.创建数据存放目录 # mkdir -p /service/data/ 4.创建用户和用户组与赋予数据存放目录权限 # groupadd mysql # useradd -g mysql mysql # chown mysql:mysql -R /service/data/

编译安装nginx并修改版本头信息—参考实例

今天做实验的时候,想起我那台yum安装的nginx+php-fpm+mysql服务器上的nginx版本有点低了,并且还要加两个第3方模块,就去nginx官网下载了最新稳定版nginx-1.0.6,好了,废话不多说看教程吧.  系统版本: centos 5.6  ip: 192.168.1.200  需要的软件包:nginx-1.0.6.tar.gz Nginx-accesskey-2.0.3.tar.gz ngx_cache_purge-1.3.tar.gz(这3个包可以自己去下载,我就不提供了

在Window平台下安装xgboost的Python版本

原文:http://blog.csdn.net/pengyulong/article/details/50515916 原文修改了两个地方才安装成功,第3步可以不用,第2步重新生成所有的就行了. 第4步,有“xgboost_wrapper.dll”以后,将该文件复制到/python-package/xgboost/中,继续后面步骤就可以了. 特别注意如果你的python是32位的,第二步就不要选择x64,而是选择win32.对应的文件也不是在x64下了.一定可以运行. xgboost的全称是eX

【NS2】ubuntu安装和同时使用不同版本的ns2(转载)

有时候我们可能会遇到要同时安装两个ns版本的问题,比如我研究wimax/802.16,因为协议太复杂,用的是长庚大学和nist的wimax补丁.长庚大学的wimax补丁是在ns2.29下开发的,nist的wimax补丁虽说可以在多个ns版本上使用,但是在ns2.31上移植最简单.因此如果能够两个版本同时使用当然最好,事实上这也是可以实现的. 我们用./install安装好后,没有设置环境变量在终端上是不能使用ns命令的,除非你在ns-2~/文件夹下.呵呵,其实这样已经告诉我们一种解决两个版本同时

eclipse安装Hadoop1.1.2版本开发插件

Hadoop1.1.2版本没有直接适合Eclipse的安装插件,需要手动打包jar文件. 我的系统配置: VMware Workstation10 CentOS-6.5-i386 hadoop-1.1.2 eclipse_SDK_3.7.2_win32 系统配置说明: 我的电脑是Win7 32位的,安装了VMware虚拟机. 在虚拟机中安装的是CentOS系统(Linux系统). 在Linux系统中配置的是Hadoop1.1.2的伪分布式集群环境. Eclipse安装在Window系统下. 实现