Method for implementing file system in embedded system

An embedded system and file system technology, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve problems such as slow start-up speed, ignoring special requirements, and difficulty in transplantation, so as to achieve less resource occupation and high operating efficiency Effect

CN102103596AActive Publication Date: 2011-06-22深圳华康创展科技控股集团有限公司
3 Cites 12 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2011-06-22

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a method for implementing a file system in an embedded system, which comprises the following steps of: establishing the file system consisting of a file information area and a file data area, wherein the file information area consists of a plurality of file information structures for describing each piece of file information respectively, and the file data area is used for storing files; initializing the file system; and establishing and maintaining the file information area by using a journal method, and when writing operation is performed on the files each time, after the files are written into the file data area, updating the records of the file information to the file information area. In the method, the file system is implemented, can modify the number of the files to be stored and total capacity according to configurations, has a power failure protection function, high file reading / writing operation efficiency and small code sizes, is less dependent on an operating system and convenient to port, and occupies fewer resources.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to a file operation method, in particular to a method for realizing a file system in an embedded system. Background technique

[0002] In the existing embedded file system technologies, most of them are FAT or Ext2fs file systems. Since FAT and Ext2fs and other file systems are based on IDEs that only support block devices like IDE, not only the code is relatively large, but also device erasure is not considered. Timing and timing requirements, no power-down protection.

[0003] And for the JFFS2 file system dedicated to embedded systems. In addition to its own complexity, it is mainly designed to be used in the Linux operating system. It is highly dependent on the operating mechanism of the Linux operating system, so it is difficult to transplant; it is a log-based file system, which leads to a relatively slow startup speed. In addition, JFFS2 uses a probabilistic method to solve the wear balance, which is difficult to ensure t...

Examples

Embodiment Construction

[0025] The invention proposes a simple and easy-to-operate file system implementation method, realizes a method that can configure and modify the number and total capacity of files to be stored according to needs; has the function of power-off protection, is less dependent on the operating system and is easy to transplant, and reads files A file system with high write operation efficiency, small code and low resource usage.

[0026] The file system configuration that the present invention proposes is as follows:

[0027] 1. Determine the maximum number of files FILE_NUM that the file system can store and the total data capacity MAX_SIZE that the file system can store according to specific requirements.

[0028] 2. Determine the capacity UNIT_SIZE of the basic storage unit of the file system according to specific requirements, which can generally be 2K, 4K, etc. If MAX_SIZE is large and FILE_NUM is small, then UNIT_SIZE can be set larger, such as 8K, 16K, etc.; if MAX_SIZE is ...