?? yaffs_report20020211.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1"> <TITLE></TITLE> <META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Linux)"> <META NAME="AUTHOR" CONTENT=" "> <META NAME="CREATED" CONTENT="20020211;20201700"> <META NAME="CHANGEDBY" CONTENT=" "> <META NAME="CHANGED" CONTENT="20020211;21005100"></HEAD><BODY><H3>YAFFS Progress 11 Feb 2002</H3><H3>Approach</H3><P><I>C. A. R. Hoare, in his 1980 ACM Turing Award lecture, told oftwo ways of constructing a software design: "One way is to makeit so simple that there are obviously no deficiencies and the otherway is to make it so complicated that there are no obviousdeficiencies."</I></P><P>The approach I'm taking with Yaffs is to design and make notes upfront as much as possible. I find this helps make the coding/debugphase go way faster and more predictably.</P><P>Although obviously the code ends up in the kernel, I'm abstractingout kernel services so that I develop/debug in user space usingvanilla dev tools. I like to use Source Navigator because it has anice xref capability though a few quirks too). Thus, yaffs code willbe tested in application space wrapped in a test harness which callsthe yaffs functions. and sits on top of a NAND emulation layer (justtwo big disk files). I can then do things like force ecc failuresetc at will to test recovery logic and check booting etc. Thisgeneral approach has served me well in the past and I expect it willthis time too.</P><H3>Design</H3><P>At this stage all the major design work is done. Basically thereare 3 in RAM management "objects":</P><UL> <LI><P> inodes: An inode maps to the normal file system concept of an inode. It is thus either a file or a directory. <BR>A file type inode points to a tnode tree which is a layered tree that is used to quickly find the pages of data in NAND.<BR>A directory type inode has a list of children links (ie. the links in that directory).<BR>An inode knows which hard links are associated with it.<BR>inode look-up uses a hashing table.</P> <LI><P>links: Links are hard or soft links. All links have a parent inode (ie. the directory they're in). <BR>Hard links point to an inode.<BR>Soft links are just alias strings.<BR>Instead of storing the link name in RAM (big and wasteful and variable size), the location in NAND is stored instead and a u16 "checksum" value is stored in RAM to help in quickly scanning links [ie. say the checksum for "freddies_file" is 123 then when I go search for it I don't need to go look at every link in NAND (slow), just those that match checksum 123]. </P> <LI><P>tnodes: Tnodes are a tiered tree system to rapidly get from inodes to their data pages in RAM.</P></UL><P>There is a need for speed in certain areas, such as rapidlylocating inodes, links data pages during certain scenarios (eg.garbage collection). These have been identified and suitable look-upstructures are in place.</P><P>All dynamic data structures are allocated from pools rather thanone at a time. This is more efficient time-wise and simplifiesclean-up.</P><H3>Code</H3><P>Much of the code for the management layers is already in place, asis some of the tag management code. Some of the code has already beentested.</P><P>I have started with coding the management layer since this is themost critical part to get right. Every now and then I have coded upsome other section to verify that what I have will work.</P><H3>Time</H3><P>So far I've logged 65 hours on yaffs (though it chews upsignificant null cycles too :-)). I believe this is comfortablywithin budget. I was not able to make much progress through Christmasand the week of January, but am able to give a lot more effort now.</P><P><BR><BR></P><P><BR><BR></P></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -