Ubuntu18.04 Bochs环境配置

Boch下载

地址:https://sourceforge.net/projects/bochs/files/bochs/2.6.9/

我安装的是 .tar.gz后缀的版本
解压到当前目录

tar -vxzf bochs-2.6.9.tar.gz

安装nasm

sudo apt-get install nasm

进入到bochs文件的目录

cd bochs-2.6.9

./config配置

./configure --with-x11 --with-wx --enable-debugger --enable-disasm --enable-all-optimizations --enable-readline --enable-long-phy-address --enable-ltdl-install --enable-idle-hack --enable-plugins --enable-a20-pin --enable-x86-64 --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-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 install

sudo make install

错误:

Makefile:118: recipe for target 'x.lo' failed
make[1]: *** [x.lo] Error 1
make[1]: Leaving directory '/home/hjw/Downloads/bochs-2.6.9/gui'
Makefile:228: recipe for target 'bochs_plugins' failed
make: *** [bochs_plugins] Error 2

解决:

sudo apt-get install xorg-dev

安装可能出现错误提示:

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

解决:

sudo apt-get --fix-missing install xorg-dev

再次尝试make install

出错
错误为:

make[1]: Leaving directory '/home/hjw/Downloads/bochs-2.6.9/iodev/sound'
echo done
done
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/vpc-img.cc
cp iodev/hdimage/vbox.cpp iodev/hdimage/vbox.cc

再次make install 成功啦!

试着启动Bochs

bochs -f bochsrc

结果为:

========================================================================
                       Bochs x86 Emulator 2.6.9
               Built from SVN snapshot on April 9, 2017
                  Compiled on May  3 2019 at 00:28:43
========================================================================
00000000000i[      ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/local/lib/bochs/plugins'
00000000000i[      ] BXSHARE not set. using compile time default '/usr/local/share/bochs'
00000000000i[      ] lt_dlhandle is 0x2034c20
00000000000i[PLUGIN] loaded plugin libbx_usb_common.so
00000000000i[      ] lt_dlhandle is 0x2035c10
00000000000i[PLUGIN] loaded plugin libbx_unmapped.so
00000000000i[      ] lt_dlhandle is 0x2036410
00000000000i[PLUGIN] loaded plugin libbx_biosdev.so
00000000000i[      ] lt_dlhandle is 0x2037bb0
00000000000i[PLUGIN] loaded plugin libbx_speaker.so
00000000000i[      ] lt_dlhandle is 0x20389a0
00000000000i[PLUGIN] loaded plugin libbx_extfpuirq.so
00000000000i[      ] lt_dlhandle is 0x20391e0
00000000000i[PLUGIN] loaded plugin libbx_parallel.so
00000000000i[      ] lt_dlhandle is 0x203adf0
00000000000i[PLUGIN] loaded plugin libbx_serial.so
00000000000i[      ] lt_dlhandle is 0x203f190
00000000000i[PLUGIN] loaded plugin libbx_iodebug.so
00000000000i[      ] reading configuration from bochsrc
00000000000p[      ] >>PANIC<< reading from bochsrc failed
00000000000e[SIM   ] notify called, but no bxevent_callback function is registered
00000000000e[SIM   ] notify called, but no bxevent_callback function is registered
========================================================================
Bochs is exiting with the following message:
[      ].bochsrc:915: Bochs is not compiled with lowlevel sound support
========================================================================
00000000000i[SIM   ] quit_sim called with exit code 1

表明Bochs配置有误

查看出错原因:.bochsrc:915: Bochs is not compiled with lowlevel sound support.

解决方法:在bochsrc文件中删除915行的sound配置即可

下一步就是编写BootLoader引导启动程序了

未完待续

猜你喜欢

转载自blog.csdn.net/qq_37637619/article/details/89784508