步骤如下:
安装bochs之前要安装一些东西(terminal中安装):
sudo apt-get install build-essential nasm
sudo apt-get install libx11-dev(否则会出现fatal error: X11/Xlib.h: No such file or directory)
sudo apt-get install xorg-dev(否则会出现fatal error:X11/extensions/Xrandr.h: No such file or directory)
sudo apt-get install libgtk2.0-dev
sudo apt-get install bison
接下来去bochs官网下载源代码压缩包(bochs-2.6.9.tar.gz)
下载后在ubuntu中打开terminal 进入相应目录:
cd /mnt/hgfs/external
然后解压源码:tar zxvf bochs-2.6.9.tar.gz
进入解压后的目录:cd bochs-2.6.9
再执行: ./configure --enable-debugger --enable-disasm
打开bochs-2.6.9文件夹下Makefile文件, 在90行左右找到LIBS 在后面添加 -lX11
在进行编译:sudo make
如果上文中步骤都执行了过程中应该不会在出现乱七八糟的错误了。再出现其他错误请自行百度。
编译没有error后执行 sudo make install 进行安装。
安装完成后 在terminal输入 bochs 显示如下
sunnil@ubuntu:/mnt/hgfs/external/bochs-2.6.9$ bochs
========================================================================
Bochs x86 Emulator 2.6.9
Built from SVN snapshot on April 9, 2017
Compiled on Feb 2 2018 at 00:41:28
========================================================================
00000000000i[ ] BXSHARE not set. using compile time default '/usr/local/share/bochs'
00000000000i[ ] reading configuration from .bochsrc
00000000000e[ ] .bochsrc:187: wrong value for parameter 'model'
00000000000p[ ] >>PANIC<< .bochsrc:187: cpu directive malformed.
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:187: cpu directive malformed.
========================================================================
00000000000i[CPU0 ] CPU is in real mode (active)
00000000000i[CPU0 ] CS.mode = 16 bit
00000000000i[CPU0 ] SS.mode = 16 bit
00000000000i[CPU0 ] EFER = 0x00000000
00000000000i[CPU0 ] | EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000000
00000000000i[CPU0 ] | ESP=00000000 EBP=00000000 ESI=00000000 EDI=00000000
00000000000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
00000000000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00000000000i[CPU0 ] | CS:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | DS:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | SS:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | ES:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | FS:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | GS:0000( 0000| 0| 0) 00000000 00000000 0 0
00000000000i[CPU0 ] | EIP=00000000 (00000000)
00000000000i[CPU0 ] | CR0=0x00000000 CR2=0x00000000
00000000000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
bx_dbg_read_linear: physical memory read error (phy=0x000000000000, lin=0x00000000)
00000000000i[SIM ] quit_sim called with exit code 1
大概说明bochs已经安装上了但是没有配置正确。需要编写bochsrc配置文件。具体方法百度。。。
编写配置文件后进入相应的目录 输入:sudo bochs -f bochsrc 显示如下
直接enter 再输入c 再enter 新窗口显示如下:
352



被折叠的 条评论
为什么被折叠?



