Principle of FAT file system 4

 

 * This field is desirable short file directory entry value 0FH, if you set the value 0FH, long filename directory section of the directory section

 

Description: 
    (1) This is the meaning of short FAT32 file format directory entry. Wherein the file name, extension name, time, date, and the algorithm when the same FAT16. 
    (2), the cluster number of addressable FAT32 to the binary number 32. So the system log file (folder) to start cluster address, they also need 32 to record, FAT32-enabled directory entry offset 0x12 ~ 0x13 to represent the 16 starting cluster number is high. 
    (3), the file size is still with four bytes, which shows still only support FAT32 file less than 4GB (directory), more than 4GB file (directory), the system will cut off treatment.

    An important feature is fully supported FAT32 long file names. Long file names are still recorded in the catalog entry. To lower version of the OS or the program can read long file names correctly, the system automatically all long file names created a corresponding short file name, so that the corresponding data can be addressed with a long file name is, you can also use the short file were addressed. Does not support long filenames OS or the program will ignore it considers illegitimate long file name field, and the OS supports long file names or program is explicitly named in the long term to document recording and editing, and hide from the short file names. 
    When creating a long file names, the system will automatically add the corresponding short file names, and some of its general principles: 
    (1), the first six characters to take the long file name plus "to 1" form short file name, extension unchanged. 
    (2), if the file name already exists, the symbol digit increments "~" after until 5. 
    (3) If the file name "~" followed by the number reaches 5, the short file name using only the first two letters long file names. Generate short file names by mathematical manipulation of the remaining letters long after the four-letter file name, then add the suffix "~ 1" until the last (if necessary, or other figures in order to avoid duplicate file names). 
    (4), if the character can not read the old OS or program exists, change the "_"

    Achieve long filename directory entry depends attribute byte offset 0xB when this byte attribute is: read-only, hidden, system, label, that is 0FH time, DOS and WIN32 think it it does not legitimate while ignoring its existence. This is the basis for long file names exist. The 0xB home directory entry for 0F, others just let the system defines, Windows9x or Windows 2000, XP typically support no more than 255 characters long file names. Long file name to the system 13 is cut in units of characters, each group occupying a directory entry. It may require more than one directory entry of a file each time long filename directory entries in descending order according to the table of contents, to prevent confusion with other file name. 
    Long filenames using unicode characters in the form of coding (a huge improvement oh), each character occupies two bytes of space. Its directory entry as defined in Table 15.

 

The table below shows the definition of 15 FAT32 long file directory entry 32 bytes
Byte offset 
(hexadecimal)
Byte count Definitions
0x0 1 Attribute Byte Bit Meaning 7 Unused reserved
6 1 indicates a directory entry last long file
5 Unused reserved
4 Numerical sequence number
3
2
1
0
0x1 ~ 0xA 10 ① long file names unicode code
0xB 1 Long filename directory entry signs, the value 0FH
0xC 1 Reserved
0xD 1 Check value (calculated in accordance with the short file names)
0xE ~ 0x19 12 ② long file names unicode code
0x1A ~ 0x1B 2 File start cluster number (currently always set to 0)
0x1C ~ 0x1F 4 ③ long file names unicode code

 

    System in the store long file names, always filled first by descending a long file name directory entry, and then followed by the corresponding short file name. As can be seen from Table 15, the long file name stored in the corresponding file does not start cluster, file size, time and date of the various properties. These attributes are stored in a file or a directory entry in the short file name, file name is always a long and short file names of their respective correspondence, short file name is not a long file names can also be read, but if there is no corresponding long file names The short file name, no matter what the system will ignore its existence. So short file names is essential. Does not support long filenames environment for short file names in the file name and extension fields for changes (including deleted because the first character is deleted rewrite E5H), will make the long file names useless. Contact long file names and short file names alone between maintaining the positional relationship between them is clearly not enough. Actually, 0xD checksum byte long filenames and play a very important role in this checksum character 11 is achieved by a short file name obtained by way of calculation. Systems based on the corresponding algorithm to determine the appropriate long file names and short file names match. This algorithm is not easy to explain using the formula we use to illustrate some c program. 
    Assuming the file name 11 characters string shortname [], calibration and use chknum said. Obtained as follows:

    int i, J, chknum = 0; 
    for (i = 11; i> 0; i -) 
        CHKSUM = ((1 & CHKSUM) 0x80: 0?) + (CHKSUM >> 1) + shortname [J + +];

    If the data offset by 0xD short filenames calculated checksum and long file names are not equal. The system will not in any way that they matched. 
    Based on long file names and file names short definition of directory entries, plus the number of clusters and links, FAT32 on the read data will be getting.

 
Domain name: www.mrtlab.com | | Telephone: +86-27-82621261 | Terms of use
MRT data recovery website,provides professional HDD firmware repair and data recovery technical resources!
Copyright 2003-2019 Powered By MrtLab