歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Linux0.11 運行環境搭建以及調式--bochs

Linux0.11 運行環境搭建以及調式--bochs

日期:2017/3/1 10:07:23   编辑:Linux編程

1:下載及安裝

1.1 工具下載

首先,我們需要去官網下載該工具,這個工具有多個平台.下載地址如下:

http://sourceforge.net/projects/bochs/

1.2 安裝

這裡我們選擇windows平台Bochs-2.6.exe..安裝過程很簡單.一路next就行了..我把bochs安裝在了E:\Program Files\Bochs-2.6路徑下 安裝完成之後會是這樣的..

2:常用配置

2.1 配置文件

在bochs中,可以設置一台虛擬pc,主要涉及的就是配置文件了.在windows中,可以直接通過雙擊配置文件就可以打開該配置的虛擬pc了..很方便.
以後要修改pc配置,均以安裝目錄下的 bochsrc-sample.txt 文件作為參考.在上面進行修改.該文件為配置的例子..基本上只需要修改需要的部分,去掉不需要的部分,最後修改後綴為*.bxrc 就行了

2.1.1 megs

megs用於模擬系統所含的內存容量.默認是32..例如 megs: 16 修改為16M

2.1.2 floppya

floppya 用於模擬一個軟盤.最後a表示第一個軟盤.當然b就是第二個軟盤了..若是想用floppya引導.那就得給軟件指定image文件.方法如下: floppya: 1_44="boot.img", status=insertedshatus=inserted表示已插入

2.1.3 ata0 ata1 ata 2 ata3

這四個參數用於指定系統模擬ata通道.最多4個..例如: # ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
# ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
# ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
# ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9

2.1.4 ata0-master

ata0-master用於模擬系統中第一個ata通道上連接的第一個ata設備,如硬盤,CDROM等,ata0-slave指明第一個通道上鏈接的第二個ata設備,如下: # ata0-master: type=disk, mode=flat, path=10M.sample, cylinders=306, heads=4, spt=17
# ata0-slave: type=disk, mode=flat, path=20M.sample, cylinders=615, heads=4, spt=17
# ata1-master: type=disk, mode=flat, path=30M.sample, cylinders=615, heads=6, spt=17
# ata1-slave: type=disk, mode=flat, path=46M.sample, cylinders=940, heads=6, spt=17
# ata2-master: type=disk, mode=flat, path=62M.sample, cylinders=940, heads=8, spt=17
# ata2-slave: type=disk, mode=flat, path=112M.sample, cylinders=900, heads=15, spt=17
# ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63
# ata3-slave: type=cdrom, path=iso.sample, status=inserted

2.1.5 boot

指定虛擬系統啟動引導的設備.由硬盤,軟件,或者磁盤符號.如: # boot: floppy
# boot: cdrom, disk
# boot: network, disk
# boot: cdrom, floppy, disk

2.1.6 ips

表示虛擬系統每秒鐘處理的指令條數,該值跟CPU有關..如下(此處為mipsms為單位): # 2.4.6 3.4Ghz Intel Core i7 2600 with Win7x64/g++ 4.5.2 85 to 95 Mips
# 2.3.7 3.2Ghz Intel Core 2 Q9770 with WinXP/g++ 3.4 50 to 55 Mips
# 2.3.7 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 38 to 43 Mips
# 2.2.6 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 21 to 25 Mips
# 2.2.6 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips

2.1.7 log

執行日志.bochs輸出一些日志信息,比如執行不正確.錯誤定位非常實用..如下: # log: ./bochs.out
Copyright © Linux教程網 All Rights Reserved