Files | |
file | fsfram.h |
FSFRAM Module for Modtronix TCP/IP Stack. |
NOTE: This file system is essential the same as the FSEE file system, with changes in implementation having been made to accomodate FRAM IO.
Reserved Block |
FSYS Header |
FAT Entry 1 |
............. |
FAT Entry n |
File 1 |
............. |
File n |
The length of "Reserved Block" is defined by FSFRAM_RESERVE_BLOCK. The reserved block can be used by the main application to store simple configuration values. FSFRAM storage begins with the "FSYS Header", which contains information about the File System type, length and other info. The format of the "FSYS Header" is shown in Figure 2.
FSYS Header Length (8 bits) | File System Identifier (8 bits) | File System Version (8 bits) | FAT Entries (16 bits) |
Following the "FSYS Header" is one or more "FAT Entries" (File Allocation Table), followed by the file data of each file. The "FAT entries" are always in alphabetic order, and all file names are in capitals. The "FAT entry" describes the file name, location and it's attributes. The format of the "FAT Entry" is shown in Figure 3.
Attributes (8 bits) | File Name (8-byte + 3-byte format) | Address (24 bits) | File Length (16 or 24 bits) |
The "Attributes" indicates whether the file is a normal file or a read only file.
Each FAT entry contains a 24-bit address value. This implies a maximum FSFRAM image size of 16 Mbytes.
FSFRAM uses "short" file names of the "8 + 3" format (8 bytes for the actual file name and 3 bytes for the extension, or NNNNNNNN.EEE). The 24-bit address gives the start of the first file data block. All file names are stored in upper case to make file name comparisons easier. All FAT entries are in alphabetical order to make finding a file faster.
The address in each FAT entry points in turn to a data block that contains the actual file data. The data block format is shown in Figure 3.
Data (variable length) |