Thanx
Michal
Byt the time you do the research in order to answer these questions,
you will know how to do it. It is not for the faint of heart.
--
Arargh (at arargh dot com) http://www.arargh.com
To reply by email, change the domain name, and remove the garbage.
(Enteract can keep the spam, they are gone anyway)
Try the official FAT documentation from Microsoft, which can be found at
http://www.singlix.com/trdos/v1vlla89.pdf
================ Start of Excerpt ================
Page 13 - FAT Data Structure
The next data structure that is important is the FAT itself. What this data
structure does is define a singly linked list of the "extents" (clusters) of
a file. Note at this point that a FAT directory or file container is nothing
but a regular file that has a special attribute indicating it is a
directory. The only other special thing about a directory is that the data
or contents of the "file" is a series of 32=byte FAT directory entries (see
discussion below). In all other respects, a directory is just like a file.
The FAT maps the data region of the volume by cluster number. The first data
cluster is cluster 2.
The first sector of cluster 2 (the data region of the disk) is computed
using the BPB fields for the volume as follows. First, we determine the
count of sectors occupied by the root directory:
RootDirSectors = ((BPB_RootEntCnt * 32) + (BPB_BytsPerSec - 1)) /
BPB_BytsPerSec;
Note that on a FAT32 volume the BPB_RootEntCnt value is always 0, so on a
FAT32 volume RootDirSectors is always 0. The 32 in the above is the size of
one FAT directory entry in bytes. Note also that this computation rounds up.
The start of the data region, the first sector of cluster 2, is computed as
follows:
If(BPB_FATSz16 != 0)
FATSz = BPB_FATSz16;
Else
FATSz = BPB_FATSz32;
FirstDataSector = BPB_ResvdSecCnt + (BPB_NumFATs * FATSz) + RootDirSectors;
NOTE: This sector number is relative to the first sector of the volume that
contains the BPB (the sector that contains the BPB is sector number 0). This
does not necessarily map directly onto the drive, because sector 0 of the
volume is not necessarily sector 0 of the drive due to partitioning.
Given any valid data cluster number N, the sector number of the first sector
of that cluster (again relative to sector 0 of the FAT volume) is computed
as follows:
FirstSectorofCluster = ((N - 2) * BPB_SecPerClus) + FirstDataSector;
NOTE: Because BPB_SecPerClus is restricted to powers of 2 (1,2,4,8,16,32..),
this means that division and multiplication by BPB_SecPerClus can actually
be performed via SHIFT operations on 2s complement architectures that are
usually faster instructions than MULT and DIV instructions. On current Intel
X86 processors, this is largely irrelevant though because the MULT and DIV
machine instructions are heavily optimized for multiplication and division
by powers of 2.
================ End of Excerpt ================
================ Start of Excerpt ================
Page 22 - FAT Directory Structure:
We will first talk about short directory entries and ignore long directory
entries for the moment.
A FAT directory is nothing but a "file" composed of a linear list of 32-byte
structures. The only special directory, which must always be present, is the
root directory. For FAT12 and FAT16 media, the root directory is located in
a fixed location on the disk immediately following the last FAT and is of a
fixed size in sectors computed from the BPB_RootEntCnt value (see
computations for RootDirSectors earlier in this document). For FAT12 and
FAT16 media, the first sector of the root directory is sector number
relative to the first sector of the FAT volume:
FirstRootDirSecNum = BPB_ResvdSecCnt + (BPB_NumFATs * BPB_FATSz16);
For FAT32, the root directory can be of variable size and is a cluster
chain, just like any other directory is. The first cluster of the root
directory on a FAT32 volume is stored in BPB_RootClus. Unlike other
directories, the root directory itself on any FAT type does not have any
date or time stamps, does not have a file name (other than the implied file
name "\"), and does not contain "." and ".." files as the first two
directory entries in the directory. The only other special aspect of the
root directory is that it is the only directory on the FAT volume for which
it is valid to have a file that has only the ATTR_VOLUME_ID attribute bit
set (see below).
================ End of Excerpt ================
> Try the official FAT documentation from Microsoft, which can be found
> at http://www.singlix.com/trdos/v1vlla89.pdf
The link doesn't work, but this works:
http://bad.caltech.edu/~iryll/ee5x/fs/V1VLLA89.pdf
BTW: I'm searching such a good documentation for NTFS. There is some
documentation about it in the Linux NTFS project, but many detailed
information are missing.
--
Frank Bu_, f...@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
...and, unfortunately, that will continue to be the case because of patent
and licensing restrictions. NTFS is complicated, proprietary, and fluid.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
I guess that they moved it. After all, I got it in the beginning of
February.
>
> BTW: I'm searching such a good documentation for NTFS. There is some
> documentation about it in the Linux NTFS project, but many detailed
> information are missing.
I'll see what I can find.
One overview is http://www.executive.com/whats-new/whitepaper.asp
There's also
http://searchwin2000.techtarget.com/whitepapersByCategory/0,293837,sid1_tax2
92941_idx0_off10,00.html
I guess that they moved it. After all, I got it in the beginning of
February.
>
> BTW: I'm searching such a good documentation for NTFS. There is some
> documentation about it in the Linux NTFS project, but many detailed
> information are missing.
One overview is http://www.executive.com/whats-new/whitepaper.asp
There's also http://tinyurl.com/8bz9 (which is
http://searchwin2000.techtarget.com/whitepapersByCategory/0,293837,sid1_tax2
92941_idx0_off10,00.html )
> There's also
> http://searchwin2000.techtarget.com/whitepapersByCategory/0,293837,sid1
> _tax2 92941_idx0_off10,00.html
You have to register before you can read this article. I've tried, but
after spending some time for the register form and hitting the "submit"
button, the next page could not be found, so forget it.
With the title I've found another interesting page, where you can read this
article (and some more) without previous registration:
http://www.techtutorials.info/win2kfs.html
But there is no (free) detailed specification, I think. Perhaps you could
write your own, if you collect all information from all documents, but I'm
sure there will be many errors.
They want to know too much.
>
> With the title I've found another interesting page, where you can read
this
> article (and some more) without previous registration:
>
> http://www.techtutorials.info/win2kfs.html
>
> But there is no (free) detailed specification, I think. Perhaps you could
> write your own, if you collect all information from all documents, but I'm
> sure there will be many errors.
>
Well, anyway, the best I could find at the moment is
http://linux-ntfs.sourceforge.net/ntfs/help/layout.html
Though, it's got some urgent todos.
--
No problem is so formidable that you can't just walk away from it.
-- C. Schulz