ubuntu下安装bochs-2.6.11

下载.tar.gz,解压后在安装包下执行下面命令:

./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-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

如果有错误的话请自行google

然后执行 make,可能会遇到以下错误:

x86_64-pc-linux-gnu-g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -I. -I./. -march=native -O2 -pipe -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -pthread   -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT dbg_main.cc -o dbg_main.o
In file included from dbg_main.cc:28:
dbg_main.cc: In function ‘void bx_dbg_tlb_lookup(bx_lin_address)’:
../cpu/cpu.h:383:28: error: invalid use of ‘this’ in non-member function
  383 | #  define BX_CPU_THIS_PTR  this->
      |                            ^~~~
../cpu/tlb.h:62:32: note: in expansion of macro ‘BX_CPU_THIS_PTR’
   62 | #define BX_ITLB_INDEX_OF(lpf) (BX_CPU_THIS_PTR ITLB.get_index_of(lpf))
      |                                ^~~~~~~~~~~~~~~
dbg_main.cc:1497:18: note: in expansion of macro ‘BX_ITLB_INDEX_OF’
 1497 |   Bit32u index = BX_ITLB_INDEX_OF(laddr);
      |                  ^~~~~~~~~~~~~~~~
../cpu/cpu.h:383:28: error: invalid use of ‘this’ in non-member function
  383 | #  define BX_CPU_THIS_PTR  this->
      |                            ^~~~
../cpu/tlb.h:59:37: note: in expansion of macro ‘BX_CPU_THIS_PTR’
   59 | #define BX_DTLB_INDEX_OF(lpf, len) (BX_CPU_THIS_PTR DTLB.get_index_of((lpf), (len)))
      |                                     ^~~~~~~~~~~~~~~
dbg_main.cc:1501:11: note: in expansion of macro ‘BX_DTLB_INDEX_OF’
 1501 |   index = BX_DTLB_INDEX_OF(laddr, 0);
      |           ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:67: dbg_main.o] Error 1

如果出现的话,执行以下命令:
在bx_debug/dbg_main.cc中,借鉴这个人的修改:
https://blog.csdn.net/weixin_43669969/article/details/105158681

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/vpc-img.cc
    cp iodev/hdimage/vbox.cpp iodev/hdimage/vbox.cc

最后,记得用sudo

sudo make install

借鉴文章:
第一篇:https://blog.csdn.net/qq_24006155/article/details/105619758#commentBox
第二篇:https://blog.csdn.net/weixin_43669969/article/details/105158681

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值