用Bochs学OS
安装依赖
- XQuartz 2.7.11
brew install sdl
brew install gtk+
brew install pkg-config
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
pkg-config --libs --cflags gtk+-2.0
- 下载安装包
bochs-2.6.tar.gz
解压./configure --with-sdl --enable-debugger --enable-disasm --with-x11 --enable-debugger-gui
make
- 根据报错提示修改源码再编译
(char *)
- 根据报错提示修改源码再编译
make install
第一个例子
修改配置文件 bochsrc
:
###############################################################
# 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=a.img, status=inserted
# choose the boot disk.
boot: floppy
# where do we send log messages?
# log: bochsout.txt
# disable the mouse
mouse: enabled=0
# enable key mapping, using US layout as default.
keyboard: keymap=$BXSHARE/keymaps/x11-pc-us.map
运行 Bochs:
bochs
参考文献