Ubuntu10.10中bochs安装与配置
1.下载
在http://bochs.sourceforge.net/下载bochs源码包(如bochs-2.4.5),放到主文件夹下。
2.安装
-
打开终端
->tar vxzf bochs-2.4.5.tar.gz
->cd bochs-2.4.5
->./configure –enable-debugger –enable-disasm
-
上一步如果遇到“bash: ./configure: 权限不够”,终端输入:“chmod 777 configure ”,便可解决。
->make
->sudo make install
3.安装完毕
->bochs,便可出现如下画面:
4.使用bximage生成生成虚拟软盘
->bximage
========================================================================
bximage
Disk Image Creation Tool for Bochs
$Id: bximage.c,v 1.34 2009/04/14 09:45:22 sshwarts Exp $
========================================================================
Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] fd
Choose the size of floppy disk image to create, in megabytes.
Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
[1.44]
I will create a floppy image with
cyl=80
heads=2
sectors per track=18
total sectors=2880
total bytes=1474560
What should I name the image?
[a.img] pm.img
Writing: [] Done.
I wrote 1474560 bytes to pm.img.
The following line should appear in your bochsrc:
floppya: image="pm.img", status=inserted
完成这一步后,当前目录下会出现pm.img。这便是我们的软盘映像了。
5.写配置文件(bochsrc)
值得注意的是《Orange's一个操作系统的实现》书中提供的bochsrc文件示例以bochs2.3.5,我安装的是bochs2.4.5,着两个版本有一些差别,在这里我卡了很久。我也是在博客http://www.cnblogs.com/Aoysme/archive/2011/01/04/1925816.h中找到他们的差别的。
bochs2.3.5版本中:
# filename of ROM images
romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: /usr/share/vgabios/vgabios.bin
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=/usr/share/bochs/keymaps/x11-pc-us.map
需要改为:
# filename of ROM images
romimage: file=$BXSHARE/BIOS-bochs-latest
vgaromimage: file= $BXSHARE/VGABIOS-lgpl-latest
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.ma
bochs2.4.5总配置文件如下:
#########################################################################
# Configuration file for Bochs
#########################################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage: file=$BXSHARE/BIOS-bochs-latest
vgaromimage: file= $BXSHARE/VGABIOS-lgpl-latest
# what disk images will be used
floppya: 1_44=pm.img, status=inserted
# choose the boot disk
boot: floppy
# where do we send log message ?
log: bochsout.txt
# disable the mouse
mouse: enabled=0
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map
运行虚拟机之后,黑乎乎的一片,这是因为我们设定的是调试模式,在终端输入c回车,便可进入虚拟机。
参考资料:
(1)于渊 《Orange's 一个操作系统的实现》
(2)http://www.cnblogs.com/Aoysme/archive/2011/01/04/1925807.html
本文完
转载表明出处,谢谢
2011-01-15