【轉】ubuntu下安裝bochs 2.4.2

今天折騰了幾個小時,終於出現“hello world"畫面了
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
準備工作:
首先,安裝以下軟件:
sudo   apt-get    bulid-essional (如果以前安裝過就免了)
sudo apt-get install xorg-dev
sudo apt-get install bison

安裝bochs:
然後到bochs官方網站下載源碼包 bochs-2.4.2.tar.gz
解壓此文件:tar  vxzf   bochs-2.4.2.tar.gz
cd bochs-2.4.2
./configure   --enable-debugger   --enable-disasm
make
sudo  make install
注意:在以上過程中可能會遇到錯誤,不必驚慌,到百度上去找答案吧

配置bochs:
安裝好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! -_-
來自: http://hi.baidu.com/roothoo/blog/item/bd00deb4931bd1c537d3ca5e.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章