Crate morpheus_persistent

Source
Expand description

Persistent Layer Management

This module handles bootloader self-persistence and data persistence.

§Architecture

The persistence system is divided into platform-neutral and platform-specific code:

§Platform-Neutral (core logic):

  • PE/COFF header parsing (DOS, PE, section tables)
  • Memory image capture
  • Storage backends (ESP, TPM, CMOS, HVRAM)

§Platform-Specific (arch modules):

  • x86_64: PE+ with IMAGE_REL_BASED_DIR64 relocations
  • aarch64: PE+ with ARM64-specific considerations
  • armv7: PE with 32-bit relocations (future)

§Critical Design Decision

This is the FIRST point where platform-specific code diverges. The relocation format is identical (PE base relocation table), but the semantics differ:

  • x86_64: Simple pointer fixups
  • ARM64: May involve instruction encoding (ADRP/ADD pairs)
  • ARM32: Thumb mode considerations

We use trait-based abstraction to keep the core agnostic.

Modules§

  • Memory image capture (Future API)
  • Visual feedback and logging for persistence operations
  • PE/COFF file format parsing
  • Persistence storage backends (Future API)