Ubuntu安装Xochs别忘了Bochs-x
,假使忘记安装 bochs-x 运维时会出如下错误:

1.到Bochs官方下载源码包,因为用到了调度效用。 Bochs 2.4.5下载地址

新手,学习自身动手写操作系统,卡在bochs配置,求大神救助
1.bochs版本:bochs-2.6.8
编写翻译前安排:提取文件,张开目录,在终端中展开;

赫赫有名Apt-get安装的bochs是不带调节和测验功用的,必须透过源码编写翻译加上–enable-debugger才行。
 
当今ubuntu源上的bochs版本是2.4.6,然而bochs网址已经公布了2.5.1(
),因而大家直接编写翻译安装bochs2.5.1。
 
 
 
编写翻译源码
从 下载最新的源码并解压
./configure –with-x11 –with-wx –enable-debugger –enable-disasm
–enable-all-optimizations –enable-readline –enable-long-phy-address
–enable-debugger-gui
假定是六十二位系统上编写翻译bochs,应当要加上–enable-long-phy-address选项,不然启动中会出现bochs
exception(): 3rd (13) exception with no resolution, shutdown status is
make
$cp bochs bochsdbg,编写翻译未有发生bochsdbg,所以那边手动拷贝一份
sudo make install
编写翻译bochs源码报错的管理
checking for C compiler default output file name… configure: error: C
compiler cannot create       executables
sudo apt-get install  build-essential libc6-dev
ERROR: X windows gui was selected, but X windows libraries were not
found.
sudo apt-get install xorg-dev libgtk2.0-dev
install: cannot stat `./bios/VGABIOS*’:
在源码的bios目录下(/xxxx/bochs-2.5.1/bios),创设符号链接ln -s
/usr/share/vgabios/vgabios.bin VGABIOS-lgpl-latest
undefined reference to ‘XStringToKeysym’
configure时加上–with-x11,–with-x11 –with-wx –enable-debugger
–enable-disasm –enable-all-optimizations –enable-readline
–enable-long-phy-address –enable-debugger-gui
如果configure时,提示–with-wx有问题,sudo apt-get install
libwxgtk2.8-dev libx11-xcb-dev
因为带debug的bochs,每趟运行都会展开调节和测验窗口,有的时候我们只是想看看程序的试行结果,由此源码make
install以往,再经过sudo apt-get install bochs安装普通bochs
习认为常安装的bochs在/usr/bin/bochs,而源码安装的在/usr/local/bin/bochs,/usr/local/bin在PATH中的优先级比/usr/bin高,由此老是实行bochs实际推行的是源码安装的百般,大家能够把/usr/local/bin/bochs重命名。
那样保障大家进行bochs时是一般安装的,实践bochsdbg是源码安装的。
源码安装使用中相见的难题
(.:7444): Gtk-WARNING **: Unable to locate theme engine in
module_path: “pixmap”,
sudo apt-get install gtk2-engines-pixbuf  解决
动用进度中死机(-_-!)
config_interface和display_library注释掉
或者config_interface = textconfig,display_library=x,
options=”gui_debug” ,综上说述别用wx
dlopen failed for module ‘x’: file not found
sudo apt-get install bochs-x
 
 
bochs2.5.1安插文件的样书是源码目录下的.bochsrc

  1. ========================================================================  
  2. Bochs x86 Emulator 2.4.5  
  3. Build from CVS snapshot, on April 25, 2010  
  4. ========================================================================  
  5. 00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default ‘/usr/lib/bochs/plugins’  
  6. 00000000000i[ ] BXSHARE not set. using compile time default ‘/usr/share/bochs’  
  7. 00000000000i[ ] reading configuration from bochsrc  
  8. 00000000000i[ ] lt_dlhandle is (nil)  
  9. 读书自身入手写操作系统,x64编写翻译安装bochs2。00000000000p[ ] >>PANIC<< dlopen failed for module ‘x’: file not found  
  10. ========================================================================  
  11. Event type: PANIC  
  12. Device: [ ]  
  13. Message: dlopen failed for module ‘x’: file not found  
  14. A PANIC has occurred. Do you want to:  
  15. cont – continue execution  
  16. alwayscont – continue execution, and don’t ask again.  
  17. This affects only PANIC events from device [ ]  
  18. die – stop execution now  
  19. abort – dump core  
  20. debug – hand control to gdb  
  21. Choose one of the actions above: [die]  

2.安装G++编译器
sudo apt-get install g++
只要不安装G++编写翻译器, 在施行configure时就能产出一些荒谬。

  • ./configure –enable debugger –enable-disasm
  • sudo make
  • sudo make install安装到位,提前设置了一些索要的次第,未报错。

摘自 如烟海的专辑

澳门金沙国际 1

3.进行配置,开启调节和测量试验和反汇编
./configure –enable-debugger –enable-disasm

2.编辑bochesrc

以后ubuntu源上的bochs版本是2.4.6,可是bochs网址已经…

4.ERROR: X windows gui was selected, but X windows libraries were not
found.

  • sudo gedit 然后用gedit展开/ect/bochs-init/bochsrc,编辑内容如下:

出现那几个漏洞非常多时,请安装xorg-dev包

###############################################################

sudo apt-get install
xorg-dev

Configuration file for Bochs

###############################################################

5.Package gtk+-2.0 was not found in the pkg-config search path.Perhaps
you should add the directory containing `gtk+-2.0.pc’to the
PKG_CONFIG_PATH environment variableNo package ‘gtk+-2.0’ foundERROR:
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).

how much memory the emulated machine will have

megs: 32

并发那几个破绽百出时,请运转:

filename of ROM images

romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/share/vgabios/vgabios.bin

sudo apt-get install
libgtk2.0-dev

what disk images will be used

floppya: 1_44=/home/OS/a.img, status=inserted

6.重新施行配置(出错处理如上)

choose the boot disk.

boot: floppy

./configure –enable-debugger –enable-disasm

where do we send log messages?

接下来运营make

log: bochsout.txt

澳门金沙国际,make

disable the mouse

mouse: enabled=0

再install

enable key mapping, using US layout as default.

keyboard_mapping: enabled=1, map=/usr/share/bochs/keymaps/x11-pc-us.map

3.运行bochs

  • sudo bochs -f /ect/bochs-init/bochsrc

    结果如下:00000000000i[ ] BXSHARE not set. using compile time
    default ‘/usr/local/share/bochs’
    00000000000i[ ] reading configuration from
    /etc/bochs-init/bochsrc
    00000000000p[ ] >>PANIC<< /etc/bochs-init/bochsrc:25:
    ‘keyboard_mapping’ is deprecated – use ‘keyboard’ option instead.

    00000000000e[SIM ] notify called, but no bxevent_callback function is registered

    Bochs is exiting with the following message:
    [ ] /etc/bochs-init/bochsrc:25: ‘keyboard_mapping’ is
    deprecated – use ‘keyboard’ option instead.

闭馆终端,重新展开,

  • sudo
    bochs结果:========================================================================
    Bochs x86 Emulator 2.6.8 Built from SVN snapshot on May 3, 2015
    Compiled on Sep 27 2015 at
    09:38:33========================================================================00000000000i[
    ] BXSHARE not set. using compile time default
    ‘/usr/local/share/bochs’——————————Bochs
    Configuration: Main Menu——————————

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate. Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found. When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

  1. Restore factory default configuration
  2. Read options from…
  3. Edit options
  4. Save options to…
  5. Restore the Bochs state from…
  6. Begin simulation
  7. Quit now

按6,然后按c,bochs图形分界面弹出,提醒No bootable device.
事态描述完结,求大神解释

sudo make install

小编试过不用sudo来直接施行,会出错的,出错提醒不明明,应该是权力相当不够

make: *** [install_bin] 错误 1

7.做到,试行bochs,嘻嘻,来个截图

澳门金沙国际 2

配置bochs:
设置好bochs之后,我们供给对bochs进行计划,其实正是对文本bochrsc举行更动!
《orange’s
:四个操作系统的实现》的附带光盘里有一个一度布署好的bochrsc,但
是它是针对性bochs2.3本子的,所以无法用!!!大家必要重新修改bochrsc!
率先将附带光盘里的chapter1子目录下的文本夹a
移动到/home/roothoo/,(首倘诺为
是让a.img 和 bochsrc在长期以来文件夹下),然后对bochrc举办修改如下:
注意,#是注释符号!即#从此以后的言辞是不行的,其实#就一定于C+语言中的//
###############################################################
# Configuration file for Bochs
###############################################################

# how much memory the emulated machine will have
megs: 32

# filename of ROM images
romimage: file=/usr/local/share/bochs/BIOS-bochs-latest

#romimage: file=$BXSHARE/BIOS-bochs-latest
(适用于bochs安装在windows下)
vgaromimage: /usr/local/share/vgabios/vgabios.bin
#vgaromimage:
file=$BXSHARE/VGABIOS-lgpl-latest(适用bochs安装在windows下)

# what disk images will be used
floppya: 1_44=a.img, status=inserted

# choose the boot disk.
boot: floppy

# where do we send log messages?
# log: bochsout.txt

# disable the mouse
mouse: enabled=0

# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1,
map=/usr/local/share/bochs/keymaps/x11-pc-us.map

修改好之后,   【 Linux公社 www.Linuxidc.com 】  别忘了封存!
最终,大家运营bochs
cd      /home/用户名   #大家切换成a.img 和 bochsrc所在的文书夹,
bochs     -f    bochsrc    #以bochsrc为布局文件运转bochs
接下来选拔6,
下一场再按c键,
OK!!!
ENJOY! -_-

难点一、安装bochs在terminal下输入下列代码
sudo apt-get install bochs
如此设置收尾后,在自己使用bochs的时候出现了下列错误:
Event type: PANIC
Device: [     ]
Message: dlopen failed for module ‘x’: file not found
那是由于在安装的时候,少安装了个bochs-x包
本条包可以在http://packages.Ubuntu.com/dapper/misc/bochs-x找到
也足以在terminal上面输入
sudo apt-get install bochs-x
这么才算安装收尾了。
  难点二、运维难题
点进去系统后调控台出现下边包车型地铁唤醒:

Please choose one: [6] 6
00000000000i[ ] installing win32 module as the Bochs GUI

00000000000i[ ] using log file bochsout.txt

Event type: PANIC
Device: [MEM0 ]
Message: ROM: System BIOS must end at 0xfffff

A PANIC has occurred. Do you want to:
cont – continue execution
alwayscont – continue execution, and don’t ask again.
This affects only PANIC events from device [MEM0 ]
die – stop execution now
abort – dump core
Choose one of the actions above: [die]
难点原因:
在2.3.5原先的bochs使用的BIOS-bochs-latest是64k的,那个时候须要丰盛
romimage: file=BIOS-bochs-latest,address=0xf0000(举例)
在2.3.第55中学的BIOS-bochs-latest更新了,产生了128k的,这一年配置供给改为
romimage: file=$BXSHARE/BIOS-bochs-latest
(比方,也正是要去掉address=0xf000)

消除措施:
清除配置文件中的address那么些
主题材料三、bochs的启航配置文件bochsrc
貌似网络的材料都会提示您安装好后会有如下工具:
/usr/bin/bochs     Bochs运转程序
/usr/bin/bximage     Bochs带的造作磁盘镜像文件的工具
/usr/bin/bxcommit     把redolog放进flat磁盘镜像文件中去的相互工具
/usr/share/doc/bochs/bochsrc-sample.txt     Bochs配置文件的例子
/usr/share/bochs/BIOS-bochs-*     ROM BIOS镜像文件
/usr/share/bochs/VGABIOS-*     与VGA BIOS镜像文件有关的文本
/usr/bin/bochs-dlx     启动Bochs中DLX linux的程序
/usr/share/bochs/dlxlinux/     DLX
Linux的目录,饱含它的磁盘镜像文件和布署文件
/usr/share/bochs/keymaps/*.map     X11和SDL的keymap列表
实际上在巅峰安装的却尚未第四、第七和第八项,就连第二第三项也要其它安装:
       sudo apt-get install bximage
       sudo apt-get install bxcommit
由此,网络这多少个bochsrx在Ubuntu是运维不了的,就因为这一点,笔者搞近四个晚上,先河小编老认为是安排文件不对呢。
普通的bochsrc:
romimage: file=$BXSHARE/BIOS-bochs-latest,

vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
唯独在Ubuntu下压根就从未有过VGABIOS-lgpl-latest
例如:
www.linuxidc.com@linuxidc-desktop:/usr/share/bochs$ ls
BIOS-bochs-latest  BIOS-bochs-legacy  BIOS-qemu-latest   keymaps
www.linuxidc.com@linuxidc-desktop:/usr/share/bochs$
新生自家才发觉,从终端下安装bochs时它把VGA专门用作了八个程序安装在了/usr/share/vgabios/中了。
www.linuxidc.com@linuxidc-desktop:/usr/share/bochs$ ls
/usr/share/vgabios/
vgabios.bin  vgabios.cirrus.bin  vgabios.cirrus.debug.bin 
vgabios.debug.bin
www.linuxidc.com@linuxidc-desktop:/usr/share/bochs$
那般布置文件将在改为:
   romimage: file=$BXSHARE/BIOS-bochs-latest
   megs:4
   floppya: image=./boot.img,status=inserted
   vgaromimage: file=/usr/share/vgabios/vgabios.bin
 
boot:a                                                                                                                                                  
  log:out.bochs

澳门金沙国际 3

相关文章