On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTFiles-32 Programming Manual
Introduction
Terms and Definitions
The FAT File System Structure
The ISO 9660 File System Structure
The exFAT File System Structure
RTFiles-32 in Embedded Applications
RTFiles-32 APIs
Configuring RTFiles-32
Demo Programs
Advanced Topics
RTFiles-32 Reference Manual
RTIP-32
RTPEG-32
RTUSB-32
|
Introduction
RTFiles-32 is a FAT-12/16/32, exFAT, and ISO 9660 compatible file system for embedded systems. It allows embedded systems to access files on mass storage devices such as floppy disks, hard disks, CD-ROMs and DVDs which can be shared with MS-DOS, Windows, or any other operating system which supports FAT, exFAT or ISO 9660 disk volumes.
RTFiles-32's documented device driver structure allows it to be ported to many different environments and storage media. Device drivers for commonly used devices are included. Custom drivers can easily be added.
The main features of RTFiles-32 are:
- Unlimited Number of Files
RTFiles-32 can handle as many open files as required by the application. Only about 300 bytes of RAM are required for each open file.
- Up to 32 Logical Drives
RTFiles-32 easily handles many physical or logical drives.
- Supports FAT-12, FAT-16, and FAT-32
RTFiles-32 supports the same FAT (File Allocation Table) formats as MS-DOS, Windows, and many other systems. Media can be shared between RTFiles-32 and other operating systems to exchange data.
- Supports exFAT
RTFiles-32 supports the improved variation of the FAT file systems to support larger disks and files.
- Supports ISO 9660 File Systems
RTFiles-32 supports the standard format used for data CD-ROMs and DVDs. Extensions to the ISO 9660 standard such as 9660-Relaxed or Joliet are supported. Most UDF volumes also contain an ISO 9660 directory tree and are thus also supported.
- Support for Super Floppy, MBR, and GPT Partition Tables
RTFiles-32 supports all commonly used partition schemes.
- Long File Name Support
On all three FAT types, exFAT, and ISO 9660, file names with up to 255 characters are allowed.
- UTF-8 Support
Through UTF-8 encoded file names, RTFiles-32 supports all 16-bit Unicode character values in file names, including Cyrillic, Japanese, Chinese, and other Far East languages.
- Supports Diskettes, Flash, SRAM Cards, Hard Disks, USB Disks, SD (Secure Digital) Memory Cards, CD-ROMs, DVDs
RTFiles-32 supports diskette drives and media with 360k, 1.2M, 720k, 1.44M, and 2.88M capacity. IDE/ATA/SATA disks with CHS (Cylinder, Head, Sector) or LBA (Logical Block Addressing) interfaces as well as IDE and DiskOnChip flash disks are supported. USB disks and memory sticks are supported in conjunction with the On Time USB host protocol stack RTUSB-32. SD (Secure Digital) Memory cards including SDSC, SDHC, and SDXC (Standard, High, eXtended Capacity) are supported on PCI SD Card host controllers. CD-ROMs and DVDs can be used on IDE-ATAPI interfaces. Adding custom drivers is easily accomplished through RTFiles-32's documented device driver interface.
- Supports Removable Devices and Hot Swapping
Floppy disks, removable hard disks (e.g., disks in PCMCIA sockets), USB devices, SD cards, and CDs/DVDs can be removed and reinserted while an application is running. Devices are automatically remounted as needed. Critical error handling support is available to handle disk removal of devices in use.
- Supports Multiword- and Ultra-DMA Transfer Modes
IDE/ATA/SATA disks and ATAPI CD/DVDs are automatically operated in the highest DMA mode supported by the disk and host controller.
- Supports Hard Disks with Unlimited Size
The latest standards (such as 48 bit LBA) for extended sector addressing are supported.
- Supports File Sizes up to 1 Terabytes (unlimited on exFAT)
RTFiles-32 can manage very large files.
- Support for Contiguous Files
RTFiles-32 can preallocate files to reside in a single contiguous chain of sectors. In this way, it can be guaranteed that no extra seek operations are required for contiguous read or write operations. Thus, the application can rely on achieving the maximum possible data throughput for such files.
- Efficient Cache Support
RTFiles-32 will cache frequently accessed data such as a volume's FAT or directories. The application has full control over the size of the cache and how delayed write operations should be handled. Large data blocks being read or written contiguously are not cached to avoid cache thrashing.
- Extensive Diagnostics Support
RTFiles-32 has functions to query the state of its cache in great detail. For each file or for a complete volume, the degree of fragmentation can be enquired. A disk-check function is supplied to detect and fix FAT file system errors in unattended embedded applications.
- Native API
RTFiles-32 has its own native API consisting of about 85 functions. The native API is best suited for optimal performance and control.
- Win32 Compatible API
If used with RTTarget-32, RTFiles-32 emulates about 30 file I/O related Win32 functions. Thus, existing Win32 applications accessing files can be supported without source code modifications.
- C/C++ and Pascal Run-Time System Support
Through RTFiles-32's Win32 API emulation, all file I/O functions of the respective run-time systems are fully supported. C functions such as fopen, fread, fprintf, etc., work unmodified with RTFiles-32. The same is true for C++ classes such as iostream.
- Multitasking Support
When RTFiles-32 is used with a multitasking system such as On Time's RTKernel-32, all RTFiles-32 operations contain appropriate locking to support simultaneous calls from several tasks. Simultaneous access to different devices is fully supported (e.g., one task reads from a hard disk while another writes to a diskette). I/O device wait times are made available to other tasks by blocking the waiting tasks at a semaphore until the device I/O completion is signalled by an interrupt.
- Low Interrupt Latencies
Although RTFiles-32's device drivers are interrupt-driven, they never disable interrupts and do not process data transfers in interrupt handlers.
- Installable Device Drivers
RTFiles-32's device driver interface is very simple. Only three non-trivial functions are required to access a device: MountDevice, ReadSectors, and WriteSectors. All drivers shipped with RTFiles-32 come with complete source code which can be used as a model to implement custom drivers.
- Installable System Drivers
RTFiles-32 needs only a few functions of the underlying operating system (e.g., to install interrupt handlers or to set/reset semaphores, etc.). RTFiles-32 comes with system drivers for RTTarget-32 and/or RTKernel-32. These drivers are shipped with complete source code.
Terms and Definitions
The FAT File System Structure
|