 faq faq admin 8 july 2012 1130pm what operating system os can you use with yaffs  yaffs is agnostic about the os it is used with it has been used with many different oss including linux ecos windows ce threadx psos and vxworks it is posixcompliant so commands in an application calling posix functions will usually work windows ce uses the microsoft file handling model and is not posixlike the difference is handled in the windows ce wrapper contact us for more information work on closer integration of yaffs into the linux kernel started in 2010 and the goal is to have yaffs merged into the mainline linux kernel the yaffs direct interface ydi is the heart of yaffs and usually stands between the application on one side and the flash chips and any os on the other side  what cpu can you use with yaffs  yaffs has been used with many 32bit and 64bit cpus including mips 68000 coldfire powerpc x86 variants and many armcored cpus it should work with 16bit cpus but has not been tested does yaffs care whichendian the cpu is  no yaffs works with bigendian and littleendian cpus how big can the whole file system be and how big can individual files be  yaffs2 which is now standard can handle a file system fs of many gigabytes total storage some people are using it with 6gb satisfactorily  individual  files are currently limited to 2gb the basic yaffs architecture can handle larger single files and some changes would be required to support individual files greater than 2g bytes there is an upper limit of around 32gb with the present 2k bytes granularity of chunks or page size and the limit of about 16 million chunks per file a coarser granularity of larger chunks can probably be obtained with knockon effects in other parameters like ram usage how many files can there be  there is no hard limit available flash and ram will limit this what about directories etc  yaffs supports many different objects including directories regular files hard links symbolic links and device nodes yaffs supports long file names attributes extended attributes and unicode how much ram does it need  this depends particularly on the number of tnodes which in turn depends on the file size and is therefore a dynamic variable however yaffs compares favourably with other similar systems specialised for flash and includes robust error handling how are errors handled  error correction code ecc is used to correct for singlebit errors ecc may use builtin code or that provided from other sources flash controllers ecc libraries etc yaffs is frequently tested on a fuzzer test harness this randomly corrupts bits of the file system image to check that the file system still mounts and loads correctly what about multilevel cell mlc chips  because a bit is represented by a smaller amount of charge in the mlc chip compared to a slc chip mlc chips are more prone to corruption than slc mlc also has various write restrictions which are obeyed by yaffs2 yaffs2 has some features such as block refreshing to help alleviate the problems associated with mlc mlc generally requires multibit ecc hardware ecc is preferred since it is faster and requires less computation than software multibit correction  how robust is yaffs  yaffs is designed specifically to take account of manufacturing faults in and of accumulated wear in individual cells and also to handle power failures during use yaffs allocates flash blocks in a way that gives statistical or implicit wear levelling when a block is freed up it is released into a  free pool  and the next allocation comes from this  free pool  this randomness tends to spread the blocks in use giving some wear levelling rather than one part of the file always being worked intensively accelerated lifetime testing has been carried out to seek evidence for excessive wear for example on one professional pdastyle device used by surveyors in the field we determined that extreme lifetime usage would be 20mb per day 200 days per year 10 year lifetime total 40gbytes lifetime write we then ran well over 200gbytes of writing through a specially designed file system exerciser a multithreaded application that writes reads verifies then deletes repeatedly there was no sign of a single bit of corruption at the end of the test another test applied randomly timed power failures repeatedly while running test code millions of cycles have been executed without any errors being observed yaffs is used under gpl in the android mobile phones sold by google and others extensive use in the field like this helps to ensure its robustness how big is its code  that depends on how much of it you need it is modular in organisation the innermost or core part is about 11k lines of code the the yaffs direct interface giving file handle access and a posixlike interface is around 2k lines glossary and useful links bigendian and littleendian bigendian is when the most significant data chunk is listed first littleendian is when the least significant data chunk is listed first http enwikipediaorg wiki endianness tnodes tnodes are yaffs data structures used to build trees that map from a file to the file data chunks stored in flash a large file will have multiple data chunks scattered throughout the flash and will need a larger tnode tree see the howyaffs works document for more information ecc error correction codes see the  yaffs error mitigation  document mlc multilevel cell allows more than one bit state to be stored in a memory cell mlc flash often allows four state ie 2 bits to be stored in one cell  http enwikipediaorg wiki multilevelcell   