external flash filesystem for sensor nodes with sparce ... fileheader free space file 3 file 2 entry...

11
First Prev Next Last Go Back Full Screen Close Quit External Flash Filesystem for Sensor Nodes with sparce Recources Stephan Lehmann, Stephan Rein, Clemens G¨ uhmann Wavelet Application Group Technische Universit¨ at Berlin MobiMedia July 2008

Upload: dangkien

Post on 23-Aug-2019

222 views

Category:

Documents


0 download

TRANSCRIPT

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    External Flash Filesystem for Sensor Nodes with

    sparce Recources

    Stephan Lehmann, Stephan Rein, Clemens Gühmann

    Wavelet Application Group

    Technische Universität Berlin

    MobiMedia July 2008

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    Motivation

    • Wireless sensors gather large amountsof data that cannot be hold in RAMor in the internal flash

    • A medium and filesystem for datastorage would be very helpful; it canalso allow for more complex algo-rithms

    • Current filesystems are designed forPC-usage

    • Requirements: low-cost, low-complexity, little memory, non volatile,simple interface, small size

    • ⇒ Design a free filesystem for SD-cards that fullfills the sensor nodes’requirements

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    Contents

    1 Features 4

    2 Function Example 52.1 Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Defragment . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    3 Usage 73.1 Programmer and high-level interface . . . . . . . . . . . . 73.2 High-level interface . . . . . . . . . . . . . . . . . . . . . . 8

    4 Evaluation 9

    5 Summary and Demo 10

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    1. Features

    • Short mounting time of 1ms as only the table header is read• Each file data is stored in one piece (and not distributed to different

    parts as done with FAT)⇒ low-complexity and random-access withina file is effective (FAT has problems with this)

    • No RAM for any entries needed as they are located on the card• RAM for read access ≤ 512 Bytes, for write access = 512 Bytes• Simple Interface: the card only needs four I/O pins

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    2. Function Example2.1. Delete

    m m c _ r e m o v e ( " A " ) ;

    i n v a l i d d a t a

    c h a n g e d d a t a

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    e n t r y 3" B "

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    e n t r y 3" B "

    1 . sh i f t en t r i es

    2 . u p d a t e h e a d e r a c c o r d i n g l y

    u n u s a b l e s p a c e ( u n t i l d e f r a g m e n t a t i o n )

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    2.2. Defragment

    m m c _ d e f r a g ( ) ;

    i n v a l i d d a t a

    c h a n g e d d a t a

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i l e 2e n t r y 2" B C D "

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    e n t r y 3" B "

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e fi le 1e n t r y 2" B C D "

    e n t r y 3" B "

    1. sh i f t f i l es

    2 . u p d a t e h e a d e r a n d e n t r i e s a c c o r d i n g l y

    u n u s a b l e s p a c e ( u n t i l d e f r a g m e n t a t i o n )

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    e n t r y 3" B "

    h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e f i le 3 f i le 2 f i le 1e n t r y 2" B C D "

    e n t r y 3" B "

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e f i le 3 f i le 2e n t r y 2" B C D "

    e n t r y 3" B "

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2 f i l e 2e n t r y 2" B C D "

    h e a d e re n t r y 1

    " A "e n t r y 2" B C D "

    e n t r y 3" B "

    f r e e s p a c e f i le 3 f i le 2h e a d e r e n t r y 1" A "

    e n t r y 2" B C D "

    f r e e s p a c e f i le 3 f i le 2e n t r y 2" B C D "

    e n t r y 3" B "

    f i le 3

    f i le 2f i le 3

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    3. Usage

    3.1. Programmer and high-level interface

    • The card has two user interfaces,1. a low-level interface with C-functions for the programmer

    2. and a high-level interface that can be accessed through the giventerminal program

    • Data can be exchanged between three entities,1. the SD-card,

    2. the PC,

    3. and the stack - that is, the RAM memory of the sensor.

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    3.2. High-level interface

    function call descriptionmmc init initialize SD-Cardmmc dir print an overview of all files on the SD-cardmmc load file filename id save a file from SD-card to PCmmc save file id filename save a file from SD-card to PCmmc load stack id load first element from stack to SD-cardmmc save stack id save a file from SD-card to stackmmc find id search the file system for a file;

    returns the entry addressmmc remove id delete a file on the SD-cardmmc status id prints status information of the SD-cardmmc clear id formats the SD-card

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    4. Evaluation

    Sequential Read: 433.9 kBytes/s Sequential Write 303.03 kBytes/sRandom Read: 428.2 kBytes/s Random Write 40.6 kBytes/s

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    5. Summary and Demo

    • Designed and programmed a filesystem that especially fullfills theneeds of sensor nodes

    • Main features: little RAM, low-cost, fast• Compatible to the OpenSensor and other sensor platforms• Freely available at www.mdt.tu-berlin.de/wavelets/research

    and soon at http://mobiledevices.kom.aau.dk/opensensor

    www.mdt.tu-berlin.de/wavelets/researchhttp://mobiledevices.kom.aau.dk/opensensor

  • •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    Flash Filesystemfor Sensor Node

    1.Features 2.Function Example 3.Usage4.Evaluation 5.Summary

    Stephan Lehmann , Stephan Rein, Clemens Gühmann [email protected] Application Group

    ./pic/SDC_Folien.wmvMedia File (video/x-ms-wmv)

    FeaturesFunction ExampleDeleteDefragment

    UsageProgrammer and high-level interfaceHigh-level interface

    EvaluationSummary and Demo