INSERT INTO `cache_render` VALUES ('https://yaffs.net/documents/detail:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 12:52:05 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:11:\"UNCACHEABLE\";}s:4:\"link\";a:3:{i:0;s:108:\"</sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh>; rel=preload; as=style\";i:1;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; rel=preload; as=style\";i:2;s:99:\"</sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.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:\"Thu, 26 Oct 2017 12:52:05 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509022325\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:20734:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"Documents - Detail | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" 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.\" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n\n    <title>Documents - Detail | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-documents navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  Documents - Detail\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\">Documents - Detail</h1>\n\n      <nav class=\"tabs\" role=\"navigation\" aria-label=\"Tabs\">\n        <h2 class=\"visually-hidden\">Primary tabs</h2>\n  <ul class=\"tabs--primary nav nav-tabs\"><li><a href=\"/documents\" data-drupal-link-system-path=\"documents\">Main</a></li>\n<li class=\"active\"><a href=\"/documents/detail\" data-drupal-link-system-path=\"documents/detail\" class=\"is-active\">Detail<span class=\"visually-hidden\">(active tab)</span></a></li>\n<li><a href=\"/documents/technical\" data-drupal-link-system-path=\"documents/technical\">Technical</a></li>\n<li><a href=\"/documents/archive\" data-drupal-link-system-path=\"documents/archive\">Archive</a></li>\n<li><a href=\"/documents/video\" data-drupal-link-system-path=\"documents/video\">Video</a></li>\n</ul>\n\n    </nav>\n    <div class=\"views-element-container form-group\"><div class=\"view view-yaffs-documents view-id-yaffs_documents view-display-id-page_2 js-view-dom-id-bf489b36ffd45419c99c5f25003f7027a46991fec0ad6cd5a0b75fdb17a64060\">\n  \n    \n      \n      <div class=\"view-content\">\n        <div class=\"table-responsive\">\n<table class=\"table table-hover\">\n        <thead>\n    <tr>\n                                      <th class=\"views-field views-field-title\" scope=\"col\"></th>\n                                      <th id=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\" scope=\"col\">Content</th>\n                                      <th class=\"priority-low views-field views-field-upload\" id=\"view-upload-table-column\" scope=\"col\">PDF/Attachment</th>\n          </tr>\n    </thead>\n    <tbody>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/yaffs-2-specification\" hreflang=\"und\">Yaffs 2 Specification</a>\n<p>The initial specification for Yaffs version 2. Describes the development of Yaffs to deal with next-generation NAND chips which have larger (2Kb) pages and don\'t allow page rewrites. This newer design is be significantly faster (write: 1.5x-5x, delete: 4x, garbage collection: 2x) and has 25-50% lower RAM footfrint.</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/internal-history-yaffs\" hreflang=\"und\">The Internal History of YAFFS</a>A brief look into the history of YAFFS through a look at the the internals.        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/comparison-between-yaffs-yaffs2-and-jffs2\" hreflang=\"und\">Comparison between Yaffs (Yaffs2) and JFFS2</a>If you are trying to decide between Yaffs and JFFS2 then this note will give you an idea of the relative advantages of each.        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/yaffs-porting-guide\" hreflang=\"und\">Yaffs Porting Guide</a>The purpose of this document is to describe how to bring up Yaffs2 on a board previously unsupported using the Yaffs Direct Interface, with an example using eCos on a Balloon board.        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/yaffs-robustness-and-testing\" hreflang=\"und\">YAFFS Robustness and Testing</a>\n<p>This document describes some of the important design criteria and design features used to achieve a robust design suitable for modern embedded systems which need to store critical data.&nbsp; The test methodologies are also described.</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsRobustnessAndTesting.pdf\" type=\"application/pdf; length=143414\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsRobustnessAndTesting.pdf</a></span><span class=\"file-size\">140.05 KB</span></span>        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/running-yaffs-direct-tests\" hreflang=\"und\">Running Yaffs Direct Tests</a>\n<p>This provides a outline to the various tests that are incorporated into Yaffs Direct. Most of these tests were written as debug tools to test error response by various Yaffs functions. These and others can be used to check if Yaffs is working properly.</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsDirectTests.pdf\" type=\"application/pdf; length=53457\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsDirectTests.pdf</a></span><span class=\"file-size\">52.2 KB</span></span>        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/yaffs-nand-flash-failure-mitigation\" hreflang=\"und\">Yaffs NAND flash failure mitigation</a>NAND flash is one of very few types of electronic device which are knowingly shipped with errors and are expected to generate further errors without causing system failure. This document describes the most important failure modes and how they may be addressed in software.        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsNandFailureMitigation.pdf\" type=\"application/pdf; length=235109\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsNandFailureMitigation.pdf</a></span><span class=\"file-size\">229.6 KB</span></span>        </td>\n          </tr>\n    </tbody>\n</table>\n  </div>\n\n    </div>\n  \n          </div>\n</div>\n\n\n  </div>\n\n              </section>\n\n                </div>\n  </div>\n\n      <footer class=\"footer container\" role=\"contentinfo\">\n        <div class=\"primary_footer row\">\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col1\">\n    <section id=\"block-yaffs-block-6\" class=\"block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<ul class=\"fa-ul\">\n<li><i class=\"fa-li fa fa-phone\"></i>+44 (0)1223 811679</li>\n<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>\n</ul>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col4\">\n    <section id=\"block-footerlegal\" class=\"block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-right\">&nbsp;<a href=\"/legal\">Legal &amp; Cookies</a></p>\n</div>\n      \n  </section>\n\n<section id=\"block-cookieinfo\" class=\"block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-justify\"><br />\nWe use <a href=\"/legal\">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n        </div>\n        <div class = \"secondary_footer row\">\n            <div class=\"col-sm-12\">\n                <div class=\"region region-footer\">\n    <nav role=\"navigation\" aria-labelledby=\"block-yaffs-account-menu-menu\" id=\"block-yaffs-account-menu\">\n            <h2 class=\"sr-only\" id=\"block-yaffs-account-menu-menu\">User account menu</h2>\n\n      \n              <ul class=\"menu nav navbar-nav navbar-right\">\n                            <li>\n        <a href=\"/user/login\" data-drupal-link-system-path=\"user/login\">Log in</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n\n  </div>\n\n            </div>\n        </div>\n    </footer>\n  \n    \n    <script type=\"application/json\" data-drupal-selector=\"drupal-settings-json\">{\"path\":{\"baseUrl\":\"\\/\",\"scriptPath\":null,\"pathPrefix\":\"\",\"currentPath\":\"documents\\/detail\",\"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>\n<script src=\"/sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.js\"></script>\n\n  </body>\n</html>\n\";s:10:\"\0*\0version\";s:3:\"1.0\";s:13:\"\0*\0statusCode\";i:200;s:13:\"\0*\0statusText\";s:2:\"OK\";s:10:\"\0*\0charset\";N;s:23:\"\0*\0cacheabilityMetadata\";O:35:\"Drupal\\Core\\Cache\\CacheableMetadata\":3:{s:16:\"\0*\0cacheContexts\";a:17:{i:0;s:26:\"languages:language_content\";i:1;s:28:\"languages:language_interface\";i:2;s:5:\"route\";i:3;s:32:\"route.menu_active_trails:account\";i:4;s:29:\"route.menu_active_trails:main\";i:5;s:30:\"route.menu_active_trails:tools\";i:6;s:5:\"theme\";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:24:\"user.roles:authenticated\";}s:12:\"\0*\0cacheTags\";a:62:{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:30:\"config:field.storage.node.body\";i:37;s:32:\"config:field.storage.node.upload\";i:38;s:31:\"config:filter.format.basic_html\";i:39;s:30:\"config:filter.format.full_html\";i:40;s:29:\"config:filter.format.raw_html\";i:41;s:22:\"config:search.settings\";i:42;s:26:\"config:system.menu.account\";i:43;s:23:\"config:system.menu.main\";i:44;s:24:\"config:system.menu.tools\";i:45;s:18:\"config:system.site\";i:46;s:26:\"config:user.role.anonymous\";i:47;s:33:\"config:views.view.yaffs_documents\";i:48;s:7:\"file:78\";i:49;s:7:\"file:82\";i:50;s:7:\"file:83\";i:51;s:13:\"http_response\";i:52;s:8:\"node:358\";i:53;s:8:\"node:359\";i:54;s:8:\"node:369\";i:55;s:7:\"node:38\";i:56;s:8:\"node:420\";i:57;s:8:\"node:454\";i:58;s:8:\"node:455\";i:59;s:9:\"node_list\";i:60;s:8:\"rendered\";i:61;s:6:\"user:0\";}s:14:\"\0*\0cacheMaxAge\";i:0;}s:14:\"\0*\0attachments\";a:4:{s:7:\"library\";a:11:{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:18:\"views/views.module\";i:9;s:27:\"core/drupal.tableresponsive\";i:12;s:50:\"environment_indicator/drupal.environment_indicator\";}s:9:\"html_head\";a:19:{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:65:\"Documents - Detail | 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: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: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\";}}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:16:\"documents/detail\";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\";}}}}',-1,1509022325.423,1,'block_content:18 block_content:23 block_content:7 block_content_view block_view config:block.block.choosingyaffs config:block.block.cookieinfo config:block.block.downloadyaffs config:block.block.footerlegal config:block.block.frontimagehighlight2 config:block.block.frontpagehero config:block.block.frontpageprimeryaffs config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.searchform config:block.block.sitebranding config:block.block.views_block__highlighted_yaffs_features_block_1 config:block.block.views_block__yaffs_admin_recent_content_block_1 config:block.block.views_block__yaffs_documents_highlights_block_1 config:block.block.views_block__yaffs_user_logos_block_1 config:block.block.yaffs_account_menu config:block.block.yaffs_block_10 config:block.block.yaffs_block_5 config:block.block.yaffs_block_6 config:block.block.yaffs_block_8 config:block.block.yaffs_block_9 config:block.block.yaffs_breadcrumbs config:block.block.yaffs_content config:block.block.yaffs_help config:block.block.yaffs_local_tasks config:block.block.yaffs_messages config:block.block.yaffs_page_title config:block.block.yaffs_user_21 config:block.block.yaffsinspace config:block_list config:color.theme.yaffs config:field.storage.node.body config:field.storage.node.upload config:filter.format.basic_html config:filter.format.full_html config:filter.format.raw_html config:search.settings config:system.menu.account config:system.menu.main config:system.menu.tools config:system.site config:user.role.anonymous config:views.view.yaffs_documents file:78 file:82 file:83 http_response node:358 node:359 node:369 node:38 node:420 node:454 node:455 node_list rendered user:0','3509'),('https://yaffs.net/documents/faq:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 11:22:39 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:4:\"MISS\";}s:4:\"link\";a:6:{i:0;s:33:\"</documents/faq>; rel=\"canonical\"\";i:1;s:28:\"</node/448>; rel=\"shortlink\"\";i:2;s:32:\"</documents/faq>; rel=\"revision\"\";i:3;s:108:\"</sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh>; rel=preload; as=style\";i:4;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; 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:\"Thu, 26 Oct 2017 11:22:39 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509016959\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:18543:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"FAQ | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" content=\"Common questions about Yaffs technical issues.\" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n<link rel=\"canonical\" href=\"/documents/faq\" />\n<link rel=\"shortlink\" href=\"/node/448\" />\n<link rel=\"revision\" href=\"/documents/faq\" />\n\n    <title>FAQ | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-node page-node-type-paper navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  FAQ\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\"><span>FAQ</span>\n</h1>\n\n  <article role=\"article\" about=\"/documents/faq\" class=\"paper full clearfix\">\n\n  \n    \n\n      <footer>\n      \n      <div class=\"author\">\n        Submitted by <span><span lang=\"\" about=\"/user/admin\" typeof=\"schema:Person\" property=\"schema:name\" datatype=\"\">Admin</span></span>\n on <span>8 July, 2012 - 11:30pm</span>\n        \n      </div>\n    </footer>\n  \n  <div class=\"content\">\n    \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\"><h3><em>What Operating System (OS) can you use with Yaffs?</em></h3>\n\n<p>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 POSIX-compliant, so commands in an application calling POSIX functions will usually work.</p>\n\n<p>Windows CE uses the Microsoft file handling model and is not POSIX-like. The difference is handled in the Windows CE wrapper.  Contact us for more information.</p>\n\n<p>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.</p>\n\n<p>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:-</p>\n\n<h3><em>What CPU can you use with Yaffs?</em></h3>\n\n<p>Yaffs has been used with many 32-bit and 64-bit CPUs including MIPS, 68000, ColdFire, PowerPC, x86 variants and many ARM-cored CPUs. It should work with 16-bit CPUs but has not been tested.</p>\n\n<h3><em>Does Yaffs care Which-Endian the CPU is?</em></h3>\n\n<p>No, Yaffs works with Big-Endian and Little-Endian CPUs</p>\n\n<h3><em>How big can the whole file system be, and how big can individual files be?</em></h3>\n\n<p>Yaffs2, which is now standard, can handle a File System (FS) of many Gigabytes total storage; some people are using it with 6GB satisfactorily. <em>Individual</em> 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.</p>\n\n<p>A coarser granularity of larger chunks can probably be obtained, with knock-on effects in other parameters like RAM usage.</p>\n\n<h3><em>How many files can there be?</em></h3>\n\n<p>There is no hard limit. Available flash and RAM will limit this.</p>\n\n<h3><em>What about directories etc?</em></h3>\n\n<p>Yaffs supports many different objects including: directories, regular files, hard links, symbolic links and device nodes.</p>\n\n<p>Yaffs supports long file names, attributes, extended attributes and Unicode.</p>\n\n<h3><em>How much RAM does it need?</em></h3>\n\n<p>This depends particularly on the number of tnodes, which in turn depends on the file size, and is therefore a dynamic variable.</p>\n\n<p>However, Yaffs compares favourably with other similar systems specialised for Flash, and includes robust error handling.</p>\n\n<h4><em>How are errors handled?</em></h4>\n\n<p>Error Correction Code (ECC) is used to correct for single-bit errors.</p>\n\n<p>ECC may use built-in code or that provided from other sources (flash controllers, ECC libraries etc).</p>\n\n<p>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.</p>\n\n<h3><em>What about Multi-level cell (MLC) chips?</em></h3>\n\n<p>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.</p>\n\n<p>MLC also has various write restrictions, which are obeyed by Yaffs2.</p>\n\n<p>Yaffs2 has some features such as block refreshing to help alleviate the problems associated with MLC.</p>\n\n<p>MLC generally requires multi-bit ECC. Hardware ECC is preferred since it is faster and requires less computation than software multi-bit correction..</p>\n\n<h3><em>How robust is Yaffs ?</em></h3>\n\n<p>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.</p>\n\n<p>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 <em>free pool</em> and the next allocation comes from this <em>free pool. </em>This randomness tends to spread the blocks in use, giving some wear levelling, rather than one part of the file always being worked intensively.</p>\n\n<p>Accelerated lifetime testing has been carried out to seek evidence for excessive wear. For example on one professional PDA-style device used by surveyors in the field we determined that extreme lifetime usage would be:</p>\n\n<ul><li>20MB per day.</li>\n	<li>200 days per year</li>\n	<li>10 year lifetime</li>\n	<li>Total 40Gbytes lifetime write.</li>\n</ul><p>We then ran well over 200Gbytes of writing through a specially designed File System Exerciser, a multi-threaded application that writes, reads, verifies, then deletes, repeatedly. There was no sign of a single bit of corruption at the end of the test.</p>\n\n<p>Another test applied randomly timed power failures repeatedly while running test code. Millions of cycles have been executed without any errors being observed.</p>\n\n<p>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.</p>\n\n<h3><em>How big is its code?</em></h3>\n\n<p>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 Posix-like interface is around 2k lines.</p>\n\n<h3>Glossary and useful links.</h3>\n\n<table><colgroup><col /><col /></colgroup><tr><td>\n			<p>Big-endian and Little-endian</p>\n			</td>\n			<td>\n			<p>Big-endian is when the most significant data chunk is listed first. Little-endian is when the least significant data chunk is listed first.</p>\n\n			<p><em>http://en.wikipedia.org/wiki/Endianness</em></p>\n			</td>\n		</tr><tr><td>\n			<p>tnodes</p>\n			</td>\n			<td>\n			<p>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.</p>\n\n			<p>See the HowYaffs Works document for more information.</p>\n			</td>\n		</tr><tr><td>\n			<p>ECC</p>\n			</td>\n			<td>\n			<p>Error correction codes, See the <em>Yaffs Error mitigation</em> document.</p>\n			</td>\n		</tr><tr><td>\n			<p>MLC</p>\n			</td>\n			<td>\n			<p>Multi-level 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. <em>http://en.wikipedia.org/wiki/Multi-level_cell</em></p>\n\n			<p> </p>\n			</td>\n		</tr></table><p> </p></div>\n      \n  </div>\n\n</article>\n\n\n  </div>\n\n              </section>\n\n                </div>\n  </div>\n\n      <footer class=\"footer container\" role=\"contentinfo\">\n        <div class=\"primary_footer row\">\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col1\">\n    <section id=\"block-yaffs-block-6\" class=\"block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<ul class=\"fa-ul\">\n<li><i class=\"fa-li fa fa-phone\"></i>+44 (0)1223 811679</li>\n<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>\n</ul>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col4\">\n    <section id=\"block-footerlegal\" class=\"block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-right\">&nbsp;<a href=\"/legal\">Legal &amp; Cookies</a></p>\n</div>\n      \n  </section>\n\n<section id=\"block-cookieinfo\" class=\"block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-justify\"><br />\nWe use <a href=\"/legal\">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n        </div>\n        <div class = \"secondary_footer row\">\n            <div class=\"col-sm-12\">\n                <div class=\"region region-footer\">\n    <nav role=\"navigation\" aria-labelledby=\"block-yaffs-account-menu-menu\" id=\"block-yaffs-account-menu\">\n            <h2 class=\"sr-only\" id=\"block-yaffs-account-menu-menu\">User account menu</h2>\n\n      \n              <ul class=\"menu nav navbar-nav navbar-right\">\n                            <li>\n        <a href=\"/user/login\" data-drupal-link-system-path=\"user/login\">Log in</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n\n  </div>\n\n            </div>\n        </div>\n    </footer>\n  \n    \n    <script type=\"application/json\" data-drupal-selector=\"drupal-settings-json\">{\"path\":{\"baseUrl\":\"\\/\",\"scriptPath\":null,\"pathPrefix\":\"\",\"currentPath\":\"node\\/448\",\"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>\n<script src=\"/sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js\"></script>\n\n  </body>\n</html>\n\";s:10:\"\0*\0version\";s:3:\"1.0\";s:13:\"\0*\0statusCode\";i:200;s:13:\"\0*\0statusText\";s:2:\"OK\";s:10:\"\0*\0charset\";N;s:23:\"\0*\0cacheabilityMetadata\";O:35:\"Drupal\\Core\\Cache\\CacheableMetadata\":3:{s:16:\"\0*\0cacheContexts\";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:\"\0*\0cacheTags\";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:8:\"node:448\";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:\"\0*\0cacheMaxAge\";i:-1;}s:14:\"\0*\0attachments\";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:50:\"FAQ | 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:46:\"Common questions about Yaffs technical issues.\";}}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:14:\"/documents/faq\";}}i:1;s:39:\"html_head_link:canonical:/documents/faq\";}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:9:\"/node/448\";}}i:1;s:34:\"html_head_link:shortlink:/node/448\";}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:14:\"/documents/faq\";}}i:1;s:38:\"html_head_link:revision:/documents/faq\";}}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:8:\"node/448\";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:33:\"</documents/faq>; rel=\"canonical\"\";i:2;b:0;}i:1;a:3:{i:0;s:4:\"Link\";i:1;s:28:\"</node/448>; rel=\"shortlink\"\";i:2;b:0;}i:2;a:3:{i:0;s:4:\"Link\";i:1;s:32:\"</documents/faq>; rel=\"revision\"\";i:2;b:0;}}}}',-1,1509016959.502,1,'block_content:18 block_content:23 block_content:7 block_content_view block_view config:block.block.choosingyaffs config:block.block.cookieinfo config:block.block.downloadyaffs config:block.block.footerlegal config:block.block.frontimagehighlight2 config:block.block.frontpagehero config:block.block.frontpageprimeryaffs config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.searchform config:block.block.sitebranding config:block.block.views_block__highlighted_yaffs_features_block_1 config:block.block.views_block__yaffs_admin_recent_content_block_1 config:block.block.views_block__yaffs_documents_highlights_block_1 config:block.block.views_block__yaffs_user_logos_block_1 config:block.block.yaffs_account_menu config:block.block.yaffs_block_10 config:block.block.yaffs_block_5 config:block.block.yaffs_block_6 config:block.block.yaffs_block_8 config:block.block.yaffs_block_9 config:block.block.yaffs_breadcrumbs config:block.block.yaffs_content config:block.block.yaffs_help config:block.block.yaffs_local_tasks config:block.block.yaffs_messages config:block.block.yaffs_page_title config:block.block.yaffs_user_21 config:block.block.yaffsinspace config:block_list config:color.theme.yaffs config:filter.format.basic_html config:filter.format.full_html config:filter.format.raw_html config:search.settings config:system.menu.account config:system.menu.main config:system.menu.tools config:system.site config:user.role.anonymous http_response node:448 node_view rendered user:0 user:1','3162'),('https://yaffs.net/documents/how-yaffs-works:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 11:25:53 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:4:\"MISS\";}s:4:\"link\";a:6:{i:0;s:45:\"</documents/how-yaffs-works>; rel=\"canonical\"\";i:1;s:28:\"</node/409>; rel=\"shortlink\"\";i:2;s:44:\"</documents/how-yaffs-works>; rel=\"revision\"\";i:3;s:108:\"</sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh>; rel=preload; as=style\";i:4;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; 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:\"Thu, 26 Oct 2017 11:25:53 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509017153\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:241006:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"How Yaffs works | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" content=\"This document gives an explanation of most of the core mechanisms that make Yaffs work. As of the time of writing this, the Yaffs2 code base includes approximately 19,000 lines of code making a very detailed discussion impractical. This document is the starting point for understanding Yaffs. Further detailed questions and discussions are welcomed on the Yaffs discussion list.\" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n<link rel=\"canonical\" href=\"/documents/how-yaffs-works\" />\n<link rel=\"shortlink\" href=\"/node/409\" />\n<link rel=\"revision\" href=\"/documents/how-yaffs-works\" />\n\n    <title>How Yaffs works | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-node page-node-type-paper navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  How Yaffs works\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\"><span>How Yaffs works</span>\n</h1>\n\n  <article role=\"article\" about=\"/documents/how-yaffs-works\" class=\"paper is-promoted full clearfix\">\n\n  \n    \n\n      <footer>\n      \n      <div class=\"author\">\n        Submitted by <span><span lang=\"\" about=\"/user/charles-manning\" typeof=\"schema:Person\" property=\"schema:name\" datatype=\"\">Charles Manning</span></span>\n on <span>2 June, 2012 - 12:28am</span>\n        \n      </div>\n    </footer>\n  \n  <div class=\"content\">\n    \n      <div class=\"field field--name-upload field--type-file field--label-hidden field--items\">\n              <div class=\"field--item\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/HowYaffsWorks.pdf\" type=\"application/pdf; length=402514\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">HowYaffsWorks.pdf</a></span><span class=\"file-size\">393.08 KB</span></span></div>\n          </div>\n  \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p style=\"margin-top: 0.42cm; orphans: 0; widows: 0; page-break-after: avoid\"><br />\n<br />\n</p>\n<p>This document aims to give an explanation of most of the core mechanisms that make Yaffs work. </p>\nThis document is the starting point for understanding Yaffs.\n<h1 class=\"western\">1 Purpose</h1>\n<p>The purpose of this document is to give a reasonable explanation of most of the core mechanisms that make Yaffs work. As of the time of writing this, the Yaffs2 code base includes approximately 19,000 lines of code making a very detailed discussion impractical.</p>\n<p>This document should serve as a first port of call for understanding Yaffs. Further detailed questions and discussions are welcomed on the Yaffs discussion list.</p>\n<p>This document is updated periodically. Yaffs mechanism design changes from time to time and this document will not always reflect the most up to date code. </p>\n<h1 class=\"western\">2 What is Yaffs?</h1>\n<p>Yaffs stands for <i>Yet Another Flash File System</i>, a term coined by Charles Manning in 2001 when suggesting that the already cluttered flash file system space could do with yet another offering – this time a flash file system designed from the ground up to work with NAND flash.</p>\n<p>The first release of Yaffs was developed during the end of 2001 and the beginning of 2002. By mid-2002, Yaffs was being trialled in various products. In May 2002, Yaffs was announced and a few more projects started playing with it. In June, porting to other OSs started. In September 2002, Yaffs was announced on linuxdevices.com which started a far wider uptake of Yaffs.</p>\n<p>Yaffs1, the original version of Yaffs, supported 512-byte page NAND devices with a SmartMedia-like memory layout.</p>\n<p>Yaffs2 is a follow-up to Yaffs1 extending Yaffs1 to support larger and different devices with different constraints.</p>\n<p>Yaffsis highly portable and has been used in many different products and applications as varied as sewing machines, point of sale, phones and aerospace. Yaffs has been used with multiple different operating systems. Native support is available for Linux, WindowsCE and eCOS while Yaffs Direct Interface provides a layer that can be used in other applications such as RTOSs. Yaffs has been used with multiple different CPUs and compilers.</p>\n<p>Yaffs has also been used as a NOR file system and even as a RAM file system.</p>\n<h1 class=\"western\">3 Design and coding strategies</h1>\n<p>Yaffs is designed to work in multiple environments which drives the need for portability. Portability also improves the debugging and testing since it is easier to develop and debug code in an application environment than within an OS kernel. This generally allows Yaffs to progress faster with less programming resources and provides more varied testing. Primary strategies that improve portability include:</p>\n<ul>\n<li>\n<p>No OS-specific features used in main code body.</p>\n </li>\n<li>\n<p>No compiler-specific features used in the main code body.</p>\n </li>\n<li>\n<p>Abstract types and functions used to allow Unicode or ASCII operation.</p>\n </li>\n</ul>\n<p style=\"page-break-before: auto; page-break-after: avoid\">Simplicity is another key goal. Complexity is limited to those situations that provide significant improvements to performance or utility. Simplicity improves robustness and the ease of integration and development. Primary strategies that improve simplicity are:</p>\n<ul>\n<li>\n<p>Single threaded model. Yaffs is locked on a per-partition basis at a high level. This is simpler than tracking lower-level locking. Yaffs Direct Interface uses a single lock for all partitions.</p>\n </li>\n</ul>\n<ul>\n<li>\n<p>Log structure makes for a simpler garbage collector and allocation methodology.</p>\n </li>\n<li>\n<p>Abstractions that build layered code which is easier to understand, port and debug.</p>\n </li>\n</ul>\n<h1 class=\"western\">4 Terminology: Yaffs vs Yaffs1 vs Yaffs2</h1>\n<p>Before we embark on our quest to understand what Yaffs is, a terminology explanation is in order.</p>\n<p>There are two versions of Yaffs code: the original Yaffs code-base and the current Yaffs2 code-base. The Yaffs2 code-base supports functionality provided by the Yaffs code-base as well as being extended with new functionality to provide extra modes of operation, most importantly those required to work with larger and more modern NAND parts. The Yaffs2 code-base supports the Yaffs1 mode of operation through a backward compatibility mode.</p>\n<p>Unless explicitly mentioned, this text refers to the Yaffs2 code-base.</p>\n<p>This text uses three terms Yaffs, Yaffs1 and Yaffs2 depending on various modes of operation.</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Yaffs1 is a simpler mode of operation that uses deletion markers to track state. </span> </p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Yaffs2 is a more complex mode of operating that was developed to support larger modern flash types, in particular MLC NAND, that cannot used deletion markers.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Yaffs means operations common to both.</span></p>\n </li>\n</ul>\n<p>Yaffs1 originally only worked with 512-byte page devices but has been extended to support larger flash pages such as Intel M18 flash with 1k pages.</p>\n<p>Yaffs2 was originally designed for 1k or larger page sizes but can be used with smaller pages by using in-band tags.</p>\n<p>Since the Yaffs1 mode of operation is simpler to understand than the Yaffs2 mode of operation, Yaffs1 will be described first and readers interested in Yaffs2 operation should first fully acquaint themselves with the Yaffs1 mode of operation. It is suggested that this document be read sequentially rather than browsing it.</p>\n<h1 class=\"western\">5 Objects</h1>\n<p>In Yaffs-speak, an Object is anything that is stored in the file system. These are:</p>\n<ul>\n<li>\n<p>Regular data files</p>\n </li>\n<li>\n<p>Directories</p>\n </li>\n<li>\n<p>Hard-links</p>\n </li>\n<li>\n<p>Symbolic links</p>\n </li>\n<li>\n<p>Special objects (pipes, devices etc).</p>\n </li>\n</ul>\n<p>All objects are identified by a unique integer object id (<i><b>obj_id</b></i><i><b>)</b></i>.</p>\n<p>In the standard POSIX model, as used by Linux, there are inodes and directory entries (dentries). </p>\n<p>An inode may be a regular file, directory, or special file.</p>\n<p>Directory entries provide the naming mechanism that is used to locate inodes.</p>\n<p>Under POSIX, each inode may have zero, one or many dentries:</p>\n<ul>\n<li>\n<p>One dentry per inode is commonly understood.</p>\n </li>\n<li>\n<p>Multiple dentries per inode allow the same inode to be accessed via multiple names. This is achieved through hard links.</p>\n </li>\n<li>\n<p>Zero dentries per inode is less often understood. This happens when an inode is unlinked while there is still a handle open to the inode. The unlinking deletes the dentry but the inode still exists. As soon as the handle is closed the inode is deleted too.</p>\n </li>\n</ul>\n<h1 class=\"western\">6 The Yaffs NAND model</h1>\n<p>The memory in NAND flash is arranged in <i><b>pages.</b></i> A page is the unit of allocation and programming. In Yaffs, the unit of allocation is the <i></i><i><b>chunk</b></i>. Typically a chunk will be the same as a NAND page, but there is flexibility to use chunks which map to multiple pages (eg. A system may have two NAND chips in parallel requiring 2x2048 = 4096 byte chunks) . This distinction gives a lot of flexibility in how the system can be configured. In this text the term page and chunk are synonymous unless stated otherwise.</p>\n<p>Many, typically 32 to 128 but as many as a few hundred, chunks form a <i><b>block</b></i>. A block is the unit of erasure. </p>\n<p>NAND flash may be shipped with bad blocks and further blocks may go bad during the operation of the device. Thus, Yaffs is aware of bad blocks and needs to be able to detect and mark bad blocks.</p>\n<p>NAND flash also typically requires the use of some sort of error detection and correction code (ECC). Yaffs can either use existing ECC logic or provide its own.</p>\n<h1 class=\"western\">7 How Yaffs1 stores files</h1>\n<p>Yaffs1 has a modified log structure, while Yaffs2 (see below) has a true log structure. A true log structured file system only ever writes sequentially. Yaffs1 uses deletion markers, which breaks the sequential write rule. Yaffs2 does not use deletion markers and is thus a true log structured file system.</p>\n<p>Instead of writing data in locations specific to the files, the file system data is written in the form of a sequential log, The entries in the log are all one chunk in size and can hold one of two types of chunk:</p>\n<ul>\n<li>\n<p><i><b>Data chunk</b></i>: A chunk holding regular data file contents.</p>\n </li>\n<li>\n<p><i><b>Object Header</b></i>: A descriptor for an object (directory, regular data file, hard link, soft link, special descriptor,...). This holds details such as the identifier for the parent directory, object name, etc.</p>\n </li>\n</ul>\n<p>Each chunk has <i><b>tags</b></i> associated with it. The tags comprise the following important fields (others being ignored for now):</p>\n<ul>\n<li>\n<p><i><b>Object Id (</b></i><i><b>obj_id</b></i><i><b>)</b></i>: Identifies which object the chunk belongs to.</p>\n </li>\n<li>\n<p><i><b>Chunk Id (</b></i><i><b>chunk_id</b></i><i><b>)</b></i>: Identifies where in the file this chunk belongs. A chunk_id of zero signifies that this chunk contains an objectHeader. chunk_id==1 signifies the first chunk in the file (ie. At file offset 0), chunk_id==2 is the next chunk and so on.</p>\n </li>\n<li>\n<p><i><b>Deletion Marker (</b></i><i><b>is_deleted</b></i><i><b>)</b></i><i><b>:</b></i> (Yaffs1 only) Shows that this chunk is no longer in use.</p>\n </li>\n<li>\n<p><i><b>Byte Count</b></i><b>: </b><b>(n_bytes)</b>: Number of bytes of data if this is a data chunk.</p>\n </li>\n<li>\n<p><i><b>Serial Number </b></i><i><b>(ser</b></i><i><b>ia</b></i><i><b>l_number)</b></i>: (Yaffs1 only) Serial number used to differentiate chunks with the same obj_id and chunk_id.</p>\n </li>\n</ul>\n<p style=\"page-break-before: always\">Now let\'s bring that all together in an explanation. This is a simplified explanation and skips over issues such as Soft Deletion (mentioned later in the document). For explanation purposes, we shall consider usage of fictitious NAND type that has 4 chunks per block, starting with an empty (erased) flash.</p>\n<p>First we\'ll create a file.</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"37\" /> <col width=\"56\" /> <col width=\"67\" /> <col width=\"60\" /> <col width=\"64\" /> <col width=\"271\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p style=\"font-weight: normal\">Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p style=\"font-weight: normal\">Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 67px;\">\n <p style=\"font-weight: normal\">obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p style=\"font-weight: normal\">chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p style=\"font-weight: normal\">Deletion</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 271px;\">\n <p style=\"font-weight: normal\">Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px; height: 26px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 67px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Object Header for this file (length 0)</p>\n  </td>\n</tr>\n</table>\n<p>Next we write a few chunks of data to the file.</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"37\" /> <col width=\"48\" /> <col width=\"60\" /> <col width=\"64\" /> <col width=\"56\" /> <col width=\"290\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>Deletion</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 290px;\">\n <p>Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 290px;\">\n <p>Object Header for t<span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">his file (length 0)</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 290px;\">\n <p>First chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 290px;\">\n <p>Second chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 56px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 290px;\">\n <p>Third chunk of data</p>\n  </td>\n</tr>\n</table>\n<p>Next we close the file. This writers a new object header for the file. Notice how the previous object header is deleted.</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"37\" /> <col width=\"48\" /> <col width=\"60\" /> <col width=\"68\" /> <col width=\"60\" /> <col width=\"282\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deletion</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 282px;\">\n <p>Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 282px;\">\n <p>Obsoleted object header <span style=\"font-size: 10pt; font-size: small; font-size: small;\">(length 0)</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 282px;\">\n <p>First chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 282px;\">\n <p>Second chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 282px;\">\n <p>Third chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 68px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 282px;\">\n <p>New object header <span style=\"font-size: 10pt; font-size: small; font-size: small;\">(length n)</span></p>\n  </td>\n</tr>\n</table>\n<p style=\"page-break-before: always\">Let\'s now open the file for read/write, overwrite part of the first chunk in the file and close the file. The replaced data and object header chunks become deleted.</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 605px; border-spacing: 0px;\">\n<col width=\"37\" /> <col width=\"48\" /> <col width=\"64\" /> <col width=\"64\" /> <col width=\"71\" /> <col width=\"271\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deletion</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 271px;\">\n <p>Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete object header.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete first chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Second chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Third chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>New first chunk of file</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>New object header</p>\n  </td>\n</tr>\n</table>\n<p>Now let\'s resize the file to zero by opening the file with O_TRUNC and closing the file. This writes a new object header with length 0 and the contents are pruned making the data chunks deleted.</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"37\" /> <col width=\"48\" /> <col width=\"64\" /> <col width=\"64\" /> <col width=\"71\" /> <col width=\"271\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deletion</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 271px;\">\n <p>Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete object header.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete first chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Second chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Third chunk of data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsolete object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Deleted first chunk of file</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Delted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>Obsoleted object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 37px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 48px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 64px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 71px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 271px;\">\n <p>New object header <span style=\"font-size: 10pt; font-size: small; font-size: small;\">(length 0).</span></p>\n  </td>\n</tr>\n</table>\n<p>Note how all the pages in block 1 are now marked as deleted. This means that block 1 no longer contains useful information so we can now erase block 1 and reuse the space.</p>\n<p>We will now rename the file. To do this we write a new object header for the file</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 605px; border-spacing: 0px;\">\n<col width=\"38\" /> <col width=\"42\" /> <col width=\"58\" /> <col width=\"60\" /> <col width=\"60\" /> <col width=\"297\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>Block</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>Chunk</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>obj_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>chunk_id</p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 297px;\">\n <p>Comment</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Erased</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Erased</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Erased</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Erased</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Obsolete object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>1</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Deleted first chunk of file</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Obsoleted object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>2</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Deleted</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>Obsolete object header</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 38px;\">\n <p>3</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 42px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 58px;\">\n <p>500</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>0</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 60px;\">\n <p>Live</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 297px;\">\n <p>New object header showing new name</p>\n  </td>\n</tr>\n</table>\n<p>Block 2 now contains only deleted chunks and can be erased and reused.</p>\n<p>Note how the tags tell us:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Which chunks belong to which object</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">The position of the chunks within a file,</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Which chunks are current</span></p>\n </li>\n</ul>\n<ul>\n</ul>\n<p><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Note that there are no file allocation tables or similar structures stored in the flash. This reduces the amount of writing and erasing (improving write performance) while also improving robustness. Corruption of file allocation tables and similar structures is a common failure mechanism for embedded file systems. The lack of such structures makes Yaffs more robust. Or, to put it another way, you can\'t corrupt what you don\'t store.</span></p>\n<h1 class=\"western\">8 Garbage collection</h1>\n<p>As we have shown so far, when a block is made up only of deleted chunks, that block can be erased and reused. However, consider what will happen if we have many blocks which each have a few current chunks in them. Clearly we cannot erase any of the current blocks or we will destroy data. What we need to do is copy the useful data chunks off a block, deleting the originals and allowing the block to be erased and reused. This process is referred to as <i><b>garbage collection</b></i>.</p>\n<p>The Yaffs garbage collection process works as follows:</p>\n<ol>\n<li>\n<p>Find a block worth collecting (according the the heuristics below). If none found, then exit.</p>\n </li>\n<li>\n<p>Iterate through the chunks in the block. If the chunk is in use then create a new copy and delete the original. Fix up the RAM data structures to reflect the change.</p>\n </li>\n</ol>\n<p>Once all chunks in this block have been deleted, the block can be erased ready for reuse.</p>\n<p>Note that although step 2 deletes the original chunk when it gets copied there is not much point in actually programming the deletion marker (is_deleted flag) in flash since we\'re about to erase the block anyway. Thus Yaffs does not program the deletion marker in these cases. If power is lost part way through the operation we can still tell the difference between the original and the copy by looking at the serial number (not that it really matters anyway since the two have the same contents so either can be used).</p>\n<p>The heuristics to determine whether a block is worth collecting are as follows:</p>\n<ol>\n<li>\n<p>If there are many erased blocks available, then Yaffs does not need to work hard, but will instead only attempt to perform garbage collection of blocks with very few chunks in use. This is termed <i><b>passive</b></i> garbage collection.</p>\n </li>\n<li>\n<p>If, however, there are very few erased blocks, Yaffs will work much harder to recover more space and will garbage collect blocks with more chunks in use. This is termed <i><b>aggressive</b></i> garbage collection.</p>\n </li>\n</ol>\n<p>OK, the passive/aggressive names are a bit silly, but they were contrived around midnight... give me a break!</p>\n<p>If garbage collection is aggressive, we need erased space urgency and the whole block is collected in a single garbage collection cycle. If the collection is passive then only a few chunks are collected at a time thus spreading the effort over many garbage collection cycles. This is done to reduce garbage collection load and improve responsiveness.</p>\n<p>The rationale behind the above heuristics is to delay garbage collection when possible to reduce the amount of collection that needs to be performed, thus increasing average system performance. Yet there is a conflicting goal of trying to spread the garbage collection so that it does not all happen at the same causing fluctuations in file system throughput. These conflicting goals make garbage tuning quite challenging.</p>\n<p>All flash file systems need some sort of garbage collector to reclaim space. The garbage collector is often a determining factor in the performance of the flash file system. Many file systems have to do a significant amount of effort in a single collection sweep.</p>\n<p>Yaffs only deals with one block at a time which constrains the amount of effort in a garbage collection cycle, thus reducing the “stall time”. Under normal conditions that garbage collection is performed a few chunks at a time, further reducing “stall time”.</p>\n<h1 class=\"western\">9 Yaffs1 serial numbers</h1>\n<p>In Yaffs1, each chunk is marked with a 2-bit serial number that is incremented every time a chunk with the same tags value is replaced (eg. When a chunk is overwritten or when copied by garbage collection).</p>\n<p>Now let\'s suppose first that we did not have a serial number. </p>\n<p>Let\'s consider a rename where an object header chunk must be replaced with a new one with the new name. Yaffs could do the following:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Delete the old chunk.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Write the new chunk. </span> </p>\n </li>\n</ul>\n<p>If the system fails after the delete, the system could end up with no chunks matching the relevant tags values. This could cause files to be lost (end up in the lost+found directory). Thus, we have to write the new chunk before deleting the old chunk.</p>\n<p>But now consider what might happen if we did this:</p>\n<ul>\n<li>\n<p>W<span style=\"font-family: Liberation Serif, serif;\">rite new chunk.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Delete old chunk.</span></p>\n </li>\n</ul>\n<p>If the system failed after the write we now have two chunks that match the tags. How can we tell which one is current?</p>\n<p>The current chunk is determined by inspecting the serial number. Since the serial number is only incremented by one before the old chunk is deleted, a 2-bit serial number is sufficient. Valid pairs are:</p>\n<table cellpadding=\"4\" style=\"width: 86px; border-spacing: 0px;\">\n<col width=\"35\" /> <col width=\"33\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 35px;\">\n <p>Old</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 33px;\">\n <p>New</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 35px;\">\n <p>00</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 33px;\">\n <p>01</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 35px;\">\n <p>01</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 33px;\">\n <p>10</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 35px;\">\n <p>10</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 33px;\">\n <p>11</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 35px;\">\n <p>11</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 33px;\">\n <p>00</p>\n  </td>\n</tr>\n</table>\n<p>Thus, by inspecting the serial number attached to the old and new tags the current chunk can be determined and the old chunk can be deleted.</p>\n<h1 class=\"western\">10 Yaffs2 NAND model</h1>\n<p>Yaffs2 is an extension of Yaffs designed to fulfill a new set of objectives to work with newer NAND types including:</p>\n<ul>\n<li>\n<p>Zero overwrites. Yaffs1 only ever overwrites a single byte in the spare area of the chunks to set the deletion marker. More modern NAND devices are less tolerant of overwrites and Yaffs2 performs no overwrites at all.</p>\n </li>\n<li>\n<p>Sequential chunk writing within a block. More modern NAND reliability specifications tend to assume sequential writing. Since Yaffs2 does not write deletion markers, the writing of chunks within a block is strictly sequential.</p>\n </li>\n<li>\n<p>Some flash technologies – such as MLC – only work properly if pages are written sequentially. This is a fundamental requirement of how many MLC types perform the bit overlaying.</p>\n </li>\n</ul>\n<p>Since Yaffs2 performs less writes, there is potential for Yaffs2 to have improved write performance.</p>\n<p>Yaffs2 cannot use a deletion marker because that would violate the zero overwrites mandate and alternate mechanisms are provided to determine which chunks are current and which are deleted. These mechanisms are:</p>\n<ul>\n<li>\n<p><i><b>Sequence Number </b></i><i><b>(seq_number)</b></i>: As each block is allocated, the file system\'s sequence number is incremented and each chunk in the block is marked with that sequence number. The sequence number thus provides a way of organising the log in chronological order.</p>\n </li>\n<li>\n<p><i><b>Shrink Header Marker </b></i><i><b>(shrink_header)</b></i>: The shrink header marker is used to mark object headers that are written to shrink the size of a data file. This is explained more in the accompanying text.</p>\n </li>\n</ul>\n<p><i><b>Note: The Yaffs2 sequence number is not the same as the Yaffs1 serial number!</b></i></p>\n<p>Note: We still refer to chunk deletion in Yaffs2. The chunks are marked as deleted in the RAM data structures used by garbage collection etc, but there is no deletion marker written to flash.</p>\n<h2 class=\"western\">10.1 Sequence Number</h2>\n<ul>\n<li>\n<p>Since we\'re scanning backwards, the most recently written – and thus current – chunk matching an obj_id:chunk_id pair will be encountered first and all subsequent matching chunks must be obsolete and treated as deleted.</p>\n </li>\n<li>\n<p>The file length in object headers are used to trim back resized files. If an object header is encountered, then subsequent data chunks that lie beyond that file length are clearly obsolete and treated as deleted. Note that both current and obsolete object header sizes must be used to obtain an accurate reconstruction.</p>\n </li>\n</ul>\n<h2 class=\"western\">10.2 Shrink Header</h2>\n<p>Explaining the purpose of the shrink header marker is a bit convoluted. The purpose of a shrink header marker is to show that this object header indicates that a file has shrunken in size, and to prevent those object headers from being deleted by garbage collection. To understand this, it is easiest to consider what would happen if the shrink header markers did not exist.</p>\n<p>For simplification we\'ll assume no garbage collection happens during this part of the exercise. It is safe to make that assumption since it does not alter the reasoning.</p>\n<p>Consider a file that has been through the following:</p>\n<p class=\"code-western\"><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>#define MB (1024 * 1024)<br />\n</b></span></span><br />\n</p>\n<p class=\"code-western\"><code class=\"western\"><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">h = open(“foo”,O_CREAT| O_RDWR, S_IREAD|S_IWRITE); /* create file */</span></span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\"><br />\nwrite(h,data,5*</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">MB</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">); /* write 5 MB of data /<br />\ntruncate(h,1*</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">MB</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">); /* truncate to 1MB */<br />\nlseek(h,2*</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">MB</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">, SEEK_SET); /* set the file access position to 2MB */<br />\nwrite(h,data,1*</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">MB</span></code><code class=\"western\"><span style=\"font-size: 9pt; font-size: small; font-size: small;\">); /* write 1MB of data */<br />\nclose(h);</span></code><br />\n<br />\n</p>\n<p>The file will now be 3MB in length, but there will be a “hole” between 1MB and 2MB. According to POSIX (and to aid security etc) that “hole” should always read back as zeros.</p>\n<p>Yaffs2 would represent that in NAND with the following sequence of chunks:</p>\n<ol>\n<li>\n<p>Object header for file creation (file length = 0)</p>\n </li>\n<li>\n<p>5MB worth of data chunks (0 to 5MB)</p>\n </li>\n<li>\n<p>Object header for truncation (file length = 1MB)</p>\n </li>\n<li>\n<p>1MB worth of data chunks (2MB to 3MB)</p>\n </li>\n<li>\n<p>Object header for close (file length = 3MB)</p>\n<p>At this stage, only the the following data chunks are current:</p>\n </li>\n</ol>\n<ul>\n<li>\n<p>The first 1MB of data created in step 2 above.</p>\n </li>\n<li>\n<p>The 1MB of data created in step 4 above.</p>\n </li>\n<li>\n<p>The object header created in step 5 above.</p>\n </li>\n</ul>\n<p>But Yaffs must remember the truncation that happened in step 3, otherwise Yaffs will “forget” that there is a hole, which would cause the old data to be visible again. Thus, if Yaffs creates a hole it first writes a shrink header to indicate the start of the hole and a regular object header to mark the end of the hole. </p>\n<p>The shrink header modifies the behavior of the garbage collector to ensure that these shrink headers are not erased until it is safe to do so. This unfortunately has a negative impact on garbage collection in systems which make extensive use of files with holes.</p>\n<p>Shrink headers are also used to indicate that a file has been deleted and that the record of the file deletion is not lost.</p>\n<h2 class=\"western\">10.3 Yaffs2 extended tags</h2>\n<p>Yaffs2 extends the tags in object headers with extra fields to improve mount scanning performance. The operation of extended tags is described later in this document.</p>\n<h1 class=\"western\">11 Bad block handling NAND error handling</h1>\n<p>NAND flash is designed to be very low cost and very high density. In order to get high yields, and thus keep costs down, NAND flash is typically shipped with a few bad blocks and some further blocks are expected to go bad during the use of the device. Thus, any flash file system without an effective bad block handling policy is unsuitable for NAND flash.</p>\n<p>Yaffs1 uses the Smart-Media style of bad block marking. This checks the sixth byte (byte 5) of the spare area. In a good block this should be 0xFF. A factory-marked bad block should be 0x00. If Yaffs1 determines that a block has gone bad it is marked bad with 0x59 (\'Y\'). Using a distinctive marker allows Yaffs-marked bad blocks to be differentiated from factory-marked bad blocks.</p>\n<p>Yaffs2 mode is designed to support a wider range of devices and spare-area layouts. Thus, Yaffs2 does not decide which bytes to mark but instead calls driver functions to determine whether the block is bad, or to mark it bad.</p>\n<p>So, when does Yaffs mark a block bad? Yaffs will mark a block bad if a read or write operation fails or if three ECC errors are detected. A block that is marked bad is retired from use, thus improving the robustness of the file system. This policy is suitable for SLC flash. MLC policies are under development.</p>\n<p>Further, NAND flash cells can sometimes be disturbed (corrupted) by NAND activity and charge loss. These errors are corrected by error correction codes (ECC) which may be implemented in hardware, software drivers, or within Yaffs itself. Again, any flash file system lacking effective ECC handling is unsuitable for NAND flash.</p>\n<p>Yaffs1 mode can use either the built in ECC or use ECC provided by the driver or hardware.</p>\n<p>Since Yaffs2 mode is designed for a wider range of devices, it does not provide ECC internally but requires that the driver provide the ECC.</p>\n<p>The ECC code supplied with Yaffs (yaffs_ecc.c) is the fastest C code implementation of a Smart Media compatible ECC algorithm that we are aware of. This code will correct any single bit error within a 256-byte data block and detect 2 errors per 256-byte data block. This is sufficient error correction to provide very high reliability on most SLC-type NAND flash.</p>\n<p>For a more complete description of failure handling, please refer to the Yaffs error mitigation document.</p>\n<h1 class=\"western\">12 RAM structures</h1>\n<p>While it is theoretically possible to use a log structured file system with very few RAM structures, this would provide reduce performance. Thus, significant RAM data structures are required to store enough information to provide sufficiently high performance. </p>\n<p>Before we jump in, it is a good idea to first figure out what purpose the RAM structures serve. The main structures are defined in yaffs_guts.h and their main purposes, are :</p>\n<ul>\n<li>\n<p>Device/partition: This is named <i><b>yaffs_dev</b></i><span style=\"font-style: normal\"><span style=\"font-weight: normal\">. </span></span>This is required to hold information relating to a Yaffs “partition” or “mount point”. Using these, rather than globals, allows Yaffs to simultaneously support multiple partitions and partitions of different types. In fact, almost other data structures mentioned here are part of, or accessed via, the structure.</p>\n </li>\n<li>\n<p>NAND Block Information: This is named <i><b>yaffs_block_info </b></i>and holds the current state of the NAND blocks. Each yaffs_dev has an array of these.</p>\n </li>\n<li>\n<p>NAND Chunk Information: This is a bitfield attached to the yaffs_dev that holds the current in-use state of each chunk in the system. There is one bit per chunk in the partition.</p>\n </li>\n<li>\n<p>Object: This is named <i><b>yaffs_obj</b></i> and holds the state of an object (see section 3). There is one of these for each object in the file system, where an object is one of a regular file, directory, hard link, symbolic link or special link. There are different variants of yaffs_Objects to reflect the different data required for these different object types. Each object is uniquely identified by an obj_id.</p>\n </li>\n<li>\n<p>File structure: For each file object, Yaffs holds a tree which provides the mechanism to find the data chunks in a file. The tree consists of nodes called <i><b>yaffs_tnode</b></i> (tree nodes).</p>\n </li>\n<li>\n<p>Directory structure: The directory structure allows objects to be found by name. The directory structure is built from a doubly-linked list that is rooted in the directory and binds together the sibling objects within a directory.</p>\n </li>\n<li>\n<p>Object number hash table: The object number hash table provides a mechanism to find an object from its obj_id. The obj_id is hashed to select a hash bucket. Each hash bucket has a doubly-linked list of objects that belong in this hash bucket, as well as a count of the objects in the bucket.</p>\n </li>\n<li>\n<p>Cache: Yaffs provides a read/write cache that significantly improves performance for short operations. The size of the cache can be set at run-time.</p>\n </li>\n</ul>\n<p>The usage of these structures is described in more detail below.</p>\n<p>Yaffs makes significant use of doubly-linked lists. These data structures are very useful because they provide rapid insertion, removal and traversal. They do however come at the expense of requiring two pointers rather than just one that would be required by a singly-linked list.</p>\n<h2 class=\"western\">12.1 Yaffs objects (struct yaffs_obj)</h2>\n<p>Each object (file, directory,...) in the system is represented by a yaffs_obj structure </p>\n<p>The yaffs_obj\'s main function is to store most of the object metadata and type-specific information. This means that almost all the information about an object can be accessed immediately without reading flash.</p>\n<p>The metadata includes, amongst others:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">obj_id: The number used to identify the object.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">parent: A pointer to the parent directory. Not all objects have a parent. The root director and special directories for unlinked and deleted files do not have parents so this is NULL.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">short_name: If the name is short enough to fit in a small fixed-sized array (default 16 characters) then it is stored here otherwise it must be fetched from flash each time it is requested.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">type: Type of object.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Permissions, time, ownership and other attributes</span></p>\n </li>\n</ul>\n<p><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Depending on the object type, yaffs_obj also stores:</span></p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">A tnode tree, file extents etc for data files</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">A directory chain for directories</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">An equivalent object for hard links</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">A string for symbolic links</span></p>\n </li>\n</ul>\n<h2 class=\"western\">12.2 Look-up by obj_id</h2>\n<p>The purpose of this mechanism is to rapidly access an object by its device and obj_id. This is required during garbage collection, scanning and similar operations.</p>\n<p>Each yaffs_dev uses a hash table for this purpose. The hash table has 256 “buckets” (tunable), each holding a doubly-linked list of the yaffs_objs in that bucket.</p>\n<p>The hash table\'s hash function is just masking the least significant bits of the obj_id. This is a very cheap function that provides reasonable “spread”.</p>\n<p>Yaffs makes an attempt to assign obj_ids in a way that keeps the number of objects in each hash bucket quite low, thus preventing any one hash entry getting too long.</p>\n<p>This mechanism is also charged with assigning new (unique) obj_id values.</p>\n<h2 class=\"western\">12.3 Directory structure</h2>\n<p>The purpose of the directory structure is to rapidly access an object by name. This is required to perform file operations such as opening, renaming etc.</p>\n<p><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">The Yaffs directory structure is formed by a tree of objects of type YAFFS_OBJECT_TYPE_DIRECTORY. These objects have a doubly linked node of children.</span></p>\n<p>Each yaffs_obj also has a doubly linked list node called sibling which chain together the siblings in a directory.</p>\n<p>Each Yaffs partition has a root directory.</p>\n<p>Each yaffs partition also has some special purpose “fake” directories which are not stored in NAND but are instead created on mounting:</p>\n<ul>\n<li>\n<p>lost+found: This directory is used as a place to store any lost file parts that cannot be placed in the normal directory tree.</p>\n </li>\n<li>\n<p>Unlinked and deleted: These are pseudo-directories that are not in the directory tree. Placing objects in these directories gives them a status of being unlinked or deleted.</p>\n </li>\n</ul>\n<p>Each object has a name that is used to look up the object within the directory, Thus, each name within a directory must be unique. This rule does not apply to objects in the unlinked and deleted pseudo-directories since we never use names to look up unlinked/deleted files and there may be many files of the same name that have been deleted.</p>\n<p>Name resolution is sped up by two mechanisms:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">short_names are stored directly in the yaffs_obj so that they don\'t have to be loaded from flash.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Each object has a “name sum”. This is a simple hashing of the name which speeds up the matching process because it is cheaper to compare the hash than compare the whole name string.</span></p>\n </li>\n</ul>\n<p><img src=\"data:image/png;base64,[encoded data, 22776 characters]\" width=\"412\" height=\"355\" alt=\"image\" id=\"Object2\" /> <br style=\"clear: left;\" />\n<br />\n<br />\n</p>\n<p>The above directory structure represents the following directory tree</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"119\" /> <col width=\"468\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/</span></span></p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Root directory</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/a</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Directory containing c,d,e</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/b</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Empty directory</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/lost+found</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Empty directory</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/a/c</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Directory</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/a/d</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Data file</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 119px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">/a/e</span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 468px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Data file</span></p>\n  </td>\n</tr>\n</table>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><br />\n</p>\n<p>If a Yaffs partition has been somehow corrupted then it is possible for an object to be created during scanning but with no object header (which contains the object name) being found. The object would then not have a name. In these cases, Yaffs creates a pseudonym from the object number of the form objnnnn so that the object can be placed in the directory structure. </p>\n<h2 class=\"western\" style=\"page-break-before: always\">12.4 Hard links</h2>\n<p>In POSIX file systems, the objects (inodes in Linux terminology, vnode in BSD-speak) and the object names (dentry in Linux terminology) are independent in that an object can have zero, one or more names.</p>\n<p>Having files with zero links is caused by constructs such as:</p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">h = open(“foo”,O_CREAT | O_RDWR, S_IREAD | S_IWRITE); /* create file “foo” */</span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">unlink(“foo”); /* unlink it </span></code><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">to remove</span></code><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">directory </span></code><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">entry </span></code><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">*/</span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">/* we still have a handle to the file so can still access it via the handle */</span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">read(h,buffer,100); </span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">write(h,buffer,100);</span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-family: Courier 10 Pitch;\"><span style=\"font-size: 8pt; font-size: xx-small; font-size: xx-small;\"><code class=\"western\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\">close(h); /* as soon as the handle is closed the file is deleted */</span></code></span></span></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><br />\n</p>\n<p>Yaffs does not store separate object and name records because that would waste space and incur extra reading/writing. Instead, Yaffs is optimised for the most typical case of one name per object. That is, Yaffs stores one name per yaffs_obj and uses “cheats” to achieve other behavior:</p>\n<ul>\n<li>\n<p>Objects that have zero names (ie unlinked objects) are handled by renaming the object into a fake directory that is used to designate unlinked objects.</p>\n </li>\n<li>\n<p>Multiple names object are handled by designating one of the objects the main object and having multiple hard link pseudo-objects that refer to it.</p>\n </li>\n<li>\n<p>The inode number (vnid in BSD-speak) is a per-file system unique number that identifies the object. The Yaffs obj_id of the main object is presented to the user. That is, if the inode number is queried from a hardlink object then the obj_id of the equivalent object is returned.</p>\n </li>\n</ul>\n<p>The linkage between hard link pseudo-objects and their equivalent object is through two fields:</p>\n<ul>\n<li>\n<p>Each object has a hard_links doubly linked list node that links the list of hard links to that object.</p>\n </li>\n<li>\n<p>Each hard link has a equiv_obj pointer to the “equivalent object”.</p>\n </li>\n</ul>\n<p style=\"page-break-before: always\">The usage of this structure is straight forward except for one interesting case when hard links are being deleted. Consider the following sequence of events:</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"50\" /> <col width=\"80\" /> <col width=\"449\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 50px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">1</span></p>\n  </td>\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 80px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"># touch a</span></p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 449px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Create file a</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 50px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">2</span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 80px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"># ln a b</span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 449px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Create a hard link b with equivalent object a.</span></p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 50px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">3</span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 80px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"># rm a</span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 449px;\">\n <p style=\"orphans: 0; widows: 0; page-break-before: auto\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">Remove a. The object must still exist under the name b</span></p>\n  </td>\n</tr>\n</table>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><br />\n</p>\n<p>In step 3, Yaffs cannot just delete the equivalent object since that would leave a “hanging” hard link with no equivalent object. </p>\n<p>We also cannot just change the type of one of the hardlink objects because that would cause the object\'s obj_id to change. This would be unacceptable since it would break any mechanism that use the obj_id (of which there are many within and outside of Yaffs).</p>\n<p>Thus, if an object is deleted and it has hard links to it then we do the following:</p>\n<ul>\n<li>\n<p>Select one of the object\'s hard links.</p>\n </li>\n<li>\n<p>Rename the object to the name in the hard link.</p>\n </li>\n<li>\n<p>Delete the hard link pseudo-object.</p>\n </li>\n</ul>\n<h2 class=\"western\">12.5 Symbolic links and special objects</h2>\n<p>These object types just store values that are needed to provide a full POSIX file system.</p>\n<p>A symbolic link object saves a symbolic link string that is used to provide the POSIX symbolic string mechanism.</p>\n<p>A special object is used to store entries for device numbers, pipes and other similar special objects.</p>\n<h2 class=\"western\">12.6 File objects</h2>\n<p>The yaffs_Objects have a type and a variant portion which is a union of different data required to hold the state of different object types.</p>\n<p>The file objects have type YAFFS_OBJECT_TYPE_FILE, and an associated file variant. This stores the following main values:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">file_size: file size</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">top_level: depth of the Tnode tree</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">top: pointer to top of Tnode tree</span></p>\n </li>\n</ul>\n<p>The meaning of the file size is quite obvious. This is the current length of the file. Note that a file might have holes in it caused by seeking forward past the extents of the file.</p>\n<p>The top and top_level work together to control the Tnode trees. </p>\n<h3 class=\"western\" style=\"page-break-before: always\">12.6.1 Tnode tree</h3>\n<p>Each file has a tnode tree to provide the mapping from file position to actual NAND chunk address. top is a pointer to the top of the tnode tree</p>\n<p><img src=\"data:image/png;base64,[encoded data, 20236 characters]\" width=\"385\" height=\"378\" alt=\"image\" id=\"Object1\" /> <br style=\"clear: left;\" />\n<br />\n<br />\n</p>\n<p>The tnode tree is made up of tnodes (tree nodes) arranged in levels, each of which holds either:</p>\n<ul>\n<li>\n<p>At levels greater than 0, a tnode has 8 pointers to other tnodes in the next level down.</p>\n </li>\n<li>\n<p>At level 0, a tnode has 16 NAND chunk Ids which identify the chunk\'s location in RAM.</p>\n </li>\n</ul>\n<p>These numbers are powers of 2 which makes for simple look-ups by just applying bitmasks. The code that traverses this tree is in yaffs_find_tnode_0().</p>\n<p>As the file size grows, more tnodes are added and as the levels fill, more levels are added. If the file is truncated or resized downwards, then the tree is pruned. If a chunk in a file is replaced (eg. data is overwritten or copied by garbage collection) then the tnode tree must be updated to reflect the change.</p>\n<p>Tnodes typically make up the bulk of the Yaffs\' RAM usage.</p>\n<h1 class=\"western\">13 How various mechanisms work</h1>\n<p>Having looked at the Yaffs data structures, we now consider how some of the mechanisms in Yaffs operates. This is most easily done by walking through some operations that Yaffs performs.</p>\n<h2 class=\"western\">13.1 Block and chunk management</h2>\n<h3 class=\"western\">13.1.1 Block states</h3>\n<p>Yaffs tracks the state of each block and chunk in the partition. This information is first built up during scanning (or recovered from a checkpoint). A block may be in one of the following states (see definition of enum yaffs_block_state):</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"146\" /> <col width=\"441\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>UNKNOWN</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 441px;\">\n <p>The block state is not yet known.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>NEEDS_SCANNING</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>During pre-scanning it has been determined that this block has something on it and needs scanning.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>SCANNING</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This block is currently being scanned.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>EMPTY</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This block has nothing in it (is erased) and may be used for allocation. The block can get to this state by being erased.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>ALLOCATING</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This is the block currently being used for allocation by the chunk allocator.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>FULL</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>All the chunks in this block have been allocated and at least one chunk contains useful information that has not yet been deleted.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>DIRTY</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>All the chunks in this block have been allocated and all have been deleted. The block might have been in the FULL or COLLECTING state before this. This block can now be erased and returned to EMPTY state.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>CHECKPOINT</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This block has checkpoint data in it. When the checkpoint is invalidated this block will be erased and returned to the EMPTY state.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>COLLECTING</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This block is being garbage collected. As soon as all live data has been inspected this block becomes DIRTY.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 146px;\">\n <p>DEAD</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 441px;\">\n <p>This block has been retired or was marked bad. This is a terminal state.</p>\n  </td>\n</tr>\n</table>\n<p><img src=\"data:image/png;base64,[encoded data, 42088 characters]\" width=\"575\" height=\"510\" alt=\"image\" id=\"Object3\" /> <br style=\"clear: left;\" />\n<br />\n<br />\n</p>\n<p>The regular runtime states are; EMPTY, ALLOCATING, FULL, COLLECTING and DIRTY.</p>\n<p>The checkpoint state is used for checkpoint blocks.</p>\n<p>The DEAD state is the terminal state for blocks that were retired because they were either marked bad or an error was detected.</p>\n<h3 class=\"western\">13.1.2 Block and chunk allocation</h3>\n<p>An available chunk must be allocated before it can be written. The chunk allocation mechanism is provided by yaffs_alloc_chunk() and is very simple. Each yaffs_dev has a current block that it is allocating from. This is termed the <i><b>allocation block </b></i><i><b>(alloc_block)</b></i>. Chunks are allocated sequentially from the allocation block. As the chunks are allocated, block and chunk management information is updated, including the block\'s pages_in_use count and the chunk use bitmap.</p>\n<p>When the block is fully allocated, another empty block is selected to become the allocation block. The blocks are selected by searching upwards from the previous allocation block.</p>\n<p>In older versions of Yaffs, the Yaffs scanning would identify the allocation block being used when the file system was last shut down and would continue allocation from that point. This had the benefit of continuing to use the same block and slightly reduce garbage creation. However, doing this could potentially cause problems due to attempting to write a block that had been in the middle of a write when power was lost. Thus Yaffs now always starts allocation on a new block after a mount. This slightly increases the amount of garbage (typically by an insignificant amount) but improves robustness.</p>\n<h3 class=\"western\">13.1.3 A word about wear leveling</h3>\n<p>Since flash memory blocks can only endure a limited number of writes and erases ( termed the flash endurance), a flash file system needs to ensure that the same few blocks are not overwritten continuously causing those blocks to wear out while the other blocks are hardly used at all.. Instead it is important that the file system spreads out the wear.</p>\n<p>This is extremely important in a file system such as FAT which uses a limited set of logical blocks to store the file allocation table entries which get modified frequently. If FAT is used with a static logical to physical block mapping then the file allocation table blocks will wear out far before other blocks causing premature device failure. Thus, for FAT, it is very important that the logical to physical mapping gets stirred up a bit to cause the file allocation tables to be written to different physical blocks, thus leveling out the wear.</p>\n<p>Wear leveling is far less of a concern in a log structured file system such as Yaffs since we always write to the end of the log and thus don\'t keep on overwriting the same blocks.</p>\n<p>There are basically two ways to achieve wear leveling:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Use a specifically written set of functions that actively perform wear leveling.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Allow a degree of wear leveling to happen as a side effect of other activity.</span></p>\n </li>\n</ul>\n<p>Yaffs takes the second approach.</p>\n<p>Firstly, being log structured, Yaffs inherently spreads out the wear by performing all writes in sequence. That means that we don\'t single out a few blocks for a specific purpose and write them more than others.</p>\n<p>Secondly, blocks are allocated serially from the erased blocks in the partition. Thus the process of erasing (after deletion of garbage collection) and then allocating blocks does tend to spread the block use and provides a level of wear leveling.</p>\n<p>Thus, even though there is no code to specifically perform wear leveling it does happen as a side effect of other activity.</p>\n<p>This strategy performs well and has survived many accelerated lifetime tests in both simulations and on real NAND-based products.</p>\n<h3 class=\"western\">13.1.4 Management of yaffs_tnode and yaffs_obj structures</h3>\n<p>yaffs_tnodes and yaffs_objs are dynamically created and released as they are needed. </p>\n<p>The allocation and management could be done by just using the standard memory allocator (malloc, kmalloc etc), but this could cause performance problems, particularly in embedded systems which tend to have rather simplistic memory allocators. </p>\n<p>The allocation and deletion of many small structures can cause memory fragmentation causing out-of-memory and slowdown problems.</p>\n<p>To prevent these problems, Yaffs manages these objects internally. Yaffs creates many structures (100 or so) at a time and then allocates them singly from a free list. When structures are released they are placed on the free list for reuse.</p>\n<h2 class=\"western\">13.2 Internal cache</h2>\n<p>This describes the standard Yaffs internal cache implementation. Alternative caches have been devised for other purposes and at some future point Yaffs might be extended to support pluggable cache policies.</p>\n<p>The main purpose of the internal cache is to reduce NAND access for badly behaved applications which perform many small reads and writes. Believe it or not, but there are applications out there that read or write files a few bytes at a time:</p>\n<p class=\"code-western\"><code class=\"western\">while(...)<br />\nwrite(h,buf,1);</code></p>\n<p style=\"margin-left: 1.25cm\"><br />\n<br />\n</p>\n<p>This sort of behavior would be terrible for performance and flash memory life if each read or write operation resulted in a flash access. Yaffs provides an internal cache to mitigate against this sort of behaviour.</p>\n<p>The Yaffs internal cache is called a “Short Op Cache” (short operation cache) and only comes in to play for operations which are not chunk aligned. The caching mechanism is very simple and was primarily written for less sophisticated OSs that lack their own file caching layer. The cache is still beneficial in OSs like Linux, which provide a caching layer, because it caches both the read and write path. Thus, while short reads will be serviced by the Linux page cache, the short op cache does address non-chunk aligned writes.</p>\n<p>Page aligned reads/writes bypass the cache unless that chunk is already in the cache, except when inband tags are used. Inband tags always require the cache because the cache is used to build up the buffer where the tags are attached to the data chunk being written.</p>\n<p>The cache is stored in an array of cache entries. The number of cache entries is set in the yaffs_dev parameters n_caches and the cache is configured during initialisation. n_caches of zero disables the cache. The cache management algorithms are simplistic and probably don\'t scale well to very large numbers. This means that it is probably best to stick with around 5 to 20 cache entries.</p>\n<p>Each cache entry holds:</p>\n<ul>\n<li>\n<p>obj_id, chunk id, nbytes (the tag info of the chunk being cached)</p>\n </li>\n<li>\n<p>The actual data bytes</p>\n </li>\n<li>\n<p>Cache slot status (last used counter, dirty,...)</p>\n </li>\n</ul>\n<p>Finding an unused cache entry is a simple operation. We just iterate through the cache entries searching for one that is not assigned. If all cache entries are busy then a cache push-out is performed to free up a cahce entry.</p>\n<p>Whenever a cache entry is accessed (read or written) the last-use counter is is set to an incrementing number. This counter value is used to drive the least-recently-used (LRU) algorithm.</p>\n<p>Cache entries which have been modified and not yet written back to flash are marked with a dirty flag. This is tells us whether we need to write out the data during a flush or push-out.</p>\n<p>A push-out happens whenever the cache is full and we need to push an entry out of the cache to make space to load a new entry. Yaffs uses the LRU algorithm to select the LRU cache entry, write it out if needed and then assign that for use.</p>\n<p>Whenever a file is flushed (file flush or close), the file\'s dirty entries are written out. At certain times (eg. before an unmount or at sync()) the entire cache is flushed.</p>\n<p>This caching policy is gives a useful performance improvement with very simple algorithms (ie good bang-for-bucks).</p>\n<p>Apart from its normal caching function, the short op cache also does much of the heavy lifting for inband tags support since all the inband tags accesses are not chunk aligned and must typically be re-aligned. The cache makes this easy.</p>\n<h2 class=\"western\">13.3 Scanning</h2>\n<p>Scanning is the process whereby file system state is rebuilt from scratch. This happens on mounting a Yaffs partition if no checkpoint data is available or if the mounting was told to ignore the checkpoint data.</p>\n<p>Scanning involves reading the tags from all the active chunks in the system so can take quite a while, but probably less time than you\'d expect.</p>\n<p>The scanning process is different for Yaffs1 vs Yaffs2 because of the differences mentioned before.</p>\n<h3 class=\"western\">13.3.1 Yaffs1 scanning</h3>\n<p>Yaffs1 scanning is rather straight forward because Yaffs1 uses deletion markers.</p>\n<p>All we really need to do is read the tags off all the chunks in the partition and determine if the chunk is active. Order is not important and blocks could be read in any order. If the deletion marker has not been set then it is active and we need to add the chunk to the file system state as follows:</p>\n<p>If the chunk is a data chunk (chunk_id &gt; 0) then the chunk must be added to the relevant file\'s tnode tree. If the object does not exist, then we create it in lost+found, although it has no name and other file details yet.</p>\n<p>If the chunk is an object header (chunk_id == 0) then the object must be created (or it might already exist in lost + found and we need to fix up its details and slot it into the correct part of the directory tree.</p>\n<p>If at any time during scanning we find that we are reading a second chunk with the same obj_id:chunk_id as a previously encountered chunk then the 2-bit serial number is used to resolve the dispute.</p>\n<p>Once the scanning is complete we still need to fix up a few things: </p>\n<p>Hard links must be connected up properly (it is more efficient to defer this until after the scanning has completed).</p>\n<p>Also, objects which were marked as unlinked must be deleted since there are no longer handles open to these objects.</p>\n<h3 class=\"western\">13.3.2 Yaffs2 scanning</h3>\n<p>Yaffs2 has no deletion markers which makes the scanning significantly more complex.</p>\n<p>The first thing that needs to be done is to pre-scan the blocks to determine the sequence number for the blocks. The list of blocks and sequence numbers is then sorted to make a chronologically ordered list.</p>\n<p>Yaffs then scans <i><b>backwards</b></i> through these blocks (ie in reverse chronological order). Thus, the first encountered obj_id:chunk_id pair is the current one and subsequent chunks with those tags are out of date.</p>\n<p style=\"margin-left: 1.25cm\">We read the tags for each chunk in each block. </p>\n<p style=\"margin-left: 1.25cm\">If it is a data chunk ( ie. chunk_id &gt; 0) then:</p>\n<ul>\n<li>\n<p>If a chunk with the same obj_id:chunk_id has already been found then this is not the current chunk. Delete this one.</p>\n </li>\n<li>\n<p>Else if the object is marked as deleted, or corrupted, then delete it.</p>\n </li>\n<li>\n<p>Else if the object does not yet exist then this chunk was written since the last object header write for this object so this chunk must be the last written chunk in the file and must have happened just before an unclean shutdown with the file still open. We can create the file and use the chunk_id and nbytes to set the file extents.</p>\n </li>\n<li>\n<p>Else if the object does exist and the chunk lies beyond the object\'s file scan size (extents) then it is a truncated chunk and can be deleted.</p>\n </li>\n<li>\n<p>Else it is placed into the file\'s tnode tree.</p>\n </li>\n</ul>\n<p style=\"margin-left: 1.25cm\">If it is an object header (ie. chunk_id == 0) then:</p>\n<ul>\n<li>\n<p>If the object is in the deleted directory then mark the object as deleted and set the object\'s shrink size to zero.</p>\n </li>\n<li>\n<p>Else if an object header has not yet been found for this object, then this is the most current object header and holds the most current name etc. If no data chunks have yet been found for this chunk then the size in the object header is also the file extents. The file size is used to set the file scan size since at the time it was written the file did not extend past that point and we can safely ignore further data chunks for that file that extend past that point.</p>\n </li>\n<li>\n<p>Else just use the file size as the scan size if it is smaller than the current file scan size.</p>\n </li>\n<li>\n<p>Else this an obsolete object header. It is deleted.</p>\n </li>\n</ul>\n<p>A bit more explanation is probably needed to describe the file scan size. The whole purpose of this is to determine data chunks that should be ignored due to the file being truncated.</p>\n<h2 class=\"western\">13.4 Checkpoint</h2>\n<p>Mount scanning takes quite a lot of time and slows mounting, though perhaps by less than you\'d think. Checkpointing is a mechanism to speed the mounting by taking a snapshot of the Yaffs runtime state at unmount or sync() and then reconstituting the runtime state on re-mounting. The speed up is dramatic.</p>\n<p>The actual checkpoint mechanism is quite simple. A “stream” of data is written to a set of blocks which are marked as holding checkpoint data and the important runtime state is written to the stream.</p>\n<p>Not all state needs to be saved, only the state needed to reconstitute the structure of the runtime data. For example, file metadata need not be saved since it is very easy to load that through lazy-loading.</p>\n<p>The checkpoint stores data in the following order:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Start marker, including checkpoint format id.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">yaffs_dev information</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Block information</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Chunk flags</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Objects, including file structure</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">End marker</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Checksum</span></p>\n </li>\n</ul>\n<p>The checkpoint validity is ensured by the following mechanisms:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">The data is stored using whatever ECC mechanisms are in place.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">The start marker includes a checkpoint version so that an obsolete checkpoint will not be read if the checkpoint code changes.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Data is written to the stream as structured records, each with a type and size.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">The end marker must be read when expected.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">Two checksums are maintained across the whole checkpoint data set.</span></p>\n </li>\n</ul>\n<p>If any checks fail, the checkpoint is ignored and the state is re-scanned.</p>\n<p>The astute reader might notice that block state changes as we\'re writing checkpoint blocks, so how do we manage to re-constitute the block states correctly? This is achieved by the following:</p>\n<ul>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">As we write the checkpoint, the checkpoint block allocation selects EMPTY blocks. We don\'t change the state as we\'re writing the checkpoint so their state is written to the checkpoint as EMPTY or CHECKPOINT, it does not really matter which.</span></p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Serif, serif;\">After reading the checkpoint, we know which blocks have been used to store checkpoint data. We update those blocks to reflect the CHECKPOINT state.</span></p>\n </li>\n</ul>\n<p>A checkpoint is invalidated by any modifications (writes, erases,...) thus any modification path also checks to see if there is a checkpoint and erases it.</p>\n<p>The regular Yaffs block allocator and garbage collection logic also needs to be aware of the approximate size of the checkpoint so that these can ensure enough spare space is reserved to store a checkpoint. There is a calculation that updates the value whenever the number of objects etc changes.</p>\n<h2 class=\"western\">13.5 Extended tags and packed tags</h2>\n<p>Extended tags is an abstraction of a way to store more information in the tags, allowing for faster scan times. Packed Tags is a physical implementation of the storage of extended tags.</p>\n<p>When we\'re scanning we really only need to build up the structure of the file system. In other words, rebuild the directory relationships, tnode trees and such. Much of the detail such as file names, permissions etc can be lazy loaded if and when needed.</p>\n<p>This required storing extra information, such as the parent directory and object type, in the tags of object headers. But how do we do this without enlarging the tags size?</p>\n<p>Object headers always have a chunk_id of zero and n_bytes has no meaning because it is not a data chunk. By using a single bit to identify object headers we suddenly open up a whole lot of space that we can stuff full of useful data. By being clever as to what data we use, we can pack in the important data in most circumstances.</p>\n<p>Sometimes, for example very large files, the packing will not work because there are insufficient bits to hold the field so we just write regular tags instead. That\'s OK since there can only be few such files in the system so the performance reduction only impacts very few files and the system level impact is unnoticeable. A simple, cheap, strategy that gives speed up 99% of the time is a very handy one.</p>\n<p>Other details are lazy-loaded on demand. This will happen when the object is looked up (eg. by a file open or searching for the file in the directory).</p>\n<h2 class=\"western\">13.6 Block summaries</h2>\n<p>Scanning requires that the tags for each chunk are read so that they can be inspected. Reading the tags from each chunk can be time consuming. Thus, block summaries were added in 2011.</p>\n<p>Block summaries write all the tags data for chunks in the block into the last few (typically only one) chunk in a block. This allows all the tags for chunks in that block to be read in one hit. Depending on the system throughput (CPU, RAM and flash speeds), this can speed up mount time dramatically.</p>\n<p>Note that the block summary does not replace the tags attached to each chunk. Both are written. Thus, if the whole block is not written (and the block summary is thus not written), the chunk tags can still be read and used.</p>\n<p>If a block summary is not available for a block, then the old mechanism is still used to scan the tags on each chunk.</p>\n<h2 class=\"western\">13.7 Inband tags</h2>\n<p>Thus far we have considered chunks where there are sufficient unallocated bytes in the spare (or out of band) area to store the tags. </p>\n<p>But what happens if we don\'t have enough space in the spare area to store the tags? Inband tags to the rescue! </p>\n<p>With inband tags we store the tags in the flash data area alongside the data. This gives us far more flexibility in the types of storage that Yaffs can support.</p>\n<p>There are three major penalties with inband tags:</p>\n<ul>\n<li>\n<p>Due to the loss of chunk alignment, all transactions must pass through the short op cache. This costs an extra memcpy().</p>\n </li>\n<li>\n<p></p>\n </li>\n<li>\n<p>Reading tags during scanning etc can involve reading the whole page, making this slower. The impact is minimised by using checkpointing or block summaries.</p>\n </li>\n</ul>\n<p>Thus, it is better, performance wise, to only use inband tags when regular tags will not work.</p>\n<h2 class=\"western\">13.8 Soft deletion</h2>\n<p>Soft deletion is a mechanism that was added to speed up file deletion in Yaffs1 mode.</p>\n<p>Looking back to the description of how files are stored in Yaffs1, you can see that deleting a file involves writing the deletion marker of every data chunk in the file. This can take quite some time for large files.</p>\n<p>The soft deletion mechanism was added to avoid writing all those deletion markers. Instead of writing the deletion markers, soft deletion instead tracks the number of chunks in each block that belong to deleted files and leaves the clean up to the garbage collector.</p>\n<p>When the garbage collector looks at a block it can see what current chunks (ie chunks not yet deleted) belong to deleted files and does not copy those, thus effectively deleting the chunk. Once all the chunks associated with a deleted file have cleaned up by the garbage collector the file header object can also be deleted.</p>\n<p>Yaffs2 mode does not write deletion markers and thus does not use soft deletion.</p>\n</div>\n      \n  </div>\n\n</article>\n\n\n  </div>\n\n              </section>\n\n                </div>\n  </div>\n\n      <footer class=\"footer container\" role=\"contentinfo\">\n        <div class=\"primary_footer row\">\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col1\">\n    <section id=\"block-yaffs-block-6\" class=\"block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<ul class=\"fa-ul\">\n<li><i class=\"fa-li fa fa-phone\"></i>+44 (0)1223 811679</li>\n<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>\n</ul>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col4\">\n    <section id=\"block-footerlegal\" class=\"block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-right\">&nbsp;<a href=\"/legal\">Legal &amp; Cookies</a></p>\n</div>\n      \n  </section>\n\n<section id=\"block-cookieinfo\" class=\"block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-justify\"><br />\nWe use <a href=\"/legal\">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n        </div>\n        <div class = \"secondary_footer row\">\n            <div class=\"col-sm-12\">\n                <div class=\"region region-footer\">\n    <nav role=\"navigation\" aria-labelledby=\"block-yaffs-account-menu-menu\" id=\"block-yaffs-account-menu\">\n            <h2 class=\"sr-only\" id=\"block-yaffs-account-menu-menu\">User account menu</h2>\n\n      \n              <ul class=\"menu nav navbar-nav navbar-right\">\n                            <li>\n        <a href=\"/user/login\" data-drupal-link-system-path=\"user/login\">Log in</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n\n  </div>\n\n            </div>\n        </div>\n    </footer>\n  \n    \n    <script type=\"application/json\" data-drupal-selector=\"drupal-settings-json\">{\"path\":{\"baseUrl\":\"\\/\",\"scriptPath\":null,\"pathPrefix\":\"\",\"currentPath\":\"node\\/409\",\"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>\n<script src=\"/sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js\"></script>\n\n  </body>\n</html>\n\";s:10:\"\0*\0version\";s:3:\"1.0\";s:13:\"\0*\0statusCode\";i:200;s:13:\"\0*\0statusText\";s:2:\"OK\";s:10:\"\0*\0charset\";N;s:23:\"\0*\0cacheabilityMetadata\";O:35:\"Drupal\\Core\\Cache\\CacheableMetadata\":3:{s:16:\"\0*\0cacheContexts\";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:\"\0*\0cacheTags\";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:30:\"config:filter.format.full_html\";i:37;s:29:\"config:filter.format.raw_html\";i:38;s:22:\"config:search.settings\";i:39;s:26:\"config:system.menu.account\";i:40;s:23:\"config:system.menu.main\";i:41;s:24:\"config:system.menu.tools\";i:42;s:18:\"config:system.site\";i:43;s:26:\"config:user.role.anonymous\";i:44;s:7:\"file:76\";i:45;s:13:\"http_response\";i:46;s:8:\"node:409\";i:47;s:9:\"node_view\";i:48;s:8:\"rendered\";i:49;s:6:\"user:0\";i:50;s:6:\"user:6\";}s:14:\"\0*\0cacheMaxAge\";i:-1;}s:14:\"\0*\0attachments\";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:62:\"How Yaffs works | 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:378:\"This document gives an explanation of most of the core mechanisms that make Yaffs work. As of the time of writing this, the Yaffs2 code base includes approximately 19,000 lines of code making a very detailed discussion impractical. This document is the starting point for understanding Yaffs. Further detailed questions and discussions are welcomed on the Yaffs discussion list.\";}}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:26:\"/documents/how-yaffs-works\";}}i:1;s:51:\"html_head_link:canonical:/documents/how-yaffs-works\";}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:9:\"/node/409\";}}i:1;s:34:\"html_head_link:shortlink:/node/409\";}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:26:\"/documents/how-yaffs-works\";}}i:1;s:50:\"html_head_link:revision:/documents/how-yaffs-works\";}}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:8:\"node/409\";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:45:\"</documents/how-yaffs-works>; rel=\"canonical\"\";i:2;b:0;}i:1;a:3:{i:0;s:4:\"Link\";i:1;s:28:\"</node/409>; rel=\"shortlink\"\";i:2;b:0;}i:2;a:3:{i:0;s:4:\"Link\";i:1;s:44:\"</documents/how-yaffs-works>; rel=\"revision\"\";i:2;b:0;}}}}',-1,1509017153.944,1,'block_content:18 block_content:23 block_content:7 block_content_view block_view config:block.block.choosingyaffs config:block.block.cookieinfo config:block.block.downloadyaffs config:block.block.footerlegal config:block.block.frontimagehighlight2 config:block.block.frontpagehero config:block.block.frontpageprimeryaffs config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.searchform config:block.block.sitebranding config:block.block.views_block__highlighted_yaffs_features_block_1 config:block.block.views_block__yaffs_admin_recent_content_block_1 config:block.block.views_block__yaffs_documents_highlights_block_1 config:block.block.views_block__yaffs_user_logos_block_1 config:block.block.yaffs_account_menu config:block.block.yaffs_block_10 config:block.block.yaffs_block_5 config:block.block.yaffs_block_6 config:block.block.yaffs_block_8 config:block.block.yaffs_block_9 config:block.block.yaffs_breadcrumbs config:block.block.yaffs_content config:block.block.yaffs_help config:block.block.yaffs_local_tasks config:block.block.yaffs_messages config:block.block.yaffs_page_title config:block.block.yaffs_user_21 config:block.block.yaffsinspace config:block_list config:color.theme.yaffs config:filter.format.full_html config:filter.format.raw_html config:search.settings config:system.menu.account config:system.menu.main config:system.menu.tools config:system.site config:user.role.anonymous file:76 http_response node:409 node_view rendered user:0 user:6','3184'),('https://yaffs.net/documents/technical:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 12:52:06 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:11:\"UNCACHEABLE\";}s:4:\"link\";a:3:{i:0;s:108:\"</sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh>; rel=preload; as=style\";i:1;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; rel=preload; as=style\";i:2;s:99:\"</sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.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:\"Thu, 26 Oct 2017 12:52:06 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509022326\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:19358:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"Documents - Technical | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" 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.\" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n\n    <title>Documents - Technical | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-documents navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  Documents - Technical\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\">Documents - Technical</h1>\n\n      <nav class=\"tabs\" role=\"navigation\" aria-label=\"Tabs\">\n        <h2 class=\"visually-hidden\">Primary tabs</h2>\n  <ul class=\"tabs--primary nav nav-tabs\"><li><a href=\"/documents\" data-drupal-link-system-path=\"documents\">Main</a></li>\n<li><a href=\"/documents/detail\" data-drupal-link-system-path=\"documents/detail\">Detail</a></li>\n<li class=\"active\"><a href=\"/documents/technical\" data-drupal-link-system-path=\"documents/technical\" class=\"is-active\">Technical<span class=\"visually-hidden\">(active tab)</span></a></li>\n<li><a href=\"/documents/archive\" data-drupal-link-system-path=\"documents/archive\">Archive</a></li>\n<li><a href=\"/documents/video\" data-drupal-link-system-path=\"documents/video\">Video</a></li>\n</ul>\n\n    </nav>\n    <div class=\"views-element-container form-group\"><div class=\"view view-yaffs-documents view-id-yaffs_documents view-display-id-page_3 js-view-dom-id-a34a46e35a5fbdebcdb097a910206c69965ce665b4b4028f46f48c20864c2fe6\">\n  \n    \n      \n      <div class=\"view-content\">\n        <div class=\"table-responsive\">\n<table class=\"table table-hover\">\n        <thead>\n    <tr>\n                                      <th class=\"views-field views-field-title\" scope=\"col\"></th>\n                                      <th id=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\" scope=\"col\">Content</th>\n                                      <th class=\"priority-low views-field views-field-upload\" id=\"view-upload-table-column\" scope=\"col\">PDF/Attachment</th>\n          </tr>\n    </thead>\n    <tbody>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/how-yaffs-works\" hreflang=\"und\">How Yaffs works</a>This document gives an explanation of most of the core mechanisms that make Yaffs work. As of the time of writing this, the Yaffs2 code base includes approximately 19,000 lines of code making a very detailed discussion impractical. This document is the starting point for understanding Yaffs. Further detailed questions and discussions are welcomed on the Yaffs discussion list.        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/HowYaffsWorks.pdf\" type=\"application/pdf; length=402514\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">HowYaffsWorks.pdf</a></span><span class=\"file-size\">393.08 KB</span></span>        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/yaffs-tuning\" hreflang=\"und\">Yaffs Tuning</a><p>This document describes the parameters which can be modified by the developer in the different phases of applying, debugging, and routine use of Yaffs.</p>        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsTuning.pdf\" type=\"application/pdf; length=93667\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsTuning.pdf</a></span><span class=\"file-size\">91.47 KB</span></span>        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/yaffs-direct-interface\" hreflang=\"und\">Yaffs Direct Interface</a>\n<p>This describes the Yaffs Direct Interface (YDI), which allows Yaffs to be simply integrated with embedded systems, with or without an RTOS.</p>\n<p>&nbsp;</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsDirect.pdf\" type=\"application/pdf; length=256079\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsDirect.pdf</a></span><span class=\"file-size\">250.08 KB</span></span>        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/documents/yaffs-vxworks\" hreflang=\"und\">Yaffs for VxWorks</a>\n<p>The purpose of this document is to describe the Yaffs-on-VxWorks wrapper and provide sufficient information to port Yaffs to the VxWorks BSP. It assumes a working knowledge of VxWorks.</p>\n<p>It does not describe the inner workings of Yaffs, and study of other Yaffs documents is recommended. Documents shown below in&nbsp;<i>Italics</i>&nbsp;will be found at&nbsp;<i><a href=\"http://yaffs.net/documents\">http://yaffs.net/documents</a> . . .</i></p>\n<p>The source and the definitive version of this document can be found in our git repository, <a href=\"http://www.aleph1.co.uk/gitweb/?p=yaffs-docs;a=tree;h=f4fcbdc9da052aa926c4bc2275547ca310eebbd8;hb=9d50c62a1c24f1b9dd00ec3eb6d0bddff0aed17d\">together with other Yaffs documents</a>.</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/node/489\" hreflang=\"en\">Test Yaffs under Linux using Virtualbox and Vagrant</a>\n<p>You can use this Vagrant box to test Yaffs.</p>        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n    </tbody>\n</table>\n  </div>\n\n    </div>\n  \n          </div>\n</div>\n\n\n  </div>\n\n              </section>\n\n                </div>\n  </div>\n\n      <footer class=\"footer container\" role=\"contentinfo\">\n        <div class=\"primary_footer row\">\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col1\">\n    <section id=\"block-yaffs-block-6\" class=\"block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<ul class=\"fa-ul\">\n<li><i class=\"fa-li fa fa-phone\"></i>+44 (0)1223 811679</li>\n<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>\n</ul>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col4\">\n    <section id=\"block-footerlegal\" class=\"block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-right\">&nbsp;<a href=\"/legal\">Legal &amp; Cookies</a></p>\n</div>\n      \n  </section>\n\n<section id=\"block-cookieinfo\" class=\"block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-justify\"><br />\nWe use <a href=\"/legal\">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n        </div>\n        <div class = \"secondary_footer row\">\n            <div class=\"col-sm-12\">\n                <div class=\"region region-footer\">\n    <nav role=\"navigation\" aria-labelledby=\"block-yaffs-account-menu-menu\" id=\"block-yaffs-account-menu\">\n            <h2 class=\"sr-only\" id=\"block-yaffs-account-menu-menu\">User account menu</h2>\n\n      \n              <ul class=\"menu nav navbar-nav navbar-right\">\n                            <li>\n        <a href=\"/user/login\" data-drupal-link-system-path=\"user/login\">Log in</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n\n  </div>\n\n            </div>\n        </div>\n    </footer>\n  \n    \n    <script type=\"application/json\" data-drupal-selector=\"drupal-settings-json\">{\"path\":{\"baseUrl\":\"\\/\",\"scriptPath\":null,\"pathPrefix\":\"\",\"currentPath\":\"documents\\/technical\",\"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>\n<script src=\"/sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.js\"></script>\n\n  </body>\n</html>\n\";s:10:\"\0*\0version\";s:3:\"1.0\";s:13:\"\0*\0statusCode\";i:200;s:13:\"\0*\0statusText\";s:2:\"OK\";s:10:\"\0*\0charset\";N;s:23:\"\0*\0cacheabilityMetadata\";O:35:\"Drupal\\Core\\Cache\\CacheableMetadata\":3:{s:16:\"\0*\0cacheContexts\";a:17:{i:0;s:26:\"languages:language_content\";i:1;s:28:\"languages:language_interface\";i:2;s:5:\"route\";i:3;s:32:\"route.menu_active_trails:account\";i:4;s:29:\"route.menu_active_trails:main\";i:5;s:30:\"route.menu_active_trails:tools\";i:6;s:5:\"theme\";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:24:\"user.roles:authenticated\";}s:12:\"\0*\0cacheTags\";a:60:{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:30:\"config:field.storage.node.body\";i:37;s:32:\"config:field.storage.node.upload\";i:38;s:31:\"config:filter.format.basic_html\";i:39;s:30:\"config:filter.format.full_html\";i:40;s:29:\"config:filter.format.raw_html\";i:41;s:22:\"config:search.settings\";i:42;s:26:\"config:system.menu.account\";i:43;s:23:\"config:system.menu.main\";i:44;s:24:\"config:system.menu.tools\";i:45;s:18:\"config:system.site\";i:46;s:26:\"config:user.role.anonymous\";i:47;s:33:\"config:views.view.yaffs_documents\";i:48;s:7:\"file:76\";i:49;s:7:\"file:80\";i:50;s:7:\"file:85\";i:51;s:13:\"http_response\";i:52;s:8:\"node:409\";i:53;s:8:\"node:451\";i:54;s:8:\"node:453\";i:55;s:8:\"node:479\";i:56;s:8:\"node:489\";i:57;s:9:\"node_list\";i:58;s:8:\"rendered\";i:59;s:6:\"user:0\";}s:14:\"\0*\0cacheMaxAge\";i:0;}s:14:\"\0*\0attachments\";a:4:{s:7:\"library\";a:11:{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:18:\"views/views.module\";i:9;s:27:\"core/drupal.tableresponsive\";i:12;s:50:\"environment_indicator/drupal.environment_indicator\";}s:9:\"html_head\";a:19:{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:68:\"Documents - Technical | 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: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: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\";}}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:19:\"documents/technical\";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\";}}}}',-1,1509022326.677,1,'block_content:18 block_content:23 block_content:7 block_content_view block_view config:block.block.choosingyaffs config:block.block.cookieinfo config:block.block.downloadyaffs config:block.block.footerlegal config:block.block.frontimagehighlight2 config:block.block.frontpagehero config:block.block.frontpageprimeryaffs config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.searchform config:block.block.sitebranding config:block.block.views_block__highlighted_yaffs_features_block_1 config:block.block.views_block__yaffs_admin_recent_content_block_1 config:block.block.views_block__yaffs_documents_highlights_block_1 config:block.block.views_block__yaffs_user_logos_block_1 config:block.block.yaffs_account_menu config:block.block.yaffs_block_10 config:block.block.yaffs_block_5 config:block.block.yaffs_block_6 config:block.block.yaffs_block_8 config:block.block.yaffs_block_9 config:block.block.yaffs_breadcrumbs config:block.block.yaffs_content config:block.block.yaffs_help config:block.block.yaffs_local_tasks config:block.block.yaffs_messages config:block.block.yaffs_page_title config:block.block.yaffs_user_21 config:block.block.yaffsinspace config:block_list config:color.theme.yaffs config:field.storage.node.body config:field.storage.node.upload config:filter.format.basic_html config:filter.format.full_html config:filter.format.raw_html config:search.settings config:system.menu.account config:system.menu.main config:system.menu.tools config:system.site config:user.role.anonymous config:views.view.yaffs_documents file:76 file:80 file:85 http_response node:409 node:451 node:453 node:479 node:489 node_list rendered user:0','3529'),('https://yaffs.net/documents/video:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 18:03:29 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:11:\"UNCACHEABLE\";}s:4:\"link\";a:3:{i:0;s:108:\"</sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh>; rel=preload; as=style\";i:1;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; rel=preload; as=style\";i:2;s:99:\"</sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.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:\"Thu, 26 Oct 2017 18:03:29 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509041009\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:15916:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"Documents - Video | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" 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.\" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n\n    <title>Documents - Video | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_Ft-hGawuooABKJanSezg8PXovgOMbB_QLx9CIyXeHsA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-documents navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  Documents - Video\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\">Documents - Video</h1>\n\n      <nav class=\"tabs\" role=\"navigation\" aria-label=\"Tabs\">\n        <h2 class=\"visually-hidden\">Primary tabs</h2>\n  <ul class=\"tabs--primary nav nav-tabs\"><li><a href=\"/documents\" data-drupal-link-system-path=\"documents\">Main</a></li>\n<li><a href=\"/documents/detail\" data-drupal-link-system-path=\"documents/detail\">Detail</a></li>\n<li><a href=\"/documents/technical\" data-drupal-link-system-path=\"documents/technical\">Technical</a></li>\n<li><a href=\"/documents/archive\" data-drupal-link-system-path=\"documents/archive\">Archive</a></li>\n<li class=\"active\"><a href=\"/documents/video\" data-drupal-link-system-path=\"documents/video\" class=\"is-active\">Video<span class=\"visually-hidden\">(active tab)</span></a></li>\n</ul>\n\n    </nav>\n    <div class=\"views-element-container form-group\"><div class=\"view view-yaffs-documents view-id-yaffs_documents view-display-id-page_5 js-view-dom-id-354897ea15f06b1d9af1ab1dd9ff0d9f04396d4385d24ae496bc4e9e88ff0060\">\n  \n    \n      \n      <div class=\"view-content\">\n        <div class=\"table-responsive\">\n<table class=\"table table-hover\">\n        <thead>\n    <tr>\n                                      <th class=\"views-field views-field-title\" scope=\"col\"></th>\n                                      <th id=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\" scope=\"col\">Content</th>\n                                      <th class=\"priority-low views-field views-field-upload\" id=\"view-upload-table-column\" scope=\"col\">Video</th>\n          </tr>\n    </thead>\n    <tbody>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/videos/yaffs-introduction-and-overview-video\" hreflang=\"und\">Yaffs introduction and overview video</a><p><a href=\"http://free-electrons.com/pub/video/2007/elce/elce-2007-wookey-yaffs.ogg\">This video</a> from 2007 describes Yaffs1 and Yaffs2. The <a href=\"/yaffs-talk-pdf-slides-celf-2007\">slides</a> from the video are available.</p><p><img alt=\"\" src=\"/sites/yaffs.net/files/file_attach/small_yaffs-introduction.png\" /></p>        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/videos/preparing-build-linux-yaffs\" hreflang=\"und\">Preparing to build Linux with Yaffs</a><p>This video covers the preparation needed to include Linux in Yaffs - describing the kernel build-tools needed, how to get the kernel source code and Yaffs source code. It\'s about 175Mb and 6m30 long.</p>        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n      <tr>\n                                                                                            <td class=\"views-field views-field-title views-field-body\"><a href=\"/videos/building-yaffs-linux\" hreflang=\"und\">Building Yaffs into Linux</a>\n<p>This video shows you how to compile Yaffs into Linux. It&rsquo;s just over 10 minutes long, and if you download it, it&rsquo;s&nbsp;325MB. After watching this video you should be able to include Yaffs in Linux.</p>\n        </td>\n                                                                      <td headers=\"view-draggableviews-table-column\" class=\"views-field views-field-draggableviews\">        </td>\n                                                                      <td class=\"priority-low views-field views-field-upload\" headers=\"view-upload-table-column\">        </td>\n          </tr>\n    </tbody>\n</table>\n  </div>\n\n    </div>\n  \n          </div>\n</div>\n\n\n  </div>\n\n              </section>\n\n                </div>\n  </div>\n\n      <footer class=\"footer container\" role=\"contentinfo\">\n        <div class=\"primary_footer row\">\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col1\">\n    <section id=\"block-yaffs-block-6\" class=\"block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<ul class=\"fa-ul\">\n<li><i class=\"fa-li fa fa-phone\"></i>+44 (0)1223 811679</li>\n<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>\n</ul>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                \n            </div>\n            <div class=\"col-sm-3\">\n                  <div class=\"region region-footer-col4\">\n    <section id=\"block-footerlegal\" class=\"block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-right\">&nbsp;<a href=\"/legal\">Legal &amp; Cookies</a></p>\n</div>\n      \n  </section>\n\n<section id=\"block-cookieinfo\" class=\"block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix\">\n  \n    \n\n      \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p class=\"text-align-justify\"><br />\nWe use <a href=\"/legal\">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>\n</div>\n      \n  </section>\n\n\n  </div>\n\n            </div>\n        </div>\n        <div class = \"secondary_footer row\">\n            <div class=\"col-sm-12\">\n                <div class=\"region region-footer\">\n    <nav role=\"navigation\" aria-labelledby=\"block-yaffs-account-menu-menu\" id=\"block-yaffs-account-menu\">\n            <h2 class=\"sr-only\" id=\"block-yaffs-account-menu-menu\">User account menu</h2>\n\n      \n              <ul class=\"menu nav navbar-nav navbar-right\">\n                            <li>\n        <a href=\"/user/login\" data-drupal-link-system-path=\"user/login\">Log in</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n\n  </div>\n\n            </div>\n        </div>\n    </footer>\n  \n    \n    <script type=\"application/json\" data-drupal-selector=\"drupal-settings-json\">{\"path\":{\"baseUrl\":\"\\/\",\"scriptPath\":null,\"pathPrefix\":\"\",\"currentPath\":\"documents\\/video\",\"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>\n<script src=\"/sites/default/files/js/js_btjcve5C9wIJe2Spz-_FmI-wP-XPLSKWiO867_VR-z8.js\"></script>\n\n  </body>\n</html>\n\";s:10:\"\0*\0version\";s:3:\"1.0\";s:13:\"\0*\0statusCode\";i:200;s:13:\"\0*\0statusText\";s:2:\"OK\";s:10:\"\0*\0charset\";N;s:23:\"\0*\0cacheabilityMetadata\";O:35:\"Drupal\\Core\\Cache\\CacheableMetadata\":3:{s:16:\"\0*\0cacheContexts\";a:17:{i:0;s:26:\"languages:language_content\";i:1;s:28:\"languages:language_interface\";i:2;s:5:\"route\";i:3;s:32:\"route.menu_active_trails:account\";i:4;s:29:\"route.menu_active_trails:main\";i:5;s:30:\"route.menu_active_trails:tools\";i:6;s:5:\"theme\";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:24:\"user.roles:authenticated\";}s:12:\"\0*\0cacheTags\";a:55:{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:30:\"config:field.storage.node.body\";i:37;s:32:\"config:field.storage.node.upload\";i:38;s:31:\"config:filter.format.basic_html\";i:39;s:30:\"config:filter.format.full_html\";i:40;s:29:\"config:filter.format.raw_html\";i:41;s:22:\"config:search.settings\";i:42;s:26:\"config:system.menu.account\";i:43;s:23:\"config:system.menu.main\";i:44;s:24:\"config:system.menu.tools\";i:45;s:18:\"config:system.site\";i:46;s:26:\"config:user.role.anonymous\";i:47;s:33:\"config:views.view.yaffs_documents\";i:48;s:13:\"http_response\";i:49;s:8:\"node:452\";i:50;s:8:\"node:458\";i:51;s:8:\"node:459\";i:52;s:9:\"node_list\";i:53;s:8:\"rendered\";i:54;s:6:\"user:0\";}s:14:\"\0*\0cacheMaxAge\";i:0;}s:14:\"\0*\0attachments\";a:4:{s:7:\"library\";a:11:{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:18:\"views/views.module\";i:9;s:27:\"core/drupal.tableresponsive\";i:12;s:50:\"environment_indicator/drupal.environment_indicator\";}s:9:\"html_head\";a:19:{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:64:\"Documents - Video | 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: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: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\";}}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:15:\"documents/video\";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\";}}}}',-1,1509041009.637,1,'block_content:18 block_content:23 block_content:7 block_content_view block_view config:block.block.choosingyaffs config:block.block.cookieinfo config:block.block.downloadyaffs config:block.block.footerlegal config:block.block.frontimagehighlight2 config:block.block.frontpagehero config:block.block.frontpageprimeryaffs config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.searchform config:block.block.sitebranding config:block.block.views_block__highlighted_yaffs_features_block_1 config:block.block.views_block__yaffs_admin_recent_content_block_1 config:block.block.views_block__yaffs_documents_highlights_block_1 config:block.block.views_block__yaffs_user_logos_block_1 config:block.block.yaffs_account_menu config:block.block.yaffs_block_10 config:block.block.yaffs_block_5 config:block.block.yaffs_block_6 config:block.block.yaffs_block_8 config:block.block.yaffs_block_9 config:block.block.yaffs_breadcrumbs config:block.block.yaffs_content config:block.block.yaffs_help config:block.block.yaffs_local_tasks config:block.block.yaffs_messages config:block.block.yaffs_page_title config:block.block.yaffs_user_21 config:block.block.yaffsinspace config:block_list config:color.theme.yaffs config:field.storage.node.body config:field.storage.node.upload config:filter.format.basic_html config:filter.format.full_html config:filter.format.raw_html config:search.settings config:system.menu.account config:system.menu.main config:system.menu.tools config:system.site config:user.role.anonymous config:views.view.yaffs_documents http_response node:452 node:458 node:459 node_list rendered user:0','3490'),('https://yaffs.net/documents/yaffs-direct-interface:html','O:31:\"Drupal\\Core\\Render\\HtmlResponse\":8:{s:7:\"headers\";O:50:\"Symfony\\Component\\HttpFoundation\\ResponseHeaderBag\":5:{s:23:\"\0*\0computedCacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}s:10:\"\0*\0cookies\";a:0:{}s:14:\"\0*\0headerNames\";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:\"\0*\0headers\";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:\"Thu, 26 Oct 2017 12:40:39 GMT\";}s:22:\"x-drupal-dynamic-cache\";a:1:{i:0;s:4:\"MISS\";}s:4:\"link\";a:6:{i:0;s:52:\"</documents/yaffs-direct-interface>; rel=\"canonical\"\";i:1;s:28:\"</node/453>; rel=\"shortlink\"\";i:2;s:51:\"</documents/yaffs-direct-interface>; rel=\"revision\"\";i:3;s:108:\"</sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh>; rel=preload; as=style\";i:4;s:108:\"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh>; 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:\"Thu, 26 Oct 2017 12:40:37 GMT\";}s:4:\"etag\";a:1:{i:0;s:12:\"\"1509021637\"\";}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:\"\0*\0cacheControl\";a:2:{s:7:\"max-age\";s:3:\"300\";s:6:\"public\";b:1;}}s:10:\"\0*\0content\";s:157616:\"<!DOCTYPE html>\n<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# \">\n  <head>\n    <meta charset=\"utf-8\" />\n<meta name=\"title\" content=\"Yaffs Direct Interface | Yaffs - A Flash File System for embedded use\" />\n<meta name=\"news_keywords\" content=\"Flash File System\" />\n<meta name=\"description\" content=\"This describes the Yaffs Direct Interface (YDI), which allows Yaffs to be simply integrated with embedded systems, with or without an RTOS.\n \" />\n<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.\" />\n<meta name=\"keywords\" content=\"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs\" />\n<meta name=\"Generator\" content=\"Drupal 8 (https://www.drupal.org)\" />\n<meta name=\"MobileOptimized\" content=\"width\" />\n<meta name=\"HandheldFriendly\" content=\"true\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css\" media=\"all\" />\n<link rel=\"shortcut icon\" href=\"/sites/default/files/yaffs_favicon.png\" type=\"image/png\" />\n<link rel=\"canonical\" href=\"/documents/yaffs-direct-interface\" />\n<link rel=\"shortlink\" href=\"/node/453\" />\n<link rel=\"revision\" href=\"/documents/yaffs-direct-interface\" />\n\n    <title>Yaffs Direct Interface | Yaffs - A Flash File System for embedded use</title>\n    <link rel=\"stylesheet\" href=\"/sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ovtedh\" media=\"all\" />\n<link rel=\"stylesheet\" href=\"/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ovtedh\" media=\"all\" />\n\n    \n<!--[if lte IE 8]>\n<script src=\"/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js\"></script>\n<![endif]-->\n\n  </head>\n  <body class=\"fontyourface path-node page-node-type-paper navbar-is-fixed-top has-glyphicons\">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      Skip to main content\n    </a>\n    <div style=\"background-color: ; color: \" id=\"environment-indicator\">\n  \n    </div>\n\n              <header class=\"navbar navbar-default navbar-fixed-top\" id=\"navbar\" role=\"banner\">\n              <div class=\"container\">\n            <div class=\"navbar-header\">\n          <div class=\"region region-navigation\">\n          <a class=\"logo navbar-btn pull-left\" href=\"/\" title=\"Home\" rel=\"home\">\n      <img src=\"/themes/custom/yaffs/logo.svg\" alt=\"Home\" />\n    </a>\n      \n  </div>\n\n                          <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-collapse\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n              </div>\n\n                    <div id=\"navbar-collapse\" class=\"navbar-collapse collapse\">\n            <div class=\"region region-navigation-collapsible\">\n    <nav role=\"navigation\" aria-labelledby=\"block-mainnavigation-menu\" id=\"block-mainnavigation\">\n            <h2 class=\"sr-only\" id=\"block-mainnavigation-menu\">Main navigation</h2>\n\n      \n              <ul class=\"menu nav navbar-nav\">\n                            <li>\n        <a href=\"/\" data-drupal-link-system-path=\"&lt;front&gt;\">Home</a>\n                  </li>\n                        <li>\n        <a href=\"/support\" title=\"Help for Yaffs\" data-drupal-link-system-path=\"node/380\">Support</a>\n                  </li>\n                        <li>\n        <a href=\"/documents\" data-drupal-link-system-path=\"documents\">Documents</a>\n                  </li>\n                        <li>\n        <a href=\"/get-yaffs\" data-drupal-link-system-path=\"node/382\">Download</a>\n                  </li>\n                        <li>\n        <a href=\"/about-us\" data-drupal-link-system-path=\"node/325\">About us</a>\n                  </li>\n                        <li>\n        <a href=\"/contact\" data-drupal-link-system-path=\"node/73\">Contact</a>\n                  </li>\n        </ul>\n  \n\n\n  </nav>\n<div class=\"search-block-form block block-search block-search-form-block\" data-drupal-selector=\"search-block-form\" id=\"block-searchform\" role=\"search\">\n  \n    \n      <form action=\"/search/node\" method=\"get\" id=\"search-block-form\" accept-charset=\"UTF-8\">\n  <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\">\n      <label for=\"edit-keys\" class=\"control-label sr-only\">Search</label>\n  \n  \n  <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>\n\n  \n  \n  </div>\n<div class=\"form-actions form-group js-form-wrapper form-wrapper\" data-drupal-selector=\"edit-actions\" id=\"edit-actions\"></div>\n\n</form>\n\n  </div>\n\n  </div>\n\n        </div>\n                    </div>\n          </header>\n  \n  <div role=\"main\" class=\"main-container container js-quickedit-main-content\">\n    <div class=\"row\">\n\n            \n            \n                  <section class=\"col-sm-12\">\n\n                                      <div class=\"highlighted\">  <div class=\"region region-highlighted\">\n        <ol class=\"breadcrumb\">\n          <li >\n                  <a href=\"/documents\">Documents</a>\n              </li>\n          <li  class=\"active\">\n                  Yaffs Direct Interface\n              </li>\n      </ol>\n\n\n\n  </div>\n</div>\n                  \n                \n                \n                                      \n                  \n                          <a id=\"main-content\"></a>\n            <div class=\"region region-content\">\n        <h1 class=\"page-header\"><span>Yaffs Direct Interface</span>\n</h1>\n\n  <article role=\"article\" about=\"/documents/yaffs-direct-interface\" class=\"paper is-promoted full clearfix\">\n\n  \n    \n\n      <footer>\n      \n      <div class=\"author\">\n        Submitted by <span><span lang=\"\" about=\"/user/admin\" typeof=\"schema:Person\" property=\"schema:name\" datatype=\"\">Admin</span></span>\n on <span>23 July, 2012 - 12:37am</span>\n        \n      </div>\n    </footer>\n  \n  <div class=\"content\">\n    \n      <div class=\"field field--name-upload field--type-file field--label-hidden field--items\">\n              <div class=\"field--item\"><span class=\"file file--mime-application-pdf file--application-pdf icon-before\"><span class=\"file-icon\"><span class=\"icon glyphicon glyphicon-file text-primary\" aria-hidden=\"true\"></span></span><span class=\"file-link\"><a href=\"https://yaffs.net/sites/default/files/downloads/YaffsDirect.pdf\" type=\"application/pdf; length=256079\" title=\"Open file in new window\" target=\"_blank\" data-toggle=\"tooltip\" data-placement=\"bottom\">YaffsDirect.pdf</a></span><span class=\"file-size\">250.08 KB</span></span></div>\n          </div>\n  \n            <div class=\"field field--name-body field--type-text-with-summary field--label-hidden field--item\">\n<p>This document describes the Yaffs Direct Interface (YDI), which allows Yaffs to be simply integrated with embedded systems, with or without an RTOS.</p>\n<p style=\"page-break-before: always\"><br />\n<br />\n</p>\n<h1 class=\"western\" style=\"page-break-before: always\">1 Background</h1>\n<p>The purpose of this document is to describe the interfacing of the Yaffs Direct Interface (YDI) as well as to provide sufficient information to allow a preliminary evaluation of Yaffs. This document tries to focus on the issues important to the system integrator without getting too detailed about how Yaffs works. Other documents provide an in-depth discussion of how Yaffs works.</p>\n<h1 class=\"western\">2 Licensing</h1>\n<p>Yaffs was originally released for Linux under the GNU Public License (GPL). Various embedded developers soon identified that Yaffs would be ideal for their applications, but were not able to use GPL based code in their systems. Aleph One <span style=\"font-style: normal\"><span style=\"font-weight: normal\">has</span></span> alternative licensing arrangements to support such applications.</p>\n<h1 class=\"western\">3 What are Yaffs and Yaffs Direct Interface?</h1>\n<p>Yaffs stands for <i>Yet Another Flash File System</i>. Yaffs was the first file system designed, from the ground up, for NAND storage.</p>\n<p>In 2002 Aleph One set out to identify file system options for using NAND Flash as a file system. Various file systems available at the time were evaluated and all were found lacking in one way or another. The need for a suitable NAND storage file system was identified and Yaffs was designed to fill that need.</p>\n<p>Although Yaffs was originally designed for NAND flash, it has been used successfully with NOR flash systems and even as a RAM file system. This allows high reliability file systems to be constructed using NOR flash, with a future migration path <span style=\"font-weight: normal\">to NAND</span> flash for higher density and performance.</p>\n<p>Yaffs was originally designed for use with the Linux operating system, but was designed in a very modular way. The operating-system-specific code was kept separate from the main Yaffs file system code. This allows Yaffs to be ported quite cleanly to other operating systems through operating system personality modules. One such personality module is the Yaffs Direct Interface (YDI) which allows Yaffs to be simply integrated with embedded systems, with or without an RTOS. </p>\n<p>Yaffs has been used for many products using various operating systems including Windows CE and various RTOSs, including <span style=\"font-weight: normal\">ThreadX, vXworks, pSOS to name just a few.</span></p>\n<p>Note that there is a native port of Yaffs to eCOS that does not use YDI. This is supported and distributed by eCocCentric.(http://www.ecoscentric.com/).</p>\n<p>Yaffs2, a more recent release of Yaffs, supports a wider range of NAND flash components including 2k page devices and devices with multi-level cells (MLC), and produces equivalent or better performance. It include Yaffs1 compatibility code so Yaffs1 images still work and migration is quite simple. Yaffs1 or Yaffs2 mode of operation are simply selected by a run-time parameter.</p>\n<p>As well as providing a NAND file system, YDI also provides a RAM emulation layer to allow Yaffs to operate as a RAM file system too. While the RAM emulation is perhaps not as efficient as a dedicated RAM file system, this does allow one well proven file system to use both RAM and flash.</p>\n<h1 class=\"western\">4 Why use Yaffs?</h1>\n<p>Yaffs is the first, and perhaps only, file system designed specifically for NAND flash. This means that Yaffs has been designed to work around the various limitations and quirks of NAND flash, as well as exploit the various features of NAND to achieve an effective file system.</p>\n<p>Some features to consider:</p>\n<ul>\n<li>\n<p>Yaffs has been well proven and has been used to ship in <span style=\"font-weight: normal\">large volumes in several products using many different operating systems, compilers and processors.</span></p>\n </li>\n<li>\n<p>Yaffs is written in portable C and is endian neutral.</p>\n </li>\n<li>\n<p>Yaffs provides <span style=\"font-weight: normal\">bad</span> <b></b><span style=\"font-weight: normal\">block</span> handling and ECC algorithms to handle deficiencies in NAND flash.</p>\n </li>\n<li>\n<p>Yaffs is a log-structured file system which makes it very robust to corruptions caused by power failures etc.</p>\n </li>\n<li>\n<p>Yaffs has highly optimised and predictable garbage collection strategies. This makes it high performance and very deterministic when compared with similar file systems.</p>\n </li>\n<li>\n<p>Yaffs has a lower memory footprint than most other log-structured flash file systems.</p>\n </li>\n<li>\n<p>Yaffs provides a wide range of POSIX-style file system support including directories, symbolic and hard links etc. through standard file system interface calls.</p>\n </li>\n<li>\n<p><span style=\"font-weight: normal\">Yaffs is h</span>ighly configurable to work with various flash geometries, various ECC options, caching options etc.</p>\n </li>\n<li>\n<p>Yaffs Direct Interface is simple to integrate in a system – only a few interface functions are required.</p>\n </li>\n<li>\n<p>Yaffs can be used with a wide range of memory technologies.</p>\n </li>\n</ul>\n<h1 class=\"western\">5 Source Code and Yaffs Resources </h1>\n<p><span style=\"font-family: Liberation Serif, serif;\">Please note the licensing terms that apply to using the Yaffs code.</span></p>\n<p><a href=\"http://www.yaffs.net/\"><span style=\"font-family: Liberation Serif, serif;\">http://www.yaffs.net</span></a><span style=\"font-family: Liberation Serif, serif;\"><span style=\"font-style: normal\"><span style=\"font-weight: normal\">serves as the hub for all Yaffs information.</span></span></span></p>\n<p><span style=\"font-family: Liberation Serif, serif;\">This document refers to the Yaffs source code extensively.<span style=\"font-style: normal\"><span style=\"font-weight: normal\">and is available via the download link on this site.</span></span></span></p>\n<p><span style=\"font-family: Liberation Serif, serif;\">There are various other documents and a Yaffs mailing list for Yaffs discussions.</span></p>\n<p><span style=\"font-family: Liberation Serif, serif;\">Consulting services are also available.</span></p>\n<h1 class=\"western\">6 System Requirements</h1>\n<p>Determining minimum system requirements is often quite difficult. The following are presented as a guideline only. Contact Aleph One for more detailed analysis if required.</p>\n<ul>\n<li>\n<p>Yaffs is endian-neutral and works fine with little-endian and big-endian processors.</p>\n </li>\n<li>\n<p>Yaffs code has been used successfully with many different 32-bit and 64-bit CPUs including MIPS, 68000, ARM, ColdFire, PowerPC and x86 variants. Yaffs has even been used with various DSP architectures. Yaffs should work with 16-bit CPUs too, but this is generally untested and might need some tuning, depending on compiler options.</p>\n </li>\n<li>\n<p>Because Yaffs is log structured, RAM is required to build up runtime data structures for acceptable performance. As a rule of thumb, budget approximately 2 bytes per <i>chunk</i> of NAND flash, where a <i>chunk</i> is typically one page of NAND. For NAND with 512byte pages, budget approximately 4kbytes of RAM per 1Mbyte of NAND. For 2kbyte page devices budget approximately 1kbyte per 1Mbyte of NAND.</p>\n </li>\n</ul>\n<h1 class=\"western\">7 How to integrate Yaffs with an RTOS/Embedded system</h1>\n<p>Yaffs Direct Interface (YDI) wraps Yaffs in a way that is simple to integrate. You need to provide a few functions for Yaffs to use to talk to your hardware and RTOS. Yaffs provides a set of POSIX-compliant functions for applications to use to talk to it.</p>\n<p>In addition to the Yaffs core file system, the YDI has three parts which are each explained in more detail in further sections:</p>\n<ul>\n<li>\n<p><b>POSIX Application Interface</b>: This is the POSIX-like interface that the application code uses to access the Yaffs file system. (<span style=\"font-family: Times New Roman;\"><i>open, close, read, write, </i></span>etc) </p>\n </li>\n<li>\n<p><b>RTOS Integration Interface</b>: These are the functions that must be provided for Yaffs to access the RTOS system resources. (<span style=\"font-family: Times New Roman;\"><i>initialise, lock, unlock, get time, </i></span><span style=\"font-family: Times New Roman;\"><i>memory allocation,</i></span><span style=\"font-family: Times New Roman;\"><i>set error, </i></span><span style=\"font-family: Times New Roman;\"><i>etc</i></span>). Note that although we use the term RTOS, the same can be done with other OSs or even with no RTOS at all in a bare-metal system.</p>\n </li>\n<li>\n<p><img src=\"data:image/png;base64,[encoded data, 27864 characters]\" width=\"485\" height=\"530\" alt=\"image\" id=\"Object1\" /> <b>Flash Device </b><b>Interface</b>: This interface support is where the flash device and appropriate device drivers are installed to provide an access path from Yaffs to the flash device(s). Multiple different devices and device types can be supported simultaneously.</p>\n </li>\n</ul>\n<h2 class=\"western\">7.1 Source Files</h2>\n<p>The following source files contain the core file system:</p>\n<table cellpadding=\"4\" style=\"width: 100%; border-spacing: 0px;\">\n<col width=\"71*\" /> <col width=\"185*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_allocator.c</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 72%;\">\n <p>Allocates Yaffs object and tnode structures.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p><br />\n  </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_bitmap.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Block and chunk bitmap handling code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_checkpointrw.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Streamer for writing checkpoint data</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_ecc.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>1-bit Hamming ECC code</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p><br />\n  </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_guts.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>The major Yaffs algorithms.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_nameval.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Name/value code for handling extended attributes (xattr).</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_nand.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Flash interfacing abstraction.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_packedtags1.c<br />\n  yaffs_packedtags2.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Tags packing code</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_summary.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Code for handling block summaries.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_tagscompat.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Tags compatibility code to support Yaffs1 mode.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_tagsmarshall.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Tags marshalling code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_verify.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Test verification code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_yaffs1.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Yaffs1-mode specific code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_yaffs2.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Yaffs2-mode specific code.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>The Yaffs direct interface is in yaffsfs.c, with the interface functions and structures defined in yaffsfd.h.</p>\n<p><br />\n<br />\n</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 100%; border-spacing: 0px;\">\n<col width=\"72*\" /> <col width=\"184*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_attribs.c</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 72%;\">\n <p>Attribute handling.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_error.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Error reporting code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffsfs.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Yaffs Direct Interface wrapper code.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_hweight.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Counts the number of hot bits in a byte, word etc.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_qsort.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Qsort used during Yaffs2 scanning</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>Example flash drivers, simulators and configurations used for testing are are in direct/test-framework directory. These include:</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 100%; border-spacing: 0px;\">\n<col width=\"72*\" /> <col width=\"184*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>nanddrv.c</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 72%;\">\n <p>A NAND driver layer that performs the commands to access NAND flash in a rudimentary manner. This code should work on many styles of CPU with little modification.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_nanddrv.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A wrapper around the NAND driver which plugs it into Yaffs.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>nandsim.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A NAND simulator layer that works with a nandstore_xxx backing store. This simulates a NAND chip.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>nandstore_file.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A storage backend for a NAND simulator that stores the data to file.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>nandsim_file.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A wrapper around nandsim.c and nandstore_file.c which makes a NAND simulator that saves its data in a file.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_nandsim_file.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A wrapper which creates a nand simulator instance, hooks up the yaffs NAND driver and then adds it to yaffs for use.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_nor_drv.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <ol>\n </ol>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_m18_drv.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A driver for Intel M18-style NOR flash.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_osglue.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>An OS glue layer example used in the test harness.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>Example and testing build files:</p>\n<table cellpadding=\"4\" style=\"width: 100%; border-spacing: 0px;\">\n<col width=\"71*\" /> <col width=\"185*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>dtest.c</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 72%;\">\n <p>A test harness. Also has sample code that can be used for better understanding of how some function calls work.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffscfg2k.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>A test configuration.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 28%;\">\n <p>yaffs_fileem.c<br />\n  yaffs_fileem2k.c</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 72%;\">\n <p>Nand flash simulation using a file as backing store.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>Further testing files are in direct/tests and direct/python.</p>\n<h2 class=\"western\" style=\"page-break-before: always\">7.2 Integrating the POSIX Application Interface</h2>\n<p>The application interface is defined in yaffsfs.h. These provide a POSIX file system interface. For the most part, this interface consists of the standard clib function names prefixed with <code class=\"western\">yaffs_</code>. For example, <code class=\"western\">yaffs_open(), yaffs_close()</code> etc.</p>\n<p><br />\n<br />\n</p>\n<p>There is a lot of flexibility in how these functions are used and the system integrator needs to determine the best strategy for the system.</p>\n<p>These functions can be used directly, with the code written using these names. For example</p>\n<p class=\"code-western\"><code class=\"western\">int main(...)<br />\n{<br />\n// initialisation<br />\nf = yaffs_open(...);<br />\nyaffs_read(f,...);<br />\nyaffs_close(f);<br />\n}</code></p>\n<p>The <span style=\"font-family: Times New Roman;\">yaffs</span> functions can also be wrapped in some way to allow existing code to use yaffs without modification. For example:</p>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto; page-break-after: avoid\"><br />\n</p>\n<p class=\"code-western\"><code class=\"western\">#define open(path, oflag, mode) yaffs_open(path, oflag, mode)<br />\n..<br />\n<br />\nint main(...)<br />\n{<br />\n// initialisation<br />\nf = open(...);<br />\nread(f,...);<br />\nclose(f);<br />\n}</code><br />\n<br />\n<br />\n</p>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><br />\n</p>\n<p>A more complex approach that can be used if more than one file-system is used is to provide redirection functions. For example:</p>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto; page-break-after: avoid\"><br />\n</p>\n<p class=\"code-western\"><code class=\"western\">int open(const char *path,...)<br />\n{<br />\n// Determine which file system is being used<br />\n</code><code class=\"western\">i</code><code class=\"western\">f(it_is_a_yaffs_path(path))<br />\nreturn yaffs_open(...);<br />\nelse {<br />\n// Do something else<br />\n}<br />\n}</code></p>\n<p style=\"margin-left: 1.25cm; margin-bottom: 0cm; page-break-inside: avoid; orphans: 0; widows: 0; page-break-before: auto; page-break-after: auto\"><br />\n</p>\n<p><br />\n<br />\n</p>\n<p>Some RTOS\'s provide a flexible way to integrate file systems in which case YDI can typically use these interfaces to access yaffs file systems.</p>\n<h1 class=\"western\" style=\"page-break-before: always\">8 RTOS Integration Interface</h1>\n<p>Before Yaffs can be used, it needs to be integrated with the system and configured so that the correct actions are performed.</p>\n<p>To do this, you need to modify the configuration file. An example configuration file is presented in <span style=\"font-family: Bitstream Vera Sans;\"><span style=\"font-family: Times New Roman;\">yaffscfg.c and yaffscfg2k.c.</span></span></p>\n<p>This is a relatively straight forward process and defines the RTOS access functions.</p>\n<p>The RTOS access functions are:</p>\n<ul>\n<li>\n<p><code class=\"western\">void yaffsfs_SetError(int err)</code>: Called by Yaffs to set the system error.</p>\n </li>\n<li>\n<p><code class=\"western\">void yaffsfs_Lock(void)</code>: Called by Yaffs to lock Yaffs from multi-threaded access.</p>\n </li>\n<li>\n<p><code class=\"western\">void yaffsfs_Unlock(void)</code>: Called by Yaffs to unlock Yaffs.</p>\n </li>\n<li>\n<p><code class=\"western\">u32 yaffsfs_CurrentTime(void)</code>: Get current time from RTOS.</p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>void *yaffsfs_malloc(size_t size)</b></span></span>: Called to allocate memory.</p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>void yaffsfs_free(void *ptr)</b></span></span>: Called to free memory.</p>\n </li>\n<li>\n<p><code class=\"western\">void yaffsfs_</code><code class=\"western\">OS</code><code class=\"western\">Initialisation(void)</code>: Called to initialise RTOS context.</p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>void yaffs_bug_fn(const char *file_name, int line_no)</b></span></span>: Function to report a bug.</p>\n </li>\n<li>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>int yaffsfs_CheckMemRegion(const void *addr, size_t size, int writ</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>e_request</b></span></span>) : Function to check if accesses to a memory region is valid. This function must return zero if the test passes and negative if it fails.</p>\n </li>\n</ul>\n<p><br />\n<br />\n</p>\n<p>If Yaffs is being used in a multi-threaded environment, then typically <code class=\"western\">yaffs_LocalInitialisation()</code> will initialise a suitable RTOS semaphore and <code class=\"western\">yaffs_Lock()</code> and <code class=\"western\">yaffs_Unlock()</code> will call the appropriate functions to lock and release the semaphore.</p>\n<p><code class=\"western\">yaffs_CurrentTime()</code> can be any time increment of use to the system. If this is not required, then it is fine to just use a function that is hard-wired to return zero.</p>\n<p>Before the application code uses Yaffs, the <code class=\"western\">yaffs</code><code class=\"western\">fs</code><code class=\"western\">_</code><code class=\"western\">OSInitialisation</code><code class=\"western\">()</code> function must be called.</p>\n<p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>yaffsfs_CheckMemRegion()</b></span></span><span style=\"font-family: Liberation Serif, serif;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"><span style=\"font-weight: normal\">is used to check addresses passed to the various yaffs_xxx functions (yaffs_open(), yaffs_read() etc)). If the function returns -1, then the yaffs_xxx function will return -EFAULT rather than attempt to dereference the address and crash.</span></span></span></p>\n<p style=\"font-weight: normal\"><span style=\"font-family: Liberation Serif, serif;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\">An implementation might do something like:</span></span></p>\n<p style=\"font-weight: normal\"><br />\n<br />\n</p>\n<p class=\"code-western\"><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>int yaffsfs_CheckMemRegion(const void addr, size_t size, <br />\nint write_</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>request</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>) <br />\n{<br />\nu32 uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>= (u32) addr;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>u32 uaddrt = uaddrb + size -1;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b><br />\nif( uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&gt;= stack_bottom &amp;&amp; uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&lt;= stack_top &amp;&amp;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>uaddrt &gt;= stack_bottom &amp;&amp; uaddrt &lt;= stack_top)<br />\nreturn 0; /* </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>r/w </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>access is OK */<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b><br />\nif( uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&gt;= </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>heap</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>_bottom &amp;&amp; uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&lt;= </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>heap</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>_top &amp;&amp;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>uaddrt &gt;= heap_bottom &amp;&amp; uaddrt &lt;= heap_top)<br />\nreturn 0; /* </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>r/w</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>access is OK /<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b><br />\nif( !</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>write_request &amp;&amp;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&gt;= </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>rom</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>_bottom &amp;&amp; uaddr</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>b</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>&lt;= </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>rom</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>_top &amp;&amp;<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>uaddrt &gt;= rom_bottom &amp;&amp; uaddrt &lt;= rom_top)<br />\nreturn 0; / </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>read </b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>access is OK /</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b><br />\n<br />\n</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>return -1; /* Bad access */</b></span></span><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b><br />\n<br />\n}</b></span></span></p>\n<p class=\"code-western\"><br />\n<br />\n</p>\n<h1 class=\"western\" style=\"page-break-before: always\">9 Yaffs NAND Model</h1>\n<p>Before defining the flash integration interface, it is important to understand the model and corresponding nomenclature used throughout Yaffs and its documentation.</p>\n<p>Yaffs uses a fairly abstract model for NAND flash. This allows a lot of flexibility in the way it can be used.</p>\n<p>Yaffs is designed for NAND flash and makes the following assumptions and definitions:</p>\n<ul>\n<li>\n<p>The flash is arranged in <i><b>blocks</b></i>. Each block is the same size and comprises an integer number of <span style=\"font-style: normal\"><span style=\"font-weight: normal\">chunks</span></span>. Each block is treated as a single erasable item. A block contains a number of chunks.</p>\n </li>\n<li>\n<p>A <i><b>chunk</b></i> equates to the allocation units of flash. For Yaffs1, each chunk equates to a 512-byte or larger NAND page (that is, a 512-byte or larger data portion and a 16-byte spare area). For Yaffs2, a chunk will typically be larger (eg. on 2k page devices, a chunk will typically be a single 2k page: 2kbytes of data and 64 bytes of spare). Yaffs2 is capable of working with smaller chunk sizes by using inband tags.</p>\n </li>\n<li>\n<p>All accesses (reads and writes) are page chunk aligned. Some reads might only read the spare area where the tags are kept.</p>\n </li>\n<li>\n<p>When programming a NAND flash, only the zero bits in the pattern being programmed are relevant, and one bits are &quot;don\'t care&quot;. For example, if a byte already contains the binary pattern b1010, then programming b1001 will result in the pattern which is the logical AND of these two patterns ie. b1000. This is different to NOR flash which would typically abort the attempt to convert a 0 into a 1.</p>\n </li>\n</ul>\n<p><br />\n<br />\n</p>\n<p>Yaffs ide<span style=\"font-weight: normal\">ntifies</span> blocks by their block number and chunks by the chunk Id. A chunk Id is calculated as:</p>\n<p><code class=\"western\">chunkId = block_id * chunks_per_block + chunk_offset_in_block</code></p>\n<p>Yaffs treats a blank (0xFF filled) block as being free or erased. Thus, the equivalent of formatting for a Yaffs partition is to erase all the blocks that are not bad.</p>\n<p>Yaffs2 has a generalised tags interface to provide better flexibility to cater for a wider range of devices with larger pages and stricter programming limitations. Yaffs2 thus handles more abstract constructs than Yaffs1 and, in older versions of Yaffs, more effort was required to interface to the NAND.</p>\n<p>In newer versions of Yaffs, the tags management has been abstracted out of the driver. This makes the driver interface far simpler.</p>\n<h2 class=\"western\">9.1 Formatting</h2>\n<p>Yaffs treats erased blocks as empty. That makes it really easy to “format” a device: just erase it.. Note that this should be done while the partition is not mounted.</p>\n<p>Unmounting will not normally work when the file system is busy (eg. files are open), Some extra non-standard unmount options are provided to enable an unmount to be forced. Note that using these will break any current handles and you will no longer be able to use open files.</p>\n<p><code class=\"western\"><span style=\"font-family: Liberation Serif, serif;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"><span style=\"font-weight: normal\">There is a </span></span></span></code><code class=\"western\"><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>yaffs_format() </b></span></span></code><code class=\"western\"><span style=\"font-family: Liberation Serif, serif;\"><span style=\"font-size: 12pt; font-size: medium; font-size: medium;\"><span style=\"font-weight: normal\">function that will take care of the details.</span></span></span></code></p>\n<p><br />\n<br />\n</p>\n<h2 class=\"western\">9.2 NAND Model considerations for Yaffs1</h2>\n<p>The historical Yaffs1 tags structure was laid out in accordance with the SmartMedia specification for use with 512-byte pages. There is now much more flexibility in the way things can be configured.</p>\n<p><br />\n<br />\n</p>\n<p>Yaffs1 is capable of being used with a variety of memory layouts so long as the flash supports the ability to overwrite the tags area to set the deletion marker to zero.</p>\n<p>If the yaffs_dev\'s use_nand_ecc field is not set, then yaffs will perform the ECC calculations. If this is set then yaffs will expect the NAND driver to do any required ECC checks. On devices that are not using ECC, for example NOR, set use_nand_ecc=1 and then don\'t do any ECC anyway.</p>\n<p>The Yaffs1 flash model expects an area of 16 spare bytes, some of which are used for tags. The mapping between the spare bytes and the usage of the bytes is specified in yaffs_packedtags1.c</p>\n<p>The Yaffs1 model has been used in many NOR-based systems. One particularly instructive example is in yaffs_nor_drv.c which implements a driver for Yaffs1 mode on CFI-style NOR flash. This does not use ECC but uses checksumming instead.</p>\n<p>The yaffs_dev structure has a yaffs_driver structure which holds the function pointers to the driver. For Yaffs1 mode of operations the following are required:</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 100%; border-spacing: 0px;\">\n<col width=\"77*\" /> <col width=\"179*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_write_chunk_fn</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 70%;\">\n <p>Write a data chunk</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_read_chunk_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Read a data chunk.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_erase_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Erase a block</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_initialise_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Initialisation.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_deinitialise_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>De-initialise</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>These functions are described later.</p>\n<h2 class=\"western\">9.3 NAND Model for Yaffs2</h2>\n<p>The Yaffs2 interface is far more flexible than Yaffs1, but that means a bit more effort must be done in the driver. In particular:</p>\n<ul>\n<li>\n<p>There is is no standard spare area/ECC layout. The driver must handle all the layout of the spare area and ECC handling.</p>\n </li>\n<li>\n<p>There is not a standard implementation for bad block markers. Thus, the driver must provide functions for checking and marking bad blocks.</p>\n </li>\n</ul>\n<p>The yaffs_driver structure for Yaffs2 mode requires the following functions:</p>\n<p style=\"margin-bottom: 0cm; orphans: 0; widows: 0; page-break-before: auto\"><br />\n</p>\n<table cellpadding=\"4\" style=\"page-break-inside: avoid; width: 100%; border-spacing: 0px;\">\n<col width=\"77*\" /> <col width=\"179*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_write_chunk_fn</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 70%;\">\n <p>Write a data chunk</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_read_chunk_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Read a data chunk.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_erase_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Erase a block</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_mark_bad_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Mark a block bad</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_check_bad_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Check bad block status of a block.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_initialise_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>Initialisation.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 30%;\">\n <p>drv_deinitialise_fn</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 70%;\">\n <p>De-initialise</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<h2 class=\"western\">9.4 Overview of flash driver function</h2>\n<p>The best way to understand how to write these functions is to look at the example drivers.</p>\n<p><br />\n<br />\n</p>\n<p class=\"code-western\">int (*drv_write_chunk_fn) (struct yaffs_dev *dev, int nand_chunk, </p>\n<p class=\"code-western\">const u8 *data, int data_len, </p>\n<p class=\"code-western\">const u8 *oob, int oob_len)</p>\n<p>This function writes the specified chunk data and oob/spare data to flash.</p>\n<p>This function should return YAFFS_OK on success or YAFFS_FAIL on failure.</p>\n<p>If this is a Yaffs2 device, or Yaffs1 with use_nand_ecc set, then this function must take care of any ECC that is required.</p>\n<p><br />\n<br />\n</p>\n<p class=\"code-western\">int (*drv_read_chunk_fn) (struct yaffs_dev *dev, int nand_chunk, </p>\n<p class=\"code-western\">u8 *data, int data_len, </p>\n<p class=\"code-western\">u8 *oob, int oob_len,</p>\n<p class=\"code-western\">enum yaffs_ecc_result *ecc_result)</p>\n<p>This function reads the specified chunk data and oob/spare data from flash.</p>\n<p>This function should return YAFFS_OK on success or YAFFS_FAIL on failure.</p>\n<p>If this is a Yaffs2 device, or Yaffs1 with use_nand_ecc set, then this function must take care of any ECC that is required and set the ecc_result.</p>\n<p><br />\n<br />\n</p>\n<p class=\"code-western\">int (*drv_erase_fn) (struct yaffs_dev *dev, int block_no) </p>\n<p>This function erases the specified block.</p>\n<p>This function should return YAFFS_OK on success or YAFFS_FAIL on failure.</p>\n<p><br />\n<br />\n</p>\n<p class=\"code-western\">int (*drv_mark_bad_fn) (struct yaffs_dev *dev, int block_no); </p>\n<p class=\"code-western\">int (*drv_check_bad_fn) (struct yaffs_dev *dev, int block_no); </p>\n<p>These functions are only required for Yaffs2 mode. They mark a block bad or check if it is bad.</p>\n<p><br />\n<br />\n</p>\n<p class=\"code-western\">int (*drv_initialise_fn) (struct yaffs_dev *dev); </p>\n<p class=\"code-western\">int (*drv_deinitialise_fn) (struct yaffs_dev *dev); </p>\n<p>These functions provide hooks for initialising or deinitialising the flash driver.</p>\n<p><br />\n<br />\n</p>\n<h1 class=\"western\" style=\"page-break-before: always\">10 Configuration and flash driver installation</h1>\n<p>For an example of how to do the configuration, refer to yaffs_cfg2k.c and one of the drivers such as yaffs_nand_drv.c</p>\n<p>The old mechanism was static and required a table of devices that was installed at start up. This mechanism had shortcomings – in particular it broke modularity and did not allow devices to be added dynamically.</p>\n<p>Things are different now. As any time, a yaffs_dev structure can be configured and then registered with Yaffs by using the yaffs_add_device() function.</p>\n<p>A yaffs_dev structure has two parts which must be configured before yaffs_add_device() is called: the paramers (dev-&gt;param) and the driver (dev-&gt;drv). The driver configuration (plugging in the driver functions) has already been described above, so we will now look at the yaffs parameters.</p>\n<p><br />\n<br />\n</p>\n<p>The yaffs_param structure must be set before the yaffs_dev is added with yaffs_add_device() and should not be modified after that.</p>\n<p>The params are defined in the Yaffs Tuning Document.</p>\n<h1 class=\"western\" style=\"page-break-before: always\">11 Using the POSIX file system interface</h1>\n<p>This section is directed to readers that might not be very familiar with accessing a file system via POSIX and POSIX-like interfaces.</p>\n<h2 class=\"western\">11.1 Difference to Windows POSIX-like interfaces</h2>\n<p>MSDOS and Windows provide a POSIX-lke interface. If you are familiar with this then that will help you. There are are however some slight differences, most importantly:</p>\n<ul>\n<li>\n<p>Windows has no concept of links and has a 1:1 mapping between file names and files.POSIX supports files with zero, one or many names. Refer to the sections on linking and unlinking files. For instance POSIX allows you to unlink a file (ie delete the name for a file) while it is still in use. You can continue to read/write the file but it will be deleted as soon as the last file handle to the file is closed. Windows, on the other hand, does not allow you to unlink a file while it is in use.</p>\n </li>\n<li>\n<p>Windows names drives with a letter. POSIX has no drive letters. The whole POSIX file system is in a single directory tree.</p>\n </li>\n<li>\n<p>Directories and “folders” are the same thing.</p>\n </li>\n</ul>\n<h2 class=\"western\">11.2 Fundamental concepts</h2>\n<table cellpadding=\"4\" style=\"width: 642px; border-spacing: 0px;\">\n<col width=\"126\" /> <col width=\"499\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>File</p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 499px;\">\n <p>A file is an object that is stored in the file system. yaffs supports the following file types:</p>\n <p>A regular file is a sequence of bytes stored in the file system.</p>\n <p>A directory holds links to other files.</p>\n <p>A symbolic link holds a name to another file.</p>\n <p>A special file holds device ids or similar information.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>Directory</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>This is a structure that holds links and allows a file to be found by name. Note that a single file may have many links(ie names) and many be found in many places in the directory structure.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>Link</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>This is a name that allows the file to be found. There are two types of link: real links (sometimes called hard links) and symbolic (or soft) links. </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>Handle</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>A file handle provides a context from which a file can be accessed and manipulated. A handle has a current file position pointer which points to where the file is being read or written. Multiple handles can simultaneously access a single file.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>File mode</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>The mode is the set of flags that define the type of file as well as the current permissions associated with the file.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>Path</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>This is a string that defines the directories and file name. For example:</p>\n <p>“/data/direct-1/file1”</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>File metadata</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>This is the information about the file, excluding the file contents. The metadata includes the name, mode, size and other details.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>Mount,<br />\n  partition,<br />\n  file system</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>These terms all refer to a single mounted flash area. Each mount is hooked into a common directory structure.<br />\n  The term file system can sometimes be confusing because it is used both for a single mounted partition as well as the the file system code. In other words, we might say that both “/boot” is a file system and might also say that yaffs is a file system.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 126px;\">\n <p>inode number</p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 499px;\">\n <p>The inode number is a unique number that identifies the object within the mount. Note that inodes are not unique between two or more mounts. There is no way to reach a file by inode, only via its links.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<h2 class=\"western\">11.3 Error code</h2>\n<p>Most functions result in error codes if the function does not execute successfully. In these cases yaffs calls a function called <code class=\"western\">yaffs_SetError()</code> with the error value. This function can be configured to deliver the error into the system\'s error mechanism.</p>\n<p>In the case of functions that return integers, a returned value smaller than 0 indicates an error occurred. Functions returning pointers will return NULL if an error occurred.</p>\n<h2 class=\"western\">11.4 Links – the hard kind (not symbolic links)</h2>\n<p>At first we\'re just considering real links and not symbolic links. Sometimes real links are also called hard links to differentiate them from symbolic links (which are sometimes called soft links).</p>\n<p>The difference between links and files is subtle and can be confusing. Briefly:</p>\n<ul>\n<li>\n<p>a file is the stored object in the file system</p>\n </li>\n<li>\n<p>the link is how it is hooked into the directory structure.</p>\n </li>\n</ul>\n<p><br />\n<br />\n</p>\n<p>The first link to a file is created by using the file creation calls: <code class=\"western\">yaffs_open()</code>, <code class=\"western\">yaffs_mknod()</code>, <code class=\"western\">yaffs_symlink()</code> and <code class=\"western\">yaffs_mkdir()</code>.</p>\n<p>A link can be destroyed by using the <code class=\"western\">yaffs_unlink()</code> function. Directories are destroyed using the <code class=\"western\">yaffs_rmdir()</code> function (oh, and the directory must be empty).</p>\n<p>Once a file is both unused (there are no handles open to it) and there are no links to it it is then deleted.</p>\n<p>A link can be renamed by using the <code class=\"western\">yaffs_rename()</code> function.</p>\n<p>A file may have many links. These may be created using the <code class=\"western\">yaffs_link()</code> function. All the links access the same file and there is no one link that is considered “the real link” and others being “the duplicate link”. All links to a file have the same priority. If you look at the inode number for “a” and for “b” then they will be the same because they are refering to exactly the same file.</p>\n<p>Thus:</p>\n<ol>\n<li>\n<p>If we start with a file called “a” and then call <code class=\"western\">yaffs_link(“a”, “b”)</code> we now have two links to the same file. We can\'t tell them apart.</p>\n </li>\n<li>\n<p>If we now unlink “a”, the file still exists under the link “b”.</p>\n </li>\n<li>\n<p>If we now unlink “b” the file will no longer be linked. If there is a handle open to the file then we can still access the file through the handle and continue to read or modify the file. If there is no link to the file it is deleted.</p>\n </li>\n<li>\n<p>If an unlinked file was kept alive because of a handle being open, the file will not show up in the directory structure (because it has no link) and will be deleted as soon as the handle is closed (or if the file system is unmounted).</p>\n </li>\n</ol>\n<p>There are some limitations in how links are used:</p>\n<ul>\n<li>\n<p>The existing file you are linking to must exist.</p>\n </li>\n<li>\n<p>The file you are linking to must be in the same mount (partition) as the link you are creating.</p>\n </li>\n<li>\n<p>You cannot create a link to a directory because this would allow the creation of recursive loops.</p>\n </li>\n<li>\n<p>The new link name must not exist.</p>\n </li>\n</ul>\n<p><br />\n<br />\n</p>\n<h2 class=\"western\">11.5 Symbolic links</h2>\n<p>Now that you understand how hard links work, we\'ll introduce symbolic (or soft) links.</p>\n<p>A symbolic link holds an alias for a different object. When you use that symbolic link in a path the alias is used instead. To that extent symbolic link and hard links are the same.</p>\n<p>You can remove symbolic links with the <code class=\"western\">yaffs_unlink()</code> function, just like hard links.</p>\n<p>There are, however, some important differences. A symbolic link only does its linking function when the path is being evaluated and thus:</p>\n<ul>\n<li>\n<p>The file you are creating an alias to does not have to exist.</p>\n </li>\n<li>\n<p>The file you are creating an alias to does not have to be in the same mount.</p>\n </li>\n<li>\n<p>You can create symbolic links to directories.</p>\n </li>\n<li>\n<p>A symbolic link will not keep a file alive by itself. Only a hard link can do that.</p>\n </li>\n</ul>\n<p>Thus:</p>\n<ol>\n<li>\n<p>If we start with a file called “a” and then call <code class=\"western\">yaffs_symlink(“a”, “b”)</code> we now have one link to the file called “a” and a symbolic link aliasising from “b” to “a”.</p>\n </li>\n<li>\n<p>If we use <code class=\"western\">yaffs_open(“a”)</code> or <code class=\"western\">yaffs_open(“b”)</code> they will open the same file. The path resolution mechanism substitutes in the alias and so will look up “a”. The same applies to almost all functions that takes a path, such as <code class=\"western\">yaffs_truncate()</code>, <code class=\"western\">yaffs_stat()</code> etc. The only exceptions are <code class=\"western\">yaffs_lstat()</code> and <code class=\"western\">yaffs_readlink()</code> which will treat the path as pointing to the symbolic link and not the file.</p>\n </li>\n<li>\n<p>You can tell “a” and “b” apart by using <code class=\"western\">yaffs_lstat()</code>. <code class=\"western\">yaffs_lstat(“a”)</code> will show the information for file “a”. <code class=\"western\">yaffs_lstat(“b”)</code> will show the information for the symbolic link itself. Note the difference with hard links. With hard links <code class=\"western\">yaffs_lstat(“a”)</code> and <code class=\"western\">yaffs_lstat(“b”)</code> would show the same results since they are EXACTLY the same thing being referenced.</p>\n </li>\n<li>\n<p>If we now unlink “a”. then the file is no longer linked and will no longer be accessible from “b”. Note the difference with hard links.</p>\n </li>\n</ol>\n<p><br />\n<br />\n</p>\n<h2 class=\"western\">11.6 Handle-based file handling</h2>\n<p>A handle is file accessor that allows us to access the contents of a regular file. The handle identifies the file being accessed as well as a position pointer tracking where the next read or write operation will take place.</p>\n<p>A handle is identified by an integer of value 0 or greater.</p>\n<p>A handle is created by using the <code class=\"western\">yaffs_open()</code> call and returns the handle value. If the handle could not be created then a negative value is returned and the yaffs error code is set.</p>\n<p>A handle remains valid until the handle is closed by <code class=\"western\">yaffs_close()</code>.</p>\n<p>The <code class=\"western\">yaffs_open()</code> call takes three parameters:</p>\n<ul>\n<li>\n<p>name: Full path name of the file being opened.</p>\n </li>\n<li>\n<p>access flags: Flags being used to open this handle</p>\n </li>\n<li>\n<p>creation mode: Mode flags used when creating a file.</p>\n </li>\n</ul>\n<p>The access flags are one or more of:</p>\n<table cellpadding=\"4\" style=\"width: 100%; border-spacing: 0px;\">\n<col width=\"59*\" /> <col width=\"197*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_CREAT</code></span></span></p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 77%;\">\n <p>Create file if it does not already exist.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_EXCL</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>Only use with O_CREAT. Create file if it does not exist. If the file already exists then fail.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_TRUNC</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>If the file exists, and opening with write access, then truncate the file to zero bytes long.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p><br />\n  </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_APPEND</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>Regardless of the handle position, always write to the end of the file.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><br />\n  </p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p><br />\n  </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_RDWR</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>Open for read/write access.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">O_WRONLY</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>Open for write access and no read access.</p>\n <p><br />\n  </p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Liberation Mono, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><b>0 (zero)</b></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>If neither O_RDWR or O_WRONLY is set then the file will be opened for read-only access.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>Where they are not mutually exclusive, these flags are typically combined. For example:</p>\n<p><code class=\"western\">O_CREAT | O_TRUNC | O_RDWR</code> : Create a new file if it does not exist otherwise if the file already exists then truncate to zero length. Typically used to overwrite a file or create if it does not already exist.</p>\n<p><code class=\"western\">O_CREAT | OEXCL | O_WRONLY</code> : Create a new file, opening it for write only. Fails if file already exists.</p>\n<p>There are three mode flags that can be controlled or set. These flags may be set by the open that creates the file or later by the <code class=\"western\">yaffs_chmod()</code>.</p>\n<table cellpadding=\"4\" style=\"width: 100%; border-spacing: 0px;\">\n<col width=\"59*\" /> <col width=\"197*\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">S_IREAD</code></span></span></p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 77%;\">\n <p>The file may be opened for read access.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">S_IWRITE</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>The file may be opened for write access.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 23%;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">S_IEXEC</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 77%;\">\n <p>The file may be opened for execution. This is not enforced by yaffs.</p>\n  </td>\n</tr>\n</table>\n<p><br />\n<br />\n</p>\n<p>Once you have opened a handle you can then do various operations on the file.</p>\n<table cellpadding=\"4\" style=\"width: 605px; border-spacing: 0px;\">\n<col width=\"248\" /> <col width=\"339\" />\n<tr valign=\"top\">\n <td style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 248px;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">yaffs_close(handle)</code></span></span></p>\n  </td>\n <td style=\"border: 1px solid #000000; padding: 0.1cm; width: 339px;\">\n <p>Close the handle. It is no longer usable.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 248px;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">yaffs_fsync(handle)</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 339px;\">\n <p>Flush out any cached writes to the file, as well as the file meta-data.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 248px;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">yaffs_datasync(handle)</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 339px;\">\n <p>Same as yaffs_fsync() but no file metadata.</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 248px;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">yaffs_flush(handle)</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 339px;\">\n <p>Same as yaffs_fsync()</p>\n  </td>\n</tr>\n<tr valign=\"top\">\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; width: 248px;\">\n <p><span style=\"font-family: Courier New, monospace;\"><span style=\"font-size: 10pt; font-size: small; font-size: small;\"><code class=\"western\">yaffs_dup(handle)</code></span></span></p>\n  </td>\n <td style=\"border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; width: 339px;\">\n <p>Duplicates a handle.</p>\n  </td>\n</tr>\n<tr valign=\"to