搜尋此網誌

2013年6月27日 星期四

ATA PASS-THROUGH (16) command

ATA PASS-THROUGH (16) command (85h)
Bit
Byte
7
6
5
4
3
2
1
0
0
OPERATION CODE (85h)
1
MULTIPLE_COUNT
PROTOCOL
EXTEND
2
OFF_LINE
CK_COND
Reserved
T_DIR
BYT_BLOK
T_LENGTH
3
FEATURES (8:15)
4
FEATURES (0:7)
5
SECTOR_COUNT (8:15)
6
SECTOR_COUNT (0:7)
7
LBA_LOW (8:15)
8
LBA_LOW (0:7)
9
LBA_MID (8:15)
10
LBA_MID (0:7)
11
LBA_HIGH (8:15)
12
LBA_HIGH (0:7)
13
DEVICE
14
COMMAND
15
CONTROL

ATA Protocols
Protocol
Description
0
Hard Reset
1
SRST
2
Reserved
3
Non-data
4
PIO Data-In
5
PIO Data-Out
6
DMA
7
DMA Queued
8
Device Diagnostic
9
DEVICE RESET
10
UDMA Data In
11
UDMA Data Out
12
FPDMA
13, 14
Reserved
15
Return Response Information


Extended ATA Status Return Descriptor

Bit
Byte
7
6
5
4
3
2
1
0
0
DESCRIPTOR CODE (09h)
1
ADDITIONAL DESCRIPTOR LENGTH (0ch)
2
Reserved
EXTEND
3
ERROR
4
SECTOR_COUNT (8:15)
5
SECTOR_COUNT (0:7)
6
LBA_LOW (8:15)
7
LBA_LOW (0:7)
8
LBA_MID (8:15)
9
LBA_MID (0:7)
10
LBA_HIGH (8:15)
11
LBA_HIGH (0:7)
12
DEVICE
13
STATUS

2013年6月3日 星期一

GUID Partition Table(GPT)



GPT header format (From Wiki)
Offset
Length
Contents
+0
8 bytes
Signature ("EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h)
+8
4 bytes
Revision (for GPT version 1.0 (through at least UEFI version 2.3.1), the value is 00h 00h 01h 00h)
+12
4 bytes
Header size in little endian (in bytes, usually 5Ch 00h 00h 00h meaning 92 bytes)
+16
4 bytes
CRC32 of header (offset +0 up to header size), with this field zeroed during calculation
+20
4 bytes
Reserved; must be zero
+24
8 bytes
Current LBA (location of this header copy)
+32
8 bytes
Backup LBA (location of the other header copy)
+40
8 bytes
First usable LBA for partitions (primary partition table last LBA + 1)
+48
8 bytes
Last usable LBA (secondary partition table first LBA - 1)
+56
16 bytes
Disk GUID (also referred as UUID on UNIXes)
+72
8 bytes
Starting LBA of array of partition entries (always 2 in primary copy)
+80
4 bytes
Number of partition entries in array
+84
4 bytes
Size of a single partition entry (usually 128)
+88
4 bytes
CRC32 of partition array
+92
*
Reserved; must be zeroes for the rest of the block (420 bytes for a sector size of 512 bytes; but can be more with larger sector sizes)
LBA size
Total
  
GUID partition entry format
Offset
Length
Contents
0
16 bytes
Partition type GUID
16
16 bytes
Unique partition GUID
32
8 bytes
First LBA (little endian)
40
8 bytes
Last LBA (inclusive, usually odd)
48
8 bytes
Attribute flags (e.g. bit 60 denotes read-only)
56
72 bytes
Partition name (36 UTF-16LE code units)
128
Total


Partition attributes
Bit
Content
0
System partition (disk partitioning utilities must preserve the partition as is)
2
Legacy BIOS bootable (equivalent to active flag (typically bit 7 set) at offset +0h in partition entries of the MBR partition table)
60
Read-only
62
Hidden
63
Do not automount (i.e., do not assign drive letter)