How nasa/eefs works
Project Type and Purpose
• This is an embedded file system project designed for memory devices like EEPROM (and similar non-block oriented memory such as RAM or ROM). It’s intended to be used in embedded systems running OSes like vxWorks and RTEMS or even in environments without an OS.
• The project allows creation of a file system image on a host development machine, which can then be burned into a target—making it ideal for bootloaders or embedded applications with minimal code footprint (e.g., using the “microeefs” interface).
Analysis of the File Structure
• Top-level directories include:
• README.md – Provides a high-level overview.
• doc – Contains design and planning documents (e.g., EEPROM File System Design Notes).
• drivers – Contains OS-specific drivers. Note the three subdirectories:
▪ rtems_driver – Implements driver logic for RTEMS.
▪ standalone_driver – Provides an API for systems with no file system.
▪ vxworks_driver – Contains driver source for vxWorks.
• inc – Contains header files that define common types, configuration options, API functions, and the version information.
• libraries – Holds core libraries implementing the actual file system logic:
▪ eepromfs – Primary implementation for the EEPROM file API.
▪ microeefs – A lightweight interface for quick, single-function file lookups (ideal for bootloaders).
▪ page_window – Likely abstracts low-level EEPROM memory handling.
• tools – Contains utility programs for preparing or managing EEFS images:
▪ eefstool – Contains a complete toolset (with Makefiles, source code, and header files) to generate or manipulate EEFS images.
▪ geneepromfs – A similar tool that includes command-line options, configuration, and a parser to generate file system images.
Main Components and Their Roles
a. Embedded File System Core:
• Libraries such as eepromfs, microeefs, and page_window represent the “heart” of the file system. They implement the logic to interact with the EEPROM memory.
b. Drivers:
• OS/platform-specific drivers under the drivers/ directory ensure that the file system can interface with diverse environments (RTEMS, vxWorks, and standalone setups).
c. Development Tools:
• Tools such as eefstool and geneepromfs are used on a host system to generate, manage, and test the file system images.
d. API and Configuration:
• The inc directory holds the interface definitions, system configurations, and versioning information vital for both the library functions and driver implementations.
e. Documentation:
• The doc directory (including design notes) supports understanding and maintaining the internal architecture and design decisions.
Relationships and Interactions
• The Drivers components (RTEMS, vxWorks, Standalone) interface with the EEFS core libraries (which include the eepromfs logic and, optionally, the microeefs lookup routine).
• The Tools (eefstool and geneepromfs) use the same core libraries (or perhaps closely mimicked APIs) to prepare file system images during development.
• The “inc” directory and configurations are cross-cutting, providing a common API layer used by both the drivers and tools.
• That while the drivers are responsible for runtime file system operations on the actual target hardware, the tools operate during development to build a complete image that is then "burned" into the device.
Architectural Patterns / Design Principles
• Modular design: The separation of drivers, libraries, and tools denotes a modular approach that allows each component to be modified or replaced independently.
• Platform abstraction: By having different driver implementations (RTEMS, vxWorks, Standalone), the system abstracts the underlying hardware/OS specifics from the core file system functionality.
• Lightweight interface for bootloaders: The microeefs interface specifically caters to minimal code size and fast lookup—a key attribute in bootstrapping environments.
Customization Based on Project Type
• The separation and interaction between the host-side tools and target-side drivers.
• How the core libraries are platform-independent and are used across different environments.
• The “microeefs” interface as a special pathway for bootloader integration.