下载bochs-xx.exe安装包,比如我下载的bochs-2.4.2.exe,安装过程中,最好把安装选项全部都勾上。
安装完bochs后,下载WinImage,网上有注册码。
安装nasm,修改nasm的环境变量,修改环境变量后,在cmd任意文件下可使用nasm安装的命令。
(关于修改nasm的环境变量,右击我的电脑,点击高级系统设置,在环境变量里边的系统变量PATH里加上nasm的路径即可)
1.对于bochs的作用:
程序bochsdbg.exe是调试用的,可参考dlxlinux(及登录输入root即可)文件新建一个自己的操作系统文件。
2.WinImage的作用
往镜像文件中添加文件,方便竟然系统后,可以执行相关.com文件
在第五章以后,我们有boot.asm-----boot.bin -------|放在同一个镜像文件中,然后修改bochsrc.bxrc里边的
loader.asm---loader.bin -------|
kernel.asm---kernel.bin
floppya: 1_44=a.img, status=inserted 其中a.img文件就包含有boot.bin和loader.bin文件。我的bochsrc.bxrc文件如下:
###############################################################
# 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=a.img, status=inserted
#floppyb: 1_44=pm.img, status=inserted
#floppya: 1_44=pm.img, status=inserted
# hard disk
#ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
#ata0-master: type=disk, path="boot.bin", cylinders=306, heads=4, spt=17
# choose the boot disk.
boot: a
# 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
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_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-fr.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-de.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-es.map