搜尋此網誌

2011年4月29日 星期五

Operating system indicator for MBR(MBR操作系統指示碼)

Value(值)    Description(描述)
00h              empty partition-table entry                                          
01h              DOS 12-bit FAT                                                       
02h              XENIX root file system                                               
03h              XENIX /usr file system (obsolete)                                    
04h              DOS 16-bit FAT (up to 32M)                                           
05h              DOS 3.3+ extended partition                                          
06h              DOS 3.31+ Large File System (16-bit FAT, over 32M)                   
07h              QNX                                                                  
07h              OS/2 HPFS                                                            
07h              Windows NT NTFS                                                      
07h              Advanced Unix                                                        
07h              see partition boot record; could be any of the above or others       
08h              OS/2 (v1.0-1.3 only)                                                 
08h              AIX bootable partition, SplitDrive                                   
08h              Commodore DOS                                                        
08h              DELL partition spanning multiple drives                              
09h              AIX data partition                                                   
09h              Coherent filesystem                                                  
0Ah              OS/2 Boot Manager                                                    
0Ah              OPUS                                                                 
0Ah              Coherent swap partition                                              
0Bh              Windows95 with 32-bit FAT                                            
0Ch              Windows95 with 32-bit FAT (using LBA-mode INT 13 extensions)         
0Eh              logical-block-addressable VFAT (same as 06h but using LBA-mode INT 13)
0Fh              logical-block-addressable VFAT (same as 05h but using LBA-mode INT 13)
10h              OPUS                                                                 
11h              OS/2 Boot Manager hidden 12-bit FAT partition                        
12h              Compaq Diagnostics partition                                         
14h              (resulted from using Novell DOS 7.0 FDISK to delete Linux Native part)
14h              OS/2 Boot Manager hidden sub-32M 16-bit FAT partition                
16h              OS/2 Boot Manager hidden over-32M 16-bit FAT partition               
17h              OS/2 Boot Manager hidden HPFS partition                              
17h              hidden NTFS partition                                                
18h              AST special Windows swap file ("Zero-Volt Suspend" partition)        
19h              Willowtech Photon coS                                                
1Bh              hidden Windows95 FAT32 partition                                     
1Ch              hidden Windows95 FAT32 partition (using LBA-mode INT 13 extensions)  
1Eh              hidden LBA VFAT partition                                            
20h              Willowsoft Overture File System (OFS1)                               
21h              officially listed as reserved                                        
21h              FSo2                                                                 
23h              officially listed as reserved                                        
24h              NEC MS-DOS 3.x                                                       
26h              officially listed as reserved                                        
31h              officially listed as reserved                                        
33h              officially listed as reserved                                        
34h              officially listed as reserved                                        
36h              officially listed as reserved                                        
38h              Theos                                                                
3Ch              PowerQuest PartitionMagic recovery partition                         
40h              VENIX 80286                                                          
41h              Personal RISC Boot                                                   
41h              PowerPC boot partition                                               
42h              SFS (Secure File System) by Peter Gutmann                            
45h              EUMEL/Elan                                                           
46h              EUMEL/Elan                                                           
47h              EUMEL/Elan                                                           
48h              EUMEL/Elan                                                           
4Fh              Oberon boot/data partition                                           
50h              OnTrack Disk Manager, read-only partition                            
51h              OnTrack Disk Manager, read/write partition                           
51h              NOVELL                                                               
52h              CP/M                                                                 
52h              Microport System V/386                                               
53h              OnTrack Disk Manager, write-only partition???                        
54h              OnTrack Disk Manager (DDO)                                           
55h              EZ-Drive (see also INT 13/AH=FFh"EZ-Drive")                          
56h              GoldenBow VFeature                                                   
5Ch              Priam EDISK                                                          
61h              SpeedStor                                                            
63h              Unix SysV/386, 386/ix                                                
63h              Mach, MtXinu BSD 4.3 on Mach                                         
63h              GNU HURD                                                             
64h              Novell NetWare 286                                                   
64h              SpeedStore                                                           
65h              Novell NetWare (3.11)                                                
67h              Novell                                                               
68h              Novell                                                               
69h              Novell                                                               
70h              DiskSecure Multi-Boot                                                
71h              officially listed as reserved                                        
73h              officially listed as reserved                                        
74h              officially listed as reserved                                        
75h              PC/IX                                                                
76h              officially listed as reserved                                        
7Eh              F.I.X.                                                               
80h              Minix v1.1 - 1.4a                                                    
81h              Minix v1.4b+                                                         
81h              Linux                                                                
81h              Mitac Advanced Disk Manager                                          
82h              Linux Swap partition                                                 
82h              Prime                                                                
82h              Solaris (Unix)                                                       
83h              Linux native file system (ext2fs/xiafs)                              
84h              OS/2-renumbered type 04h partition (related to hiding DOS C: drive)  
85h              Linux EXT                                                            
86h              FAT16 volume/stripe set (Windows NT)                                 
87h              HPFS Fault-Tolerant mirrored partition                               
87h              NTFS volume/stripe set                                               
93h              Amoeba file system                                                   
94h              Amoeba bad block table                                               
98h              Datalight ROM-DOS SuperBoot                                          
99h              Mylex EISA SCSI                                                      
A0h              Phoenix NoteBIOS Power Management "Save-to-Disk" partition           
A1h              officially listed as reserved                                        
A3h              officially listed as reserved                                        
A4h              officially listed as reserved                                        
A5h              FreeBSD, BSD/386                                                     
A6h              OpenBSD                                                              
A9h              NetBSD
B1h              officially listed as reserved                                        
B3h              officially listed as reserved                                        
B4h              officially listed as reserved                                        
B6h              officially listed as reserved                                        
B6h              Windows NT mirror set (master), FAT16 file system                    
B7h              BSDI file system (secondarily swap)                                  
B7h              Windows NT mirror set (master), NTFS file system                     
B8h              BSDI swap partition (secondarily file system)                        
BEh              Solaris boot partition                                               
C0h              DR DOS/DR-DOS/Novell DOS secured partition                           
C0h              CTOS                                                                 
C1h              DR DOS 6.0 LOGIN.EXE-secured 12-bit FAT partition                    
C4h              DR DOS 6.0 LOGIN.EXE-secured 16-bit FAT partition                    
C6h              DR DOS 6.0 LOGIN.EXE-secured Huge partition                          
C6h              corrupted FAT16 volume/stripe set (Windows NT)                       
C6h              Windows NT mirror set (slave), FAT16 file system                     
C7h              Syrinx Boot                                                          
C7h              corrupted NTFS volume/stripe set                                     
C7h              Windows NT mirror set (slave), NTFS file system                      
CBh              Reserved for DR DOS/DR-DOS/OpenDOS secured FAT32                     
CCh              Reserved for DR DOS/DR-DOS secured FAT32 (LBA)                       
CEh              Reserved for DR DOS/DR-DOS secured FAT16 (LBA)                       
D0h              Multiuser DOS secured FAT12                                          
D1h              Old Multiuser DOS secured FAT12                                      
D4h              Old Multiuser DOS secured FAT16 (<= 32M)                             
D5h              Old Multiuser DOS secured extended partition                         
D6h              Old Multiuser DOS secured FAT16 (> 32M)                              
D8h              CP/M-86                                                              
DBh              CP/M, Concurrent CP/M, Concurrent DOS                                
DBh              CTOS (Convergent Technologies OS)                                    
E1h              SpeedStor 12-bit FAT extended partition                              
E2h              DOS read-only (Florian Painke's XFDISK 1.0.4)                        
E3h              DOS read-only                                                        
E3h              Storage Dimensions                                                   
E4h              SpeedStor 16-bit FAT extended partition                              
E5h              officially listed as reserved                                        
E6h              officially listed as reserved                                        
EBh              BeOS BFS (BFS1)                                                      
F1h              Storage Dimensions                                                   
F2h              DOS 3.3+ secondary partition                                         
F3h              officially listed as reserved                                        
F4h              SpeedStor                                                            
F4h              Storage Dimensions                                                   
F5h              Prologue                                                             
F6h              officially listed as reserved                                        
FEh              LANstep                                                              
FEh              IBM PS/2 IML (Initial Microcode Load) partition                      
FFh              Xenix bad block table                                             

2011年4月28日 星期四

5. DDF Srruct(結構)

DDF(Disk Data Format)
Common RAID Disk Data Format Specification  Version 2.0 Revision 19

5.1 DDF資料結構概述
一個DDF結構必須存在於每個實體硬碟,並分享RAID的結構配置在一個RAID的儲存的輔助系統上。它DDF的結構最小為32M必須且被預留在每個實體硬碟中。預留的空間中的最後一個區塊必須是也是實體硬碟的可定址空間中的最後一個區塊。

圖36說明DDF結構的觀念格式在一個實體硬碟及M個可定址的區塊。DDF結構包含9個部分型態,它們被顯示在表19。

圖36 DDF結構

19. DDF區段
Contents(內容)
Context(應用類別的範圍)
DDF Header(DDF 標頭)
Global(RAID全域使用)
Controller Data(控制器資料)
Global(RAID全域使用)
Physical Disk Records(實體硬碟紀錄)
Global(RAID全域使用)
Virtual Disk Records(虛擬磁碟紀錄)
Global(RAID全域使用)
Configuration Records(配置結構紀錄)
Local(本硬碟使用)
Physical Disk Data(實體硬碟資料)
Local(本硬碟使用)
Bad Block Management Log(壞軌管理紀錄)
Local(本硬碟使用)
Diagnostic Space(診斷空間) Local(本硬碟使用)
Vendor Specific Logs(製造商特有紀錄)
Vendor Specific(製造商特有)
DDF標頭有3個型態。底部DDF表頭必須紀錄在每顆實體硬碟的最後位置。它必須紀錄在最後一個可定址的邏輯區塊在一個實體硬碟。這個底部DDF表頭包含一個指標指向主要的DDF標頭。如果DDF結構覆式被運作執行,這個底部DDF表頭也會包含一個指標指向次要的DDF標頭。

圖36顯示一個DDF結構範例與覆式條目。覆式是非必要的,但如果它被執行這個全域值在整區段型態,除了DDF標頭區段以外,其他必須被均等在兩主要跟次要區域。


此外,次要區段起始偏移量從次要DDF標頭開始,必須等於主要區段起始偏移量從主要DDF標頭開始(此兩個標頭當案必須相等)。這必須只能有一個DDF結構存在於一個實體硬碟中。這實體硬碟必須不能被分割使用分割表或另外的途經。這容量的分割被DDF結構操作使用在虛擬磁碟的概念。DDF結構術語包含底部DDF標頭、主要標頭、次要標頭、還有所有DDF區段被描述在表19。

=======>>其餘尚未完成

2011年4月27日 星期三

WinDeg的環境設定

Target Computer and Host Computer
Kernel-mode除錯需求要一台target computer 和一台host computer。使用這台target computer去執行kernel-mode程式。而使用這台host computer去執行debugger。
如下圖形態顯示安裝Microsoft® Windows® ,使用它去執行核心的除錯與診斷系統的失效。
Typical Windows Debugging Setup
這圖說明典型的架構。然而目前KD和WinDbg的版本,任何一個都附有其安裝文件,非常的有彈性:
  • 當執行使用Windows NT® 4.0, Windows 2000, Windows XP, 或更新的Windows的作業系統,他們能夠在一台target computer上除錯。
  • 當執行在x86 platform, Intel Itanium platform, 或x64 platform,他們能夠在一台target computer上除錯。
  • 當執行使用Windows NT® 4.0, Windows 2000, Windows XP, 或更新的Windows的作業系統,他們能夠在一台host computer上開始下命令。
  • 當執行在x86 platform, Intel Itanium platform, 或x64 platform,他們能夠在一台host computer上開始下命令。
Target computer和host computer可以使用在不同的硬體工作平台或是不同的Windows作業系統。
Kernel debugging不需要體指明要建構free或checked。它可能來自free或checked 系統去free系統除錯,或來自free或checked 系統去checked系統除錯。不管怎樣,通常在沒又任何動機情況下Host computer是建立執行監視的動作。
注意:如果你在Itanium host computer執行除錯器,你應該確保你使用到正確的二進位版本。查看細節選擇32-bit64-bit Packages


Setting Up a Null-modem Cable Connection
當host computer和target computer在同一部電腦, 或當你需要去放一台本地host computer對應遠端存取server (RAS),其功能如target連接一個遠程的host,這兩台電腦的連接必須透過除錯(null-modem)連接線或是IEEE 1394 ("FireWire")連接線。
這個部分描述如何去掛接上除錯連接線,如果你使用1394連接線,請看Setting Up a 1394 Cable Connection
Null-modem連接線是序列連接線,它必須安裝在兩個Serial Port才能去送資料。它們使用在大部份的電腦儲存裝置。不要搞混null-modem cables跟不是做連接Serial Port 的standard serial cables。如果在相同的電腦除錯一個失敗的user-mode行程,你直接撥到target system's modem,或分析拋棄掉的檔案, 要使用一條null-modem的連接線是不需要地。

COM Ports

這系統默認值關於serial port除錯的輸出,從target computer高一點的Port(通常是COM2)。這可在開機選項設定改變除錯Port。對於細節請看Configuring Software on the Target Computer
這系統默認值serial port對於除錯的輸入到Host computer的COM1。這可以改變經由_NT_DEBUG_PORT的環境變數riable。對於細節請看Configuring Software on the Host Computer

Null Modem Cable Construction

如果你不曾去接近null-modem cable,或如果你比較喜歡自行製作硬體接線,接下來的資訊可能對你有些幫助。
標準商用null-modem cable是利用下面的配置方法:
  • Transmit Data connected to Receive Data
  • Receive Data connected to Transmit Data
  • Ground connected to Ground
對於9-pin和25-pin D型連接器(分別認識db9db25),硬體的協定如下:這電線需連結接收Pin(RXD)到發射Pin(TXD),TXD接到RXD,還有Ground (GND) 接到GND。另外, 每個接線端應當將Data Terminal Ready (DTR)連接到Data Set Ready (DSR),與Request to Send (RTS)連接到Clear to Send (CTS)。
下面的表格中顯示許多pins的關聯性:
9-pin Connector
25-pin Connector
2 (RXD) 2 (TXD)
3 (TXD) 3 (RXD)
4 (DTR) 6 (DSR)
5 (GND) 7 (GND)
6 (DSR) 20 (DTR)
7 (RTS) 5 (CTS)
8 (CTS) 4 (RTS)
這debugger在host不依靠任何控制接腳(例如DTR, DSR, RTS, or CTS)。然而, 你可能需要去放入跳線在連接線兩邊的連接器端點,從DTR接到DSR,還有從RTS接到CTS,如下:
Connector
Jumpers
db9 From pin 4 (DTR) to pin 6 (DSR)
From pin 7 (RTS) to pin 8 (CTS)
db25 From pin 20 (DTR) to pin 6 (DSR)
From pin 5 (RTS) to pin 4 (CTS)
在host和target computers之間,連結null-modem的連接線到serial port。


Setting Up a 1394 Cable Connection
當主電腦在相同位置作為一台控制端電腦,或當你需要放一本地端主電腦具有遠端存取伺服器remote access server (RAS)能力在控制端與遠處主機之間。 這兩台必須連接debug (null-modem)線IEEE 1394 ("FireWire")線任何一種。
核心除錯經由一條1394的線,它不支援所有系統。控制端電腦必須使用Windows XP或更新的Windows作業系統版本,同樣的主機也必須執行在這些系統中的一種(控制端跟主機端不必一模一樣的Windows的版本)
控制端電腦與主機各自都需要一張1394的卡。在使用一條1394的線接入這兩張卡的1394阜。卡上的阜將不被限定必須在哪一個阜,它將不會影響通道的編號,此編號將被使用在軟體安裝。
如果你使用除錯連接線(null-modem)取代1394連接線,請參考Setting Up a Null-modem Cable Connection章節。
注意:在使用1394進行核心除錯之前,你必須正確的設定主機與控制端兩邊的軟體。細節請參閱Disabling the 1394 Host ControllerInstalling the 1394 Virtual Driver


Testing the Connection
在主機與控制端系統用null-modem去連接,在有效確認開始這除錯器之前。你可以使用超級終端機程式(Hyperterminal),去確認連線是否完成
注意:在 Windows Server 2003與更新的Windows 版本。 超級終端機程式(Hyperterminal)在一般安裝的情況底下將不被安裝,不過,你可以安裝超級終端機程式(Hyperterminal)從 Windows的安裝光碟。

測試null-modem的連接
  1. 在主機上按下[開始]紐, 移到[程式集],然後移到[輔助程式],然後在移到[通信],然後按超級終端機。如果超級終端機沒被安裝,請安裝它從產品光碟從控制台使用[新增/移除程式]
  2. 在連接說明對話框,輸入一個新連線名稱。(名稱無須在意,也不會影響任何行為)
  3. 在連結的對話框,點選連接使用的下拉式選單。選擇COM阜與符合這null-modem線的設定在此機器上。
  4. 接受系統預設值當作COM阜的屬性,在下一次的對畫框。
  5. 重複步驟14,對於控制端電腦。
  6. 超級終端機開啟與準備做測試,輸入字元串在主機端,如果null-modem 線正確的被安裝與正確的兩端COM阜的軟體設定。當兩端都開啟超級終端機的前提,在主機端輸入的字將顯示在控制端;在控制端輸入的字串將顯示在主機端。

如果在主控端鍵盤敲擊的字沒被顯示在控制端,確認線已經被連接在兩端。也確認null-modem的線在迴授的連接也是可以的。
當可能的COM阜問題都已通過線路的檢查。控制端建立一個新連線在超級終端機上,使用一個替代方案COM阜接著步驟2到5和重置。
如果這問題沒被解答,在主機端試著更換到其他的COM阜。如果問題還在的話,改變控制端系統的Com阜的設定值回到原始設定和重置。最後正確的配置值將會被設定與此測試將成功。
如果在幾次重複的COM阜重新配置與最後使它能夠工作,你忘掉哪一台使用哪一個阜,在超級終端機點選檔案選單與選擇屬性去顯露正確的阜設定當作一個除錯交談。

How to trace your driver in windows XP/2003?

1. Edit at c:\boot.ini or others:\boot.ini
Please install WinDbg that is powerful to help trace your source code.


2. If you want to use com port, please add red parts as below:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetect /debug /debugport=com1 /baudrate=115200


3. If you want to use 1394, please add as:
==>/debugport=1394 /channel=xxx    xxx is number that it must match with Windbg's setting.

4. Connect debugging platform to your computer with a RS232 or 1394 cable.


A(debugging platform)                            B(Your Computer)
PIN 2 <----------------------------------------------> PIN 3

PIN 3 <----------------------------------------------> PIN 2
PIN 5 <----------------------------------------------> PIN 5



5. Where can I get the Windbg?
Debugging Tools for Windows 32-bit Versions
Debugging Tools for Windows 64-bit Versions


6. Double clicks and install it.

7. Choose Symbol File Path.
(1).And set Symbol Path.
(2).Choose Sourcel File Path
(3).Set Source files Path.
(4).Choose Image File Path
(5).Set Executable Image Search Path.


8. Open your Windbg and choose "kernel debug".


   
9. Set Port and baudrate.
Or
10.After Click Ok, Windbg will connect with Windows Platform.