
clt4iLS*rBBbr*wmn*uh*·mu·-;u- .- ur aalLrr· 1----_.-I- -_ . - -, - -_ ~ I ~ ~, _- ,i~ ~~Y ,lr~a r,.~r ;.. rrr- _1.....,......... , = - ^ lw - - j- -......... *~__ Nc Designinga Us Write-Once |tI File System I Ageneral-purpose optical storage software technology Simson Garfinkel estorage systems are than being mass-produced. hree different opti- WORM cartridges can store two to ige technologies to four times more data than similarly- over the last dec- sized rewritable ones. Today, 5.25- rite-once systems inch drives are available that can store (called WORMs, for Write Once, Read more than 500 Mbytes per side, and 14- Multiple) are the oldest of the optical inch write-once systems can store two systems and in many ways the most to four gigabytes. As stated earlier, the successful to date. unique virtue of write-once technology Once a block is written into WORM, is the permanence it offers for valuable it can't be changed. This unique char- data. In many application areas, such acteristic of WORM is at once its virtue as financial and medical applications, and its handicap: WORM offers data this feature is extremely critical. permanence, but traditional computer systems can't use WORM without spe- WORM in Use cial software. Operating systems like There are three approaches to using MS-DOS and Unix, for example, need write-once technology in computer ap- to be able to update the blocks used plications. In the first, a specialized to store directories when files are cre- application uses the optical disk for ated or deleted. storing large datafiles (such as images). In 1985 I started a research project The application may track these files at the MIT Media Lab to develop a file using its own dedicated routines, or A*AACNaWe- o system designed for write-once devices. cal storage technology has advantages use a ataDaseL I+~ management system uor This article describes the design and anddisadvantages. this purpose. evolution of this software component, CD-ROM, with more than 500 Mbytes The second approach is to use a known as the Write-Once File System on a 4.77-inch disk that costs less than special device driver that lets the write- (WOFS). a dollar to manufacture, is an ideal once disk simulate a rewritable disk. system for publishing databases and When the operating system tries to re- Why WORM? distributing large software systems. But write a block, the driver writes a new Comparing WORM disks with read- CD-ROM can't be written, and thus isn't block and remembers the translation. only CD-ROMs and rewritable magneto- a replacement for conventional storage. This article focuses on the third ap- optical systems, we find that each opti- Rewritable magneto-optical disks are proach: A file system designed specifi- much slower than magnetic disks, and cally for use with write-once optical Simson is the principalscientist at N/ don't hold as much as CD-ROM, or disks. The goal of our WOFS project HIance Systems, which sells a variety even magnetic disks of the same size. was twofold: To invent a file system ofproducts based upon WOFS. He can Although rewritable cartridges are re- standard which defined the means of be reached at 52 1/2 Pleasant, Cam- movable, they cannot easily serve as a arranging information into files on the bridge, MA 02139, or Internetmail as publication format, because each disk optical disk; and to create a file system simsong@next. cambridge.ma. us. be individually recorded, rather implementation - a function librarywrit- must j 78 Dr. Dobb'sJournal,January 1991 WO FS .. (continuedfrompage 78) When working %withwrite-oncc de- 16-bit values to 32-bit values. ,,ten in the C programming language vices, however, things are more com- Tlo get around these problems. x' OFS ^,hich would let us test the tdesign. plicated. Because the physicadl blocks stores all directories and other file ss- From the beginning, we had high on a write-once disk cannot be changed, tem information ith a small set ol hopes for our project. We designed the files and directories that are logically predefined structures which were spe- file system so that it would be applica- changed must be rewritten to new lo- cifically designed to be portable and t ble to both read-only and rewritable cations. The role of the w rite-once file readlable by many different kinds of optical disks, in addition to write-once. microcomputers. The only two data (Our system was designed one year types in the structures are 32-bit un- before the High Sierra CD-ROM stan- Making WOFS CPU- signed numlllxrs and null-termlinated clhar- dard.) We chose not to take advantage acter strings. Strings are always padded of special features that were present in independent was tricky to a multiple of 4 bytes. WOFS solves during t the drives made by certain manufactur- word-alignment problems by storing shipping ers, so that the software would work all data on 4-byte boundaries. WOFS *Not va with any drive. (See the accompanying because different also has a mechanism for detecting and text box entitled "The Problem with swapping byte order when necessary. Post Fields.") Most importantly, we de- microprocessorsstore signed the file system to be operating data in different ways Basic Structures system independent, so that files writ- WOFS records new data and updates Name _ ten to a disk with one operating system to the optical file system as a series of could be read back with another. sequential block-write operations, start- Naille o Over the past five years, WOFS has ing with the first block on the disk and undergone three major redesigns, most system is to keep track of the most continuing until the end. Address recently in November 1989. Today it is recent version of each directory and The WOFS approach divides the disk City a full-fledged file system that provides file on the disk and permit them to be into two discrete regions: One in which Val to r da muOst many of the function calls specified by found quickly. A good write-once file blocks have been recorded and one in BookSoc the POSIX standard, including open(), system also minimizes the number of which they are blank. The transition close(), read(), and write(). WOFS blocks' that have to be written for any point between the two regions is called has been ported to both MS-DOS and given operation. the "last written block." Unix; optical cartridges can be moved WOFS does not store information By not having a specific part of the between the two systems, and files from on the optical disk in MS-DOS, Unix, disk dedicated to directories or file point- one operating system can be shared Macintosh, or any other "standard" for- ers (such as Unix inodes), WOFS elimi- with the other, even if the two operat- mat. WOFS uses its own format, nates a problem that is common with ing systems are running on processors instead; an operating system specific other file systems: Part of the disk fills that use different byte orders. WOFS interface allows existing operating sys- up, making the disk unable to hold also allows the user to access previous tems to read and write files on the more information, while other parts of versions of files, as well as take the optical. the disk remain empty. entire disk "into the past." Making WOFS CPU-independent was When a disk is mounted, WOFS finds 329C tricky, however, because different kinds the last written block with a binary Col l Differences from Conventional Systems of microprocessors store data in differ- search: If the block examined contains Magnetic file systems update the data ent ways. The Intel 80286 microproces- valid data, WOFS searches higher on stored in files by rewriting the blocks sor, for example, stores 16-bit integer the disk for the last written block; if the that the data is stored in. Files are de- values on 2-byte boundaries; the Mo- block does not contain data, WOFS leted from directories by rewriting the torola 68020 processor stores 16-bit in- searches lower on the disk. directory with the file's name missing, tegers on 4-byte boundaries. Different Although a binary search across the and returning the blocks associated with microprocessors use different strategies disk requires much "seeking" (move- the file to the pool of unused blocks. for signO extension. when. converting. O from. ...ment .._ of. theX .ontical. .----. head)..._ , each_- - seek is TheS- ;*<$ ProblemWith Post Fields >*.afroblemg 4.+ In the eariy days'of wit-6roni&some 'i 'Would be set to "567." ability of write-once disks. WORM manufacturers tried to add spial fTa-,. There are two primary difficulties disks frequently contain blocks with tures to their drives to orerco'ie'thei-; with post fields: speed and reliability., bad bytes in them. WORM drives get difficulty'ofusing write-once with tra-a "Te more often a block is modified around this problem by reading back ditional operating systems. One popu- . with a post field-based file system, every block after it is written and re- 31 lar system was called "post fields," the longer it takes to find that block. writing it in another location if re- small records at the end of each block is is a big problem with blocks that quired. The problem with a post field of data that could be recoided inde- 'are used to store directories, for if the based-scheme is that occasionally it pendently from the block'itself. Post -:'irectory is modified 100 times, then is the bytes in the post field itself that fields were used as pointers to newer .'1:xOt blocks and post fields have to be are bad, which inakes it impossible versions of blocks.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-