CN103092876A - Embedded file system based on CF (compact flash) - Google Patents

Embedded file system based on CF (compact flash) Download PDF

Info

Publication number
CN103092876A
CN103092876A CN2011103460639A CN201110346063A CN103092876A CN 103092876 A CN103092876 A CN 103092876A CN 2011103460639 A CN2011103460639 A CN 2011103460639A CN 201110346063 A CN201110346063 A CN 201110346063A CN 103092876 A CN103092876 A CN 103092876A
Authority
CN
China
Prior art keywords
file system
embedded
card
filename
long filenames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011103460639A
Other languages
Chinese (zh)
Inventor
杨际荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Original Assignee
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD filed Critical ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority to CN2011103460639A priority Critical patent/CN103092876A/en
Publication of CN103092876A publication Critical patent/CN103092876A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an embedded file system based on a CF (compact flash). The compact flash (called CF for short) is a storage device which is wide in application space and low in cost. The embedded file system comprises an SEP3203 embedded processor and a CF interface circuit, and the operating principle of the CF is used for running a drive program of the CF. An FAT file system is more and more widely applied to the embedded system, a traditional 8.3 format filename cannot meet the requirements of some applications. The difference between a short filename and a long filename is explained, a data structure supporting the long filename is analyzed, and the FAT16 file system is designed and implemented by taking the CF as a storage medium and supports read-write operation of a file with the long filename, so that the problem of difficulty in using the long filename in an embedded environment is effectively solved.

Description

Embedded file system based on the CF card
Technical field
The present invention relates to the embedded file system based on the CF card, the present invention illustrates the difference between short filename and long filenames, analyzed the data structure of supporting long filenames, take CF as the storage medium Design and implementation FAT16 file system. this file system is supported the read-write operation of long filenames file, has effectively solved and has used the existing problem of long filenames under embedded environment.
Background technology
Along with the develop rapidly of electronic technology, computer technology, that embedded system appears at more and more is consumer, in the electronic product of communication class.The development of embedded system requires the system can a large amount of data of store and management.SEP3203 is the embedded microprocessor of a ARM7TDMI of Southeast China University's independent research.SEP3203 mobile terminal application processor is for the application demand of low-cost individual mobile terminal, enriches peripheral hardware, low merit trustship reason and external memory configuration cheaply for what the user provided that facing moving terminal uses.The CF card be specially for mass memory design flash card, have the advantages such as cost is low, compatible good.For the CF card can carry out exchanges data with the Windows system, realize driving file operation based on the CF card with the FAT16 file system.
The FAT file system is used the demand that 8.3 more and more extensive, traditional formatted file names can not meet some application in embedded system.
Summary of the invention
Based on the problems referred to above, hereby invent the embedded file system based on the CF card. this system supports the read-write operation of long filenames file, has effectively solved and has used the existing problem of long filenames under embedded environment.
1.CF card driver design; The write operation of showing disrespect on of CF card is all realized by internal register.The CF card has two groups of internal registers: command register block and control register group.Command register block sends to the disk register and orders and carry out the data exchange, and the control register group is used for controlling disc driver.These two groups of registers are selected by CE1 and CE2.A2 one A0 is the addressed line of register.Select CE1 and CE2 to access each register by address wire A2 one A0 and sheet.When read-write, ide interface has two kinds of working method: LBA (LBA (Logical Block Addressing)) and CHS (cylinder magnetic head/sector).This dual mode is by the 6th digit separator of head register.Under the LBA mode, system hides the sector and can not access, and the sector that can access since 0 cylinder, 0 magnetic head, 1 sector, is No. 0 sector under the LBA mode.All sectors are Unified number successively.During CHS (cylinder P magnetic head P sector) addressing, direct defeated people corresponding cylinder P magnetic head P sector numerical value is just passable.When the LBA access mode, convert the logic sector value that to access to corresponding physical track, cylinder and sector number.The design adopts the LBA addressing.
0, in card read-write operation process, at first arrange and show disrespect on the addressing mode of write access address, then driver/head register, cylinder low byte register, cylinder high byte register, sector number register are set respectively to obtain showing disrespect on the start address of write operation according to set addressing mode.Sector counter then is set decides the data block quantity that to read and write, take piece as unit, the CF card is read and write at last.
2. the design of file system; Numerous Embedded applications relates to showing disrespect on of file and writes, and simultaneously the CF card reader is generally to operate under the Windows system.So must set up a cover file system, the design chooses the FAT16 form, supports long filenames, Chinese file name.
(1) .CF card disk is divided into: boot sector, FAT district, root directory area and data field.Boot sector accounts for 512 bytes, comprises jump instruction, identification of the manufacturer and version number, BPB, expansion BPB and system bootstrap routine.The FAT district is that the FAT file system is used for remembering disk record data field bunch chain structure.Root directory area is used for the information of saving contents.The data of file are preserved in the data field.
Wherein, RS is the reserve sector number, and FS is that the FAT table takies sector number, and NF is FAT table backup number, and acquiescence is that 2, DB is the root directory initial sector, and DS is the root directory number, and SS is the shared byte number in every sector.
(2). the realization of long filenames; The expansion of FAT file system aspect long filenames is called VFAT.Traditional FAT16 file system is only supported the filename of 8.3 forms.The file name list form of 8.3 forms is as shown in table 2.In fact a long filenames is storing two names on catalogue: the another name of a long filenames (short filename) and a long filenames.Short filename as another name is stored in directory entry with 8.3 forms, and long filenames is stored in the attribute mark in several directory entries of OFH.
Wherein, the short name directory entry uses GR2312 code form, and each character needs 1 byte space; The long filenames directory entry uses Unicode code form, so must set up the GB2312 code to the conversion table between the Unicode code.Due in embedding people formula field, only set up the conversion table of 3600 Chinese characters commonly used, usually can satisfy the demand of application.The GB2312 code is regularly arranged, and with the GB2312 code one to one the Unicode code be irregular L6J.So can set up a table according to the rule of GB2312 code.When the GB2312 code is converted to the Unicode code, just can easily obtain side-play amount, when the Unicode code is converted to the GB2312 code, just can only pass through whole table of sequential search.For a long filenames, short filename and long filenames all are stored in directory entry, and the long filenames catalogue is according to the catalogue sequence number storage of first byte.
Wherein, as follows about the judgement whether file exists: judge that first filename is a long filenames, if not, judge according to classic method.If a long filenames is first searched the directory entry of another name (short filename) at directory entry, if do not open unsuccessful.If have, then long filenames synthetic according to the long filenames catalogue, compare with it, if identical, there is this file in explanation, if different, does not exist.After finding directory entry, just can obtain first bunch number of file, realize the read-write operation of file.
The process that creates a new file is: judge that first filename is a long filenames, if not, create according to classic method.If a long filenames, the first enough large space of one of application on directory entry, can deposit another name (short filename) and long filenames, if do not have the space unsuccessfully.Fill in directory entry according to the form of short filename and long filenames again, the backspace file indications.

Claims (2)

1. based on the embedded file system of CF card: this system take CF as the storage medium Design and implementation FAT16 file system.
2. according to claim 1 the embedded file system based on the CF card, this system is mainly operated by the realization of the design of CF card driver, long filenames.The read-write operation of CF card is all realized by internal register.The CF card has two groups of internal registers: command register block and control register group.Command register block sends to the disk register and orders and carry out the data exchange, and the control register group is used for controlling disc driver.The FAT16 form is chosen in the realization design of long filenames, supports long filenames, Chinese file name.
CN2011103460639A 2011-11-01 2011-11-01 Embedded file system based on CF (compact flash) Pending CN103092876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103460639A CN103092876A (en) 2011-11-01 2011-11-01 Embedded file system based on CF (compact flash)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103460639A CN103092876A (en) 2011-11-01 2011-11-01 Embedded file system based on CF (compact flash)

Publications (1)

Publication Number Publication Date
CN103092876A true CN103092876A (en) 2013-05-08

Family

ID=48205455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103460639A Pending CN103092876A (en) 2011-11-01 2011-11-01 Embedded file system based on CF (compact flash)

Country Status (1)

Country Link
CN (1) CN103092876A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105803A (en) * 2007-08-01 2008-01-16 北京中星微电子有限公司 Method and system for locating file in mobile terminal FAT system
CN101441634A (en) * 2007-11-19 2009-05-27 凤凰微电子(中国)有限公司 Embedded type file system suitable for smart card application environment
US20100034516A1 (en) * 2007-06-06 2010-02-11 Panasonic Corporation Reproducing apparatus, reproducing method, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100034516A1 (en) * 2007-06-06 2010-02-11 Panasonic Corporation Reproducing apparatus, reproducing method, and program
CN101105803A (en) * 2007-08-01 2008-01-16 北京中星微电子有限公司 Method and system for locating file in mobile terminal FAT system
CN101441634A (en) * 2007-11-19 2009-05-27 凤凰微电子(中国)有限公司 Embedded type file system suitable for smart card application environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴东兴 等: "基于CF 卡的嵌入式文件系统设计", 《计算机技术与发展》 *

Similar Documents

Publication Publication Date Title
US8312554B2 (en) Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus
US20080052459A1 (en) Redundant array of independent disks system
CN101551780B (en) Television and data storage method and device thereof
WO2009153982A1 (en) Plurally partitioned nonvolatile memory device and system
US7802072B2 (en) Data storage device, memory management method and program for updating data recorded in each of a plurality of physically partitioned memory areas
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN103577574A (en) High-reliability linear file system based on nand flash
CN108763531B (en) MDVR file storage system and operation method thereof
CN103996412A (en) Power-fail protection method applied to intelligent-card nonvolatile memories
CN109240939A (en) A kind of method of quick processing solid state hard disk TRIM
CN102214143A (en) Method and device for managing multilayer unit flash memory, and storage equipment
US20080250189A1 (en) Circuit and Method for Improving Operation Life of Memory
CN102426586A (en) FAT (file allocation table) file storage method in embedded system
US20110035543A1 (en) Memory drive that can be operated like optical disk drive and method for virtualizing memory drive as optical disk drive
CN111796759A (en) Computer readable storage medium and method for fragment data reading on multiple planes
CN101521039B (en) Data storage system, controller and method therefor
CN101303667B (en) Method and device for establishing magnetic disk null cluster table and seeking magnetic disk null cluster
CN102200946B (en) Data access method, memory controller and storage system
CN101441596A (en) Method for improving flash memory medium read-write speed
CN100543748C (en) A kind of method and system of utilizing file allocation table to carry out the file tracking
CN102955787A (en) Using method for file directory table, file writing method and main circuit board, CPU (central processing unit) and external storage applying same
CN110286859B (en) Data storage method and device based on FAT file system
CN102375781B (en) Data protecting method, memory controller and portable memory storage device
CN102981975A (en) Management method of flash data and system thereof
US11403211B2 (en) Storage system with file priority mechanism and method of operation thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130508

WD01 Invention patent application deemed withdrawn after publication