[原創(chuàng)]Bochs使用指南簡介
一般而言,一講到 PC 仿真器,大家第一個想到的大概就是 VMWare,或是 Virtual PC 吧? 但還有另一個 Open Source 的項目,Bochs,也可以做到類似的功能哦∼ Bochs(發(fā)音為 Box)是一個「純粹」的 Software Emulator,所以它可以在很多平臺上執(zhí)行;也可以成功仿真大部份的 x86 作業(yè) 系統(tǒng),但因為它完全是使用軟件來仿真硬件的,因此它的執(zhí)行效率就真的不是很好了。 而相較于 VMware 及 Virtual PC,VMware 和 Virtual PC 則是為了加快仿真器的速度,采用了極多的硬件加速技術(shù)。所以它的模 擬效率一級棒,但是只限于在 x86 平臺上執(zhí)行。其中的 Virtual PC 更局限于僅能在 MS Widows 的環(huán)境下執(zhí)行。 另外還有一個采用了類似 VMware 的硬件加速技術(shù)的Open Source 項目,Plex86。不過,Plex86 的程序代碼己被 Bochs 所采納,所 以它的地位已完全被 Bochs 所取代了。至少,在 Debian 里已經(jīng)完全沒有 Plex86 的影子了: (以下為 Debian 里的 Plex86 套件 之說明) The functionality of Plex86 in debian has been superceeded by the Bochs package. This is a dummy package that depends on bochs to facilitate upgrade, and can be safely removed. [編輯]事前準(zhǔn)備 為了要能夠順利執(zhí)行 Bochs,我們必須先準(zhǔn)備它的硬設(shè)備-其中最重要、也最難搞定的就是硬盤;和 VMware 類似的,在 Bochs 里,是利用 Image File 來仿真硬盤的;也就是 Bochs 是將一個大大的檔案仿真成一顆硬盤。 我們可以利用 bximage 這個套件所提供的 bximage 工具程序來制作這些 Image File,例: (請注意它所顯示的 bashrc 之相關(guān)設(shè)定信息) [編輯]制作一個 Floppy Image File ======================================================================== bximage Disk Image Creation Tool for Bochs $Id: bximage.c,v 1.19 2003/08/01 01:20:00 cbothamy Exp $ ======================================================================== Do you want to create a floppy disk image or a hard disk image? Please type hd or fd. [hd] fd Choose the size of floppy disk image to create, in megabytes. Please type 0.36, 0.72, 1.2, 1.44, or 2.88. [1.44] 1.44 I will create a floppy image with cyl=80 heads=2 sectors per track=18 total sectors=2880 total bytes=1474560 What should I name the image? [a.img] Boot.img Writing: [] Done. I wrote 1474560 bytes to Boot.img. The following line should appear in your bochsrc: floppya: 1_44="Boot.img", status=inserted [編輯]制作一個 Hard Disk Image File 在這里是指定 growing 這種格式。這種格式的 Image File 可以有效節(jié)省硬盤空間。 ======================================================================== bximage Disk Image Creation Tool for Bochs $Id: bximage.c,v 1.19 2003/08/01 01:20:00 cbothamy Exp $ ======================================================================== Do you want to create a floppy disk image or a hard disk image? Please type hd or fd. [hd] hd What kind of image should I create? Please type flat, sparse or growing. [flat] growing Enter the hard disk size in megabytes, between 1 and 32255 [10] 1969 I will create a 'growing' hard disk image with cyl=4000 heads=16 sectors per track=63 total sectors=4032000 total size=1968.75 megabytes What should I name the image? [c.img] Native.img Writing: [] Done. I wrote 2064384000 bytes to Native.img. The following line should appear in your bochsrc: ata0-master: type=disk, path="Native.img", mode=growing, cylinders=4000, heads=16, spt=63 [編輯]BIOS 另外,還有開機(jī)時所要用到的 BIOS。這些 BIOS 已包含于 bochsbios 這個套件中,在安裝了 bochsbios 套件后,這些 BIOS 將會出現(xiàn)在 /usr/share/bochs/ 里。其中建議使用的 BIOS 為 BIOS-bochs-latest。 [編輯]顯示卡 BIOS 而顯示卡也有其專用之 BIOS。這個 BIOS 已包含于 vgabios 這個套件中,在安裝了 vgabios 套件后,這些 BIOS 將會出現(xiàn)在 /usr/share/vgabios/ 里。其中建議使用使用的 BIOS 為 vgabios.bin。 硬設(shè)備的準(zhǔn)備工作就到此為止了。 [編輯]設(shè)定 Bochs 當(dāng)?shù)谝淮螆?zhí)行 Bochs 時,它會激活一個預(yù)設(shè)的文字設(shè)定接口。其實真的有蠻多需要設(shè)定的: [編輯]內(nèi)存 在此是將其設(shè)定為 64 MB。 Enter memory size (MB): [4] 64 [編輯]操作接口 Bochs 只有提供了 wxWidgets based 的 GUI 設(shè)定接口, 其它則全使用文字接口的設(shè)定程序,textconfig, 也就是您 from site : http://bbs./thread-1166-1-1.html
|
|
|