File system for nonvolatile memory
First Claim
1. A file system for a nonvolatile memory medium, comprising:
- a nonvolatile memory medium logically divided into memory blocks of predetermined size, wherein each of said memory blocks comprises a header portion and a data portion, and wherein said header portion comprises;
a magic number indicating whether said memory block is a valid file system block;
the name of the file to which said memory block belongs, if any;
a set of flags indicating whether said memory block is the first or last block of said file;
the block number of the next memory block comprising said file, if any; and
the length of valid data in said data portion of said memory block.
0 Assignments
0 Petitions
Accused Products
Abstract
A file system for nonvolatile memory media is disclosed, based on the assumptions that the file system structure is flat (i.e., does not contain directories), and that a relatively small amount of memory space is available. The nonvolatile memory medium is divided into logical blocks of predetermined size, depending on the typical file size expected for each particular implementation. Each of these logical blocks includes a header describing the contents of the block. For example, the block header may comprise a magic number indicating whether the block is a valid file system block or a free block, the name of the file to which the current block belongs, a flag indicating whether the current block is the first or last block of the file, the block number of the next block of the current file, if any, and the length of valid data in the present block.
-
Citations
19 Claims
-
1. A file system for a nonvolatile memory medium, comprising:
a nonvolatile memory medium logically divided into memory blocks of predetermined size, wherein each of said memory blocks comprises a header portion and a data portion, and wherein said header portion comprises;
a magic number indicating whether said memory block is a valid file system block;
the name of the file to which said memory block belongs, if any;
a set of flags indicating whether said memory block is the first or last block of said file;
the block number of the next memory block comprising said file, if any; and
the length of valid data in said data portion of said memory block. - View Dependent Claims (2, 3, 4)
-
5. A nonvolatile memory medium, characterized in that it is logically divided into memory blocks of predetermined size, wherein each of said memory blocks comprises a header portion and a data portion, and wherein said header portion comprises:
-
a magic number indicating whether said memory block is a valid block or a free block;
the name of the file to which said memory block belongs;
a flag indicating whether said memory block is the first or last block of said file;
the block number of the next memory block comprising said file, if any; and
the length of valid data in said data portion of said memory block. - View Dependent Claims (6, 7, 8)
-
-
9. A method for opening an existing file stored on a nonvolatile memory medium, comprising:
-
(1) scanning said nonvolatile memory medium to find a first memory block containing a header indicating that said first memory block is the first memory block of said file; and
(2) finding a next memory block using a next block pointer stored in said header of said first memory block, if said file comprises more than said first memory block.
-
-
10. The method of claim 10, further comprising the step of repeating step (2) until either all memory blocks comprising said file have been found or an error condition occurs.
-
11. A method for opening an existing file stored on a nonvolatile memory medium, comprising:
-
scanning said nonvolatile memory medium in sizes of one predetermined logical block;
for each said logical block, reading a block header containing a magic number;
testing said magic number to determine whether said logical block is a valid block or a free block, and if said logical block is a valid block, performing a comparison of a file name encoded within said block header with a specified file name to be opened;
testing a flag within said block header indicating to determine whether said logical block is the first block of said specified file, if said comparison produces a match; and
returning to said scanning step with the next logical block until either said comparison produces a match or all the blocks have been tested, thereby indicating an error condition.
-
-
12. A method for opening a new file to be stored on a nonvolatile memory medium, comprising:
-
scanning said nonvolatile memory medium in sizes of one predetermined logical block;
for each said logical block, reading a block header containing a magic number;
testing said magic number to determine whether said logical block is a valid block or a free block, and if said logical block is a free block, modifying said block header to comprise a valid magic number, the name of the file to be opened, and flags indicating whether said logical block is either the first block or the last block of said file; and
returning to said scanning step with the next logical block until either said testing step has identified a free block or all the blocks have been tested, thereby indicating an error condition.
-
-
13. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for opening an existing file stored on a nonvolatile memory medium, the method comprising:
-
scanning said nonvolatile memory medium to find a first memory block containing a header indicating that said first memory block is the first memory block of said file; and
finding a next memory block using a next block pointer stored in said header of said first memory block, if said file comprises more than said first memory block.
-
-
14. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for opening an existing file stored on a nonvolatile memory medium, the method comprising:
-
scanning said nonvolatile memory medium in sizes of one predetermined logical block;
for each said logical block, reading a block header containing a magic number;
testing said magic number to determine whether said logical block is a valid block or a free block, and if said logical block is a valid block, performing a comparison of a file name encoded within said block header with a specified file name to be opened;
testing a flag within said block header indicating to determine whether said logical block is the first block of said specified file, if said comparison produces a match; and
returning to said scanning step with the next logical block until either said comparison produces a match or all the blocks have been tested, thereby indicating an error condition.
-
-
15. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for opening a new file to be stored on a nonvolatile memory medium, comprising:
-
scanning said nonvolatile memory medium in sizes of one predetermined logical block;
for each said logical block, reading a block header containing a magic number;
testing said magic number to determine whether said logical block is a valid block or a free block, and if said logical block is a free block, modifying said block header to comprise a valid magic number, the name of the file to be opened, and flags indicating whether said logical block is either the first block or the last block of said file; and
returning to said scanning step with the next logical block until either said testing step has identified a free block or all the blocks have been tested, thereby indicating an error condition.
-
-
16. An apparatus for implementing a file system having a flat file structure, comprising:
a processor configured to control the writing of data to and reading of data from a nonvolatile memory medium, wherein said nonvolatile memory medium is logically divided into memory blocks of predetermined size, wherein each of said memory blocks comprises a header portion and a data portion, and wherein said header portion comprises a magic number indicating whether said memory block is a valid file system block, the name of the file to which said memory block belongs, if any, a set of flags indicating whether said memory block is the first or last block of said file, the block number of the next memory block comprising said file, if any, and the length of valid data in said data portion of said memory block. - View Dependent Claims (17, 18, 19)
Specification