File system drivers can be loaded in two different ways: loaded in response to a disk being attached to the system (discovered during boot or after media insertion), and auto-loaded during the boot sequence.
Auto-Loaded File Systems
Auto-loaded file systems are monolithic file systems that do not use on an underlying disk driver to read and write sectors. A good example of an auto-loaded file system is a network file system driver, which would rely on network protocols rather than on a disk to for I/O. Another example might be a monolithic flash file system where flash I/O routines are statically built into the FSD.
The installation of auto-loaded file systems during the boot sequence is driven by registry keys. An auto-load registry key would look like this:
The following table explains each of the values shown above:
Provides the name of the FSD Dll to be loaded.
Describes the name of a utility/helper Dll that provides format, scan, and/or defragment functions for the file system.
Specifies the order in which the FSD should be loaded relative to other auto-load file systems in the same boot phase. Lower order numbers will cause the FSD to load earlier. If this value is not specified, the FSD will be loaded last.
Set to either 0, 1 or 2, this value tells the storage manager the boot phase in which to load the driver. If no boot phase is specified, the driver will be loaded during boot phase 1.
Currently set to either 0 or 1. If set to 1, the FSD will be loaded synchronously. If set to 0, the FSD will be loaded asynchronously. FSDs loaded during boot phases 0 or 1 must be loaded synchronously.
Specifies whether or not the FSD should support demand-paging for memory mapped files. By default, paging will be supported if this value is not specified in the registry.
Additional file system specific registry values should be placed under this same key. These values can be read by the FSD using the FSDMGR_ registry helper functions (described above).
Partition-Backed File Systems
File system drivers that are instantiated in response to a storage device being mounted load in response to the type of the partition being mounted. The partition type is a single byte value that is specified when the partition is created. The mapping between a partition type byte and a file system is provided in the registry under the PartitionTable key. The following is the default partition table provided by Microsoft in common.reg:
The partition table associates a byte value partition type with a file system string. For example, byte value 0x04 is mapped to the file system string “FATFS.” The settings for this partition, then, are located under the registry sub-key with the name “FATFS”:
An OEM may add or modify the partition table provided in common.reg to accommodate new file systems. For example:
A file system key would also be necessary in order to map the new file system to an appropriate Dll and settings:
Additionally, the partition table and file system settings can be overridden on a per-profile basis. Typically, storage/block drivers report a storage profile name to the storage manager (via the IOCTL_DISK_DEVICE_INFO control code) when a storage device is loaded. This profile string can be used to map specific file system and/or partition table settings to a particular storage device or class of storage device.
For example, if a storage driver reports is profile name as “Sample” the following registry key will override the base settings for the “MYFSD” file system:
Values that are not explicitly overridden for the profile will be loaded from the base key, in this case HKLM\System\StorageManager\MYFSD. The same applies for file system specific settings read using the FSDMGR_ registry helper functions; these functions will always check both the profile file system key and base file system key for the value.
In some cases, it may be desirable to modify the default partition table for a certain storage profile. This can be done by adding a profile-specific partition table to the registry:
The above example overrides the default value for partition type 0x04 from FATFS to MYFSD. This modification only applies to storage devices reporting a profile name of “Sample.”