Ubuntu10.10中bochs安装与配置

1.下载

http://bochs.sourceforge.net/下载bochs源码包(如bochs-2.4.5),放到主文件夹下。

2.安装

  1. 打开终端

    ->tar vxzf bochs-2.4.5.tar.gz

    ->cd bochs-2.4.5

    ->./configure –enable-debugger –enable-disasm

  2. 上一步如果遇到“bash: ./configure: 权限不够”,终端输入:“chmod 777 configure ”,便可解决。

    ->make

    ->sudo make install

3.安装完毕

->bochs,便可出现如下画面:


4.使用bximage生成生成虚拟软盘

->bximage

========================================================================<br><br>                                bximage<br><br>                  Disk Image Creation Tool for Bochs<br><br>        $Id: bximage.c,v 1.34 2009/04/14 09:45:22 sshwarts Exp $<br><br>========================================================================<br><br><br><br>Do you want to create a floppy disk image or a hard disk image?<br><br>Please type hd or fd. [hd] fd<br><br><br><br>Choose the size of floppy disk image to create, in megabytes.<br><br>Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.<br><br> [1.44] <br><br>I will create a floppy image with<br><br>  cyl=80<br><br>  heads=2<br><br>  sectors per track=18<br><br>  total sectors=2880<br><br>  total bytes=1474560<br><br><br><br>What should I name the image?<br><br>[a.img] pm.img<br><br><br><br>Writing: [] Done.<br><br><br><br>I wrote 1474560 bytes to pm.img.<br><br><br><br>The following line should appear in your bochsrc:<br><br>  floppya: image="pm.img", status=inserted<br><br><br>

完成这一步后,当前目录下会出现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 imagesromimage: file=$BXSHARE/BIOS-bochs-latestvgaromimage: file= $BXSHARE/VGABIOS-lgpl-latest# what disk images will be usedfloppya: 1_44=pm.img, status=inserted# choose the boot diskboot: floppy# where do we send log message ?log: bochsout.txt# disable the mousemouse: 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 一个操作系统的实现》

2http://www.cnblogs.com/Aoysme/archive/2011/01/04/1925807.html

本文完

转载表明出处,谢谢

2011-01-15

posted @   独酌逸醉  阅读(2360)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
点击右上角即可分享
微信分享提示