成人久久精品一区二区三区,久久精品国产男包,精品久久久久久99人妻http://m.shnenglu.com/Viking/category/15188.html集中精力,放棄一切的去做一件事情,只要盡力了,即使失敗了,你也不會后悔!zh-cnSun, 21 Nov 2010 09:27:44 GMTSun, 21 Nov 2010 09:27:44 GMT60麒麟操作系統內核同其他操作系統內核的相似性分析(按ctrl + a 閱讀)http://m.shnenglu.com/Viking/archive/2010/11/17/133920.html張貴川張貴川Wed, 17 Nov 2010 13:48:00 GMThttp://m.shnenglu.com/Viking/archive/2010/11/17/133920.htmlhttp://m.shnenglu.com/Viking/comments/133920.htmlhttp://m.shnenglu.com/Viking/archive/2010/11/17/133920.html#Feedback1http://m.shnenglu.com/Viking/comments/commentRss/133920.htmlhttp://m.shnenglu.com/Viking/services/trackbacks/133920.html閱讀全文

張貴川 2010-11-17 21:48 發表評論
]]>
如何在Linux上使用Bochs[轉]http://m.shnenglu.com/Viking/archive/2010/10/16/130150.html張貴川張貴川Sat, 16 Oct 2010 10:12:00 GMThttp://m.shnenglu.com/Viking/archive/2010/10/16/130150.htmlhttp://m.shnenglu.com/Viking/comments/130150.htmlhttp://m.shnenglu.com/Viking/archive/2010/10/16/130150.html#Feedback0http://m.shnenglu.com/Viking/comments/commentRss/130150.htmlhttp://m.shnenglu.com/Viking/services/trackbacks/130150.html
作者:王聰

引言

     最近在做操作系統方面的研究,不得不去下一個虛擬機 來用。由于我不使用Windows,所以選擇很少了。因為在Linux上,差不多就只有兩款好的 虛擬機——Bochs和Qemu。這兩個之中,Bochs是用C++編寫,能在很多平臺上使用,而且不論什么平臺, 它都不倚賴主機的指令系統,總是模擬x86。所以我選擇了Bochs。但是,我驚訝地發現 關于如何在Linux上使用Bochs的資料很少。Bochs自帶的文檔中講得也不很明確,而且還 是英文的。所以我寫了這篇文章。

安裝

     到Bochs的主頁: http://bochs.sourceforge.net 上下載最新的Bochs RPM安裝包。(寫這篇文章時,最新的版本是2.2.1。)以root的身份安裝:

#rpm -ivh bochs-2.2.1-1.i586.rpm
其實RPM安裝包給你裝上了四個新程序:bochs,bochs-dlx,bximage,bxcommit, 以及相關文檔。安裝完畢后,你可以先試試bochs-dlx,它是DLX Linux的一個demo。
$ bochs-dlx
---------------------------------------------------------------
             DLX Linux Demo, for Bochs x86 Emulator
---------------------------------------------------------------
Checking for bochs binary...ok
Checking for DLX linux directory...ok
Checking for /usr/bin/gzip...ok
Checking for /home/wangcong/.bochsdlx directory...ok
Entering /home/wangcong/.bochsdlx
Running bochs
00000000000i[APIC?] local apic in initializing
========================================================================
                         Bochs x86 Emulator 2.2.1
                 Build from CVS snapshot on July 8, 2005
========================================================================
00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[ ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[ ] reading configuration from bochsrc.txt
00000000000i[ ] lt_dlhandle is 0x8bac490
00000000000i[PLGIN] loaded plugin libbx_x.la
00000000000i[ ] installing x module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt

馬上,你就會看到一個X11窗口。



顯示的是VGA BIOS信息,然后是加載Linux的信息。以root身份登錄,試試DLX Linux。安裝成功。

使用

     下面是一些重要的文件:

/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列表

     命令bohcs可以接受4個參數:-q 加載配置文件后跳過開始菜單;-f configfile 識別指定的配制文件;-n 不加載配置文件;-h 打印幫助信息;-qf configfile 相當于同時使用-q和-f兩個選項。使用Bochs,你必須有一個配置文件,或者你通 過-f參數指定,或者讓Bochs自己搜索。配置文件的作用是告訴Bochs到哪里尋找鏡像 文件,模擬層如何工作等。Bochs搜索配置文件的順序是:


  1. bochsrc 在當前目錄中


  2. .bochsrc 在用戶的主目錄中

  3. bochsrc /etc 目錄中

以dlx-linux的配置文件為例,講一下如何定制你需要的配置文件。dlx-linux的 配置文件是/usr/share/doc/bochs目錄中的bochsrc-sample.txt。它的內容 如下:
###############################################################
# bochsrc.txt file for DLX Linux disk image.
###############################################################

# how much memory the emulated machine will have
megs: 32

# filename of ROM images
romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest

# what disk images will be used
floppya: 1_44=floppya.img, status=inserted
floppyb: 1_44=floppyb.img, status=inserted

# hard disk
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="hd10meg.img", cylinders=306, heads=4, spt=17

# choose the boot disk.
boot: c

# default config interface is textconfig.
#config_interface: textconfig
#config_interface: wx

#display_library: x
# other choices: win32 sdl wx carbon amigaos beos macintosh nogui rfb term svga

# where do we send log messages?
log: bochsout.txt

# disable the mouse, since DLX is text only
mouse: enabled=0

# enable key mapping, using US layout as default.
#
# NOTE: In Bochs 1.4, keyboard mapping is only 100% implemented on X windows.
# However, the key mapping tables are used in the paste function, so
# in the DLX Linux example I'm enabling keyboard_mapping so that paste
# will work. Cut&Paste is currently implemented on win32 and X windows only.

keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-fr.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-de.map
#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-es.map
以#開頭的每一行都是注釋。注釋寫得很明白。
megs: 32
指明想要模擬32M的內存。注意:后面的數字最大為2048,但是因為主機系統的限制,在 大多數系統上,Bochs甚至不能支持1024M。
romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
指明ROM的鏡像文件在哪,開機時ROM BIOS被加載到哪里。$BXSHARE是環境變量,指明 Bochs的share目錄,在Linux上為/usr/share/bochs。這一般不用改動。下面的vgaromimage 指明VGA ROM的鏡像文件位置。
floppya: 1_44=floppya.img, status=inserted
floppyb: 1_44=floppyb.img, status=inserted
floppya是第一軟驅,floppyb是第二軟驅。后面標明的是軟驅鏡像文件的位置,軟盤 是否插入。可以根據你的需要做適當的修改。
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="hd10meg.img", cylinders=306, heads=4, spt=17
打開ata0通道,另外還有ata1,ata2,ata3。對于每一個通道,都必須指明兩個IO地址和IRQ。 ata0是默認被打開的,它的ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14。ata0-master 是主ata0通道,后面指明它附帶的設備是硬盤,硬盤鏡像文件路徑,硬盤柱面數,磁頭數等參數。
boot: c
指明啟動次序,可以是cdrom,floppy,disk。不過由于歷史的原因a和c也能被接受。 也可以這樣來寫:
boot: cdrom, floppy, disk
mouse: enabled=0
指明鼠標是否可見。
keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map
打開對虛擬US鍵盤的重映射,keymap必須被指明。
     更多的配置文件選項說明見/usr/share/doc/bochs/user/bochsrc.html。 如何編寫鍵盤的keymap列表見/usr/share/doc/bochs/user/keymap.html。

制作磁盤鏡像

     bximage是Bochs自帶的制作磁盤鏡像的工具,具有 良好的交互性,使用很方便。運行bximage,你會看到:

========================================================================
                                 bximage
                   Disk Image Creation Tool for Bochs
       $Id: bximage.c,v 1.25.2.1 2005/07/06 20:40:00 vruppert Exp $
========================================================================

Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd]
詢問我們是建立一個軟盤鏡像還是硬盤鏡像,默認的是硬盤。我們直接按回車,選擇硬盤 鏡像。
What kind of image should I create?
Please type flat, sparse or growing. [flat]
我們想建立一個簡單的鏡像,選擇默認的flat。回車。
Enter the hard disk size in megabytes, between 1 and 32255
[10]
想要多少Mbyte的大小?鍵入你想要的大小。
I will create a 'flat' hard disk image with
   cyl=2
   heads=16
   sectors per track=63
   total sectors=2016
   total size=0.98 megabytes

What should I name the image?
[c.img]
在上一步中輸入“1”后,顯示相關的硬盤信息。詢問想要什么鏡像文件名字?默認的是 c.img。輸入hd.img回車。
Writing: [] Done.

I wrote 1032192 bytes to hd.img.

The following line should appear in your bochsrc:
   ata0-master: type=disk, path="hd.img", mode=flat, cylinders=2, heads=16, spt=63
建立完畢。然后你就可以使用這個鏡像,用Bochs做實驗了。

     另外Bochs還有強大的調試功能,詳細請參閱用戶 手冊第8章。Bochs主頁上還有一些做好的系統鏡像,比如:OpenBSD,FreeDOS等。 不妨下載一個來試試。 Bochs的確是一款優秀的工具,我推薦給每一位做操作系統研究的朋友。




張貴川 2010-10-16 18:12 發表評論
]]>
bochs和硬盤管理http://m.shnenglu.com/Viking/archive/2010/10/14/129926.html張貴川張貴川Thu, 14 Oct 2010 12:59:00 GMThttp://m.shnenglu.com/Viking/archive/2010/10/14/129926.htmlhttp://m.shnenglu.com/Viking/comments/129926.htmlhttp://m.shnenglu.com/Viking/archive/2010/10/14/129926.html#Feedback0http://m.shnenglu.com/Viking/comments/commentRss/129926.htmlhttp://m.shnenglu.com/Viking/services/trackbacks/129926.html
實驗一 
目的:熟悉實驗環境,認識Bochs虛擬機 
內容: 
1、下載并安裝Bochs 2.3.7,官方網站 http://bochs.sourceforge.net/ 
2、下載DOS 6.22安裝光盤,參考地址 http://www.grqhd.com/downloads/hdd/dos622cd.iso 
3、使用Bochs自帶工具制作10M硬盤鏡像若干、1.44M軟盤鏡像若干,備用。 
4、練習修改Bochs配置文件,使用DOS 6.22安裝光盤將DOS安裝到硬盤和軟盤。 
5、練習修改配置文件,分別實現從光盤、硬盤或軟盤啟動。 

實驗二 
目的:MBR的讀寫與分析 
內容: 
1、練習使用int 13功能獲取安裝了DOS 6.22系統的硬盤MBR、反匯編。 
2、使用int 13功能將獲取的MBR,寫到空白的硬盤上。 
3、修改MBR代碼,并測試其工作流程。 

實驗三 
目的:掌握分區表的數值意義 
內容: 
1、練習使用DOS 6.22自帶的分區工具FDisk,把一個空白硬盤分區,觀察MBR的變化。 
2、使用FDisk把一個空白硬盤分一個主分區,自定義大小,其余分為擴展分區,擴展分區上分兩個邏輯分區,自定義大小。 
3、說明以上分區表的數值含義。 

實驗四 
目的:DBR的讀寫與分析 
內容: 
1、獲取正常DOS 6.22系統盤上的DBR,并反匯編、閱讀。 
2、比較空白硬盤經分區后,使用Format前后DBR的差別。 
3、測試DBR的工作流程。 

實驗五 
目的:掌握FAT原理 
內容: 
1、以FAT12為例,分析BPB以及FAT、根目錄表。 
2、利用以上原理,通過直接改寫磁盤扇區的辦法,在根目錄下生成一個文本文件,并寫入適當的內容。



張貴川 2010-10-14 20:59 發表評論
]]>
成人亚洲欧美久久久久| 777午夜精品久久av蜜臀| 一本大道加勒比久久综合| 婷婷久久综合九色综合98| 国产精久久一区二区三区| 99久久香蕉国产线看观香| 国产欧美久久一区二区| 亚洲综合久久夜AV | 国产精品久久久久影院嫩草| 亚洲日本va午夜中文字幕久久| 国产精品久久久久免费a∨| 久久国产高清字幕中文| 中文字幕久久精品| 青青草国产精品久久久久| 一本色道久久综合狠狠躁| 久久影院亚洲一区| 国产精品视频久久| 久久精品亚洲日本波多野结衣| 久久人人爽人人爽人人片AV东京热| 精品蜜臀久久久久99网站| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 色婷婷噜噜久久国产精品12p| 日韩AV无码久久一区二区| 久久久久久久免费视频| 久久久精品国产Sm最大网站| 99精品久久久久久久婷婷| 国产91色综合久久免费分享| 久久免费的精品国产V∧| 亚洲香蕉网久久综合影视| 亚洲欧美成人久久综合中文网| 久久www免费人成精品香蕉| 精品久久一区二区三区| jizzjizz国产精品久久| 精品久久一区二区三区| 亚洲国产精品久久久久婷婷老年| AV狠狠色丁香婷婷综合久久 | 久久婷婷五月综合色99啪ak| 国产成人香蕉久久久久| 999久久久国产精品| 久久AAAA片一区二区| 亚洲欧美国产日韩综合久久|