ubuntu 9.04 安裝帶調試功能的bochs (轉)

學習操作系統,下載了bochs最新版本,但是不會編譯安裝,老是出錯,用了一會簡單的無調試功能的bochs但是感覺缺少點什麼,想用帶調試功能的,網 上搜索了好多資料,終於自己完成了編譯安裝的bochs,不容易啊,趕緊分享一下,linux版本是ubuntu 9.04 虛擬己版本是bochs 2.4.1


不帶調試功能的簡單安裝方法:
sudo apt-get install bochs

帶調試功能的bochs安裝

sudo apt-get install build-essential  安裝編譯環境

tar vxzf bochs-2.4.1.tar.gz
cd bochs-2.3.5
./configure --enable-debugger --enable-disasm
這一步問題出來了,沒注意配置時出現的問題就接着make了,導致make的時候,老是說83行遺漏分隔符。後來注意到了configure 的時候最後一行出現了一句:

> ERROR: X windows gui was selected, but X windows libraries were not found.

後來解決了, sudo aptitude install xorg-dev
(參考http://blog.163.com/i.kenting/blog/static/1226902032009625102310341/)

When install bochs, While I compile come file with ./configure there give a msg:

> configure: WARNING: Bochs for wxWidgets cannot be compiled here, disabling it

> checking for default gui on this platform... x11

> ERROR: X windows gui was selected, but X windows libraries were not found.

I just follow this :

You need to install the development libraries. To compile a wxWidgets

program you need libwxbase2.4-dev, libwxbase2.4-dev, and

libwxgtk2.4-contrib-dev (for a wx2.4 program) or libwxgtk2.6-dev (for a

wx2.6 program). For an X11 program you need x-window-system-dev, which

should pull in all the dependencies you need.

but I couldn't install the x-window-system-dev with: sudo apt-get install x-window-system-dev

the to solved this just:

sudo aptitude install xorg-dev   everything is fine with the ./configure now .

 

sudo apt-get install xorg-dev無法安裝,吼吼,又學到了個aptitude 。

再./configure 試試,暈,又有錯誤,錯誤提示是
checking for display libraries...  X11
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
ERROR: pkg-config was not found, or unable to access the gtk+-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).

這個安裝了個 gtk就解決了
sudo aptitude install libgtk2.0-dev (這個是自己猜的,安裝上果然可以了,呵呵,還有點天分)

然後make,make 的時候也出了點問題。
proc_ctrl.cc:654: 錯誤: ‘CheckPDPTR’在此作用域中尚未聲明
proc_ctrl.cc:668: 錯誤: ‘CheckPDPTR’在此作用域中尚未聲明
make[1]: *** [proc_ctrl.o] 錯誤 1
make[1]:正在離開目錄 `/media/disk-1/Linux/bochs-2.4.1/cpu'
make: *** [cpu/libcpu.a] 錯誤 2

上網搜的是那個文件出了錯proc_ctrl.cc參考
http://forum.ubuntu.org.cn/viewtopic.php?f=56&t=210457



make時的錯誤
proc_ctrl.cc:654: error: ‘CheckPDPTR’ was not declared in this scope
proc_ctrl.cc:668: error: ‘CheckPDPTR’ was not declared in this scope
make[1]: *** [proc_ctrl.o] Error 1

Google無果,還望哪位大哥指點一二
GCC版本gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3



自己解決:
代碼:
650行開始
#if BX_SUPPORT_VMX
VMexit_CR3_Write(i, val_32);
if (BX_CPU_THIS_PTR cr0.get_PG() && BX_CPU_THIS_PTR cr4.get_PAE() &&
!long_mode()) {
if (! CheckPDPTR(val_32)) {
BX_ERROR(("SetCR3(): PDPTR check failed !"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
SetCR3(val_32);
BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_MOV_CR3, val_32);
break;
#endif
#if BX_CPU_LEVEL > 3
case 4: // CR4
#if BX_SUPPORT_VMX
val_32 = VMexit_CR4_Write(i, val_32);
if (BX_CPU_THIS_PTR cr0.get_PG() && (val_32 & (1<<5)) != 0 /* PAE */
&& !long_mode()) {
if (! CheckPDPTR(BX_CPU_THIS_PTR cr3)) {
BX_ERROR(("SetCR4(): PDPTR check failed !"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
// Protected mode: #GP(0) if attempt to write a 1 to
// any reserved bit of CR4
if (! SetCR4(val_32))
exception(BX_GP_EXCEPTION, 0, 0);
break;
#endif
#endif
default:
BX_ERROR(("MOV_CdRd: #UD - control register %d index out of range",
i->nnn()));
exception(BX_UD_EXCEPTION, 0, 0);
}
}

683結束

代碼:
@@ -649,7 +649,6 @@
case 3: // CR3
#if BX_SUPPORT_VMX
VMexit_CR3_Write(i, val_32);
-#endif
if (BX_CPU_THIS_PTR cr0.get_PG() && BX_CPU_THIS_PTR cr4.get_PAE() && !long_mode()) {
if (! CheckPDPTR(val_32)) {
BX_ERROR(("SetCR3(): PDPTR check failed !"));
@@ -659,11 +658,11 @@
SetCR3(val_32);
BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_MOV_CR3, val_32);
break;
+#endif
#if BX_CPU_LEVEL > 3
case 4: // CR4
#if BX_SUPPORT_VMX
val_32 = VMexit_CR4_Write(i, val_32);
-#endif
if (BX_CPU_THIS_PTR cr0.get_PG() && (val_32 & (1<<5)) != 0 /* PAE */ && !long_mode()) {
if (! CheckPDPTR(BX_CPU_THIS_PTR cr3)) {
BX_ERROR(("SetCR4(): PDPTR check failed !"));
@@ -676,6 +675,7 @@
exception(BX_GP_EXCEPTION, 0, 0);
break;
#endif
+#endif
default:
BX_ERROR(("MOV_CdRd: #UD - control register %d index out of range", i->nnn()));
exception(BX_UD_EXCEPTION, 0, 0);

make問題解決了,然後
sudo make install 就可以了


錯誤還真多,幸好一開始己把ubuntu 上網的問題解決了,呵呵,能上網一切都好解決。
有點亂,弄了一天了,先記錄一下,免得忘記了。。。。
(俺是新手,開源愛好者,呵呵,有問題一起討論)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章