用源碼安裝完後會遇到的問題:
《1》
運行可能碰到如下問題:
Event type: PANIC
Device: [ ]
Message: dlopen failed for module 'x': file not found
這是由於在安裝
的時候,少安裝
了個bochs
-x
包
這個包可以在
http://packages.
ubuntu
.
com/dapper/misc/bochs
-x
找到
也可以在terminal下面輸入
sudo apt-get install bochs
-x
這樣才算安裝
完畢了。
《2》
、啟動問題
點進入系統後控制台出現下面的提示:
Please choose one: [6] 6
00000000000i[ ] installing win32 module as the Bochs
GUI
00000000000i[ ] using log file bochsout.
txt
========================================================================
Event type: PANIC
Device: [MEM0 ]
Message: ROM: System BIOS must end at 0xfffff
A PANIC has occurred.
Do you want to:
cont - continue execution
alwayscont - continue execution, and don't ask again.
This affects only PANIC events from device [MEM0 ]
die - stop execution now
abort - dump core
Choose one of the actions above: [die]
問題原因:
在2.
3.
5以前的bochs
使用的BIOS-bochs
-latest是64k的,那個時候需要加上
romimage: file=BIOS-bochs
-latest,address=0xf0000
在2.
3.
5中的BIOS-bochs
-latest更新了,變成了128k的,這個時候配置
需要改為
romimage: file=$BXSHARE/BIOS-bochs
-latest
解決方案:
去掉配置
檔案中的address那個
《3》
、bochs
的啟動配置
檔案bochsrc
一般網上的資料都會提示你安裝
好後會有如下工具:
/usr/bin/bochs
Bochs
啟動程式
/usr/bin/bximage Bochs
帶的製作磁碟鏡像檔案的工具
/usr/bin/bxcommit 把redolog放進flat磁碟鏡像檔案中去的互動工具
/usr/share/doc/bochs
/bochsrc-sample.
txt Bochs
配置
檔案的例子
/usr/share/bochs
/BIOS-bochs
-* ROM BIOS鏡像檔案
/usr/share/bochs
/VGABIOS-* 與VGA BIOS鏡像檔案相關的檔案
/usr/bin/bochs
-dlx 啟動Bochs
中DLX linux的程式
/usr/share/bochs
/dlxlinux/ DLX Linux的目錄,包含它的磁碟鏡像檔案和配置
檔案
/usr/share/bochs
/keymaps/*.
map X11和SDL的keymap列表
其實在終端安裝
的卻沒有第四、第七和第八項,就連第二第三項也要另外安裝
:
sudo apt-get install bximage
sudo apt-get install bxcommit
所以,網上那些bochsrx在Ubuntu
是運行不了的,就因為這點,我搞近一個下午,開始我老以為是配置
檔案不對呢。
普通的bochsrc:
romimage: file=$BXSHARE/BIOS-bochs
-latest, address=0xf0000
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
但是在Ubuntu
下壓根就沒有VGABIOS-lgpl-latest
例如:
lzel@lzel-desktop:/usr/share/bochs
$ ls
BIOS-bochs
-latest BIOS-bochs
-legacy BIOS-qemu-latest keymaps
lzel@lzel-desktop:/usr/share/bochs
$
後來我才發現,從終端下安裝
bochs
時它把VGA專門作為了一個程式安裝
在了/usr/share/vgabios/中了。
lzel@lzel-desktop:/usr/share/bochs
$ ls /usr/share/vgabios/
vgabios.
bin vgabios.
cirrus.
bin vgabios.
cirrus.
debug.
bin vgabios.
debug.
bin
lzel@lzel-desktop:/usr/share/bochs
$
這樣配置
檔案就要改為:
romimage: file=$BXSHARE/BIOS-bochs
-latest
megs:4
floppya: image=.
/boot.
img,status=inserted
vgaromimage: file=/usr/share/vgabios/vgabios.
bin
boot:a
log:out.
bochs
最
後在是《orange's 一個作業系統的實現》第二章關於bochsrc設定檔內容的修改:
安裝好bochs之後,我們需要對bochs進行配置,其實就是對檔案bochrsc進行修改!
《orange's :一個作業系統的實現》的附帶光碟片裡有一個已經配置好的bochrsc,但
是它是針對bochs2.3版本的,所以不能用!!!我們需要重新修改bochrsc!
首先將附帶光碟片裡的chapter1子目錄下的檔案夾a 移動到/home/roothoo/,(主要是為
是讓a.img 和 bochsrc在同一檔案夾下),然後對bochrc進行修改如下:
注意,#是注釋符號!即#之後的語句是無效的,其實#就相當於C+語言中的//
###############################################################
# Configuration file for Bochs
###############################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
#romimage: file=/usr/local/share/bochs/BIOS-bochs-latest
romimage: file=$BXSHARE/BIOS-bochs-latest
#vgaromimage: /usr/local/share/vgabios/vgabios.bin
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_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map
注意看字型為紅色的那兩句!
修改好之後,別忘了儲存!
最後,我們運行bochs
cd /home/roothoo/a #我們切換到a.img 和 bochsrc所在的檔案夾,
bochs -f bochsrc #以bochsrc為設定檔啟動bochs
然後選擇6,
然後再按c鍵,
OK!!!
ENJOY! -_-