1 / 16

Storage Abstractions in TinyOS 2.x

Storage Abstractions in TinyOS 2.x. Jonathan Hui jwhui@cs.berkeley.edu University of California, Berkeley. David Gay dgay@acm.org Intel Research, Berkeley. Non-Volatile Storage. Flash storage becoming more widely used “Mass” data storage logging sensor data network programming

elaina
Télécharger la présentation

Storage Abstractions in TinyOS 2.x

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Storage Abstractionsin TinyOS 2.x Jonathan Hui jwhui@cs.berkeley.edu University of California, Berkeley David Gay dgay@acm.org Intel Research, Berkeley TinyOS Technology Exchange

  2. Non-Volatile Storage • Flash storage becoming more widely used • “Mass” data storage • logging sensor data • network programming • event logging for debugging • Configuration data that survives • power-failure • reprogramming TinyOS Technology Exchange

  3. Flash Storage Variety • STMicro M25P (NOR) • Telos rev. B, Eyes 1 • Intel StrataFlash (NOR) • iMote 2 • Atmel AT45DB (NOR) • Mica Family, Telos rev. A, Eyes 2 • But has very different characteristics TinyOS Technology Exchange

  4. Technology Differences • One write per bit per erase cycle • Flash characteristics: Not used in current motes TinyOS Technology Exchange

  5. Architecture • Differences + limited RAM preclude common low-level HIL interfaces (e.g. block interface) • Provide high-level storage services useful for sensor network applications • Large Objects • Small Objects • Large Sequential Objects • Separate implementations of these abstractions for each class of storage chip TinyOS Technology Exchange

  6. Large Objects • Get a large object, write to each byte once in any arbitrary order, and commit. • Characteristics • Size: Large (100B to 100KB, or more) • Reads: random • Writes: random (write once) • Fault tolerance: validity check • Example Applications • Network Programming • Large Data Transfer TinyOS Technology Exchange

  7. Small Objects • Maintain a small chunk of values. Requires multiple and random reads/writes. • Characteristics • Size: Small (< 100B) • Reads: random • Writes: random • Fault tolerance: writes are atomic • Failure between/during writes  no data loss • Example Applications: • Configuration data storage TinyOS Technology Exchange

  8. Large Sequential Object • Some applications (e.g., low-rate data collection) may want to reliably log all their results. • Characteristics • Size: Large • Reads: sequential • Writes: sequential • Fault tolerance: user-specified commit points • Failure between/during writes  entire object is not lost • Example Applications • Logging TinyOS Technology Exchange

  9. Putting It Together • Sharing the flash through Volumes, with numerical identifiers • Volumes allocated similar to using fdisk. • A utility explicitly “formats” the flash. 1) Init volume table 2) Allocate each desired volume (user specifies UID and size) 3) Commit volume table • Volume table kept in non-volatile storage. Volume 0 Volume 1 Volume 2 Volume 3 Flash TinyOS Technology Exchange

  10. Putting It Together • TinyOS apps must mount volume before use. • Mount by specifying UID of volume • No unmount operation • A volume is used by at most one HIL. • Allows switching of applications while managing the sharing of flash. Small Object Large Object Log Log Volume 0 Volume 1 Volume 2 Volume 3 Flash TinyOS Technology Exchange

  11. Implementation Status • Currently under development: • AT45DB – Mica family, Telos rev. A, Eyes 2 • STM25P – Telos rev. B, Eyes 1 • Alpha (incomplete, etc) code on SourceForge, in: • tinyos-2.x/tos/chips/at45db • tinyos-2.x/tos/chips/stm25p • Thanks! TinyOS Technology Exchange

  12. Backup Slides TinyOS Technology Exchange

  13. BlockStorage interface BlockRead { command result_t read(addr_t addr, void* dest, addr_t len); event void readDone(storage_result_t result); command result_t verify(); event void verifyDone(storage_result_t result); } interface BlockWrite { command result_t write(addr_t addr, void* source, addr_t len); event void writeDone(storage_result_t result); command result_t erase(); event void eraseDone(storage_result_t result); command result_t commit(); event void commitDone(storage_result_t result); } TinyOS Technology Exchange

  14. ConfigStorage interface ConfigStorage { command result_t read(addr_t addr, void* dest, addr_t len); event void readDone(storage_result_t result); command result_t write(addr_t addr void* source, addr_t len); event void writeDone(storage_result_t result); command result_t commit(); event void commitDone(storage_result_t result); } TinyOS Technology Exchange

  15. Logger interface LogRead { command result_t read(uint8_t* data, uint32_t numBytes); event void readDone(uint8_t* data, uint32_t numBytes, storage_result_t success); command result_t seek(uint32_t cookie); event void seekDone(storage_result_t success); } interface LogWrite { command result_t erase(); event void eraseDone(storage_result_t success); command result_t append(uint8_t* data, uint32_t numBytes); event void appendDone(uint8_t* data, uint32_t numBytes, storage_result_t success); command uint32_t currentOffset(); command result_t sync(); event void syncDone(storage_result_t success); } TinyOS Technology Exchange

  16. Volume Management interface FStorage { command result_t init(); command result_t allocate(uint8_t id, addr_t size); command result_t allocateFixed(uint8_t id, addr_t addr, addr_t size); command result_t commit(); event void commitDone(storage_result_t result, uint8_t id); } interface Mount { command result_t mount(uint8_t id); event void mountDone(storage_result_t result, uint8_t id); } TinyOS Technology Exchange

More Related