Principle of FAT file system 2

Four, FAT partition principle.

First to a structure:     We now focuses on the FAT partition data format of how the store. MICROSOFT first FAT partition format is supported partition format, according to the median FAT table for each share of cluster chain (related concepts will be mentioned later) into fat12, fat16, fat32 three formats "variant", but its basic storage is similar.     Careful study of the composition of the structure in Figure 7 fat16 and fat32 partition. Explained in order below DBR, FAT1, FAT2, root directory, the data area, the concept of the remaining sectors. Address if no special tips mentioned are the internal partition offset.


4.1 About DBR.

    DBR region (DOS BOOT RECORD) means that the operating system boot record area usually occupied by the partition sector 0 of 512 bytes (also occupied by other special circumstances reserved sectors, we start with the first 0). In this 512 bytes in fact turn, jump instructions, the manufacturer logo and operating system version number, BPB (BIOS Parameter Block), extended BPB, os boot program, marks the end of several parts. In the most used FAT32 partition DBR an example of each byte meaning. Figure 8. Figure 8 corresponds to the interpretation of Table 3   



    Table 3 FAT32 partitions on location in various parts of the divided DBR   
Byte displacement Field Length Field name Figure 8 corresponds to the color
0x00 3 bytes Jump instruction  
0x03 8 bytes Manufacturers logos and os version number  
0x0B 53 bytes BPB  
0x40 26 bytes Extended BPB  
0x5A 420 bytes Boot code  
0x01FE 2 bytes Effectively marks the end  


Figure 9 shows the winhex on Figure 8 DBR related parameters explained:     According to the legend on top, we discuss the significance DBR parameters for each byte.           MBR transfers CPU execution to the boot sector, so the first three bytes of the boot sector must be legitimate executable x86-based CPU instructions. This is usually a jump instruction, which is responsible for the next couple of bytes skipped unenforceable (BPB and extended BPB), jump to the operating system boot code section.     After the jump instruction is an 8-byte OEM ID, which is a string, OEM ID identifies the format the partition operating system name and version number. In order to retain compatibility with MS-DOS, and Windows 2000 is usually the disk is formatted in FAT16 and FAT32 disks recorded in the field "MSDOS 5.0", on an NTFS disk (on ntfs, another state), Windows 2000 record is "NTFS". Typically OEM ID field appears "MSWIN4.0" was 95 at the formatted disk Windows, OEM ID field appears "MSWIN4.1" on is Windows 95 OSR2 and Windows 98 formatted disk.     Offset from the beginning of the next is a description 0x0B enables the executable boot code to find information relevant parameters. Usually called BPB (BIOS Parameter Block), BPB generally start at the same amount of displacement, and therefore, are in a standard parameters known location. Disk capacity and geometry variables are being sealed in BPB. Since the guide is a sector portion of the first jump instruction x86. Therefore, in the future by the end of the additional new information BPB, BPB can be extended. The jump instruction needs only to make a small adjustment can adapt to changes in BPB's. Figure 9 has a list of the names and values ​​of the project, in order to study the system, for Figure 8, the BPB meaning FAT32 partition format and extended BPB interpretation of the meaning of the form, as shown in Table 4 and Table 5.




Table 4 FAT32 partitions BPB field     
Byte displacement Field Length (bytes) Figure 8 corresponds to the value of Names and definitions
0x0B 2 0x0200 The size of the number of sectors (Bytes Per Sector) byte hardware sectors. Decimal value of the legal field has 512,1024,2048 and 4096. For most disks, the field is 512
0x0D 1 0x08 Number of sectors (Sectors Per Cluster) per cluster, the number of sectors in the cluster. Due to the FAT32 file system can only track a finite number of clusters (up to 4,294,967,296), so you, by increasing the number of sectors per cluster, you can make the FAT32 file system supports a maximum number of partitions. A partition default cluster size depends on the size of the partition. Legal decimal value of this field has 1,2,4,8,16,32,64 and 128. FAT32 Windows 2000 implementations can only create a maximum of 32GB partition. However, Windows 2000 can access larger partition by other operating systems (95, OSR2 and later versions of Windows) created
0x0e 2 0x0020 Number of reserved sectors (Reserved Sector) first started a few sectors before FAT, including the boot sector. Decimal value of the field is generally 32
0x10 1 0x02 The number of copies of the FAT FAT partition number (Number of FAT). The value of this field is generally 2
0x11 2 0x0000 Root of the number of items (Root Entries) only FAT12/FAT16 use this field. FAT32 partition on purpose, the field must be set to 0
0x13 2 0x0000 A small number of sectors (Small Sector) (Only FAT12/FAT16 use this field) on a FAT32 partition purposes, the field must be set to 0
0x15 1 0xF8 Media descriptor (Media Descriptor) to provide information about the media being used. Value 0xF8 indicates hard, 0xF0 indicates a high-density 3.5-inch floppy disk. Media descriptor to be used in MS-DOS FAT16 disks, has not been used in Windows 2000
0x16 2 0x0000 FAT sectors (Sectors Per FAT) is only used every FAT12/FAT16, on the FAT32 partition purposes, the field must be set to 0
0x18 2 0x003F The number of sectors per track (Sectors Per Track) contains a disk using INT13h "sectors per track" geometry value. The partition is divided into a plurality of cylinder heads a plurality of tracks
0x1A 2 0x00FF Heads (Number of Head) This field contains the disk using the INT 13h "heads" geometry value.For example, on a 1.44MB 3.5 inch floppy disk, this field is 2
0x1C 4 0x0000003F Number of sectors before the boot sector on the partition to hide the number of sectors (Hidden Sector). This value is used during the boot sequence to calculate the root of the absolute displacement of the data area. This field is generally only meaningful to those seen in the interrupt 13h media. No partition on the media it must always be 0
0x20 4 0x007D043F The total number of sectors (Large Sector) This field contains the FAT32 partition of the total number of sectors
0x24 4 0x00001F32 FAT sectors (Sectors Per FAT) (FAT32 only be used) for each of the number of sectors per FAT partitions share. Computer use this number and the number of FAT and hidden sectors to decide (as described in this table) root from where to start. The computer can also be determined from the number of directory user data area of ​​the partition where to start
0x28 2 0x00

Extension flag (Extended Flag) (FAT32 only be used) in the two-byte structure you value: 
Bits 0-3: Number of active FAT (start counting from 0, not 1) 
       only in the mirror when not in use Effective 
Bit 4-6: Reserved 
Bit 7:0 mean values ​​at runtime is mapped to all FAT FAT 
     FAT 1 value represents only one is active 
Bit 8-15: Reserved

0x2A 2 0x0000 File System Version (File ystem Version) FAT32 only use the high byte is the major revision number, and the low byte is the minor revision number. This field supports the FAT32 media types for future expansion. If this field is non-zero, the previous version of Windows will not support such a partition
0x2C 4 0x00000002 Root directory cluster number (Root Cluster Number) (use only FAT32) root of first cluster number. The value of the field is usually 2, but not always
0x30 2 0x0001 File system information sector number (File System Information SectorNumber) (use only FAT32) FAT32 partition reserved area of ​​the file system information (File System Information, FSINFO) the structure of the sector number. The typical value of 1. Keep a copy of the FSINFO structure in the backup boot sector (Backup Boot Sector), but this copy is not kept up to date
0x34 2 0x0006 Backup boot sector (FAT32 only use) is a non-zero value, this non-zero value indicates to save a copy of the boot sector of the partition reserved area sector number. The value of this field is generally 6, it is recommended not to use other values
0x36 12 12 bytes are 0x00 Reserved (for use FAT32) reserves space for future expansion use. The total value of this field is 0


Domain name: | | Telephone: +86-27-82621261
MRT data recovery website,provides professional HDD firmware repair and data recovery technical resources!
Copyright 2003-2014 Powered By MrtLab