Beruflich Dokumente
Kultur Dokumente
History
2006, on Windows Hardware Engineering Conference (WinHEC), Microsoft presented Personal Storage: Opportunities and challenges for pocket-sized storage devices in the Windows world. Same Conference Vishal Ghotge - Program Manager, Core File Services, Microsoft Corporation presents exFAT
exFAT vs FAT 32
exFAT is not backward compatible with FAT32 There are no short names in exFAT
VOLUME Structure
Sector 10
Sector 12
FAT Region
A FAT describes cluster chains in the Cluster Heap. A cluster chain is a series of clusters which provides space for recording the contents of files, directories, and other file system structures. A FAT represents a cluster chain as a singly-linked list of clusters indices. With the exception of the first two entries, every entry in a FAT represents exactly one cluster and each entry is 4 bytes in size.
FAT Region
Data Region
The Data region contains the Cluster Heap, which provides managed space for file system structures, directories, and files. The Cluster Heap's structure is very simple; each consecutive series of sectors describes one cluster, as the SectorsPerClusterShift field defines. Importantly, the first cluster of the Cluster Heap has index two, which directly corresponds to the index of Fat Entry 2.
Allocation Bitmap
In an exFAT volume, an Allocation Bitmap maintains the record of the allocation state of all clusters. This is a significant difference from exFAT's predecessors (FAT12, FAT16, and FAT32), in which a FAT maintained a record of the allocation state of all clusters in the Cluster Heap.
Allocation Bitmap
An Allocation Bitmap records the allocation state of the clusters in the Cluster Heap. Each bit in an Allocation Bitmap indicates whether its corresponding cluster is available for allocation or not. An Allocation Bitmap represents clusters from lowest to highest index. For historical reasons, the first cluster has index 2. Note: the first bit in the bitmap is the lowest-order bit of the first byte.
Directory Structure
The exFAT file system uses a directory tree approach to manage the file system structures and files which exist in the Cluster Heap. Directories have a one-to-many relationship between parent and child in the directory tree. The directory to which the FirstClusterOfRootDirectory (96, 4) field refers is the root of the directory tree. All other directories descend from the root directory in a singly-linked fashion. Each directory consists of a series of directory entries.
Directory Structure
One or more directory entries combine into a directory entry set which describes something of interest, such as a file system structure, sub-directory, or file.
The CharacterCount field contains the length of the Unicode string the VolumeLabel field contains.
The VolumeLabel field contains a Unicode string, which is the user-friendly name of the volume. Maximum 11 characters Volume Label Name.
0, which means the given directory entry describes the First Allocation Bitmap 1, which means the given directory entry describes the Second Allocation Bitmap and is possible only when NumberOfFats contains the value 2
This field contains the index of the first cluster of the cluster chain, as the FAT describes, which hosts the Allocation Bitmap.
Entry Type 82
The TableChecksum field contains the checksum of the Up-case Table (which the FirstCluster and DataLength fields describe). Implementations shall verify the contents of this field are valid prior to using the Up-case Table.
This field contains the index of the first cluster of the cluster chain, as the FAT describes, which hosts the Up-case Table.
Entry Type 85
The SecondaryCount field describes the number of secondary directory entries which immediately follow the given primary directory entry. These secondary directory entries, along with the given primary directory entry, comprise the directory entry set.
The SetChecksum field contains the checksum of all directory entries in the given directory entry set. The checksum excludes this field
In combination, the CreateTimestamp and CreateTime10msIncrement fields describe the date and time the given file/directory was created. These two fields conform to the definitions of the Timestamp and 10msIncrement fields.
0 4 Seconds divided by 2 (0 = 0 sec., 29 = 58 sec.) 5 10 Minutes 0 59 11 15 Hours 0 23 16 20 Days 1 31 21 24 Months (01 = January 02 = February etc. ) 25 31 Years since 1980
There is one byte for each Time Stamp (Created, Modified and Accessed). The bit assignment is: - 1 bit reserved (the most significant bit) - the other 7 bits are representing a signed integer that is recording the number of 15 minutes intervals.
A8h = 10101000 -> 101100 = 40 X 15 = 600 min => Time Zone +10 (Canberra, Sydney)
Entry Type C0
The NameLength field contains the length of the Unicode string the subsequent File Name directory entries collectively contain.
The NameHash field contains a 2-byte hash of the upcased file name. This enables implementations to perform a quick comparison when searching for a file by name. Importantly, it provides a sure verification of a mismatch. Implementations shall verify all NameHash matches with a comparison of the up-cased file name.
The ValidDataLength field describes how far into the data stream user data has been written. Implementations shall update this field as they write data further out into the data stream.
Entry Type C1
File Creation
By Examining the FAT entries we can find the allocated clusters. We know that the First cluster is 78h, so we go to the beginning of the FAT, at sector 128, which is defined in the boot sector:
So, if we do the math, we have: First Fragment: 4999-119 = 4880 Second Fragment: 7135-5607 = 1528 FILE SIZE: = 6408 CLUSTERS
Deleted Files
Directory Entry after file deletion: As we already mentioned, The InUSE bit describes whether the given directory entry in use or not. The valid values for this field are: 0, which means the given directory entry is not in use; this means the given structure actually is an unused directory entry 1, which means the given directory entry is in use; this means the given structure is a regular directory entry Accordingly, when a file or directory is deleted, the flag changes to 0, indicating that this directory entry is free or unused directory entry.
Deleted Files
FAT after file deletion No change until re-used for the next fragmented file. BITMAP after file deletion The bits that were showing in use (1) are immediately changed to not in use (0)
Questions?
Special Thank you to my colleague and friend Steve Ilett. Thank you all for attending this session!
Bibliography
Ravisankar V. Pudipeddi and Vishal Ghotge and Ravinder Thind 2009: Contiguous Allocation in an Extensible File System, US Patent Application Publication, Pub. No.: US 2009/0164539 A1. Ravisankar V. Pudipeddi and Vishal Ghotge and Ravinder Thind 2009: Quick Filename Lookup Using Name Hash, US Patent Application Publication, Pub. No.: US 2009/0164440 A1. Jeff Hamm, Extended FAT File System, 2009 Article ID: 955704 - Last Review: September 29, 2009 - Revision: 3.1: Description of the exFAT file system driver update package, http://support.microsoft.com/kb/955704, accessed February 2009. Raymond Chen 2006: Windows Confidential, A Brief and Incomplete History of FAT32, TechNet Magazine. Vishal Ghotge, (Program Manager, Core File Services Microsoft Corporation), exFAT (PPT), Win HEC 2006