bochs 的安装

来源:互联网 发布:sqlserver创建视图语句 编辑:程序博客网 时间:2024/05/16 15:24

成功在Ubuntu 14.04下源码编译安装bochs 2.4.5,下面来说说安装的过程

1.先下载 bochs-2.4.5.tar.gz  官网已经进不去了自己去百度上找吧

2.准备工作,安装bochs依赖的软件: 
sudo apt-get install build-essential
sudo apt-get install xorg-dev
sudo apt-get install bison


3. 解压 tar vxzf bochs-2.4.5.tar.gz


4. 配置 ./configure --enable-debugger --enable-disasm


5. 编译 make


6. cp bochs bochsdbg

    避免安装时错误


7.  真正开始安装 sudo make install

8.测试boch是否安装成功

boot.asmorg07c00h; 告诉编译器程序加载到7c00处movax, csmovds, axmoves, axcallDispStr; 调用显示字符串例程jmp$; 无限循环DispStr:movax, BootMessagemovbp, ax; ES:BP = 串地址movcx, 16; CX = 串长度movax, 01301h; AH = 13,  AL = 01hmovbx, 000ch; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)movdl, 0int10h; 10h 号中断retBootMessage:db"Hello, OS world!"times 510-($-$$)db0; 填充剩下的空间,使生成的二进制代码恰好为512字节dw 0xaa55; 结束标志

nasm boot.asm -o boot.bin

用bximage创建软盘

dd if=boot.bin of=a.img bs=512 conv=notrunc  //将boot.bin 写入虚拟软盘

写配置文件bochsrc

bochr(无调试直接运行)  bochsdbg(这个是调试)

root@ubuntu:/tmp/temp# bochs

root@ubuntu:/tmp/temp# bochsdbg

//如果你没有bochsdbg 那就要看你在配置bochs时加--enable-debugger这个没有

//这样你的bochs就弄好了,下面就要开始写操作系统了

//最好安装个g++编译器 会用的上 apt-get install g++

遇到的问题

ERROR: pkg-config was not found, or unable to access thegtk+-2.0 package.
 

     Install pkg-config and the gtk+ development package,
      or disable the gui debugger, or the wxWidgets display library(whichever is being used).

解决方法:

 sudo apt-get install libgtk2.0-dev

没有多线程库

/usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined reference to symbol 'pthread_create@@GLIBC_2.1'
/usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [bochs] Error 1

解决方法:

打开Makefile,在92行左右找到 LIBS = 。。。一行,在这一行最后面添加 -lpthread

问题:couldn't open ROM image file '/usr/share/bochs/BIOS-bochs-latest'.

解决:修改配置文件中的以下两行   //这个是安装的目录的问题自己可以按照目录点击查看下

romimage: file=/usr/local/share/bochs/BIOS-bochs-latest #/usr/share/bochs/BIOS-bochs-latest

vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest #/usr/share/vgabios/vgabios.bin

0 0
原创粉丝点击