elvalad

修仙
Bochs使用说明

简介

关于Bochs的介绍:http://en.wikipedia.org/wiki/Bochs

Bochs的官网:http://bochs.sourceforge.net/

这里记录如何在Windows系统下使用Bochs,要在Bochs中运行一个操作系统需要准备一些资源:Bochs的执行文件,bios镜像文件,vga bios镜像文件,引导启动磁盘镜像文件。在使用Bochs时需要做一些系统预设参数,一般将这些参数放在一个配置文件中,文件后缀为bxrc。

配置文件

Bochs使用配置文件中的信息来寻找使用的磁盘镜像文件,运行环境配置以及其他一些模拟器的配置信息。每个仿真系统都需要一个配置文件,配置文件后缀一般为.bxrc,这类后缀的文件可以直接被Bochs打开,在Windows下安装Bochs之后会有一个bochsrc-sample文件,在这个文件里对所有可用的参数做了详细说明。这里以Bochs自带的dlxlinux为例,看看一些重要参数的含义。

###############################################################
# bochsrc.txt file for DLX Linux disk image.
###############################################################

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

# filename of ROM images
romimage: file=../BIOS-bochs-latest
vgaromimage: file=../VGABIOS-lgpl-latest

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

# hard disk
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="hd10meg.img", cylinders=306, heads=4, spt=17

# choose the boot disk.
boot: c

# default config interface is textconfig.
#config_interface: textconfig
#config_interface: wx

#display_library: x
# other choices: win32 sdl wx carbon amigaos beos macintosh nogui rfb term svga

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

# disable the mouse, since DLX is text only
mouse: enabled=0

# set up IPS value and clock sync
cpu: ips=15000000
clock: sync=both

# enable key mapping, using US layout as default.
#
# NOTE: In Bochs 1.4, keyboard mapping is only 100% implemented on X windows.
# However, the key mapping tables are used in the paste function, so 
# in the DLX Linux example I'm enabling keyboard_mapping so that paste 
# will work.  Cut&Paste is currently implemented on win32 and X windows only.

keyboard: keymap=../keymaps/x11-pc-us.map
#keyboard: keymap=../keymaps/x11-pc-fr.map
#keyboard: keymap=../keymaps/x11-pc-de.map
#keyboard: keymap=../keymaps/x11-pc-es.map

megs用于设置模拟系统的内存,这里使用的是32MB。

romimage用于控制PC第一次上电后该做些什么,一般可以使用Bochs自带的BIOS-bochs-latest文件。

vgaromimage要求用户在C0000载入VGA ROM BIOS,这里可以使用Bochs自带的VGABIOS-lgpl-latest文件。

floppya和floppyb分别表示第一个软驱和第二个软驱,如果需要从一个软盘上来引导系统则floppya就需要指向一个可引导的磁盘。

ata0用于启动模拟系统中的ATA通道,对于每个通道必须指明两个IO基地址和一个中断请求号。

ata0-master用来指明模拟系统中第一个ATA通道上连接的第一个ATA设备(硬盘等)。

boot用来定义模拟机器中踊跃引导启动的驱动器,可以为软盘硬盘或CDROM。

log用于记录日志信息。

cpu用于指定cpu参数,其中ips表示每秒钟的仿真命令数。

mouse用于指定模拟鼠标行为的参数。

keyboard用于指定模拟键盘行为的参数。

使用Bochs运行dlxlinux

Bochs为用户制作了一个demo,在Bochs的安装目录下有一个dlxlinux目录,里面有一个bochsrc.brxc的配置文件,双击这个文件就能在Bochs中启动一个模拟的Linux系统。

posted on 2015-01-25 16:04  elvalad  阅读(8906)  评论(0编辑  收藏  举报