Subject: Re: PR #2187 (msdosfs)
To: Mike Long <mikel@shore.net>
From: Trevin Beattie <trevin@xmission.com>
List: current-users
Date: 09/28/1997 07:35:09
At 03:52 am 9/28/97 -0400, Mike Long wrote:
>I've been avoiding 2187 because (1) I don't have any references for
>Lose95's extensions of the MSDOS file system and (2) I can't test the
>fix.  I'm sure most of the other developers have similar issues,
>instead of an issue with the patch itself (but I can't speak for them).

This is where the Norton Utilities came in handy (again!) for me: the
user's guide has a chapter on the logical FAT16 format, including
descriptions of the standard directory entries and the LFN entries.  Here's
a copy of the SFN:

>>>>
Short Name Format

Before the release of Windows 95, all directory entries used what is now
known as the short name format.  Three types of directory entries use this
format:

* File
* Subdirectory
* Volume label

Figure 3-9 provides an example of each of these types of directory entries.

Name     .Ext  ID        Size      Date      Time   Cluster  76ARSHDV
IO       DOS   File       40566   9-30-93   6:20 am      2     ARSH--
MSDOS    DOS   File       38138   9-30-93   6:20 am      4     ARSH--
COMMAND  DOS   File       54619   9-30-93   6:20 am      6     AR----
IDE 1 GB       Vol            0   4-26-95   7:34 pm      0     A----V
DOS            Dir            0   4-19-95  10:37 pm      9     ----D-
\ 0-7 -/\8-10/       \ 28-31 -/  \24-25 /  \22-23 / \26-27/  \- 11 --/

NT   Create Date   Create Time  Accessed  EA
  0    0-00-80    12:00.000 am   5-31-95     0
  0    0-00-80    12:00.000 am   5-31-95     0
  0    0-00-80    12:00.000 am   5-31-95     0
  0    4-26-95     7:34.192 pm   4-26-95     0
  0    0-00-80    12:00.000 am   5-31-95     0
\12/ \- 16-17 -/ \14-15/\13/    \18-19 / \20-21/     <-- Byte Position

Every directory entry is exactly 32 bytes long.  (If you look at the row
labeled "Byte Position" in Figure 3-9, you can see that all three types of
entries end at 31, and when counting from 0 that makes 32 bytes.)  Here's a
brief summary of the directory entry fields in Figure 3-9.

Byte		Field Name		Description
position
0-7		Filename		Name given to the entry.
8-10		File extension	File type identifier.  Examples of common
					file extensions are TXT, DOC, and EXE.
11		File Attributes	Special properties of the entry, as
					explained in a separate section.
12		NT attribute	Reserved for use by Windows NT.
13		Creation time	Milliseconds (thousandths of a second)
		(msec)		after the minute the entry was created.
					This field is combined with the previous
					one to provide a higher time resolution.
14-15		Creation time	Time the entry was created.  This field is
					accurate to the minute.
16-17		Creation date	Date the file was created.
18-19		Last access date	Date that the file was last accessed, either
					for reading or for writing.
20-21		Extended attribute OS/2 field that points to other information
					about files, such as their icons and
					configuration information.  Also called the
					EA handle, this field provides
					compatibility with OS/2.
22-23		Modified time	Time that the file was last modified.
24-25		Modified date	Date that the file was last modified.
26-27		Starting cluster	The first cluster in the FAT chain for a file
					or subdirectory.  When retrieving a file or
					subdirectory, the operating system must
					first find this cluster so that the FAT chain
					for the file can be traversed.
28-31		File size		Number of bytes contained in the file.
<<<<<

Note: after some experimentation and testing with Norton Disk Doctor, it
seems the creation time (msec) field is actually (msec % 200), because any
value >=200 is considered an error.

If you want the section on the LFN, I can copy that for you too; I don't
think it's relevant to this PR.

As for point (2), I'm sure there are plenty of people in NetBSD's user base
who have Windoze 95 and could test the fix on the i386 port, if you can
provide the testing procedures (or script file).  However, we probably
should also have testers for OS/2 and Windows NT, as well as people using
other ports besides i386 (using floppies, perhaps?)  I don't know how
common those are.

---digression---

Just as an aside on a related topic, is there any planned support for the
new FAT32 filesystem used by Windows 95 OSR2?  Is there even a big enough
demand for it?  (Before anybody asks: no, I don't have any documentation on
FAT32.)

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown