RTEMS  5.0.0
Files | Data Structures | Macros | Functions
FAT Filesystem Support

FAT file system configuration support, format and mount options. More...

Files

file  dosfs.h
 Application Interface to FAT Filesystem.
 
file  msdos_conv_default.c
 Default Converter.
 
file  msdos_conv_utf8.c
 UTF-8 Converter.
 

Data Structures

struct  rtems_dosfs_mount_options
 FAT filesystem mount options. More...
 
struct  msdos_format_request_param_t
 FAT file system format request parameters. More...
 

Macros

#define RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE   1
 Semaphore count per FAT filesystem instance. More...
 
#define MSDOS_FMT_INFO_LEVEL_NONE   (0)
 
#define MSDOS_FMT_INFO_LEVEL_INFO   (1)
 
#define MSDOS_FMT_INFO_LEVEL_DETAIL   (2)
 
#define MSDOS_FMT_INFO_LEVEL_DEBUG   (3)
 

Functions

rtems_dosfs_convert_controlrtems_dosfs_create_default_converter (void)
 Allocates and initializes a default converter. More...
 
rtems_dosfs_convert_controlrtems_dosfs_create_utf8_converter (const char *codepage)
 Allocates and initializes a UTF-8 converter. More...
 
int msdos_format (const char *devname, const msdos_format_request_param_t *rqdata)
 Formats a block device with a FAT file system. More...
 

Detailed Description

FAT file system configuration support, format and mount options.

A block device can be formatted with a FAT file system with the msdos_format() function.

The FAT file system mount operation can be controlled with FAT file system specific mount options, see rtems_dosfs_mount_options.

Macro Definition Documentation

◆ RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE

#define RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE   1

Semaphore count per FAT filesystem instance.

This can be used for system configuration via <rtems/confdefs.h>.

Function Documentation

◆ msdos_format()

int msdos_format ( const char *  devname,
const msdos_format_request_param_t rqdata 
)

Formats a block device with a FAT file system.

Parameters
[in]devnameThe block device path.
[in]rqdataThe FAT file system format request data. Use NULL for default parameters.
Return values
0Successful operation.
-1An error occurred. The errno indicates the error.

◆ rtems_dosfs_create_default_converter()

rtems_dosfs_convert_control* rtems_dosfs_create_default_converter ( void  )

Allocates and initializes a default converter.

This default converter will accept only POSIX file names with pure ASCII characters. This largely corresponds to the file name handling before the optional UTF-8 support was added to the RTEMS implementation of the FAT file system. This handling is mostly backwards compatible to the previous RTEMS implementation of the FAT file system.

For backwards compatibility and the previous RTEMS implementation of the FAT file system please see also rtems_dosfs_mount_options and mount().

Return values
NULLSomething failed.
otherPointer to initialized converter.

◆ rtems_dosfs_create_utf8_converter()

rtems_dosfs_convert_control* rtems_dosfs_create_utf8_converter ( const char *  codepage)

Allocates and initializes a UTF-8 converter.

This converter will assume that all file names passed to POSIX file handling methods are UTF-8 strings and will convert them to the selected code page for short file names and to UTF-16 for long file names. This conversion will be done during reading and writing. These conversions correspond to the specification of the FAT file system. This handling is mostly backwards compatible to the previous RTEMS implementation of the FAT file system.

For backwards compatibility and the previous RTEMS implementation of the FAT file system please see also rtems_dosfs_mount_options and mount().

One possible issue with this converter is: When reading file names which have been created with other implementations of the FAT file system, it can happen that during the conversion to UTF-8 a long file name becomes longer and exceeds the 255 bytes limit. In such a case only the short file name will get read.

Parameters
[in]codepageThe iconv() identification string for the used code page.
Return values
NULLSomething failed.
otherPointer to initialized converter.