O:31:"Drupal\Core\Render\HtmlResponse":8:{s:7:"headers";O:50:"Symfony\Component\HttpFoundation\ResponseHeaderBag":5:{s:23:"*computedCacheControl";a:2:{s:7:"max-age";s:3:"300";s:6:"public";b:1;}s:10:"*cookies";a:0:{}s:14:"*headerNames";a:14:{s:12:"content-type";s:12:"Content-Type";s:13:"cache-control";s:13:"Cache-Control";s:4:"date";s:4:"Date";s:22:"x-drupal-dynamic-cache";s:22:"X-Drupal-Dynamic-Cache";s:4:"link";s:4:"Link";s:15:"x-ua-compatible";s:15:"X-UA-Compatible";s:16:"content-language";s:16:"Content-language";s:22:"x-content-type-options";s:22:"X-Content-Type-Options";s:15:"x-frame-options";s:15:"X-Frame-Options";s:7:"expires";s:7:"Expires";s:13:"last-modified";s:13:"Last-Modified";s:4:"etag";s:4:"ETag";s:4:"vary";s:4:"Vary";s:11:"x-generator";s:11:"X-Generator";}s:10:"*headers";a:14:{s:12:"content-type";a:1:{i:0;s:24:"text/html; charset=UTF-8";}s:13:"cache-control";a:1:{i:0;s:19:"max-age=300, public";}s:4:"date";a:1:{i:0;s:29:"Tue, 14 Nov 2017 10:26:10 GMT";}s:22:"x-drupal-dynamic-cache";a:1:{i:0;s:4:"MISS";}s:4:"link";a:6:{i:0;s:57:"</archives/yaffs-original-specification>; rel="canonical"";i:1;s:27:"</node/37>; rel="shortlink"";i:2;s:56:"</archives/yaffs-original-specification>; rel="revision"";i:3;s:108:"</sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ozekku>; rel=preload; as=style";i:4;s:108:"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ozekku>; rel=preload; as=style";i:5;s:99:"</sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js>; rel=preload; as=script";}s:15:"x-ua-compatible";a:1:{i:0;s:7:"IE=edge";}s:16:"content-language";a:1:{i:0;s:2:"en";}s:22:"x-content-type-options";a:1:{i:0;s:7:"nosniff";}s:15:"x-frame-options";a:1:{i:0;s:10:"SAMEORIGIN";}s:7:"expires";a:1:{i:0;s:29:"Sun, 19 Nov 1978 05:00:00 GMT";}s:13:"last-modified";a:1:{i:0;s:29:"Tue, 14 Nov 2017 10:26:09 GMT";}s:4:"etag";a:1:{i:0;s:12:""1510655169"";}s:4:"vary";a:1:{i:0;s:6:"Cookie";}s:11:"x-generator";a:1:{i:0;s:33:"Drupal 8 (https://www.drupal.org)";}}s:15:"*cacheControl";a:2:{s:7:"max-age";s:3:"300";s:6:"public";b:1;}}s:10:"*content";s:44699:"<!DOCTYPE html>
<html  lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/  dc: http://purl.org/dc/terms/  foaf: http://xmlns.com/foaf/0.1/  og: http://ogp.me/ns#  rdfs: http://www.w3.org/2000/01/rdf-schema#  schema: http://schema.org/  sioc: http://rdfs.org/sioc/ns#  sioct: http://rdfs.org/sioc/types#  skos: http://www.w3.org/2004/02/skos/core#  xsd: http://www.w3.org/2001/XMLSchema# ">
  <head>
    <meta charset="utf-8" />
<meta name="title" content="Yaffs Original Specification | Yaffs - A Flash File System for embedded use" />
<meta name="news_keywords" content="Flash File System" />
<meta name="description" content="The initial specification for Yaffs. Circa 2002. Details of the filing system, including short backgrounder. Read this if you want to know what it is, what it does and how it works. This specification does not cover Yaffs2." />
<meta name="abstract" content="Yaffs (Yet Another Flash File System) is an open-source file system specifically designed to be fast, robust and suitable for embedded use with NAND and NOR Flash. It is widely used with Linux, RTOSs, or no OS at all, in consumer devices and critical infrastructure. It is available under GNU Public License, GPL, or on commercial terms from Aleph One." />
<meta name="keywords" content="flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs" />
<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="shortcut icon" href="/sites/default/files/yaffs_favicon.png" type="image/png" />
<link rel="canonical" href="/archives/yaffs-original-specification" />
<link rel="shortlink" href="/node/37" />
<link rel="revision" href="/archives/yaffs-original-specification" />

    <title>Yaffs Original Specification | Yaffs - A Flash File System for embedded use</title>
    <link rel="stylesheet" href="/sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ozekku" media="all" />
<link rel="stylesheet" href="/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ozekku" media="all" />

    
<!--[if lte IE 8]>
<script src="/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js"></script>
<![endif]-->

  </head>
  <body class="fontyourface path-node page-node-type-page navbar-is-fixed-top has-glyphicons">
    <a href="#main-content" class="visually-hidden focusable skip-link">
      Skip to main content
    </a>
    <div style="background-color: ; color: " id="environment-indicator">
  
    </div>

              <header class="navbar navbar-default navbar-fixed-top" id="navbar" role="banner">
              <div class="container">
            <div class="navbar-header">
          <div class="region region-navigation">
          <a class="logo navbar-btn pull-left" href="/" title="Home" rel="home">
      <img src="/themes/custom/yaffs/logo.svg" alt="Home" />
    </a>
      
  </div>

                          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
              </div>

                    <div id="navbar-collapse" class="navbar-collapse collapse">
            <div class="region region-navigation-collapsible">
    <nav role="navigation" aria-labelledby="block-mainnavigation-menu" id="block-mainnavigation">
            <h2 class="sr-only" id="block-mainnavigation-menu">Main navigation</h2>

      
              <ul class="menu nav navbar-nav">
                            <li>
        <a href="/" data-drupal-link-system-path="&lt;front&gt;">Home</a>
                  </li>
                        <li>
        <a href="/support" title="Help for Yaffs" data-drupal-link-system-path="node/380">Support</a>
                  </li>
                        <li>
        <a href="/documents" data-drupal-link-system-path="documents">Documents</a>
                  </li>
                        <li>
        <a href="/get-yaffs" data-drupal-link-system-path="node/382">Download</a>
                  </li>
                        <li>
        <a href="/about-us" data-drupal-link-system-path="node/325">About us</a>
                  </li>
                        <li>
        <a href="/contact" data-drupal-link-system-path="node/73">Contact</a>
                  </li>
        </ul>
  


  </nav>
<div class="search-block-form block block-search block-search-form-block" data-drupal-selector="search-block-form" id="block-searchform" role="search">
  
    
      <form action="/search/node" method="get" id="search-block-form" accept-charset="UTF-8">
  <div class="form-item js-form-item form-type-search js-form-type-search form-item-keys js-form-item-keys form-no-label form-group">
      <label for="edit-keys" class="control-label sr-only">Search</label>
  
  
  <div class="input-group"><input title="Enter the terms you wish to search for." data-drupal-selector="edit-keys" class="form-search form-control" placeholder="Search" type="search" id="edit-keys" name="keys" value="" size="15" maxlength="128" data-toggle="tooltip" /><span class="input-group-btn"><button type="submit" value="Search" class="button js-form-submit form-submit btn-primary btn icon-only" name=""><span class="sr-only">Search</span><span class="icon glyphicon glyphicon-search" aria-hidden="true"></span></button></span></div>

  
  
  </div>
<div class="form-actions form-group js-form-wrapper form-wrapper" data-drupal-selector="edit-actions" id="edit-actions"></div>

</form>

  </div>

  </div>

        </div>
                    </div>
          </header>
  
  <div role="main" class="main-container container js-quickedit-main-content">
    <div class="row">

            
            
                  <section class="col-sm-12">

                                      <div class="highlighted">  <div class="region region-highlighted">
      


  </div>
</div>
                  
                
                
                                      
                  
                          <a id="main-content"></a>
            <div class="region region-content">
        <h1 class="page-header"><span property="schema:name">Yaffs Original Specification</span>
</h1>

  <article role="article" about="/archives/yaffs-original-specification" typeof="schema:WebPage" class="page is-sticky full clearfix">

  
      <span property="schema:name" content="Yaffs Original Specification" class="hidden"></span>


  
  <div class="content">
    
            <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>YAFFS (Yet Another Flash File System)</p>

<h4>Version 0.3</h4>

<h4>Charles Manning (and Wookey), December 2001</h4>

<p><br />
 </p>

<h2>Revision History</h2>

<p>V0.0 20/12/01 First Draft</p>

<table><tr><td>
			<p>V0.1</p>
			</td>
			<td>
			<p>11/01/02</p>
			</td>
			<td>
			<p>Minor corrections &amp; cosmetics.<br />
			Change use of data status byte.</p>
			</td>
		</tr><tr><td>
			<p>V0.2</p>
			</td>
			<td>
			<p>28/01/02</p>
			</td>
			<td>
			<p>Added observations about inodes, file headers and hard links.</p>
			</td>
		</tr><tr><td>
			<p>V0.3</p>
			</td>
			<td>
			<p>26/02/02</p>
			</td>
			<td>
			<p>W:Added some general observations on compatibility, partitions and bootloading.</p>
			</td>
		</tr></table><p><br />
 </p>

<h2>Scope</h2>

<p>The purpose of this document is to outline a potential NAND-friendly file system for Linux.</p>

<h2>Background</h2>

<p>There are already various flash-file systems (FFSs) or block drivers for flash (on top of which a regular FS runs). There are pros and cons with all of these.</p>

<p>Flash memory has quite a few constraints which will not be addressed here. Various approaches are available to work around these constraints to provide a file system. It is important to recognise that "flash" includes both NOR and NAND flash which have different sets of constraints. It is easy to be mislead by the generic term "flash" into thinking that approaches appropriate for NOR flash are immediately suitable for NAND flash.</p>

<p>The NAND block drivers (eg. SmartMedia [currently not available for Linux] and DiskOnChip NFTL) typically use FAT16 as the file system. This isn't too robust and nor is it that flash-friendly. These block drivers provide a logical to physical mapping layer to emulate rewritable blocks that look like disk sectors. When used with FAT16, these file systems work reasonably well. They have a low memory footprint and scale well. Like all FAT based systems they are prone to corruption ("lost clusters etc").</p>

<p>The other approach is to design an entire file system which does not work through a block driver layer and is flash-friendly. This allows more scope to work around issues.</p>

<p>Currently, two Linux file systems that support NOR flash very well are JFFS and its derivative JFFS2. Both of these are based on the principles of journaling (hence the leading J) which significantly increases robustness - a particularly important feature in embedded systems. Unfortunately neither of these file systems scale particularly well in both boot time and RAM usage. Scaling is particularly relevant when one considers that a 16MB NOR array would be considered large while a 128MB NAND is available as a single chip.</p>

<p>JFFS requires a RAM-based jffs_node structure for each journalling node in the flash. Each of these nodes is 48 bytes. JFFS2 makes a significant improvement here by reducing the equivalent structure (jffs2_raw_node_ref) to 16 bytes. Still, at say an average node-size of 512 bytes, a 128MB NAND might need 250000 of these ... 4MB!</p>

<p>Both JFFS and JFFS2 require scanning the flash array at boot time to find the journaling nodes and determine the file structures. Since NAND is large, slow, serially accessed and needs ECC this does not scale well and will take an unacceptably long boot time for the target systems. As a thumb-suck, the scanning of a 128MB NAND array might take approx 25 seconds.</p>

<p>The intentions of the design sketched here are:</p>

<ul><li>
	<p>Be NAND-flash friendly.</p>
	</li>
	<li>
	<p>Robustness through journaling strategies.</p>
	</li>
	<li>
	<p>Significantly reduce the RAM overheads and boot times associated with JFFSx.</p>
	</li>
</ul><p>This FS is intended primarily for internal NAND rather than removable NAND (SM cards). On removable SM cards Smartmedia compatibility is likely to be important so SM/FAT will normally be used, although of course YAFFS makes a lot of sense if reliability is more important than compatibility.</p>

<h2>Overview</h2>

<p>Here follows a simplified overview of YAFFS.</p>

<p>YAFFS uses a physical flash format similar to SmartMedia. This is done for various reasons:</p>

<ul><li>
	<p>Some of the formatting, eg placement of bad block markers is determined by the NAND manufacturers and can't be changed.</p>
	</li>
	<li>
	<p>Potential to reuse code.</p>
	</li>
	<li>
	<p>If it ain't broke don't fix.</p>
	</li>
</ul><p>Some of the fields are obviously different to reflect the different usage. Despite the similarities YAFFS is not actually compatible with SM/FAT. SM cards need to be reformatted to switch from using SM/FAT to YAFFS or vice versa.</p>

<p>File data is stored in fixed size "chunks" consistent with the size of a page (ie. 512 bytes). Each page is marked with a file id and chunk number. These tags are stored in the "spare data" region of the flash. The chunk number is determined by dividing the file position by the chunk size.</p>

<p>When data in a file is overwritten, the relevant chunks are replaced by writing new pages to flash containing the new data but the same tags. The overwritten data is marked as "discarded".</p>

<p>File "headers" are stored as a single page, marked so as to be differentiated from data pages.</p>

<p>Pages are also marked with a short (2 bit) serial number that increments each time the page at this position is incremented. The reason for this is that if power loss/crash/other act of demonic forces happens before the replaced page is marked as discarded, it is possible to have two pages with the same tags. The serial number is used to arbitrate.</p>

<p>A block containing only discarded pages (termed a <em>dirty block</em>) is an obvious candidate for garbage collection. Otherwise valid pages can be copied off a block thus rendering the whole block discarded and ready for garbage collection.</p>

<p>In theory you don't need to hold the file structure in RAM... you could just scan the whole flash looking for pages when you need them. In practice though you'd want better file access times than that! The mechanism proposed here is to have a list of __u16 page addresses associated with each file. Since there are 218 pages in a 128MB NAND, a __u16 is insufficient to uniquely identify a page but is does identify a group of 4 pages - a small enough region to search exhaustively. This mechanism is clearly expandable to larger NAND devices - within reason. The RAM overhead with this approach is approx 2 bytes per page - 512kB of RAM for a whole 128MB NAND.</p>

<p>Boot-time scanning to build the file structure lists should require just one pass reading NAND. Since only the the spare data needs to be read, this should be relatively fast ( approx 3 seconds for 128MB). Improvements can be achieved by partitioning the NAND. ie. mount the critical partition first then mount the data partition afterwards.</p>

<p>Various runtime improvements can be achieved by changing the "chunk size" to 1024 bytes or more. However this would likely reduce flash efficiency. As always, life is a compromise....</p>

<p><br />
 </p>

<h3>Spare area details</h3>

<p>The following table summarizes the layout of the spare area of each page.</p>

<p>Byte #SmartMedia usageYAFFS usage</p>

<table><tr><td>
			<p>0..511</p>
			</td>
			<td>
			<p>Data</p>
			</td>
			<td>
			<p>Data. either file data or file header depending on tags</p>
			</td>
		</tr><tr><td>
			<p>512..515</p>
			</td>
			<td>
			<p>Reserved</p>
			</td>
			<td>
			<p>Tags</p>
			</td>
		</tr><tr><td>
			<p>516</p>
			</td>
			<td>
			<p>Data status byte. Not used in SM code from Samsung</p>
			</td>
			<td>
			<p>Data status byte. If more than 4 bits are zero, then this page is discarded.</p>
			</td>
		</tr><tr><td>
			<p>517</p>
			</td>
			<td>
			<p>Block status byte</p>
			</td>
			<td>
			<p>Block status byte</p>
			</td>
		</tr><tr><td>
			<p>518..519</p>
			</td>
			<td>
			<p>Block address</p>
			</td>
			<td>
			<p>Tags</p>
			</td>
		</tr><tr><td>
			<p>520..522</p>
			</td>
			<td>
			<p>ECC on second 256 bytes part of data</p>
			</td>
			<td>
			<p>ECC on second 256 bytes of data</p>
			</td>
		</tr><tr><td>
			<p>523..524</p>
			</td>
			<td>
			<p>Block address</p>
			</td>
			<td>
			<p>Tags</p>
			</td>
		</tr><tr><td>
			<p>525..527</p>
			</td>
			<td>
			<p>ECC on first 256 bytes part of data</p>
			</td>
			<td>
			<p>ECC on first 256 bytes part of data</p>
			</td>
		</tr></table><p><br />
 </p>

<p>The block status is a reserved value that shows whether the block is damaged.</p>

<p>The data status tracks whether the page is valid. If less than 4 bits are zero, then the page is valid otherwise it is discarded.</p>

<p>There are 8 bytes (64 bits) for use by YAFFS tags. This is partitioned as follows:</p>

<p>Number of bitsUsage</p>

<table><tr><td>
			<p>18</p>
			</td>
			<td>
			<p>18-bit file id. ie. Limit of 218 (over 260000) files. File id 0 is not valid and indicates a deleted page. File Id 0x3FFFF i is also not valid.</p>
			</td>
		</tr><tr><td>
			<p>2</p>
			</td>
			<td>
			<p>2-bit serial number.</p>
			</td>
		</tr><tr><td>
			<p>20</p>
			</td>
			<td>
			<p>20-bit page id within file. Limit of 220 pages per file. ie. over 500MB file max size. Page id 0 means the file header for this file.</p>
			</td>
		</tr><tr><td>
			<p>10</p>
			</td>
			<td>
			<p>10-bit counter of the number of bytes used in the page.</p>
			</td>
		</tr><tr><td>
			<p>12</p>
			</td>
			<td>
			<p>12-bit ECC on tags.</p>
			</td>
		</tr><tr><td>
			<p>2</p>
			</td>
			<td>
			<p>Unused. Keep as 1.</p>
			</td>
		</tr><tr><td>
			<p><strong>64</strong></p>
			</td>
			<td>
			<p><strong>Total</strong></p>
			</td>
		</tr></table><p><br />
 </p>

<p>A bit of explanation on the usage of some of these fields:</p>

<p>file Id is synonymous with inode.</p>

<p>The serial number is incremented each time a page with the same file_id:page_id is rewritten (because of data changes or copy during garbage collection). When a page is replaced, there is a brief period during which there are two pages with the same id. The serial number resolves this. Since there should never be a difference of less than more than one, a two-bit counter is sufficient to determine which is the current page.</p>

<p>When the page is rewritten, the file id, these data status byte and the 12-bit ECC are all written to zero.</p>

<p>The byte counter indicates how many bytes are valid in this page. Since the page would not exist if it contains zero bytes, this field should thus hold 512 for all pages except the last page in the file. The use of counters means that the file length integrity is preserved while the file is open without having to constantly update the file length in the file header. The file header only needs to be refreshed when the file is closed (rather than whenever it is appended to). This field is wide enough to allow expansion to 1024-byte "chunks".</p>

<p>File "headers" come in two flavours:</p>

<ul><li>
	<p>file info ( the mode, ower id, group id, length,...)</p>
	</li>
	<li>
	<p>the hard link(s) that refers to the file.</p>
	</li>
</ul><p>A directory also appears as a file (ie. has an inode and hard link(s)) but has no data.</p>

<p>The 12-bit ECC applies to only the tag data uses a similar algorithm to the 22-bit ECCs used for file system data. They are kept independent.</p>

<h3>RAM data details</h3>

<p>Block management details are reasonably obvious and, I feel, don't need to be addressed here apart from stating that there will be a structure to track block status (eg. number of pages in use, failed blocks, and which are candidates for garbage collection etc).</p>

<p>The files need an indexing structure of sorts to locate and track the pages in the file. Some sort of tree structure should work rather well. The look-up needs to be quite efficient in both CPU time and space.</p>

<h3>Page allocation and garbage collection</h3>

<p>Pages are allocated sequentially from the currently selected block. When all the pages in the block are filled, another clean block is selected for allocation. At least two or three clean blocks are reserved for garbage collection purposes. If there are insufficient clean blocks available, then a dirty block ( ie one containing only discarded pages) is erased to free it up as a clean block. If no dirty blocks are available, then the dirtiest block is selected for garbage collection.</p>

<p>Garbage collection is performed by copying the valid data pages into new data pages thus rendering all the pages in this block dirty and freeing it up for erasure. I also like the idea of selecting a block at random some small percentage of the time - thus reducing the chance of wear differences.</p>

<p>Relative to NOR, NAND writes and erases very fast. Therefore garbage collection might be performed on-demand (eg. during a write) without significant degradation in performance. Alternatively garbage collection might be delegated to a kernel tasklet.</p>

<p>Relative to JFFSx, the garbage collection presented here is incredibly simple - thanks mainly to the use of fixed-size pages instead of journaling nodes.</p>

<h3>Flash writing</h3>

<p>As presented here, YAFFS only writes to the page's data area once and to the spare area twice (once when new page is written and once when it gets stomped on) before an erasure. This is within the limits of the most restrictive NAND flashes.</p>

<h3>Wear levelling</h3>

<p>No wear levelling is explicitly used here. Instead we rely on two "strategies":</p>

<ul><li>
	<p>Reserving some blocks to cater for failure. You need to do this anyway with NAND. The main purpose behind wear levelling is to prevent some blocks getting more wear and failing. Since we expect, and handle, failure this is no longer as important.</p>
	</li>
	<li>
	<p>The infrequent random block selection should prevent low-wear blocks getting "stuck".</p>
	</li>
</ul><h3>Partitioning</h3>

<p>Partitioning is not included in this spec, but could be added if required.</p>

<h3>Bootloading</h3>

<p>Bootloaders cannot just read files direct from NAND due to the high probability of bad blocks. Because YAFFS is quite simple it will be relatively straightforward for bootloaders to read from it (eg reading a kernel).</p>

<h3>Conclusion</h3>

<p>YAFFS is very simple. It is also NAND-friendly, is relatively frugal with resources (especially RAM) and boots quickly. Like JFFSx it has journaling which makes it far more robust than FAT.</p>

<p>While it might seem high-risk to develop YAFFS, it is probably about the same amount of effort as implementing changes to JFFS to get it to work effectively within the constraints of NAND. A resulting JFFSx system would still require significant amounts of RAM and have long boot times.</p>

<p>While YAFFS is indeed a new file system internally, much of the file system glue code (including inode management, link management etc) can likely be stolen from JFFSx.</p>

<p> </p>

<p>YAFFS Development Notes</p>

<h3>Build options</h3>

<p>Yaffs can be built as either a kernel module (ie. a Linux file system) or as an application.</p>

<p>Of course the goal is to build yaffs as a file system running on top of real NAND flash, but yaffs can be built to run on a RAM emulation layer for in-kernel testing without NAND flash in the system.</p>

<p>Building as an application allows the yaffs_guts algorithms to be tested/debugged in a more friendly debugging environment. The test harness is in yaffsdev.c</p>

<h3>Trying it out</h3>

<p>YAFFS can be built to run with either mtd or RAM emulation, or both. The file system that interfaces to mtd is called <strong>yaffs</strong>, the file system that uses internal ram is called <strong>yaffsram</strong>. YAFFS simultaneously supports both if they are enabled.</p>

<ol><li>
	<p>Hack the Makefile and change the KERNELDIR define to your kernel directory.</p>
	</li>
	<li>
	<p>If you don't have mtd support in your kernel, then you might need to turn off USE_MTD otherwise the yaffs module might not load.</p>
	</li>
	<li>
	<p>Type <strong>make clean; make</strong> to build yaffs</p>
	</li>
	<li>
	<p>Load yaffs as a module by typing <strong>/sbin/insmod yaffs.o</strong> (ya gotta be root!).</p>
	</li>
	<li>
	<p>Create a mount point eg. <strong>mkdir /mnt/y</strong></p>
	</li>
	<li>
	<p>To mount the RAM emulation version of yaffs, <strong>mount -t yaffsram none /mnt/y</strong></p>
	</li>
	<li>
	<p>Alternatively, to mount the mtd version of yaffs,<strong> mount -t yaffs /dev/mtd0 /mnt/y</strong></p>
	</li>
</ol><p><br />
 </p>

<h3>YAFFS Data structures</h3>

<p>All data types are defined in yaffs_guts.h</p>

<p>Yaffs uses the following major objects:</p>

<ul><li>
	<p>yaffs_Object: A yaffs_Object can be a file, directory, symlink or hardlink. The yaffs_Objects "know" about their corresponding yaffs_ObjectHeader in NAND and the data for that object. yaffs_Objects also bind together the directory structure as follows:</p>
	</li>
	<li>
	<p>parent: pointer to the yaffs_Object that is a parent of this yaffs_Object in the directory structure.</p>
	</li>
	<li>
	<p>siblings: this field is used to link together a list of all the yaffs_Objects in the same directory.</p>
	</li>
	<li>
	<p>children: if the object is a directory, then children holds the head of the list of objects in the directory.</p>
	</li>
	<li>
	<p>yaffs_Tnode: yaffs_Tnodes form a tree structure that speeds up the search for data chunks in a file. As the file grows in size, the levels increase. The Tnodes are a constant size (32 bytes). Level 0 (ie the lowest level) comprise 16 2-byte entries giving an index used to search for the chunkId. Tnodes at other levels comprise 8 4-byte pointer entries to other tnodes lower in the tree.</p>
	</li>
	<li>
	<p>yaffs_Device: this holds the device context and is in some ways analogous to the VFS superblock. It stores the data used to access the mtd as well as function pointers to access the NAND data.</p>
	</li>
</ul><p>The Tnodes and Objects are allocated in groups to reduce memory allocation/freeing overheads. Freed up tnodes and objects are kept in a free list and re-used.</p>

<h3>yaffs_Object</h3>

<p><br />
 </p>

<p>struct yaffs_ObjectStruct</p>

<p>{</p>

<p>__u8 fake:1; // A fake object has no presence on NAND.</p>

<p>__u8 renameAllowed:1; // Are we allowed to rename it?</p>

<p>__u8 unlinkAllowed:1; // Are we allowed to unlink it?</p>

<p>__u8 dirty:1; // the object needs to be written to flash</p>

<p>__u8 valid:1; // When the file system is being loaded up, this</p>

<p>// object might be created before the data</p>

<p>// is available (ie. file data records appear before the header).</p>

<p>__u8 serial; // serial number of chunk in NAND. Store here so we don't have to</p>

<p>// read back the old one to update.</p>

<p>__u16 sum; // sum of the name to speed searching</p>

<p> </p>

<p>struct yaffs_DeviceStruct *myDev; // The device I'm on</p>

<p> </p>

<p> </p>

<p>struct list_head hashLink; // list of objects in this hash bucket</p>

<p> </p>

<p> </p>

<p>struct list_head hardLinks; // all the equivalent hard linked objects</p>

<p>// live on this list</p>

<p>// directory structure stuff</p>

<p>struct yaffs_ObjectStruct *parent; //my parent directory</p>

<p>struct list_head siblings; // siblings in a directory</p>

<p>// also used for linking up the free list</p>

<p> </p>

<p>// Where's my data in NAND?</p>

<p>int chunkId; // where it lives</p>

<p> </p>

<p>__u32 objectId; // the object id value</p>

<p> </p>

<p> </p>

<p>__u32 st_mode; // protection</p>

<p>__u32 st_uid; // user ID of owner</p>

<p>__u32 st_gid; // group ID of owner</p>

<p>__u32 st_atime; // time of last access</p>

<p>__u32 st_mtime; // time of last modification</p>

<p>__u32 st_ctime; // time of last change</p>

<p> </p>

<p> </p>

<p>yaffs_ObjectType variantType;</p>

<p> </p>

<p>yaffs_ObjectVariant variant;</p>

<p> </p>

<p>};</p>

<p><br />
 </p>

<p>Obvious stuff skipped....</p>

<p>fake, renameAllowed, unlinkAllowed are special flags for handling "fake" objects which live in the file system but do not live on NAND. Currently there are only two such objects: the root object and the lost+found directory. None of these may be renamed or unlinked.</p>

<p>serial, sum: see yaffs_ObjectHeader.</p>

<p>dirty indicates that the object's contents has changed and a new yaffs_ObjectHeader must be written to flash.</p>

<p>valid indicates that the object has been loaded up. This is only used during scanning (yaffs_Scan()) since we can know of an object's existance - and thus need to create the object header - before we encounter the associated yaffs_ObjectHeader.</p>

<p>hashlink is a list of Objects in the same hash bucket.</p>

<p>The four variants hold extra info:</p>

<p>Files hold the file size and the top level and pointer to the tnode tree for the file.</p>

<p>Directories hold a list of children objects.</p>

<p>Symlinks hold a pointer to the alias string. This is probably inefficient, but that probably does not matter since we don't expect to see many of these.</p>

<p>Hardlinks hold information to identify the equivalent object.</p>

<p><br />
 </p>

<p><br />
 </p>

<h3>File structure (tnodes)</h3>

<p>File structures are done with a tiered indexing structure</p>

<p><br />
 </p>

<p><img alt="" height="294" src="yaffs/sv9349341.gif" width="491" /><br /><br />
 </p>

<p>The file structure is maintained by a tree structure. Depending where it is in the tree, each tree node (<strong><em>tnode</em></strong>) (the blue/things) holds either:</p>

<ul><li>
	<p>.... if it is at the lowest level, then 16 __u16s which identify the page.</p>
	</li>
	<li>
	<p>.... if it is at a higher level (ie an internal tnode), then 8 pointers to lowest-level tnodes.</p>
	</li>
</ul><p>When the file starts out, it is assigned only one low-level tnode. When the file expands past what a single tnode can hold, then it is assigned a second tnode and an internal node is added to point to the two tnodes. As the file grows, more low-level tnodes and high level tnodes are added.</p>

<p>Traversing the tnode tree to find a particular page in a file is quite simple: each internal tnode is selected from by using 3 bits of the page offset in the file. The level 0 page resolves 4 bits.</p>

<p>For example, finding page 0x235 (ie. the one starting at file position 0x46800 would proceed as follows:</p>

<p>0x235 is 0000001000110101, partitioned as follows. 000.000.100.011.0101</p>

<p>LevelBitsSelected value</p>

<table><tr><td>
			<p>3 or more if they exist</p>
			</td>
			<td>
			<p>&gt;= 10</p>
			</td>
			<td>
			<p>Zero</p>
			</td>
		</tr><tr><td>
			<p>2</p>
			</td>
			<td>
			<p>9 to 7</p>
			</td>
			<td>
			<p>100 binary = 4</p>
			</td>
		</tr><tr><td>
			<p>1</p>
			</td>
			<td>
			<p>6 to 4</p>
			</td>
			<td>
			<p>011 binary = 3</p>
			</td>
		</tr><tr><td>
			<p>0</p>
			</td>
			<td>
			<p>3 to 0</p>
			</td>
			<td>
			<p>0101 binary = 5</p>
			</td>
		</tr></table><p><br />
 </p>

<p>Free tnodes are stored in a list. When the list is exhausted, more are allocated.</p>

<p>Each tnode takes 32 bytes. Each file needs at least one level 0 tnode. How many do we need? A full 16MB file system needs at least 16MB/512/16 = 2000 level zero tnodes. More for internal tnodes. More for files smaller than optimal.</p>

<p>The tree grows as required. When the file is resized to a smaller size then it is pruned.</p>

<p><br />
 </p>

<h3>NAND data</h3>

<p>Data is stored on NAND in "chunks". Currently each chunk is the same size as a NAND flash page (ie. 512 bytes + 16 byte spare). In the future we might decide to allow for different chunk sizes. Chunks can hold either:</p>

<ul><li>
	<p>A yaffs_ObjectHeader. This is the way a yaffs_Object gets stored on NAND.</p>
	</li>
	<li>
	<p>A chunk of file data.</p>
	</li>
</ul><p>The 16 byte spare area contains:</p>

<ul><li>
	<p>8 bytes of tags,</p>
	</li>
	<li>
	<p>6 bytes of ECC data</p>
	</li>
	<li>
	<p>1 byte block status (used to identify damaged blocks)</p>
	</li>
	<li>
	<p>1 byte data status (currently unused).</p>
	</li>
</ul><p>The tags are made up as follows:</p>

<p>typedef struct</p>

<p>{</p>

<p>unsigned chunkId:20; //chunk number in file</p>

<p>unsigned serialNumber:2; //serial number for chunk</p>

<p>unsigned byteCount:10; //number of bytes of data used in this chunk</p>

<p>unsigned objectId:18; //the object id that this chunk belongs to.</p>

<p>unsigned ecc:12; //ECC on tags</p>

<p>unsigned unusedStuff:2; //unused</p>

<p>} yaffs_Tags;</p>

<p> </p>

<p>A chunkId of zero indicates that this chunk holds a yaffs_ObjectHeader. A non zero value indicates that this is a data chunk and the position of the chunk in the file (ie. the first chunk - at offset 0 - has chunkId 1). See yaffs_guts.c:yaffs_Scan () to see how this is done.</p>

<p>When a chunk is replaced (eg. file details changed or a part of a file was overwritten), the new chunk is written before the old chunk is deleted. This means that we don't lose data if there is a power loss after the new chunk is created but before the old one is discarded, but it does mean that we can encounter the situation where we find both the old and the new chunks in flash. The serialNumber is incremented each time the chunk is written. 2 bits is sufficient to resolve any ambiguity.</p>

<p>bytecount applies only to data chunks and tells how many of the data bytes are valid.</p>

<p>objectId says which object this chunk belongs to.</p>

<p>ecc is used to perform error correction on the tags. Another ecc field is used to error correct the data.</p>

<p><br />
 </p>

<h3>yaffs_ObjectHeader</h3>

<p>typedef struct</p>

<p>{</p>

<p>yaffs_ObjectType type;</p>

<p> </p>

<p>// Apply to everything</p>

<p>int parentObjectId;</p>

<p>__u16 sum; // checksum of name</p>

<p>char name[YAFFS_MAX_NAME_LENGTH + 1];</p>

<p> </p>

<p>// Thes following apply to directories, files, symlinks - not hard links</p>

<p>__u32 st_mode; // protection</p>

<p>__u32 st_uid; // user ID of owner</p>

<p>__u32 st_gid; // group ID of owner</p>

<p>__u32 st_atime; // time of last access</p>

<p>__u32 st_mtime; // time of last modification</p>

<p>__u32 st_ctime; // time of last change</p>

<p> </p>

<p>// File size applies to files only</p>

<p>int fileSize;</p>

<p> </p>

<p>// Equivalent object id applies to hard links only.</p>

<p>int equivalentObjectId;</p>

<p>// alias only applies to symlinks</p>

<p>char alias[YAFFS_MAX_ALIAS_LENGTH + 1];</p>

<p> </p>

<p> </p>

<p>} yaffs_ObjectHeader;</p>

<p> </p>

<p>A yaffs_ObjectHeader is stored in NAND for every yaffs_Object.</p>

<p>type holds the type of yaffs_Object (file,directory,hardlink or symlink).</p>

<p>parentObject is the objectId of this object's parent. name holds the object's name. Together these form the directory structure of the file system. Also worth mention is sum. This is a "checksum" on the name which speeds directory searching (ie. when searching the directory we only compare the name for those entries where sum matches).</p>

<p>Obvious stuff skipped....</p>

<p>equivalentObjectId is used by hardlinks. A hardlink to an object uses this field to specify the object that this links to. This way of doing things is a bit different than the normal Linux way of doing things (ie. keeping the links distinct from the inode) but is simpler and uses less space except for a few corner cases with hardlinks.</p>

<p>alias is used by symlinks to hold the symlink alias string. This limits the size of the symlink alias. In future we should expand YAFFS to use data chunks to store aliases too long to fit into the yaffs_ObjectHeader.</p>

<p><br />
 </p>

<h3>NAND Interface</h3>

<p>All NAND access is performed via four functions pointed to by yaffs_Device. At the moment a chunk is a page.</p>

<ul><li>
	<p>int WriteChunkToNAND(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, yaffs_Spare *spare)</p>
	</li>
	<li>
	<p>int ReadChunkFromNAND(struct yaffs_DeviceStruct *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);</p>
	</li>
	<li>
	<p>int EraseBlockInNAND(struct yaffs_DeviceStruct *dev,int blockInNAND);</p>
	</li>
	<li>
	<p>int InitialiseNAND(struct yaffs_DeviceStruct *dev);</p>
	</li>
</ul><p>In the Readxxx and Writexxx functions, the data and/or spare pointers may be NULL in which case these data transfers are ignored.</p>

<p>A quick note about NAND:</p>

<ul><li>
	<p>NAND is not random access, but page oriented. Thus, we do all reads &amp; writes in pages.</p>
	</li>
	<li>
	<p>Each NAND page holds 512 bytes of data and 16 "spare" bytes. Yaffs structures the spare area with tags used to identify what is stored in the data area. There are 32 such pages to a block.</p>
	</li>
	<li>
	<p>NAND writes will only change 1 bits to 0. eg. if a byte holds 10110011 and you write 11011010 to it you will get the logical and of the two values: 10010010. The only way to get 1s again is to erase the entire block.</p>
	</li>
	<li>
	<p>You may only write to a page a few times before erasing the entire block. Yaffs lives within these limitations. Each page only gets written to twice (once when written and once when discarded).</p>
	</li>
	<li>
	<p>ECC is normally used with NAND to correct for single bit errors. YAFFS applies the ECC itself, so the MTD should not do this.</p>
	</li>
	<li>
	<p>The current mtd interfaces are not particularly well suited to YAFFS and we will address the issue with the mtd group. (The mtd interface does not support page-oriented read/write which YAFFS would prefer).</p>
	</li>
</ul><p><br />
 </p>

<h3>mkyaffs</h3>

<p>mkyaffs is the tool to format a NAND mtd to be used for YAFFS. This is quite simple, just erase all the undamaged blocks. YAFFS treats erased blocks as free (empty) space.</p>

<p><br />
 </p>

<h2>Expected performance</h2>

<p>The following numbers should give an indication of the performance we should expect from YAFFS.</p>

<p>As an example, I'll use the following numbers. Since the hardware is capable of 50ns read/write, these numbers allow for some other ovberheads. Clearly though, the performance can be degraded in various ways.</p>

<p>Seek10uS/page</p>

<table><tr><td>
			<p>Read</p>
			</td>
			<td>
			<p>100nS/byte</p>
			</td>
		</tr><tr><td>
			<p>Write</p>
			</td>
			<td>
			<p>100nS/byte</p>
			</td>
		</tr><tr><td>
			<p>Program</p>
			</td>
			<td>
			<p>200uS/page</p>
			</td>
		</tr><tr><td>
			<p>Erase</p>
			</td>
			<td>
			<p>2mS/block</p>
			</td>
		</tr></table><p><br />
 </p>

<p>From this we can derive some higher-level numbers:</p>

<p>OperationTimeCalculation</p>

<table><tr><td>
			<p>Read spare</p>
			</td>
			<td>
			<p>12uS</p>
			</td>
			<td>
			<p>seek + 16 * read</p>
			</td>
		</tr><tr><td>
			<p>Read page</p>
			</td>
			<td>
			<p>63 uS</p>
			</td>
			<td>
			<p>seek + 528 * read</p>
			</td>
		</tr><tr><td>
			<p>Write page</p>
			</td>
			<td>
			<p>326 uS</p>
			</td>
			<td>
			<p>seek + 528 * write + program + read page (for verification)</p>
			</td>
		</tr><tr><td>
			<p>Discard page</p>
			</td>
			<td>
			<p>212 uS</p>
			</td>
			<td>
			<p>seek + 16 * write + program</p>
			</td>
		</tr><tr><td>
			<p>Overwrite page</p>
			</td>
			<td>
			<p>538 uS</p>
			</td>
			<td>
			<p>write page + discard page</p>
			</td>
		</tr><tr><td>
			<p>Erase overhead per page</p>
			</td>
			<td>
			<p>63uS</p>
			</td>
			<td>
			<p>erase/32</p>
			</td>
		</tr></table><p><br />
 </p>

<p>From this we can infer the following flash access times:</p>

<p>OperationTimeCalculation</p>

<table><tr><td>
			<p>Read 1MB file</p>
			</td>
			<td>
			<p>0.13s (about 7.5 MB/s)</p>
			</td>
			<td>
			<p>2000 * read page</p>
			</td>
		</tr><tr><td>
			<p>Write 1MB (clean system)</p>
			</td>
			<td>
			<p>0.53s (about 1.8 MB/s)</p>
			</td>
			<td>
			<p>2000 * write page</p>
			</td>
		</tr><tr><td>
			<p>Overwrite 1MB file (no gc)</p>
			</td>
			<td>
			<p>1.08s (about 0.9MB/s)</p>
			</td>
			<td>
			<p>2000 * overwrite page</p>
			</td>
		</tr><tr><td>
			<p>Overwrite 1MB with 50% gc</p>
			</td>
			<td>
			<p>2.4s (about 0.4 MB/s)</p>
			</td>
			<td>
			<p>2000 * overwrite page + 2000 * page copy (== overwrite page) + 4000 * erase overhead</p>
			</td>
		</tr><tr><td>
			<p>Delete 1MB file</p>
			</td>
			<td>
			<p>0.43s (about 2.2 MB/s)</p>
			</td>
			<td>
			<p>2000 * discard page</p>
			</td>
		</tr><tr><td>
			<p>Delete 1MB file with 50% gc</p>
			</td>
			<td>
			<p>0.49s (about 2.0MB/s)</p>
			</td>
			<td>
			<p>2000 * discard page + 1000 * erase overhead</p>
			</td>
		</tr></table><p> </p></div>
      
  </div>

</article>


  </div>

              </section>

                </div>
  </div>

      <footer class="footer container" role="contentinfo">
        <div class="primary_footer row">
            <div class="col-sm-3">
                  <div class="region region-footer-col1">
    <section id="block-yaffs-block-6" class="block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<ul class="fa-ul">
<li><i class="fa-li fa fa-phone"></i>+44 (0)1223 811679</li>
<li><i class="fa-li fa fa-envelope"></i><a href="denied:mailto:info@aleph1.co.uk?Subject=Website contact" target="_top">info@aleph1.co.uk</a></li>
</ul>
</div>
      
  </section>


  </div>

            </div>
            <div class="col-sm-3">
                
            </div>
            <div class="col-sm-3">
                
            </div>
            <div class="col-sm-3">
                  <div class="region region-footer-col4">
    <section id="block-footerlegal" class="block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<p class="text-align-right">&nbsp;<a href="/legal">Legal &amp; Cookies</a></p>
</div>
      
  </section>

<section id="block-cookieinfo" class="block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<p class="text-align-justify"><br />
We use <a href="/legal">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>
</div>
      
  </section>


  </div>

            </div>
        </div>
        <div class = "secondary_footer row">
            <div class="col-sm-12">
                <div class="region region-footer">
    <nav role="navigation" aria-labelledby="block-yaffs-account-menu-menu" id="block-yaffs-account-menu">
            <h2 class="sr-only" id="block-yaffs-account-menu-menu">User account menu</h2>

      
              <ul class="menu nav navbar-nav navbar-right">
                            <li>
        <a href="/user/login" data-drupal-link-system-path="user/login">Log in</a>
                  </li>
        </ul>
  


  </nav>

  </div>

            </div>
        </div>
    </footer>
  
    
    <script type="application/json" data-drupal-selector="drupal-settings-json">{"path":{"baseUrl":"\/","scriptPath":null,"pathPrefix":"","currentPath":"node\/37","currentPathIsAdmin":false,"isFront":false,"currentLanguage":"en"},"pluralDelimiter":"\u0003","bootstrap":{"forms_has_error_value_toggle":1,"modal_animation":1,"modal_backdrop":"true","modal_keyboard":1,"modal_show":1,"modal_size":"","popover_enabled":1,"popover_animation":1,"popover_container":"body","popover_content":"","popover_delay":"0","popover_html":0,"popover_placement":"right","popover_selector":"","popover_title":"","popover_trigger":"click","popover_trigger_autoclose":1,"tooltip_enabled":1,"tooltip_animation":1,"tooltip_container":"body","tooltip_delay":"0","tooltip_html":0,"tooltip_placement":"auto left","tooltip_selector":"","tooltip_trigger":"hover"},"ajaxTrustedUrl":{"\/search\/node":true},"user":{"uid":0,"permissionsHash":"aa7fc4c8fb40c7a8665ccd12fea07926dff0f59b9ee3346bc513c6399bee5b01"}}</script>
<script src="/sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js"></script>

  </body>
</html>
";s:10:"*version";s:3:"1.0";s:13:"*statusCode";i:200;s:13:"*statusText";s:2:"OK";s:10:"*charset";N;s:23:"*cacheabilityMetadata";O:35:"Drupal\Core\Cache\CacheableMetadata":3:{s:16:"*cacheContexts";a:18:{i:0;s:28:"languages:language_interface";i:1;s:5:"route";i:2;s:32:"route.menu_active_trails:account";i:3;s:29:"route.menu_active_trails:main";i:4;s:30:"route.menu_active_trails:tools";i:5;s:5:"theme";i:6;s:8:"timezone";i:7;s:3:"url";i:8;s:8:"url.path";i:9;s:17:"url.path.is_front";i:10;s:15:"url.path.parent";i:11;s:30:"url.query_args:_wrapper_format";i:12;s:4:"user";i:13;s:21:"user.node_grants:view";i:14;s:16:"user.permissions";i:15;s:10:"user.roles";i:16;s:20:"user.roles:anonymous";i:17;s:24:"user.roles:authenticated";}s:12:"*cacheTags";a:51:{i:0;s:16:"block_content:18";i:1;s:16:"block_content:23";i:2;s:15:"block_content:7";i:3;s:18:"block_content_view";i:4;s:10:"block_view";i:5;s:32:"config:block.block.choosingyaffs";i:6;s:29:"config:block.block.cookieinfo";i:7;s:32:"config:block.block.downloadyaffs";i:8;s:30:"config:block.block.footerlegal";i:9;s:39:"config:block.block.frontimagehighlight2";i:10;s:32:"config:block.block.frontpagehero";i:11;s:39:"config:block.block.frontpageprimeryaffs";i:12;s:33:"config:block.block.mainnavigation";i:13;s:35:"config:block.block.mainnavigation_2";i:14;s:29:"config:block.block.searchform";i:15;s:31:"config:block.block.sitebranding";i:16;s:66:"config:block.block.views_block__highlighted_yaffs_features_block_1";i:17;s:66:"config:block.block.views_block__yaffs_admin_recent_content_block_1";i:18;s:66:"config:block.block.views_block__yaffs_documents_highlights_block_1";i:19;s:56:"config:block.block.views_block__yaffs_user_logos_block_1";i:20;s:37:"config:block.block.yaffs_account_menu";i:21;s:33:"config:block.block.yaffs_block_10";i:22;s:32:"config:block.block.yaffs_block_5";i:23;s:32:"config:block.block.yaffs_block_6";i:24;s:32:"config:block.block.yaffs_block_8";i:25;s:32:"config:block.block.yaffs_block_9";i:26;s:36:"config:block.block.yaffs_breadcrumbs";i:27;s:32:"config:block.block.yaffs_content";i:28;s:29:"config:block.block.yaffs_help";i:29;s:36:"config:block.block.yaffs_local_tasks";i:30;s:33:"config:block.block.yaffs_messages";i:31;s:35:"config:block.block.yaffs_page_title";i:32;s:32:"config:block.block.yaffs_user_21";i:33;s:31:"config:block.block.yaffsinspace";i:34;s:17:"config:block_list";i:35;s:24:"config:color.theme.yaffs";i:36;s:31:"config:filter.format.basic_html";i:37;s:30:"config:filter.format.full_html";i:38;s:29:"config:filter.format.raw_html";i:39;s:22:"config:search.settings";i:40;s:26:"config:system.menu.account";i:41;s:23:"config:system.menu.main";i:42;s:24:"config:system.menu.tools";i:43;s:18:"config:system.site";i:44;s:26:"config:user.role.anonymous";i:45;s:13:"http_response";i:46;s:7:"node:37";i:47;s:9:"node_view";i:48;s:8:"rendered";i:49;s:6:"user:0";i:50;s:6:"user:1";}s:14:"*cacheMaxAge";i:-1;}s:14:"*attachments";a:5:{s:7:"library";a:9:{i:0;s:14:"core/html5shiv";i:1;s:11:"system/base";i:2;s:15:"bootstrap/theme";i:3;s:20:"yaffs/global-styling";i:4;s:23:"yaffs/bootstrap-scripts";i:5;s:19:"yaffs/yaffs-helpers";i:6;s:17:"bootstrap/popover";i:7;s:17:"bootstrap/tooltip";i:8;s:50:"environment_indicator/drupal.environment_indicator";}s:9:"html_head";a:22:{i:0;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:5:"title";s:7:"content";s:75:"Yaffs Original Specification | Yaffs - A Flash File System for embedded use";}}i:1;s:5:"title";}i:1;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:13:"news_keywords";s:7:"content";s:17:"Flash File System";}}i:1;s:13:"news_keywords";}i:2;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:11:"description";s:7:"content";s:223:"The initial specification for Yaffs. Circa 2002. Details of the filing system, including short backgrounder. Read this if you want to know what it is, what it does and how it works. This specification does not cover Yaffs2.";}}i:1;s:11:"description";}i:3;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"abstract";s:7:"content";s:352:"Yaffs (Yet Another Flash File System) is an open-source file system specifically designed to be fast, robust and suitable for embedded use with NAND and NOR Flash. It is widely used with Linux, RTOSs, or no OS at all, in consumer devices and critical infrastructure. It is available under GNU Public License, GPL, or on commercial terms from Aleph One.";}}i:1;s:8:"abstract";}i:4;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"keywords";s:7:"content";s:82:"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs";}}i:1;s:8:"keywords";}i:5;a:2:{i:0;a:3:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:1:{s:7:"charset";s:5:"utf-8";}s:7:"#weight";i:-1000;}i:1;s:24:"system_meta_content_type";}i:6;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:9:"Generator";s:7:"content";s:33:"Drupal 8 (https://www.drupal.org)";}}i:1;s:21:"system_meta_generator";}i:7;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:15:"MobileOptimized";s:7:"content";s:5:"width";}}i:1;s:15:"MobileOptimized";}i:8;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:16:"HandheldFriendly";s:7:"content";s:4:"true";}}i:1;s:16:"HandheldFriendly";}i:9;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"viewport";s:7:"content";s:37:"width=device-width, initial-scale=1.0";}}i:1;s:8:"viewport";}i:10;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:125:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1151";}i:11;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:124:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1152";}i:12;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:122:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1153";}i:13;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:123:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1149";}i:14;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:129:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1150";}i:15;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:125:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1148";}i:16;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:126:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1147";}i:17;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:128:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1154";}i:18;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:13:"shortcut icon";s:4:"href";s:38:"/sites/default/files/yaffs_favicon.png";s:4:"type";s:9:"image/png";}}i:1;s:67:"html_head_link:shortcut icon:/sites/default/files/yaffs_favicon.png";}i:19;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:9:"canonical";s:4:"href";s:38:"/archives/yaffs-original-specification";}}i:1;s:63:"html_head_link:canonical:/archives/yaffs-original-specification";}i:20;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:9:"shortlink";s:4:"href";s:8:"/node/37";}}i:1;s:33:"html_head_link:shortlink:/node/37";}i:21;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:8:"revision";s:4:"href";s:38:"/archives/yaffs-original-specification";}}i:1;s:62:"html_head_link:revision:/archives/yaffs-original-specification";}}s:12:"placeholders";a:0:{}s:14:"drupalSettings";a:5:{s:4:"path";a:7:{s:7:"baseUrl";s:1:"/";s:10:"scriptPath";N;s:10:"pathPrefix";s:0:"";s:11:"currentPath";s:7:"node/37";s:18:"currentPathIsAdmin";b:0;s:7:"isFront";b:0;s:15:"currentLanguage";s:2:"en";}s:15:"pluralDelimiter";s:1:"";s:9:"bootstrap";a:25:{s:28:"forms_has_error_value_toggle";i:1;s:15:"modal_animation";i:1;s:14:"modal_backdrop";s:4:"true";s:14:"modal_keyboard";i:1;s:10:"modal_show";i:1;s:10:"modal_size";s:0:"";s:15:"popover_enabled";i:1;s:17:"popover_animation";i:1;s:17:"popover_container";s:4:"body";s:15:"popover_content";s:0:"";s:13:"popover_delay";s:1:"0";s:12:"popover_html";i:0;s:17:"popover_placement";s:5:"right";s:16:"popover_selector";s:0:"";s:13:"popover_title";s:0:"";s:15:"popover_trigger";s:5:"click";s:25:"popover_trigger_autoclose";i:1;s:15:"tooltip_enabled";i:1;s:17:"tooltip_animation";i:1;s:17:"tooltip_container";s:4:"body";s:13:"tooltip_delay";s:1:"0";s:12:"tooltip_html";i:0;s:17:"tooltip_placement";s:9:"auto left";s:16:"tooltip_selector";s:0:"";s:15:"tooltip_trigger";s:5:"hover";}s:14:"ajaxTrustedUrl";a:1:{s:12:"/search/node";b:1;}s:4:"user";a:2:{s:3:"uid";i:0;s:15:"permissionsHash";s:64:"aa7fc4c8fb40c7a8665ccd12fea07926dff0f59b9ee3346bc513c6399bee5b01";}}s:11:"http_header";a:3:{i:0;a:3:{i:0;s:4:"Link";i:1;s:57:"</archives/yaffs-original-specification>; rel="canonical"";i:2;b:0;}i:1;a:3:{i:0;s:4:"Link";i:1;s:27:"</node/37>; rel="shortlink"";i:2;b:0;}i:2;a:3:{i:0;s:4:"Link";i:1;s:56:"</archives/yaffs-original-specification>; rel="revision"";i:2;b:0;}}}}