= RTEMS File System = [[TOC(TBR/UserManual/RTEMS_File_System, depth=2)]] The RTEMS File System or RFS provides a fully featured file system that is fast and compact. The RFS interfaces to the [wiki:File_Systems#Block_Devices Block Devices API] and therefore supports all the block devices RTEMS has. It also interfaces to the RTEMS libc file system support layer. This means the POSIX interface to files in RTEMS is supported by the RFS file system. = RFS Structure = The RFS file system consists of superblock at the start followed by a series of groups. A group is a group of blocks.
{| border="1" cellpadding="5" cellspacing="0" |- ! style="background:#efefef;" | Superblock |- ! align="center" | Group |- ! align="center" | Group |}A group is broken up into the block allocation bitmap the inode allocation bitmap, the inodes, and the data blocks.
{| border="1" cellpadding="5" cellspacing="0" |- ! align="center' | Block Bitmap |- ! align="center" | Inode Bitmap |- ! align="center" | Inodes |- ! align="center" | Data Blocks |}The block bitmap contains a single bit for every block in a group. The default format is to allocate the size of a group based on the number of bits that fit into a single block. For example a block of 1024 bytes has 8,192 bits therefore a group can have 8192 blocks including the block bitmap block. The inode bitmap has a bit for ever inode in the group. An inode is the information about a node on the disk. A node is the data that links the elements of the disk together to create directories, files, and nodes. The number of inodes in a group is format configuration parameter. The default is use 1% of the disk's blocks for inode data. Again with a 1024 byte block size there are 18 inodes per block and 1448 inodes per group. = Using the RFS = The easiest way to use the RFS and to play with it is to enable the shell in your application. To do this add to the file that handles your {{{condefs.h defines: #define CONFIGURE_SHELL_COMMANDS_INIT #define CONFIGURE_SHELL_COMMANDS_ALL #define CONFIGURE_SHELL_MOUNT_RFS #define CONFIGURE_SHELL_DEBUGRFS #include