FreeRTOS+FAT stores information that is common to all media types in a structure of type FF_Disk_t. The FF_Disk_t structure can be extended by the developer of the media driver so it includes additional information that is specific to the media in use.
The FF_Disk_t structure references an object called an input/output manager (IO Manager, or simply IOMAN). The IO manager is responsible for, amongst other things, buffering and caching both file and directory information.
The mechanism for actually reading data from and writing data to the media is dependent on the media type. Therefore the developer of the media driver must provide suitable read and write functions.
Many media drivers will themselves make use of a peripheral driver in order to perform the actual read and write operations. For example, if the media is an SD card then it might be necessary to access the card through an SPI peripheral. A peripheral driver is not necessary when implementing a RAM disk, as RAM can be read from and written to using the standard C library memcpy() function.
Some media types also require higher level management logic to perform actions such as bad block management, or wear levelling.
A media driver requires [at least] three functions.
Click each item above for more information, and to see a worked example.
FreeRTOS+FAT implements a virtual file system in which the mounted partition must be registered, after which it will appear as a directory in the embedded file system's root directory.