Bochs配置(ing)

4.3 配置文件 bochsrc

官網(wǎng)參考地址

Bochs利用一個(gè)叫做bochsrc的配置文件來說明磁盤鏡像的存放位置乃坤,Bochs模擬層應(yīng)該怎樣工作等回溺。當(dāng)你第一次啟動(dòng)Bochs,它按照5.2章節(jié)中的順序查找它的配置文件惹悄,并解析其中的配置春叫。下面是配置文件中的一段配置樣例:

  ata0-master: type=disk, path="30M.sample", cylinders=615, heads=6, spt=17
  boot: disk

Bochs文件配置格式非常嚴(yán)格,對空格數(shù)敏感,且使用小寫字母暂殖。如你所見价匠,大多數(shù)配置行會(huì)有一個(gè)關(guān)鍵字來說明這一行配置什么,后面跟著":"呛每,然后是一些鍵值對踩窖,鍵值對通過","分隔。對于一些簡單的配置項(xiàng)晨横,通常只需要配置一個(gè)簡單的值洋腮。源碼和二進(jìn)制發(fā)布版帶有一個(gè)bochsrc樣本文件,你只要復(fù)制這個(gè)樣本文件然后根據(jù)需要編輯改變這些設(shè)置就可以了手形。

bochsrc文件的配置語法也適用于Bochs命令行參數(shù)啥供。如果命令行參數(shù)有空格,應(yīng)該用單引號(hào)括起來叁幢,比如:

  bochs 'boot:floppy' 'floppya: 1_44=a.img, status=inserted'

其他參數(shù)滤灯,參考命令行參數(shù)章節(jié)坪稽。

bochsrc文件中可以使用'$'符號(hào)加上環(huán)境變量曼玩,比如:

  floppya: 1_44="$IMAGES/bootdisk.img", status=inserted
  boot: floppy

在編譯安裝階段內(nèi)置了兩個(gè)環(huán)境變量。
BXSHARE指明"share"目錄窒百,在UNIX機(jī)器上默認(rèn)值通常是/usr/local/share/bochs黍判。在Makefile重設(shè)置(sharedir)可以改變默認(rèn)值。BXSHARE在Bochs磁盤鏡像配置文件中用于定位BIOS鏡像和鍵盤映射文件所在的目錄篙梢。如果BXSHARE沒有定義顷帖,Bochs使用默認(rèn)值。
$LTDL_LIBRARY_PATH指明一組目錄用于尋找Bochs插件渤滞。這些路徑通過':'分割(windows上通過';')贬墩。Win32和MacOSX的默認(rèn)值取決于平臺(tái)相關(guān)的獨(dú)特算法。在Win32上妄呕,我們通過注冊表查看Bochs及相關(guān)支持文件被安裝在哪里陶舞。在MacOSX上,share目錄就是程序所在目錄绪励。

配置文件支持使用#include語句來引用其他配置文件肿孵。所以平臺(tái)或安裝默認(rèn)配置可以房租一個(gè)全局配置文件(比如rom鏡像的位置)中。把#include語句房租配置文件的最上面:

 #include /etc/bochsrc

對于那些位置的配置項(xiàng)疏魏,Bochs將他們作為設(shè)備插件處理停做。Bochs嘗試加載這些插件,如果成功就為這一行配置調(diào)用插件中對應(yīng)的解析函數(shù)大莫。這個(gè)機(jī)制用于實(shí)現(xiàn)Bochs網(wǎng)絡(luò)蛉腌、聲音以及USB設(shè)備。如果可選配置或者過期配置中有錯(cuò)誤輸出,Bochs就會(huì)panic報(bào)錯(cuò)退出烙丛,同時(shí)報(bào)出插件加載失敗錯(cuò)誤信息贯吓。在這種情況下,bochsrc文件的失敗行必須review并修復(fù)蜀变。

以下段落列舉了所有支持的bochsrc配置項(xiàng)悄谐。

4.3.1. plugin_ctrl

示例:

  plugin_ctrl: unmapped=0, e1000=1 # unload 'unmapped' and load 'e1000'

plugin_ctrl控制可選的設(shè)備插件是否可用。這些插件通過這個(gè)配置項(xiàng)直接加載库北,其中有些插件只有插件設(shè)備被加載之后才會(huì)安裝一些配置爬舰。'1'表示加載這個(gè)插件,'0'表示不加載(如果之前已經(jīng)加載就會(huì)卸載)寒瓦。

這些插件如果可用將會(huì)默認(rèn)直接加載:'biosdev', 'extfpuirq', 'gameport', 'iodebug','parallel', 'serial', 'speaker' and 'unmapped'情屹。

這些插件也支持直接加載,但是他們通常直接通過他們的bochsrc配置項(xiàng)來加載:'e1000', 'es1370', 'ne2k', 'pcidev', 'pcipnic', 'sb16', 'usb_ehci', 'usb_ohci', 'usb_uhci', 'usb_xhci' and 'voodoo'杂腰。

4.3.2. config_interface

配置接口是一組菜單和對話框垃你,通過這些菜單和對話框,你可以編輯所有設(shè)置來控制Bochs行為喂很。根據(jù)平臺(tái)不同惜颇,有3種配置接口的選擇:文本模式稱之為'textconfig',還有兩周圖形化模式稱之為'win32config' 和 'wx'少辣。文本模式使用標(biāo)準(zhǔn)輸入輸出凌摄,是默認(rèn)支持的,除非編譯的時(shí)候指定只使用wx漓帅。win32config接口只使用于win32锨亏,并且在win32上默認(rèn)使用win32config。只有Bochs在編譯的時(shí)候支持wxWidgets忙干,wx接口才可用器予,詳見章節(jié)3.4.12.如果你不配置config_interface,Bochs會(huì)為你選擇默認(rèn)接口(通常是textconfig)捐迫。

注意:wxWidgets同時(shí)包括配置接口和顯示庫乾翔。所以如果你使用'wx'配置接口,你必須同時(shí)使用'wx'顯示庫弓乙,詳見display_library章節(jié)

示例:

  config_interface: textconfig
  config_interface: win32config
  config_interface: wx

4.3.3. display_library

顯示庫用于顯示Bochs的VGA屏幕末融。Bochs大約有10種可選的顯示庫從而適配不同的平臺(tái)。在運(yùn)行Bochs時(shí)暇韧,附帶--with-*參數(shù)勾习,display_library配置項(xiàng)允許你選擇你想要的顯示庫。如果不配置display_library懈玻,Bochs會(huì)選擇一個(gè)默認(rèn)庫巧婶。

注意:wxWidgets同時(shí)包括配置接口和顯示庫。所以如果你使用'wx'顯示庫,你必須同時(shí)使用'wx'配置接口艺栈,詳見config_interface章節(jié)

示例:

  display_library: x
  display_library: sdl

有些顯示庫現(xiàn)在支持單獨(dú)配置項(xiàng)英岭,從而控制他們的行為。這些配置項(xiàng)配置項(xiàng)是多個(gè)顯示庫共同支持的:

  "gui_debug"   - use GTK debugger gui (sdl, x) / Win32 debugger gui (sdl, sdl2, win32)
  "hideIPS"     - disable IPS output in status bar (rfb, sdl, sdl2, vncsrv, win32, wx, x)
  "nokeyrepeat" - turn off host keyboard repeat (sdl, sdl2, win32, x)
  "timeout"     - time (in seconds) to wait for client (rfb, vncsrv)

下面是現(xiàn)在支持的其他配置項(xiàng)示例

  display_library: sdl, options="fullscreen"  # startup in fullscreen mode
  display_library: sdl2, options="fullscreen"  # startup in fullscreen mode
  • 表 4-2 display_library 值
Option Description
x use X windows interface, cross platform
win32 use native win32 libraries
carbon use Carbon library (for MacOS X)
macintosh use MacOS pre-10
amigaos use native AmigaOS libraries
sdl use SDL 1.2.x library, cross platform, details in Section 3.4.11
sdl2 use SDL 2.x library, cross platform, details in Section 3.4.12
svga use SVGALIB library for Linux, allows graphics without X windows
term text only, uses curses/ncurses library, cross platform
rfb provides an interface to AT&T's VNC viewer, cross platform, details in Section 3.4.9
vncsrv use LibVNCServer for extended RFB(VNC) support, details in Section 3.4.10
wx use wxWidgets library, cross platform, details in Section 3.4.13
nogui no display at all

4.3.4. cpu

示例:

  cpu: count=2, ips=10000000

這個(gè)配置定義了Bochs內(nèi)部的CPU參數(shù):

  • model
    根據(jù)所有支持的配置項(xiàng)預(yù)先定義好配置列表湿右,從中選擇CPU配置來模擬诅妹。當(dāng)這個(gè)配置項(xiàng)配置且值不是'bx_generic',CPUID配置項(xiàng)將不再生效。詳見5.4章節(jié)

  • count
    當(dāng)Bochs編譯時(shí)是SMP模擬器時(shí)毅人,這個(gè)配置項(xiàng) 設(shè)置處理器數(shù)量:每個(gè)處理器的核心數(shù):每個(gè)核心的線程數(shù)吭狡。Bochs現(xiàn)在可以支持14線程(legacy APIC)或者254線程(xAPIC及更高版本中斷控制器)同時(shí)運(yùn)行。如果Bochs在編譯階段沒有支持SMP丈莺,那么這個(gè)配置項(xiàng)不接受除了1之外的值划煮。更多SMP相關(guān)信息參考8.9章節(jié)

  • quantum
    這個(gè)配置項(xiàng)設(shè)置在將控制權(quán)返回給另一個(gè)cpu之前,處理器允許執(zhí)行的最大指令數(shù)缔俄。這個(gè)配置的生效需要在Bochs編譯時(shí)支持SMP弛秋。

  • reset_on_triple_fault
    這個(gè)配置項(xiàng)設(shè)置重置CPU的時(shí)機(jī)是在發(fā)生triple錯(cuò)誤時(shí),而不是PANIC俐载。注意:如果你在發(fā)生triple錯(cuò)誤之后仍試圖繼續(xù)蟹略,Bochs的模擬行為是完全虛假的。

  • cpuid_limit_winnt
    這個(gè)配置項(xiàng)決定是否將最大CPUID功能限制為2瞎疼。在安裝和啟動(dòng)WinNT時(shí)科乎,需要設(shè)置這個(gè)配置。

  • mwait_is_nop
    當(dāng)這個(gè)配置項(xiàng)被啟用贼急,MWAIT指令將不會(huì)設(shè)置CPU進(jìn)入睡眠狀態(tài)。這個(gè)配置的生效需要在Bochs編譯時(shí)加上--enable-monitor-mwait編譯選項(xiàng)捏萍。

  • msrs
    這個(gè)配置項(xiàng)定義用戶CPU msr 寄存器規(guī)范的路徑太抓。參考mers.def示例。

  • ignore_bad_msrs
    忽略Bochs不識(shí)別的MSR參考文獻(xiàn)令杈;打印一個(gè)告警信息而不是產(chǎn)生一個(gè)常規(guī)保護(hù)異常(#GP)走敌。這個(gè)配置項(xiàng)默認(rèn)被啟用,但是如果msrs配置項(xiàng)優(yōu)先級(jí)更高逗噩。

  • ips
    每秒模擬的指令數(shù)掉丽。這是Bochs在你的機(jī)器上能夠運(yùn)行的IPS數(shù)值。你可以加上--enable-show-ips編譯選項(xiàng)重新編譯Bochs异雁,這樣就可以查看你的工作站的算力了捶障。實(shí)測的IPS值會(huì)被記錄在你的日志文件或者狀態(tài)欄里(如果GUI支持的話)。
    在Bochs模擬器中IPS用于校準(zhǔn)很多時(shí)間依賴性事件纲刀。比如项炼,改變IPS將會(huì)影響VGA更新頻率、按鍵開始自動(dòng)重復(fù)的間隔時(shí)間、以及BogoMips和其他基準(zhǔn)的測量锭部。下面的表格列出了不同機(jī)器的一些典型IPS設(shè)置暂论。

表 4-3. IPS 設(shè)置示例

Bochs版本 Speed主頻 CPU/編譯器 典型 IPS
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

4.3.5. cpuid

示例:

  cpuid: level=6, mmx=1, sep=1, sse=sse4_2, apic=xapic, aes=1, movbe=1, xsave=1

這個(gè)配置項(xiàng)定義Bochs模擬的CPU支持的特性和功能。這些設(shè)置只有在CPU型號(hào)(參考4.3.4)設(shè)置為默認(rèn)值bx_generic時(shí)才是合法可配置的拌禾。

  • level
    這個(gè)配置項(xiàng)設(shè)置模擬CPUID指令返回的CPU級(jí)別信息取胎。默認(rèn)值取決于編譯選項(xiàng)--enable-cpu-level。當(dāng)前支持的值是5(對Pentium和相近的處理器生效)6(對P6以及更新的處理器生效)湃窍。

  • family
    這個(gè)配置項(xiàng)設(shè)置模擬CPUID指令返回的family信息扼菠。默認(rèn)的family值由編譯選項(xiàng)--enable-cpu-level確定。

  • model
    這個(gè)配置項(xiàng)設(shè)置CPUID指令返回的model信息坝咐。默認(rèn)的model值是3循榆。

  • stepping
    這個(gè)配置項(xiàng)設(shè)置CPUID指令返回的 信息。默認(rèn)的stepping值是3墨坚。

  • vendor_string
    這個(gè)配置項(xiàng)設(shè)置CPUID指令返回的vendor信息秧饮。這個(gè)值應(yīng)該是一個(gè)12字符的ASCII字符串。

  • brand_string
    這個(gè)配置項(xiàng)設(shè)置CPUID指令返回的brand信息泽篮。這個(gè)值應(yīng)該是一個(gè)最長48字符的ASCII字符串盗尸。

  • mmx
    選擇支持MMX指令集。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 5帽撑。

  • apic
    這個(gè)配置項(xiàng)設(shè)置APIC(高級(jí)可編程中斷控制器)泼各。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 5

  • sep
    選擇支持SYSENTER/SYSEXIT指令亏拉。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6扣蜻。

  • simd
    選擇支持SIMD指令。NONE/SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2/AVX/AVX2/AVX512中任意指令都可以選擇支持及塘。這個(gè)配置是生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6莽使。其中選擇支持AVX的話需要Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx

  • sse4a
    選擇支持AMD SSE4A指令集笙僚。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6芳肌。

  • misaligned_sse
    選擇支持AMD未校準(zhǔn)SSE模式。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6肋层。

  • aes
    選擇支持AES指令集亿笤。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6

  • sha
    選擇支持SHA指令集栋猖。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6净薛。

  • ovbe
    選擇支持MOVBE Intel(R) Atom指令。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6掂铐。

  • adx
    選擇支持ADCX/ADOX指令罕拂。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6揍异。

  • xsave
    選擇支持XSAVE拓展。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6爆班。

  • xsaveopt
    選擇支持XSAVEOPT指令衷掷。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6

  • avx_f16c
    選擇支持AVX float16轉(zhuǎn)換指令柿菩。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx戚嗅。

  • avx_fma
    選擇支持AVX FMA(積和熔加運(yùn)算,處理浮點(diǎn)數(shù)時(shí)只有一次的數(shù)值修約)枢舶。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx懦胞。

  • bmi
    選擇支持 BMI1/BMI2 指令。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx凉泄。

  • fma4
    選擇支持AMD四操作數(shù)FMA指令(積和熔加運(yùn)算躏尉,處理浮點(diǎn)數(shù)時(shí)只有一次的數(shù)值修約)。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx后众。

  • xop
    選擇支持 AMD XOP 指令胀糜。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx

  • tbm
    選擇支持AMD TBM指令蒂誉。這個(gè)配置生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)--enable-avx教藻。

  • x86_64
    配置支持long mode(長模式)。這個(gè)這個(gè)配置的生效需要在Bochs編譯是指定支持x86-64右锨。

  • 1g_pages
    配置在long mode(長模式)下支持1G內(nèi)存頁括堤。這個(gè)這個(gè)配置的生效需要在Bochs編譯是指定支持x86-64。

  • pcid
    配置在long mode(長模式)下支持啟用進(jìn)程上下文標(biāo)識(shí)符(PCID)绍移。這個(gè)這個(gè)配置的生效需要在Bochs編譯是指定支持x86-64。

  • smep
    配置支持SMAP(監(jiān)督模式執(zhí)行保護(hù))登夫。這個(gè)配置的生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6广匙。

  • smap
    配置支持SMAP(監(jiān)督模式訪問保護(hù))。這個(gè)配置的生效需要在Bochs編譯時(shí)指定編譯選項(xiàng)BX_CPU_LEVEL >= 6恼策。

  • mwait
    選擇支持MONITOR/MWAIT指令。這個(gè)配置的生效需要在Bochs編譯時(shí)加上--enable-monitor-mwait編譯選項(xiàng)潮剪。

  • vmx
    選擇支持VMX擴(kuò)展模擬涣楷。這個(gè)配置的生效需要在Bochs編譯時(shí)加上--enable-vmx編譯選項(xiàng)。

  • svm
    選擇支持AMD安全虛擬機(jī)擴(kuò)展模擬抗碰。這個(gè)配置的生效需要在Bochs編譯時(shí)加上--enable-svm編譯選項(xiàng)狮斗。

4.3.6. memory

示例:

  memory: guest=512, host=256

這個(gè)配置項(xiàng)設(shè)置Bochs需要模擬的物理內(nèi)存。

  • guest
    設(shè)置套模擬的客戶機(jī)物理內(nèi)存弧蝇。默認(rèn)值是32MB碳褒,這個(gè)值的最大值只受限于物理地址空間的上限折砸。

  • host
    設(shè)置你希望分配給客戶機(jī)用來模擬RAM的宿主機(jī)內(nèi)存。實(shí)際分配的內(nèi)存可能小于你在客戶機(jī)中想要模擬的內(nèi)存沙峻。這會(huì)欺騙客戶機(jī)去查看沒有可用內(nèi)存睦授。當(dāng)客戶機(jī)系統(tǒng)檢測到新的內(nèi)存塊,將會(huì)動(dòng)態(tài)的從內(nèi)存池中分走摔寨。當(dāng)客戶機(jī)耗盡分配的物理內(nèi)存并想申請更多時(shí)去枷,會(huì)發(fā)出警告。

注意: 由于宿主機(jī)操作系統(tǒng)限制是复,Bochs在32位操作系統(tǒng)上不能分配超過1024MB的內(nèi)存删顶。為了克服這個(gè)問題請?jiān)跇?gòu)建Bochs時(shí)帶上--enable-large-ramfile編譯選項(xiàng)。

4.3.7. megs

示例:

  megs: 32
  megs: 128

這個(gè)配置項(xiàng)將'guest'和'host'內(nèi)存設(shè)置為同一個(gè)值淑廊。除此(宿主機(jī)和客戶機(jī)內(nèi)存相同)之外的其他所有情景逗余,請使用memory配置項(xiàng)代替。

4.3.8. romimage

示例:

  romimage: file=bios/BIOS-bochs-latest, options=fastboot
  romimage: file=$BXSHARE/BIOS-bochs-legacy
  romimage: file=mybios.bin, address=0xfff80000

ROM BIOS控制PC第一次開機(jī)時(shí)的行為季惩。一般來講录粱,你可以在源代碼或者二進(jìn)制發(fā)布版本的Bochs中使用一個(gè)預(yù)先編譯號(hào)的BIOS。默認(rèn)的ROM BIOS一般從地址 0xfffe0000 開始加載蜀备,并且是嚴(yán)格的128KB大小关摇。你可以通過環(huán)境變量$BXSHARE去指定BIOS的位置。現(xiàn)在支持在內(nèi)存頂部使用外部大BIOS映像(高達(dá)512k)碾阁,但我們?nèi)匀唤ㄗh使用隨Bochs分發(fā)的BIOS输虱。 起始地址是可選的,因?yàn)榭梢酝ㄟ^鏡像大小計(jì)算出來脂凶。Bochs BIOS現(xiàn)在只支持通過"fastboot"選項(xiàng)去跳過啟動(dòng)菜單宪睹。

4.3.9. vgaromimage

示例:

  vgaromimage: file=bios/VGABIOS-elpin-2.40
  vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
  vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus

這個(gè)配置項(xiàng)設(shè)置Bochs加載VGA ROM BIOS(從 0xC0000)。
Bochs的源碼和二進(jìn)制版本中已經(jīng)提供了來自 Elpin Systems 公司的VGA BIOS 以及一個(gè) LGPL協(xié)議的VGA BIOS蚕钦。

注意:確認(rèn)VGA配置以決定使用哪一個(gè)VGA BIOS亭病。

4.3.10. optromimage1, optromimage2, optromimage3 or optromimage4

示例:

   optromimage1: file=optionalrom.bin, address=0xd0000

這個(gè)配置項(xiàng)設(shè)置最多讓Bochs可以支持4個(gè)可選的ROM鏡像。
確保使用一個(gè)只讀區(qū)域嘶居,通常地址范圍在C800和EFFF之間罪帖。這些可選的ROM鏡像不應(yīng)該重寫rombios(地址F0000-FFFFF)和videobios(地址C0000-C7FFF)中的內(nèi)容。
如果這些ROM鏡像包含了正確的簽名(0x55AA)邮屁,將會(huì)被BIOS初始化整袁。
它還可以方便地在模擬器中上傳任意代碼/數(shù)據(jù),這些代碼/數(shù)據(jù)可以由引導(dǎo)加載程序檢索佑吝。

4.3.11. vga

示例:

  vga: extension=cirrus, update_freq=10, realtime=1
  vga: extension=vbe

這個(gè)配置項(xiàng)定義VGA顯示相關(guān)的配置參數(shù)坐昙。

  • extension
    'extension'選項(xiàng)用來指定VGA顯示插件。如果配置值為'none'則可以使用標(biāo)準(zhǔn)的沒有擴(kuò)展的VGA芋忿。其他支持的配置值分別是:'vbe'炸客,表示使用Bochs VBE(需要使用VGABIOS-lgpl-latest作為VGA BIOS疾棵,參考vgaromimage配置項(xiàng));'cirrus'痹仙,表示支持Cirrus SVGA((需要使用VGABIOS-lgpl-latest作為VGA BIOS)是尔;'voodoo',表示支持Voodoo Graphics(需要使用其他VGA BIOS蝶溶,參考章節(jié)8.21)嗜历。

  • update_freq
    VGA更新頻率指定了每秒顯示更新的次數(shù)。這個(gè)參數(shù)可以在運(yùn)行時(shí)修改抖所,默認(rèn)值是5梨州。

  • realtime
    'realtime'配置項(xiàng)指定VGA更新定時(shí)器的操作模式。如果設(shè)置為1田轧,VGA定時(shí)器將實(shí)時(shí)更新暴匠,否則將基于IPS設(shè)置進(jìn)行更新。如果宿主機(jī)很慢(ips傻粘,和更新頻率較低)并且客戶機(jī)使用適當(dāng)?shù)氖褂肏LT每窖,將這個(gè)值設(shè)置成0,同時(shí)"clock: sync=none"可以在客戶機(jī)其他空閑情況下提高客戶機(jī)圖形界面的響應(yīng)弦悉。默認(rèn)值是1窒典。

4.3.12. voodoo

示例:

  voodoo: enabled=1, model=voodoo1

這個(gè)配置項(xiàng)定義Voodoo圖形模擬(實(shí)驗(yàn)性的)。當(dāng)前支持的模式分別是'voodoo1', 'voodoo2', 'banshee' 和 'voodoo3'稽莉。Voodoo2支持還不完全瀑志,但是大部分功能可用了。Banshee 和Voodoo3還在構(gòu)件中污秆,但是基礎(chǔ)功能可用劈猪。2D/3D卡需要額外的VGA BIOS支持,且vga extension(4.3.11)需要設(shè)置為'voodoo'良拼。如果選擇實(shí)驗(yàn)i440BXPCI芯片战得,他們可以被集成到AGP中(5號(hào)插口)。所有模式的GUI屏幕更新時(shí)長都受'vga'配置項(xiàng)相關(guān)參數(shù)控制庸推。詳情參考8.21章節(jié)常侦。

4.3.13. keyboard

示例:

  keyboard: type=mf, serial_delay=200, paste_delay=100000
  keyboard: keymap=gui/keymaps/x11-pc-de.map
  keyboard: user_shortcut=ctrl-alt-del

這個(gè)配置項(xiàng)定義鍵盤模擬相關(guān)的參數(shù)。

  • type
    配置對鍵盤控制器使用"identify keybord"命令的返回值贬媒」伟桑可選的值只有"xt", "at" 或者 "mf"。默認(rèn)是"mf"掖蛤,這個(gè)配置對幾乎所有人都?jí)蛴昧恕R粋€(gè)已知的例外是法語版的macs井厌,需要配置成類"at"鍵盤蚓庭。

  • serial_delay
    串行方式從鍵盤輸入一個(gè)字符到鍵盤控制器的延遲時(shí)間致讥,以毫秒為單位。

  • paste_delay
    粘貼字符到鍵盤控制器的延遲時(shí)間器赞,以毫秒為單位垢袱。這個(gè)延遲為客戶機(jī)操作系統(tǒng)預(yù)留時(shí)間去處理字符流。
    Approximate time in microseconds between attempts to paste characters to the keyboard controller. This leaves time for the guest os to deal with the flow of characters. The ideal setting depends on how your operating system processes characters. The default of 100000 usec (.1 seconds) was chosen because it works consistently in Windows.

If your OS is losing characters during a paste, increase the paste delay until it stops losing characters.

  • keymap

This enables a remap of a physical localized keyboard to a virtualized us keyboard, as the PC architecture expects.

Keyboard mapping is available for the display libraries x, sdl (Linux port) and wx (GTK port). For SDL you have to use keymaps designed for SDL, the wxWidgets GUI uses the keymaps for X11.

  • user_shortcut

This defines the keyboard shortcut to be sent when you press the "user" button in the headerbar. The shortcut string is a combination of maximum 3 key names (listed below) separated with a '-' character.

Valid key names:

"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", "plus", "power", "print", "right", "scrlck", "shift", "space", "tab", "up" and "win".

4.3.14. mouse

示例:

  mouse: enabled=1
  mouse: type=imps2, enabled=1
  mouse: type=serial, enabled=1
  mouse: enabled=0, toggle=ctrl+f10

This defines parameters for the emulated mouse type, the initial status of the mouse capture and the runtime method to toggle it.

  • type

With the mouse type option you can select the type of mouse to emulate. The default value is 'ps2'. The other choices are 'imps2' (wheel mouse on PS/2), 'serial', 'serial_wheel', 'serial_msys' (one com port requires setting 'mode=mouse', see com option) 'inport' and 'bus' (if present). To connect a mouse to a USB port, see the usb_uhci, 'usb_ohci', 'usb_ehci' or 'usb_xhci' options (requires PCI and USB support).

  • enabled

The Bochs gui creates mouse "events" unless the 'enabled' option is set to 0. The hardware emulation itself is not disabled by this. Unless you have a particular reason for enabling the mouse by default, it is recommended that you leave it off. You can also toggle the mouse usage at runtime (see headerbar and the 'toggle' option below).

  • toggle

The default method to toggle the mouse capture at runtime is to press the CTRL key and the middle mouse button ('ctrl+mbutton'). This option allows to change the method to 'ctrl+f10' (like DOSBox) or 'ctrl+alt' (like QEMU) or 'f12'.

4.3.15. pci

Examples:

pci: enabled=1, chipset=i440fx # default if compiled with PCI support
pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
pci: enabled=1, chipset=i440bx, slot5=voodoo, slot1=e1000

This option controls the presence of a PCI chipset in Bochs. Currently it supports the i430FX, i440FX and i440BX chipsets. You can also specify the devices connected to PCI slots. Up to 5 slots are available. For these combined PCI/ISA devices assigning to slot is mandatory if you want to emulate the PCI model: cirrus, ne2k and pcivga. These PCI-only devices are also supported, but they are auto-assigned if you don't use the slot configuration: e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci and voodoo. In case of the i440BX chipset, slot #5 is the AGP slot. Currently only the 'voodoo' device can be assigned to AGP.

4.3.16. clock

This defines the parameters of the clock inside Bochs:

  • sync

This defines the method how to synchronize the Bochs internal time with realtime. With the value 'none' the Bochs time relies on the IPS value and no host time synchronization is used. The 'slowdown' method sacrifices performance to preserve reproducibility while allowing host time correlation. The 'realtime' method sacrifices reproducibility to preserve performance and host-time correlation. It is possible to enable both synchronization methods.

  • rtc_sync

If this option is enabled together with the realtime synchronization, the RTC runs at realtime speed. This feature is disabled by default.

  • time0

Specifies the start (boot) time of the virtual machine. Use a time value as returned by the time(2) system call or a string as returned by the ctime(3) system call. If no time0 value is set or if time0 equal to 1 (special case) or if time0 equal 'local', the simulation will be started at the current local host time. If time0 equal to 2 (special case) or if time0 equal 'utc', the simulation will be started at the current utc time.

  • Syntax:
    clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc]

Examples:
clock: sync=none, time0=local # Now (localtime)
clock: sync=slowdown, time0=315529200 # Tue Jan 1 00:00:00 1980
clock: sync=none, time0="Mon Jan 1 00:00:00 1990" # 631148400
clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999
clock: sync=realtime, time0="Sat Jan 1 00:00:00 2000" # 946681200
clock: sync=none, time0=1 # Now (localtime)
clock: sync=none, time0=utc # Now (utc/gmt)

Default value are sync=none, rtc_sync=0, time0=local

4.3.17. cmosimage

Example:

cmosimage: file=cmos.img, rtc_init=time0

This defines a binary image file with size 128 bytes that can be loaded into the CMOS RAM at startup. The rtc_init parameter controls whether initialize the RTC with values stored in the image. By default the time0 argument given to the clock option is used. With 'rtc_init=image' the image is the source for the initial time.

4.3.18. private_colormap

Example:

private_colormap: enabled=1

Requests that the GUI creates and uses its own non-shared colormap. This colormap will be used when in the Bochs window. If not enabled, a shared colormap scheme may be used. Once again, enabled=1 turns on this feature and 0 turns it off.

4.3.19. floppya/floppyb

Examples:

2.88M 3.5" media:
floppya: 2_88=a:, status=inserted
1.44M 3.5" media (write protected):
floppya: 1_44=floppya.img, status=inserted, write_protected=1
1.2M 5.25" media:
floppyb: 1_2=/dev/fd0, status=inserted
720K 3.5" media:
floppya: 720k=/usr/local/bochs/images/win95.img, status=inserted
auto-detect floppy media type:
floppya: image=floppy.img, status=inserted
use directory as VFAT media:
floppya: 1_44=vvfat:path, status=inserted
1.44M 3.5" floppy drive, no media:
floppya: type=1_44

Floppya is the first drive, and floppyb is the second drive. If you're booting from a floppy, floppya should point to a bootable disk. To read from a disk image, write the name of the image file. In many operating systems Bochs can read directly from a raw floppy drive. For raw disk access, use the device name (Unix systems) or the drive letter and a colon (Windows systems).

Following floppy media types are supported: 2_88, 1_44, 1_2, 720k, 360k, 320k, 180k, 160k, as well as "image" to let Bochs auto-detect the type of floppy media (does only work with images, not with raw floppy drives). In that case the size must match one of the supported types.

You can set the initial status of the media to ejected or inserted. Usually you will want to use inserted.

The parameter 'type' can be used to enable the floppy drive without media and status specified. Usually the drive type is set up based on the media type.

The optional parameter 'write_protected' can be used to control the media write protect switch. By default it is turned off.

4.3.20. ata0, ata1, ata2, ata3

Examples:

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

These options enables up to 4 ata channels. For each channel the two base io addresses and the irq must be specified. ata0 and ata1 are enabled by default, with the values shown above.

4.3.21. ata0-master, ata0-slave, ata1-, ata2-, ata3-*

Examples:

ata0-master: type=disk, path=10M.img, mode=flat, cylinders=306, heads=4, spt=17, translation=none
ata1-master: type=disk, path=2GB.cow, mode=vmware3, cylinders=5242, heads=16, spt=50, translation=echs
ata1-slave: type=disk, path=3GB.img, mode=sparse, cylinders=6541, heads=16, spt=63, translation=auto
ata2-master: type=disk, path=7GB.img, mode=undoable, cylinders=14563, heads=16, spt=63, translation=lba
ata2-slave: type=cdrom, path=iso.sample, status=inserted

This defines the type and characteristics of all attached ata devices:

Table 4-4. ata devices configuration options
Option Comments Possible values
type type of attached device [disk | cdrom]
path path of the image
mode image type, only valid for disks [flat | concat | external | dll | sparse | vmware3 | vmware4 | undoable | growing | volatile | vpc | vbox | vvfat ]
cylinders only valid for disks
heads only valid for disks
spt only valid for disks
status only valid for cdroms [inserted | ejected]
biosdetect type of biosdetection [auto | cmos | none]
translation type of translation done by the BIOS (legacy int13), only for disks [none | lba | large | rechs | auto]
model string returned by identify device ATA command
journal optional filename of the redolog for undoable, volatile and vvfat disks

You have to tell the type of the attached device. For Bochs 2.0 or later, it can be disk or cdrom.

You have to point the "path" at a hard disk image file, cdrom iso file, or physical cdrom device. To create a hard disk image, try running bximage (see Section 8.2). It will help you choose the size and then suggest a line that works with it.

In Unix it is possible to use a raw device as a Bochs hard disk, but we don't recommend it for safety reasons. In Windows, there is no easy way.

Disk geometry autodetection works with images created by bximage if CHS is set to 0/0/0 (cylinders are calculated using heads=16 and spt=63). For other hard disk images and modes the cylinders, heads, and spt are mandatory. In all cases the disk size reported from the image must be exactly CHS*512. Flat hard disk images from other projects might store additional information at the end of the file that makes this check fail. Only in this case it is safe to select "continue" when Bochs panics.

The disk translation scheme (implemented in legacy int13 BIOS functions, and used by older operating systems like MS-DOS), can be defined as:

none : no translation, for disks up to 528MB (1032192 sectors)

large : a standard bitshift algorithm, for disks up to 4.2GB (8257536 sectors)

rechs : a revised bitshift algorithm, using a 15 heads fake physical geometry, for disks up to 7.9GB (15482880 sectors). (don't use this unless you understand what you're doing)

lba : a standard lba-assisted algorithm, for disks up to 8.4GB (16450560 sectors)

auto : autoselection of best translation scheme. (it should be changed if system does not boot)

Please see Section 8.17.2 for a discussion on translation scheme.

The mode option defines how the disk image is handled. Disks can be defined as:

flat : one file flat layout

concat : multiple files layout

external : developer's specific, through a C++ class

dll : developer's specific, through a DLL

sparse : stackable, commitable, rollbackable

vmware3 : vmware version 3 disk support

vmware4 : vmware version 4 disk support (aka VMDK)

undoable : read-only base file with commitable redolog

growing : growing file

volatile : read-only base file with volatile redolog

vpc: fixed / dynamic size VirtualPC image

vbox: fixed / dynamic size Oracle(tm) VM VirtualBox image (VDI version 1.1)

vvfat: local directory appears as VFAT disk (with volatile redolog / optional commit)

Please see Section 8.22 for a discussion on disk modes.

Default values are:

mode=flat, biosdetect=auto, translation=auto, model="Generic 1234"

The biosdetect option has currently no effect on the BIOS.

Note: Make sure the proper ata option is enabled when using a device on that ata channel.

4.3.22. boot

Examples:

boot: floppy
boot: cdrom, disk
boot: network, disk
boot: cdrom, floppy, disk

This defines the boot sequence. You can specify up to 3 boot drives, which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). Legacy 'a' and 'c' are also supported.

4.3.23. floppy_bootsig_check

Example:

floppy_bootsig_check: disabled=1

This disables the 0xaa55 signature check on boot floppies The check is enabled by default.

4.3.24. log

Examples:

log: bochsout.txt
log: -
log: /dev/tty (Unix only)
log: /dev/null (Unix only)
log: nul (win32 only)

Give the path of the log file you'd like Bochs debug and misc. verbiage to be to be written to. If you don't use this option or set the filename to '-' the output is written to the console. If you really don't want it, make it "/dev/null" (Unix) or "nul" (win32). :^(

4.3.25. logprefix

Examples:

logprefix: %t-%e-@%i-%d
logprefix: %i%e%d

This handles the format of the string prepended to each log line. You may use those special tokens :

%t : 11 decimal digits timer tick
%i : 8 hexadecimal digits of current cpu eip (ignored in SMP configuration)
%e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror)
%d : 5 characters string of the device, between brackets

Default is %t%e%d

4.3.26. debug/info/error/panic

Examples:

debug: action=ignore, pci=report
info: action=report
error: action=report
panic: action=ask

During simulation, Bochs encounters certain events that the user might want to know about. These events are divided into four levels of importance: debug, info, error, and panic. Debug messages are usually only useful when writing Bochs code or when trying to locate a problem. There may be thousands of debug messages per second, so be careful before turning them on. Info messages tell about interesting events that don't happen that frequently. Bochs produces an "error" message when it finds a condition that really shouldn't happen, but doesn't endanger the simulation. An example of an error might be if the emulated software produces an illegal disk command. Panic messages mean that Bochs cannot simulate correctly and should probably shut down. A panic can be a configuration problem (like a misspelled bochsrc line) or an emulation problem (like an unsupported video mode).

The debug, info, error, and panic lines in the bochsrc control what Bochs will do when it encounters each type of event. The allowed actions are: fatal (terminate bochs), ask (ask the user what to do), warn (show dialog with message and continue), report (print information to the console or log file), or ignore (do nothing). The recommended settings are listed in the sample above.

It is also possible to specify the 'action' to do for each Bochs facility separately (e.g. crash on panics from everything except the cdrom, and only report those). See the log function module table for valid module names.

Tip: The safest action for panics is "fatal" or "ask". If you are getting lots of panics and get tired of telling it to continue each time, you can try action=report instead. If you allow Bochs to continue after a panic, don't be surprised if you get strange behavior or crashes after a panic occurs. Please report panic messages to the bochs-developers mailing list unless it is just a configuration problem like "could not find hard drive image."

4.3.27. debugger_log

Examples:

debugger_log: debugger.out
debugger_log: /dev/null (Unix only)
debugger_log: -

Give the path of the log file you'd like Bochs to log debugger output. If you really don't want it, make it '/dev/null', or '-'.

4.3.28. com[1-4]

Examples:

com1: enabled=1, mode=null
com1: enabled=1, mode=mouse
com1: enabled=1, mode=term, dev=/dev/ttyp9
com2: enabled=1, mode=file, dev=serial.out
com3: enabled=1, mode=raw, dev=com1
com3: enabled=1, mode=socket-client, dev=localhost:8888
com3: enabled=1, mode=socket-server, dev=localhost:8888
com4: enabled=1, mode=pipe-client, dev=\.\pipe\mypipe
com4: enabled=1, mode=pipe-server, dev=\.\pipe\mypipe

This defines a serial port (UART type 16550A).

When using the mode 'term', you can specify a device to use as com1. This can be a real serial line, or a pty. To use a pty (under X/Unix), create two windows (xterms, usually). One of them will run Bochs, and the other will act as com1. Find out the tty of the com1 window using the tty' command, and use that as thedev' parameter. Then do `sleep 1000000' in the com1 window to keep the shell from messing with things, and run Bochs in the other window. Serial I/O to com1 (port 0x3f8) will all go to the other window.

When using socket* and pipe* (win32 only) modes Bochs becomes either socket/named pipe client or server. In client mode it connects to an already running server (if connection fails Bochs treats com port as not connected). In server mode it opens socket/named pipe and waits until a client application connects to it before starting simulation. This mode is useful for remote debugging (e.g. with gdb's "target remote host:port" command or windbg's command line option -k com:pipe,port=\.\pipe\pipename). Socket modes use simple TCP communication, pipe modes use duplex byte mode pipes.

Other serial modes are 'null' (no input/output), 'file' (output to a file specified as the 'dev' parameter and changeable at runtime), 'raw' (use the real serial port - partly implemented on win32), 'mouse' (standard serial mouse - requires mouse option setting 'type=serial', 'type=serial_wheel' or 'type=serial_msys').

4.3.29. parport[1-2]

Examples:

parport1: enabled=1, file="parport.out"
parport2: enabled=1, file="/dev/lp0"
parport1: enabled=0

This defines a parallel (printer) port. When turned on and an output file is defined, the emulated printer port sends characters printed by the guest OS into the output file. On some platforms, a device filename can be used to send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on win32 platforms). The output file can be changed at runtime.

4.3.30. sound

Example for one driver (uses platform-default):

sound: driver=default, waveout=/dev/dsp

Example for different drivers:

sound: waveoutdrv=sdl, waveindrv=alsa, midioutdrv=dummy

This defines the lowlevel sound driver(s) for the wave (PCM) input / output and the MIDI output feature and (if necessary) the devices to be used. It can have several of the following properties. All properties are in the format sound: property=value.

waveoutdrv: This defines the driver to be used for the waveout feature. Possible values are 'file' (all wave data sent to file), 'dummy' (no output) and the platform-dependant drivers 'alsa', 'oss', 'osx', 'sdl' and 'win'.

waveout: This defines the device to be used for wave output (if necessary) or the output file for the 'file' driver.

waveindrv: This defines the driver to be used for the wavein feature. Possible values are 'dummy' (recording silence) and platform-dependent drivers 'alsa', 'oss', 'sdl' and 'win'.

wavein: This defines the device to be used for wave input (if necessary).

midioutdrv: This defines the driver to be used for the MIDI output feature. Possible values are 'file' (all MIDI data sent to file), 'dummy' (no output) and platform-dependent drivers 'alsa', 'oss', 'osx' and 'win'.

midiout: This defines the device to be used for MIDI output (if necessary).

driver: This defines the driver to be used for all sound features with one property. Possible values are 'default' (platform default) and all other choices described above. Overriding one or more settings with the specific driver parameter is possible. 

See Section 5.6 for more information.

4.3.31. speaker

Example:

speaker: enabled=1, mode=sound

This defines the PC speaker output mode. In the 'sound' mode the beep is generated by the square wave generator which is a part of the lowlevel sound support. The 'system' mode is only available on Linux and Windows. On Linux /dev/console is used for output and on Windows the Beep() function. The 'gui' mode forwards the beep to the related gui methods (currently only used by the Carbon gui).

4.3.32. sb16

Example:

sb16: midimode=2, midifile=output.mid, wavemode=3, wavefile=output.wav
loglevel=2, log=sb16.log, dmatimer=600000

Note: The example is wrapped onto several lines for formatting reasons, but it should all be on one line in the actual bochsrc file.

This defines the Sound Blaster 16 emulation, see the developer documentation for more information. It can have several of the following properties. All properties are in the usual "property=value" format.

enabled: This optional property controls the presence of the SB16 emulation. The emulation is turned on unless this property is used and set to 0.

midimode: This parameter specifies what to do with the MIDI output.

    0 = no output
    1 = output to device specified with the sound option (system dependent)
    2 = MIDI or raw data output to file (depends on file name extension)
    3 = dual output (mode 1 and 2 at the same time)
   

midifile: This is the file where the midi output is stored (midimode 2 or 3).

wavemode: This parameter specifies what to do with the PCM output.

    0 = no output
    1 = output to device specified with the sound option (system dependent)
    2 = VOC, WAV or raw data output to file (depends on file name extension)
    3 = dual output (mode 1 and 2 at the same time)
   

wavefile: This is the file where the wave output is stored (wavemode 2 or 3).

log: The file to write the sb16 emulator messages to.

loglevel:

   0 = No log.
   1 = Resource changes, midi program and bank changes.
   2 = Severe errors.
   3 = All errors.
   4 = All errors plus all port accesses.
   5 = All errors and port accesses plus a lot of extra information.
   

It is possible to change the loglevel at runtime.

dmatimer: Microseconds per second for a DMA cycle. Make it smaller to fix non-continuous sound. 750000 is usually a good value. This needs a reasonably correct setting for the ips parameter of the cpu option. It is possible to adjust the dmatimer value at runtime. 

4.3.33. es1370

Examples:

es1370: enabled=1, wavemode=1 # use 'sound' parameters
es1370: enabled=1, wavemode=2, wavefile=output.voc # send output to file

This defines the ES1370 sound emulation (recording and playback - except DAC1+DAC2 output at the same time). The parameter 'enabled' controls the presence of the device. The wave and MIDI output can be sent to device, file or both using the parameters 'wavemode', 'wavefile', 'midimode' and 'midifile'. See the description of these parameters at the SB16 directive.

4.3.34. ne2k

The ne2k line configures an emulated NE2000-compatible Ethernet adapter, which allows the guest machine to communicate on the network. To disable the NE2000 just comment out the ne2k line.

Examples:

ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=en0 #macosx
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
ne2k: mac=b0:c4:20:00:00:01, ethmod=socket, ethdev=40000 # use localhost
ne2k: mac=b0:c4:20:00:00:01, ethmod=socket, ethdev=mymachine:40000
ne2k: mac=b0:c4:20:00:00:01, ethmod=slirp, script=slirp.conf, bootrom=ne2k_pci.rom

IOADDR, IRQ: You probably won't need to change ioaddr and irq, unless there
are IRQ conflicts. These parameters are ignored if the NE2000 is assigned to
a PCI slot.

MAC: The MAC address MUST NOT match the address of any machine on the net.
Also, the first byte must be an even number (bit 0 set means a multicast
address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast
address. For the ethertap module, you must use fe:fd:00:00:00:01. There may
be other restrictions too. To be safe, just use the b0:c4... address.

ETHMOD: The ethmod value defines which low level OS specific module to be
used to access physical ethernet interface. You can also specify a network
simulator or a module with no input/output ("null"). See the table below for
currently supported values.

ETHDEV: The ethdev value is the name of the network interface on your host
platform. On UNIX machines, you can get the name by running ifconfig. On
Windows machines, you must run niclist to get the name of the ethdev.
Niclist source code is in misc/niclist.c and it is included in Windows
binary releases.

SCRIPT: The script value is optional, and is the name of a script that
is executed after bochs initialize the network interface. You can use
this script to configure this network interface, or enable masquerading.
This is mainly useful for the tun/tap devices that only exist during
Bochs execution. The network interface name is supplied to the script
as first parameter.

BOOTROM: The bootrom value is optional, and is the name of the ROM image
to load. Note that this feature is only implemented for the PCI version of
the NE2000.

The following table shows the available ethernet modules with description, whether the "ethdev" and "script" parameters are used or not and the Bochs version where this module was added.

Table 4-5. Ethernet modules
Module Description ethdev script Bochs version
fbsd FreeBSD / OpenBSD packetmover. Yes No 1.0
linux Linux packetmover - 'root' privileges required, no connection to the host machine. Yes No 1.3
null Null packetmover. All packets are discarded, but logged to a few files. No No 1.0
tap TAP packetmover. Yes Yes 1.4
tuntap TUN/TAP packetmover - see Configuring and using a tuntap network interface. Yes Yes 2.0
vde Virtual Distributed Ethernet packetmover. Yes Yes 2.2
vnet ARP, ping (ICMP-echo), DHCP and read/write TFTP simulation. The virtual host uses 192.168.10.1. DHCP assigns 192.168.10.2 to the guest. The TFTP server uses the 'ethdev' value for the root directory and doesn't overwrite files. Yes, for TFTP Yes, for log file name 2.2
slirp Built-in Slirp support with DHCP / TFTP servers. Adds user mode networking to Bochs - see Using the 'slirp' networking module. The 'script' parameter can be used to set up an alternative IP configuration or additional features. The TFTP server uses the 'ethdev' value for the root directory and doesn't overwrite files. Yes, for TFTP Yes, for Slirp config 2.6.5
socket Connect up to 6 Bochs instances on the same or other machine with external program 'bxhub' (simulating an ethernet hub). It provides the same services as the 'vnet' module and assigns IP addresses like 'slirp' (10.0.2.x) (see Using the 'socket' networking module). Yes, for base UDP port and (optional) the host to connect No 2.6.9
win32 Win32 packetmover - WinPCap driver required. Yes No 1.3

4.3.35. pcipnic

Example:

pcipnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet

To support the Bochs/Etherboot pseudo-NIC, Bochs must be compiled with the --enable-pnic configure option. It accepts the same syntax (for mac, ethmod, ethdev, script, bootrom) and supports the same networking modules as the NE2000 adapter.

4.3.36. e1000

Example:

e1000: enabled=1, mac=52:54:00:12:34:56, ethmod=slirp, script=slirp.conf

To support the Intel(R) 82540EM Gigabit Ethernet adapter, Bochs must be compiled with the --enable-e1000 configure option. It accepts the same syntax (for mac, ethmod, ethdev, script, bootrom) and supports the same networking modules as the NE2000 adapter.

4.3.37. usb_uhci

Examples:

usb_uhci: enabled=1, port1=mouse, port2=disk:usbstick.img
usb_uhci: enabled=1, port1=hub:7, port2=disk:growing:usbdisk.img
usb_uhci: enabled=1, port2=disk:undoable:usbdisk.img, options2=journal:redo.log
usb_uhci: enabled=1, port2=disk:usbdisk2.img, options2=sect_size:1024
usb_uhci: enabled=1, port2=disk:vvfat:vvfat, options2="debug,speed:full"
usb_uhci: enabled=1, port1=printer:printdata.bin, port2=cdrom:image.iso
usb_uhci: enabled=1, port2=floppy:vvfat:diskette, options2="model:teac"

This option controls the presence of the USB root hub which is a part of the i440FX PCI chipset.

With the portX option you can connect devices to the hub (currently supported: 'mouse', 'tablet', 'keypad', 'disk', 'cdrom', 'floppy, ''hub' and 'printer').

If you connect the mouse or tablet to one of the ports, Bochs forwards the mouse movement data to the USB device instead of the selected mouse type. When connecting the keypad to one of the ports, Bochs forwards the input of the numeric keypad to the USB device instead of the PS/2 keyboard.

To connect a 'flat' mode image as a USB hardisk you can use the 'disk' device with the path to the image separated with a colon. To use other disk image modes similar to ATA disks the syntax 'disk:mode:filename' must be used (see above).

To emulate a USB cdrom you can use the 'cdrom' device name and the path to an ISO image or raw device name also separated with a colon. An option to insert/eject media is available in the runtime configuration.

To emulate a USB floppy you can use the 'floppy' device with the path to the image separated with a colon. To use the VVFAT image mode similar to the legacy floppy the syntax 'floppy:vvfat:directory' must be used (see above). An option to insert/eject media is available in the runtime configuration.

The device name 'hub' connects an external hub with max. 8 ports (default: 4) to the root hub. To specify the number of ports you have to add the value separated with a colon. Connecting devices to the external hub ports is only available in the runtime configuration.

The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is sent to a file specified in bochsrc.txt. The current code appends the PCL code to the file if the file already existed. The output file can be changed at runtime.

The optionsX parameter can be used to assign specific options to the device connected to the corresponding USB port. Currently this feature is used to set the speed reported by device ('low', 'full', 'high' or 'super'). The available speed choices depend on both HC and device. The option 'debug' turns on debug output for the device at connection time. For the USB 'disk' device the optionsX parameter can be used to specify an alternative redolog file (journal) of some image modes. For 'vvfat' mode USB disks the optionsX parameter can be used to specify the disk size (range 128M ... 128G). If the size is not specified, it defaults to 504M. For the USB 'floppy' device the optionsX parameter can be used to specify an alternative device ID to be reported. Currently only the model "teac" is supported (can fix hw detection in some guest OS). The USB floppy also accepts the parameter "write_protected" with valid values 0 and 1 to select the access mode (default is 0).

Note: PCI support must be enabled to use USB UHCI.

4.3.38. usb_ohci

Example:

usb_ohci: enabled=1, port1=printer:printdata.bin

This option controls the presence of the USB OHCI host controller with a 2-port hub. The portX parameter accepts the same device types with the same syntax as the UHCI controller (see the usb_uhci option). The optionsX parameter is also available on OHCI.

4.3.39. usb_ehci

Example:

usb_ehci: enabled=1, port1=tablet, options1="speed:high"

This option controls the presence of the USB EHCI host controller with a 6-port hub. The portX parameter accepts the same device types with the same syntax as the UHCI controller (see the usb_uhci option). The optionsX parameter is also available on EHCI.

4.3.40. usb_xhci

Example:

usb_xhci: enabled=1, port1="disk:usbdisk.img"

This option controls the presence of the USB xHCI host controller with a 4-port hub. The portX parameter accepts the same device types with the same syntax as the UHCI controller (see the usb_uhci option). The optionsX parameter is also available on xHCI. NOTE: port 1 and 2 are USB3 and only support super-speed devices, but port 3 and 4 are USB2 and support speed settings low, full and high.

4.3.41. pcidev

Example:

pcidev: vendor=0xbabe, device=0x2bad

Enables the mapping of a host PCI hardware device within the virtual PCI subsystem of the Bochs x86 emulator. The arguments vendor and device should contain the PCI vendor ID respectively the PCI device ID of the host PCI device you want to map within Bochs.

Note: The PCI device mapping is still in a very early stage of development and thus it is very experimental. This feature requires Linux as a host operating system.

Besides the pcidev config line you will need to load a pcidev kernel module within your Linux host OS. This kernel module is located in the bochs/host/linux/pcidev/ directory.

4.3.42. gdbstub

Example:

gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0

Default:

gdbstub: enabled=0

This enables the GDB stub. See Section 8.15.

4.3.43. magic_break

Example:

magic_break: enabled=1

This enables the "magic breakpoint" feature when using the debugger. The useless cpu instruction XCHG BX, BX causes Bochs to enter the debugger mode. This might be useful for software development.

4.3.44. debug_symbols

Example:

debug_symbols: file=mysymbols.sym
debug_symbols: file=mysymbols.sym, offset=0x1000

This loads symbols from the specified file for use in Bochs' internal debugger. Symbols are loaded into global context. This is equivalent to issuing ldsym debugger command at start up.

4.3.45. port_e9_hack

Example:

port_e9_hack: enabled=1

The 0xE9 port doesn't exists in normal ISA architecture. However, we define a convention here, to display on the console of the system running Bochs anything that is written to it. The idea is to provide debug output very early when writing BIOS or OS code for example, without having to bother with setting up a serial port or etc. Reading from port 0xE9 will will return 0xe9 to let you know if the feature is available. Leave this 0 unless you have a reason to use it.

4.3.46. user_plugin

Example:

user_plugin: name=testdev

Load user-defined plugin. This option is available only if Bochs is compiled with plugin support. Maximum 8 different plugins are supported. See the example in the Bochs sources how to write a plugin device.

Notes
[1]

IPS measurements depend on OS and compiler configuration in addition to host processor clock speed.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末港柜,一起剝皮案震驚了整個(gè)濱河市请契,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌夏醉,老刑警劉巖爽锥,帶你破解...
    沈念sama閱讀 218,122評論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異畔柔,居然都是意外死亡氯夷,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,070評論 3 395
  • 文/潘曉璐 我一進(jìn)店門靶擦,熙熙樓的掌柜王于貴愁眉苦臉地迎上來腮考,“玉大人,你說我怎么就攤上這事玄捕〔任担” “怎么了?”我有些...
    開封第一講書人閱讀 164,491評論 0 354
  • 文/不壞的土叔 我叫張陵枚粘,是天一觀的道長馅闽。 經(jīng)常有香客問我,道長赌结,這世上最難降的妖魔是什么捞蛋? 我笑而不...
    開封第一講書人閱讀 58,636評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮柬姚,結(jié)果婚禮上拟杉,老公的妹妹穿的比我還像新娘。我一直安慰自己量承,他們只是感情好搬设,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,676評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著撕捍,像睡著了一般拿穴。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上忧风,一...
    開封第一講書人閱讀 51,541評論 1 305
  • 那天默色,我揣著相機(jī)與錄音,去河邊找鬼狮腿。 笑死腿宰,一個(gè)胖子當(dāng)著我的面吹牛呕诉,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播吃度,決...
    沈念sama閱讀 40,292評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼甩挫,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了椿每?” 一聲冷哼從身側(cè)響起伊者,我...
    開封第一講書人閱讀 39,211評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎间护,沒想到半個(gè)月后亦渗,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體层宫,經(jīng)...
    沈念sama閱讀 45,655評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡仗哨,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,846評論 3 336
  • 正文 我和宋清朗相戀三年歉井,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了须教。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片酥馍。...
    茶點(diǎn)故事閱讀 39,965評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡衡创,死狀恐怖俄烁,靈堂內(nèi)的尸體忽然破棺而出它呀,到底是詐尸還是另有隱情苞也,我是刑警寧澤洛勉,帶...
    沈念sama閱讀 35,684評論 5 347
  • 正文 年R本政府宣布,位于F島的核電站如迟,受9級(jí)特大地震影響收毫,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜殷勘,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,295評論 3 329
  • 文/蒙蒙 一此再、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧玲销,春花似錦输拇、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,894評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至瘩绒,卻和暖如春猴抹,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背锁荔。 一陣腳步聲響...
    開封第一講書人閱讀 33,012評論 1 269
  • 我被黑心中介騙來泰國打工蟀给, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,126評論 3 370
  • 正文 我出身青樓坤溃,卻偏偏與公主長得像拍霜,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子薪介,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,914評論 2 355