在UBUNTU上安装基于bochs的 xv6

第一个步骤——安装bochs:

在安装bochs时需要从官网x下载tar包
解压后,
首先配置configure,
./configure --prefix=/usr/local/bin/bochs –enable-debugger –enable-disasm --enable-x86-debugger --with-x --with-x11
(–enable-debugger和 –enable-disasm 表示开启调试和反汇编功能)
然后make编译
最后 sudo make install 安装

bochs查找bochsrc文件的顺序 http://bochs.sourceforge.net/doc/docbook/user/search-order.html

If no configuration file is specified on the command line and config file loading is not disabled, Bochs searches for a default configuration file. This is the search order:

.bochsrc in the current directory

bochsrc in the current directory

bochsrc.txt in the current directory

(win32 only) bochsrc.bxrc in the current directory

(Unix only) .bochsrc in the user's home directory

(Unix only) bochsrc in the /etc directory

多参考Bochs User Manual

1.9.15. I am new to Bochs, how do I start?

You should read Chapter 4 first. Next, you can check Chapter 9 if there specific instructions on how to install your (guest) OS inside of Bochs.

第二个步骤——在bochs中运行xv6:

在xv6内有一个dot-bochsrc的文件,里面是运行bochs时的配置文件。
可以参考目前版本bochs的/share/doc/bochs/bochs-sample.txt来配置dot-bochsrc
# how much memory the emulated machine will have
megs: 254

# 键盘的映射方式也改变了
keyboard: keymap=$BXSHARE/keymaps/x11-pc-us.map

以下链接可参考:
一个操作系统的实现——使用Bochs运行程序
自己动手写操作系统(二)——搭建bochs环境

原文地址:https://www.cnblogs.com/gangzhuzi/p/10176252.html