This is an old revision of the document!


I'm working on the msdosfs driver for [:SummerOfCode2007:Summer of Code 2007], and am being mentored by [:KonstantinBelousov:Konstantin Belousov].

The following are snippets that Konstantin has managed to gather for me about my project.

  • Consolidate FAT data structure definitions. From Poul-Henning Kamp:
> I have en ancient entry in my TODO list that says that we have
> the FAT filesystem data structures defined three places in our
> source tree, and that one should be enough.
>
> For the life of me, I can't remember what the third place is,
> but the first two must be:
>         fsck_msdosfs
>         sys/fs/msdosfs
>
> For some reason, I think mksdos_fs is not the third one, it could
> possibly be geom_label, but I'm not sure.
  • Creating a fsck for msdos. From Pedro F. Giffuni:
> Yet another idea, but this I recall as more important, from the days I used
> FAT: it would be really nice to have an fsck (chkdsk) utility on FreeBSD. There
> is a GPL'd example here:
>
> http://users.telenet.be/imre/FreeDOS/
  • fsck does not call fsck_msdos.
  • WFM. fsck properly calls fsck_msdos if /etc/fstab has the map between the device and the filesystem. fsck also properly calls fsck_msdosfs if explicitly told to by the -t switch.
  • Original post follows:
> Are you aware of /sbin/fsck_msdos ? I think that it may require improvements,
> but nonetheless, it is there.
>

Aha!! I think I tried the normal fsck and was expecting it should know which
fsck_* to call ... but it didn't so I thought it was not there at all. Those
utilities are usually very tricky as they tend to break things depending on the
OS you are using: if they don't break EAs they will break long names.

For some reason your email address got filtered as spam, so if you answered the
FAT EA stuff.. I probably lost it. Of course .. it's not important, just good
to know such a thing existed.
  • Implementing Extended Attributes. A snipplet sent by Pedro, from a OS/2 handbook:
EXTENDED ATTRIBUTES IN THE FAT FILE SYSTEM

OS/2 supports Extended Attributes (EAs) in the FAT filesystem, as well as in the HPFS file system. EAs can be composed of up to 64 KB of data relatied to the file. Because of the potential size of these EAs, they cannot be stored in a file's directory entry.

OS/2 uses reserved space in each file's directory entry to contain pointers to the EAs. The EAs themselves are stored in your root directory in a file called EA_DATA_SF, which has Hidden, System, and Read Only attributes. Note that the file EA_DATA_SF has two blank spaces represented here by the underscore characters (_) for clarity. DOS and DOS applications do not recognize filenames with embedded blank spaces because the blank is not a valid file-name character in DOS. The blank character is a valid filename in OS/2, however, even on a FAT drive.

More details:
http://www.tavi.co.uk/os2pages/eadata.html
  • Investigate how Darwin accepts a broader range of FAT volumes (Robert Watson)
It turns out that quite a bit of our historical sanity checking on msdosfs is
too conservative when applied to the highly diverse set of FAT file systems in
the field.  I think it would be useful for someone(tm) to compare the sanity
checks in our version of msdosfs and the checks in the Darwin version and see
what they've had to remove.
  • Making the driver SMP-friendly by identifying the structures to sleep on and killing all references to the GIANT LOCK.

  • brianchu.1183699793.txt.gz
  • Last modified: 2007/07/06 05:29
  • by BrianChu