Changes between Version 2 and Version 3 of Ticket #77, comment 3


Ignore:
Timestamp:
Oct 2, 2018, 3:00:49 AM (6 years ago)
Author:
Valery V. Sedletski

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #77, comment 3

    v2 v3  
    55DirCluster is a start cluster of a directory. RootDirStrtClus is a DirCluster of a root directory. Yes, on FAT32, it is usually 2, which means that it usually follows FAT (the very first cluster). Cluster numbers 0 and 1 are reserved. On FAT12/FAT16, root directory starts right after last FAT, too. But here, root dir belongs to a reserved area, which has not assigned any cluster number. Cluster 2 immediately follows the root directory. In fat32.ifs, each directory is specified by its DirCluster. So, to accomodate FAT root dir case, I assigned it a special "fake" value 1. So, directory is FAT root directory if and only if its DirCluster == 1. So, each directory has its dir cluster, including FAT root dir.
    66
    7 It can fail to match if the directory is not a root one. So, I add "." and ".." to root dirs only. They have ulDirCluster == pVolInfo->BootSect.bpb.RootDirStrtClus. pVolInfo->BootSect.bpb.RootDirStrtClus == 2 on FAT12/FAT16, on FAT32 it is usually 2. And on exFAT, it is usually 5 or 6 (they follow an Allocation bitmap and UpCase table, which have lesser cluster values).
     7It can fail to match if the directory is not a root one. So, I add "." and ".." to root dirs only (though, It looks like I need to add "." and ".." to non-root dirs for exFAT too). They have ulDirCluster == pVolInfo->BootSect.bpb.RootDirStrtClus. pVolInfo->BootSect.bpb.RootDirStrtClus == 2 on FAT12/FAT16, on FAT32 it is usually 2. And on exFAT, it is usually 5 or 6 (they follow an Allocation bitmap and UpCase table, which have lesser cluster values).
    88
    99And yes, clusters always relate to a partition, not a whole disk. Whole disk has sectors, only. Cluster is a FAT concept. HPFS has no clusters, for example. It has sectors. And JFS is divided to blocks of 4 KB, which aren't called clusters. So, the notion of cluster is not defined outside FAT and only FAT partitions are divided to clusters.