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
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2011-06-22
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
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 ...