版权声明:此文档版权归本人所有,非经允许不得转载,已授权steem@geyu等使用。
fedora28
安装bochs
下载https://sourceforge.net/projects/bochs/files/bochs/2.6.9/bochs-2.6.9.tar.gz/download
tar vxzf bochs-2.6.9.tar.gz
cd bochs-2.6.9
./configure --enable-debugger --enable-disasm
make
出现 找不到X11/Xlib.h 错误:
x11/xlib.h no such file or directory
尝试:sudo dnf install libx11-dev
提示:无匹配
分析:libx11-dev是ubuntu上的库,fedora上大概不叫这个名字。
尝试:sudo dnf install libX*
运行:make
报错:/usr/lib64/libX11.so.6 :error adding symbols : DSO missing from command line
继续输入:
make dist-clean
configure --enbale-debugger --enable-disasm
make
make这次终于成功,下一步
make install
由于还没有将bochs与bximage加入环境变量,需要加入
cd /bin ; ln -s ~/bochs.2.6.9/bochs /bin/bochs ;ln -s ~/bochs.2.6.9/bximage /bin/bximage
1.bximage 创建硬盘镜像 1->hd -> enter->enter...
2.nasm boot.asm -o boot.bin
3.dd写入镜像文件
dd if=boot.bin of=c.img bs=512 count=1 conv=notrunc
4.修改bochsrc.txt 到合适
启动即可
x /514bx addr
参考链接:
https://blog.csdn.net/linuxheik/article/details/8618268
https://www.jianshu.com/p/6b3df43932c3
###############################################################
# bochsrc.txt file for DLX Linux disk image.
###############################################################
# 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=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="c.img", cylinders=306, heads=4, spt=17
ata0-master: type=disk, path="c.img", mode=flat
# 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=$BXSHARE/keymaps/x11-pc-us.map
#keyboard: keymap=$BXSHARE/keymaps/x11-pc-fr.map
#keyboard: keymap=$BXSHARE/keymaps/x11-pc-de.map
#keyboard: keymap=$BXSHARE/keymaps/x11-pc-es.map