TargetBFS™ Boot File System
TargetBFS is a minimal flash file system intended for use in boot loaders. It allocates blocks of flash memory using extents and so is able to manage large volumes using a very small RAM footprint. It is ideal for storing executable code and FPGA bitstreams.
Features
Simple API for boot loader applications. Supports dynamic creation and deletion of files, with full read and write capability, and seeking within files.
New files do not persist unless written and closed, meaning all files found at start-up must have been opened, written, and closed successfully, and therefore have valid contents.
Supports ‘update’ open mode which guarantees that if a reset occurs before the file is written and closed, the file has its original contents at the next start up. The new contents replace the old only if the close call completes successfully.
Guaranteed file system integrity across unexpected shutdowns. Only data written to an open file can be lost. Closed files and files open for reading are never at risk.
Extremely fast initialization/mount time.
TargetBFS’s advantages come with these restrictions:
- Directory hierarchies are unsupported. All files share a single directory.
- Only one file may be open at a time.
- Zero-length files are not allowed. They are automatically deleted.
- The maximum number of files is set at compile-time and cannet exceed the number of erasable flash blocks.
- File memory allocations are done in units of whole erasable flash blocks.
Reduces metadata size by allocating flash memory via extents (block number and run length). Files normally use few extents, but repetitive ‘perverse’ sequences of file creation and deletion can grow them. TargetBFS monitors extent list size and performs just-in-time defragmentation as needed.
Flash memory use moves sequentially through the flash address range as writes occur, performing static program-erase wear leveling. No data is re-written to the same location until after all other flash blocks have been used.
Optionally supports one special file whose data is only written to consecutive reserved blocks at the beginning of flash memory. Intended for boot code installation.
Simple configuration using #defines in an external include file.
Recovers dirty flash blocks using just-in-time garbage collection.
TargetBFS volumes can share the same flash device as TargetXFS™ volumes and be accessed by both boot loader and application code.
Supports parallel and serial NAND and NOR flash devices including Single Level Cell (SLC), Multi-Level Cell (MLC), ‘Write Once’ NOR flash, and other variants.
Well documented driver interface for NAND and NOR. Includes sample flash drivers and a test program proven useful for detecting both driver software and interface hardware errors.
I/O errors during operation are gracefully reported to the application.
Developed using TargetOS-Lite™, Blunk’s free RTOS. Easily ported to other RTOSes or used in polled mode, without a kernel.
Source code is 100% Standard C and has been tested using PC-lint and multiple Standard C compilers, including GCC.
Royalty-free license. Includes complete source code, sample applications, sample drivers, user’s manual, and one year of technical support. Electronic delivery via customer-specific web portal.