[go: up one dir, main page]

CN101441634A - Embedded type file system suitable for smart card application environment - Google Patents

Embedded type file system suitable for smart card application environment Download PDF

Info

Publication number
CN101441634A
CN101441634A CNA2007101776344A CN200710177634A CN101441634A CN 101441634 A CN101441634 A CN 101441634A CN A2007101776344 A CNA2007101776344 A CN A2007101776344A CN 200710177634 A CN200710177634 A CN 200710177634A CN 101441634 A CN101441634 A CN 101441634A
Authority
CN
China
Prior art keywords
file
interface
cache
directory
sector
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
CNA2007101776344A
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.)
RDA Microelectronics (Shanghai) Corp. Ltd.
Original Assignee
POENIX MCROELECTRONIC (CHINA) 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 POENIX MCROELECTRONIC (CHINA) CO Ltd filed Critical POENIX MCROELECTRONIC (CHINA) CO Ltd
Priority to CNA2007101776344A priority Critical patent/CN101441634A/en
Publication of CN101441634A publication Critical patent/CN101441634A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention discloses an embedded file system suitable for an intelligent card application environment. A DOS subarea like comprises a boot sector, a file allocation table, a root directory and a data area; the file system comprises a file management module, a directory management module, a file allocation table management module, a file directory table management module, a logic disk management module and a cache management module. Through the storage of various data and files safely and reliably, the embedded file system can provide ultra-high capacity storage management with the capacity higher than megabyte level so as to realize the functions of a SIM card of sharing and exchanging data with currently dominating digital equipment such as personal computers, digital cameras and MP3/MP4 players.

Description

Be applicable to the embedded file system of smart card application environment
Technical field
The present invention relates to smart card designs and application, relate in particular to the design and the application of the smart card document system of high calculated performance, super large memory capacity, high-speed transfer interface.
The smart card of indication of the present invention is meant that basic function meets or adopts ISO/IEC 7816 standards, and enhancement function adopts the high capacity novel smart card of industry member state-of-the-art technology.
Background technology
Smart card is IC-card again, is that a kind of integrated circuit (IC) chip that will have storage, encryption and data-handling capacity is embedded in the card in the plastic substrate.Smart card is divided according to the chip of setting-in, can be divided into memory card and microprocessor card two big classes.Smart card among the present invention is meant microprocessor card, also claim the CPU card, the integrated circuit in the card comprises central processor CPU, EEPROM, random access memory ram and is solidificated in chip operating system COS (Chip Operating System) in the read only memory ROM.
File is a very important notion among the COS.Called file is meant the organized set about record in data cell or the card.COS realizes its storage and management to each application by the method for setting up a respective file for every kind of application.What therefore, store in the application file of COS all is various data or the record relevant with application program.
At present, main intelligent card data recording mode is directly to leave flash memory the inside in, and the form that data owner will be deposited continuously with order is not suitable for reading of the file beyond the file layout on the conventional smart card, as media file, and database file etc.And the file system of a kind of COS generally all can only be applied to specific certain (or some) smart card, therefore can't be by data synchronization on general high-speed interface (as USB, SD/MMC etc.) and PC or the terminal.Since at present the Flash storage medium in embedded system large-scale application and people for the demand of large-capacity memory card, simple data on the conventional smart card (as SIM card) is managed the storage means and the addressing of the paging structure of the physical management that more can't adapt to flash memory, and there is very big problem in access mechanism.
Because value-added service is to supporting USB, the demand of multiple mass-memory unit such as MMC, for the data management in the system, the compatibility management that realizes multiple medium (NAND/NOR) is the major requirement of file management, therefore, how to set up file system and come the management storage region data, become the industry problem demanding prompt solution based on in-line memory.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of embedded file system that is applicable to smart card application environment, for the user provides simple, unified file access and management platform, by becoming the data organization of being managed the form of file to handle, help location, the analysis of data, improve the efficient of data management.
For solving the problems of the technologies described above, the invention provides a kind of embedded file system that is applicable to smart card application environment, in the class DOS partition, comprise: boot sector, file allocation list area, root directory area and data field;
Described file system comprises as lower module:
Document management module is used to provide the related application that file is operated interface;
The directory management module is used to provide the related application that catalogue is operated interface;
The file allocation table administration module is used to provide the related application that bunch chain is operated interface;
The File Directory Table administration module is used to preserve the attribute information of file and catalogue, and the related application that catalogue is operated interface is provided;
The Logical Disk administration module is used to preserve the essential information of Logical Disk, and the related application that Logical Disk is operated interface is provided;
The cache management module is used for high-speed cache is carried out dynamic assignment, makes the sector content carry out mutual read-write operation in Logical Disk and high-speed cache.
Wherein, described system can further include:
Application program module is used for by calls application interface, realizes the operation to file and catalogue;
The bsp driver module is used to provide and device-independent interface, makes system pass through the hardware of this interface accessing reality.
Utilize the present invention, can Various types of data and file be stored safely and reliably by specific operation, provide to be at least the above vast capacity storage administration of megabyte rank, thereby digital equipments such as the PC of realization SIM card and present main flow, digital camera, MP3/MP4 player are shared and the function of swap data.
Description of drawings
Fig. 1 is the general structure synoptic diagram according to embedded file system of the present invention;
Fig. 2 is according to each module level synoptic diagram of file system of the present invention, and wherein the MP3 read module is as the example of an application program and exist;
Fig. 3 is the synoptic diagram according to high-speed cache of the present invention (Cache) distribution mechanism;
Fig. 4 is the software configuration exemplary plot according to novel smart card of the present invention;
The synoptic diagram of Fig. 5 for articulating according to file system of the present invention and storage medium.
Embodiment
At present, oneself is through there being the file system of a lot of maturations, as the FAT file system under the DOS, new technology file system under the Windows NT and unix filesystem etc. on PC.But these file system also are not suitable for directly using the storage of carrying out multimedia data contents in the embedded system, this be because:
1, embedded system is comparatively complicated and diversified as the Flash kind of mobile storage use, and file system not only will provide file system for a kind of application (as USB flash disk), also to use (as SIM for other, SD, MMC, CF etc.) the Flash storage medium of multiple different physical layer interfaces provides file system, will carry out the operation of similar abstract and encapsulation to these different objects, so that upper layer application can use same interface to finish file management to different objects.This and traditional disk management have difference, need the file system design to accomplish bottom layer independence.
2, universal document system is at the profuse computer platform of system resource and based on slow disc driver, its caching technology will expend many system memory resources, some Attribute class and root directory size etc. also can consume part hard disk resource, are not suitable for the very limited applicable cases of system resource in the embedded system.
3, need support many specific application based on the embedded file system of mass memory, as SIM, USB, SD/MMC etc., the file system of this and ordinary desktop operating system is in function and used very big-difference, under some situation in embedded file system, file system can be at special purpose customization, and this systemic-function regularity to embedded OS is had higher requirement.
Based on above-mentioned consideration, a kind of embedded file system of suitable SIM card applied environment need be provided, it not only support short title management, file pointer access and automatically corrupted manage the function that these universal document systems have, and also to consider to some extent aspect the extra resource consumption of the reliability of file system and file system.Overview need be utilized user interface, can be achieved as follows function complete, easily:
1, the location of file and access.
2, the operation of file and control.
3, file shares and protection.
The present invention is described in further detail below in conjunction with drawings and Examples.
The universal document system that the embodiment of the invention provides is based on the embedded OS, support USB, SD, FAT12/FAT16/FAT32 system on the mmc card, management when supporting polylith FLASH, and can be according to actual needs and the different management and the configurations of carrying out Cache of hardware sector-size, and increased on this basis and the concrete file system interface that matches of using such as SIM card, according to embedded type apparatus characteristic some system independence items are simplified simultaneously.
Owing to the file system of the embodiment of the invention is that file manager as embedded system exists, on its structure treatment, can more simplify than MS-DOS FAT file system, more flexible, to improve the storage efficiency of total system.But consider the mutual of USB flash disk interface and PC, therefore, structurally must with the FAT system compatible.
According to application purpose and demand, the basic structure design of embedded type file manager, must satisfy following two kinds of principles:
1, compatible MS-DOS FAT file system on the structure.This structure is comparatively complicated, and occupying system resources is more.But take this mode, the data file on the Flash storer just can be backward compatible by the FAT file system of MS-DOS or Windows (FAT 12/16/32).
2, the intelligent card embedded system that real-time is had relatively high expectations can simplify the operation by certain methods.For example, the hidden parts of cancellation master boot sector is simplified the structure of boot sector, FAT district, root directory area, or is revised according to system requirements.Storage space has not only been saved in structural simplification effectively, has also improved storage efficiency greatly.
According to mentioned above principle, when realizing file system, storage organization has been taked and the similar storage organization of hard disk.Visibly different is not need main boot partition MBR in the Flash storage medium of novel file system management, because need the FAT file system of having only in the Flash storage medium with the PC interactive operation, can leap to the boot sector DBR of FAT, i.e. the DOS boot partition.
If embedded file system provided by the invention just is used for the file management of internal system, even employing FAT file system also can be according to the storage organization of standard, but, consider and to carry out alternately with PC, format storage on PC and the mobile phone, the file system of managing can be discerned, use by smart card system, equally, also must be discerned, use by the file system of smartcard internal format back storage, management by PC.The storage organization of this just necessary employing standard, each instruction and parameter among the boot sector DBR must be according to the standards of Microsoft's release.
According to above requirement, the present invention has designed file system structure as shown in Figure 1.
In class DOS partition structure, comprise boot sector, file allocation table (FAT) district, root directory area and data (DATA) district.The class DOS partition is meant that basic structure and DOS partition are similar, carried out function at the low profile edge system and deleted partitioned organization with structural adjustment.Be allocated as follows in detail:
--boot sector.This sector is positioned at logic first sector of subregion, has wherein comprised the whole important informations and the filesystem information of relevant memory characteristics.
--the FAT district.The structure arrangement in FAT district is with MS-DOS FAT file system difference.Include only a FAT table, to reduce operation complexity.Depositing the storage link structure with idle condition and each file of taking of all blocks of smart card in the FAT table.Support FAT 12/16/32 form.
--root directory area.Be root directory area behind the FAT district.This zone comprises the directory entry of 32 strict byte formats, is used for description document and sub-directory.The name of include file or sub-directory, attribute, generation or the last date and time of revising, file starting cluster number and file size etc.
--data field (data district).Really be used to deposit the zone of the various data files of user.
At the said system structure, the invention provides a kind of novel smart card universal document system that satisfies the compatible again MS-DOS FAT of embedded memory space requirements system simultaneously.Function is as follows:
--support a plurality of Logical Disk, and different Logical Disk can be on different media.
--support the tree type contents structure, the sub-directory number of plies is unrestricted.
--support with FAT12, FAT16, the formative Logical Disk of FAT32
--support file read-write and directory operation.
--the big I of root directory area is established during format (format).
--support 8.3 filename forms, ignore long filenames.Because the SIM file size mostly is 4 bytes, therefore do not support the file of creating and visiting long filenames can save big code space.But, the file with long filenames still can be visited by short filename.
--ignore time correlation attribute in file (catalogue) attribute because embedded system does not usually have system clock, even and have, do not have unified standard yet, handle file, catalogue characteristic so design reduces as far as possible about time correlation.
--support in file (catalogue) attribute read-only, file, implicit, system property.
--simplify the FAT table handling, ignore except that all the FAT tables first FAT table.Because bad piece manages under file system, make security greatly improve, therefore do not need to carry out the FAT table synchronously to simplify the operation, if Logical Disk has several FAT tables, then only operate first FAT table, other FAT table remains unchanged.
Embodiment provided by the invention system adopts the design of modularization hierarchical structure, and uses bsp driver compatible different hardware configuration and different media, and its structure as shown in Figure 2.
Below introduce its function by module.
1, application program module 202
Application program is the own written program of user, is the user of file system, is positioned at the top of whole procedure.The function (API) that application program can be called file system to be provided is operated accordingly to file and catalogue.
Because system operates on the multiple task management basis of RTOS, therefore, must carry out control corresponding for concurrent file read-write operation.
Wherein, user interface layer (API) provide file operation API, by message mailbox mechanism corresponding file operation requests sent to the file system management layer, finishes obstruction or unblock and call.The file system management layer provides the file system space management, access control, and read-write operation, this layer are handled USB as a task independent operating by message queue, the concurrent requests of using file operation such as SD/MMC and SIM more.
From user interface layer, the api interface of file system of the present invention is finished file operation by the message mechanism that operating system (OS) provides, the file server of file system by the interface of file system, is finally finished the read-write operation to Flash under the scheduling of OS.
2, document management module 204 and directory management module 206
Document management module 204 and directory management module 206 are modules of direct and application programming interfaces, are positioned at the top of file system.Most of user interface function (API) all defines in these two modules.Document management module provides all functions relevant with operation file; The directory management module provides the function relevant with operating catalogue.
Wherein, basic file operation interface in the document management module 204 comprises:
1) establishment of file is opened
Open or create a new file, (, write) wait to determine its concrete operations as read by path (WINDOWS standard routes form) and the mode created or open.Different with DOS FAT form is that file has been ignored long filenames.Need close file behind the EO.
2) close file
Close the filec descriptor of opened file.
3) file reads
The byte that begins to read appointment from the file current position of opening is to buffer zone, and the move pointer.Buffer size must be greater than this maximum length that reads.
4) file writes
Begin to write the byte of appointment from the file current position of opening, and the move pointer.
5) searching of file, the pointer location
The move pointer position.
6) obtain file current location pointer
Obtain the current file pointer position.
7) whether file arrives tail
Check whether file arrives tail.
8) deleted file
The file of deletion specified path, file must be not open file.
9) smart card special applications file operation
For the SIM that adapts in the smart card uses, the present invention has increased in document management module the SIM file of the establishment of SIM fixed-length file and strip length inspection has been write incoming interface.When document creation, the FAT file system of MS-DOS only increases the property content of 32 bytes at the parent directory of file, and the size of file writes and increases with file.Because the SIM file has the characteristic of fixed length, as note bar number, telephone directory space etc., simultaneously in order to guarantee the secure access of SIM data, at above demand, on original file operation basis, increased the establishment of fixed-length file, promptly when document creation, increase corresponding number of clusters, and in the attribute byte of its parent directory, add the length setting according to designated length.When writing the SIM file, because the FLASH space that smart card uses is limited, for having the data that length restriction causes, operating writing-file in the FAT file system that prevents MS-DOS do not overflow, increased the write operation interface that strip length is checked, promptly when each write operation, checked whether write address size exceeds the proper length that the SIM file is determined.
This two places interface must not change original FAT structure, with the complete compatibility of assurance with WINDOWS FAT file system.
Directory management module 206 comprises the base directory operation-interface, mainly contains:
1) establishment of catalogue: create the catalogue under the specified path.
2) deltree: the deletion assigned catalogue, if this catalogue is not empty, then can not delete this catalogue.
3) change the current directory: changing the current directory is assigned catalogue.
4) obtain file attribute
Obtain the length of specified file (catalogue) or be not the file attribute of catalogue etc.
5) application-specific operation
As judge whether assigned catalogue (file) is the parent directory of current directory, and sub-directory, fraternal catalogue, relational directory etc. can be used for the SIM applying portion, and this part can be added according to the concrete application need of reality.Add and to change original FAT structure.
3, file allocation table administration module 208 and File Directory Table administration module 210
File allocation table (FAT) administration module 208 and File Directory Table (FDT) administration module 210 are being managed two important data structures of FAT file system, and user program can not call them.
The similar MS-DOS FAT of the processing of FAT module 208 system, as the next one that obtains bunch bunch number are provided with next bunch number, are that bunch chain increases by one bunch, a bunch of chain of deletion etc.Be provided with operation simultaneously, number of clusters is increased according to byte, to satisfy the as above establishment interface of regular length file at bunch chain of the increase regular length of SIM.Specific as follows:
1) obtains down cluster bunch number
Obtain the following cluster number of bunch chain under specifying bunch.
2) cluster bunch number is set down
Seek a sky bunch, and the following cluster that is set to specify bunch.
3) bunch of chain of deletion
The whole bunch of chain at bunch place specified in deletion.
4) use relevant design
As increase a bunch of chain etc.
File Directory Table (FDT) is the important data structures of FAT file system, and the main information of all files, catalogue (not comprising root directory) all is kept in this data structure.File Directory Table is stored in the data field in the mode of file, comprises among the FAT32 that root directory area all uses the FAT management mode identical with ordinary file.For FAT12 and FAT16, its root directory has special data storage areas, and is different with the processing mode of other catalogues.
The FDT module stores attribute information of file and catalogue.Comprise filename, size, attribute, Time Created, at last visit the date, write date, starting cluster etc. at last.In the present invention, file (catalogue) name is supported 8.3 filename forms, ignores long filenames.Because the SIM file size mostly is 4 bytes, therefore do not support the file of creating and visiting long filenames can save big code space.But, the file with long filenames still can be visited by short filename.Ignore the time correlation attribute in file (catalogue) attribute because embedded system does not usually have system clock, even and have, do not have unified standard yet, handle file, catalogue characteristic so design reduces as far as possible about time correlation.Ignore in file (catalogue) attribute read-only, file, implicit, system property.The file, the catalogue that have these several attributes are not carried out special processing, thereby save the processing time, the simplified system operation.
The function that this document directory management module 210 needs to realize comprises:
1) will specify bunch all data zero clearings.
2) increase FDT information
Look into increase specified file (catalogue) at assigned catalogue, be used for the establishment of catalogue and file.
3) deletion FDT information
At assigned catalogue deletion specified file (catalogue), be used for the deletion of catalogue and file.
4) change FDT information
Change the attribute of assigned catalogue specified file (catalogue).
5) obtain FDT information
Obtain assigned catalogue specified file (catalogue) information.
6) search FDT information
Search specified file (catalogue) at assigned catalogue.
4, the Logical Disk administration module 212
Some essential informations of Logical Disk administration module 212 in store each Logical Disk.For example, the driver of Logical Disk use is preserved by this module.These information can be used by a lot of other modules, and the function (API) that most of module all needs to call this module obtains the information of the Logical Disk of oneself needs.File system is by a plurality of Logical Disk of this module management.
This module mainly comprises as lower interface:
1) loading of Logical Disk driven management
Design an interface that has nothing to do with underlying device, promptly comprised read-write and specified Logical Disk, the interface of designated sector.Read Flash information by this interface, and load this driver.
2) the unloading Logical Disk drives
Delete a bsp driver.
3) initialization of disc information
Design logic dish information registration item is in order to write down the various information of each Logical Disk.In this interface, carry out necessary initialization.
5, cache module 214
High-speed cache (Cache) adds for the access speed of accelerating Logical Disk.It utilizes some ram to preserve the content of some Logical Disk sectors of visiting as Cache.If its backup is arranged among the Cache when certain reads the Logical Disk sectors of data, reading disk no longer then.Simultaneously, write data to not direct control Logical Disk sector of Logical Disk sector reality, but write earlier among the Cache, when this a slice of certain reason Cache will store other sector data, or just write Logical Disk when calling corresponding function (API) veritably.So just reduce the number of times of access logic dish greatly, improved speed (Logical Disk speed is slow usually) accordingly.This module is used for managing Cache.
Because file system is that (distributing as sector-size with 512bytes as the WINDOWS minimum) operated by unit with the sector, and the space of Flash is limited in smart card, therefore, is divided into littler sector and will more helps making full use of of storage space.In novel smart card, because the equipment of integrated USB/SD/MMC etc. and WINDOWS file system compatibility, sector-size must be divided with minimum 512byte.This just makes different FLASH to manage with different sector-size, and Cache also must be in limited space the sectors of compatible two kinds of different sizes, and carry out rationally and effectively distributing.
Thus, the success or not of Cache modular design among the present invention will play a part crucial to the running of total system.The function that this module will realize mainly should have:
--distribute mobilism (make Cache utilization factor higher).
--its integrality is to greatest extent read and guarantees when writing data in instruction to every APDU.
--the equilibrium that Cache is read
In a system, the size of Different Logic sector, will be distributed with different sectors according to the Different Logic dish in the branch timing of Cache dynamically by Logical Disk (logic sector number) decision at its place.
The distribution principle and the flow process of Cache piece are as follows:
At first, the distribution that is based on least unit of Cache, and the piece number that distributes counted.As shown in Figure 3, the RAM district that when Cache is initialized, Cache is divided into MIN_CACHE_SIZE * FIX_MAX_CACHES size.Wherein the least unit of MIN_CACHE_SIZE for distributing can be provided with voluntarily according to system's needs.The sector-size of all Logical Disk should be the integral multiple of MIN_CACHE_SIZE.
Second, designated sector is carried out Cache and is divided timing, by searching identical big or small sector or the respective stored space is found in other sectors of merging/decomposition, when being arranged in Cache, this sector of this Logical Disk then do not need to carry out the distribution of Cache, when all Cache pieces all are masked as can write the time, after then needing Cache carried out write back operations, redistribute again.The principle of distributing is, but when size (Size) that the allocated sector that finds by the Cache algorithm (ToAllocateSize) is distributed greater than needs, this sector is cut apart, be divided into the sector of the sector consistent (Size) and (ToAllocateSize-Size)/MIN_CACHE_SIZE MIN_CACHE_SIZE size with needing allocated size.But when size (Size) that the allocated sector size (ToAllocateSize) that finds by the Cache algorithm is distributed less than needs, this sector is moved on to the Cache end, and other sectors are moved forward in proper order, need allocated size to become Size-ToAllocateSize, redistribute, equal Size until moving on to last space size.If in assigning process, find a Cache piece that equals the Size size just, then return this Cache piece.Therein, if dividing timing to find, each piece reallocates after answering write-back when all Cache pieces all need write-back.
The 3rd, the algorithm of Cache adopts improved LFU (least-frequently-used) algorithm, and that promptly shifts out minimum use at first reads to indicate the sector, can accomplish that promptly effective and stable Cache distributes.
Thereby can accomplish that the sector content carries out mutual read-write operation in FLASH and Cache.
Concrete functional unit is achieved as follows:
1) the initialized unit of Cache
With the Cache information initializing.Be about to the RAM district that Cache is divided into the MIN_CACHE_SIZE*FIX_MAX_CACHES size.
2) unit of the distribution of Cache
Promptly find the appointment Logical Disk in Cache, the buffer zone at designated sector place simultaneously, when the sector content is not in Cache, distributes the buffer zone of an identical size from the Cache district by above Cache allocation algorithm.
3) read the unit of sector
To specify Logical Disk, the data of designated sector are read by Cache, if content is then read Cache with data from Flash not in Cache.
4) write the unit of sector
To specify Logical Disk, the data markers of designated sector is for writing.Because the Cache scheme is based on write-back mechanism, be with respective markers set therefore at this place, the real Flash operation of writing occurs in the Cache write-back.
5) unit of Cache write-back
Be written among the real Flash by Cache being labeled as the sector that can write in the whole C ache district data, the principle of write-back can be determined according to the actual conditions of smart card.As can behind an APDU order fulfillment, carrying out write-back in the SIM card.Check the Cache piece when minute timing the operation of Cache write-back also will take place when all needing write-back.
6, the bsp driver module 216
For can compatible multiple medium and hardware, can realize by bsp driver.Bottom layer driving provides and device-independent interface for upper procedure, and system is by the hardware of this interface accessing reality.
The function of this interface is specially, and by the Logical Disk of appointment, designated sector is read buffer zone with the Flash content or buffer contents is written back among the Flash.
7, other utility routine module 218
Utility routine is not the ingredient of file system.But they are very important again.Because different application all has its singularity, except that basic file operation, also need other and use relevant interface, as SIM, MP3 etc. relate to the module that file system is used in a large number.This interface can add according to actual needs flexibly.But must follow original file operation standard, meet MS-DOS FAT form.
Below with reference to Fig. 4, Fig. 5, be example in SIM card, to realize the USB/SD/MMC interface simultaneously, the invention is further described.
The software of the novel smart card that the embodiment of the invention relates to designs by hierarchy, be divided into hardware driving, RTOS, API and concrete application/business etc. which floor, detailed structure is as shown in Figure 4.Smartcard internal of the present invention comprises numerous Device elements and application program, the complexity height of scheduling and management, therefore adopt RTOS to do intelligent management, so that efficient, a sane multitask, the working environment of using to be provided more, major function comprises task scheduling management, file management, memory management, interrupt management, time management, equipment control.
Have three FLASH among the embodiment in the smart card, be respectively data-carrier store D_FLASH in the sheet, sheet internal program storer P_FLASH, and sheet is outer and the shared OUT_D_FLASH of memory interface such as USB/SD/MMC, three kinds of different mediums that the concrete file system that the present invention is based on RTOS is managed have been constituted, as shown in Figure 5, wherein D_FLASH design sector-size is 64bytes/Sec, and P_FLASH and OUT_D_FLASH design sector-size are the 512bytes/Sec with the WINDOWS compatibility.
The class FAT structure of embodiment has been cancelled the hiding sector between boot sector and the FAT table according to the capacity limit of embedded environment, and two FAT table becomes single FAT table so that management.
Among the embodiment Cache according to RAM and actual uses to be provided with big or smallly be that the sector-size 64bytes/Sec that 4Kbytes, Cache divide timing to get inner D_FLASH is the allocated size MIN_CACHE_SIZE of unit, thereby make allocator simplify most.
Because the application among the embodiment comprises SIM, SD/MMC, USB and MP3 etc., therefore file system is according to the demand in the example, increased the establishment of the SIM fixed size file that is directed to the SIM application, the operating writing-file of tape file length check, and whether catalogue (file) is the parent directory of current directory, sub-directory, the judgement of brother's catalogue etc., also use to increase saving interface in addition, and walk around the interface that Cache directly reads the Flash file according to what the MP3 application-specific increased to current path according to STK.
Format according to structure shown in Figure 1 during the smartcard internal format, when WINDOWS formats it, file system reads BOOT district information and obtains formatted message and set up the FAT system by drive loading, and makes file system have the dual-use function as WINDOWS storage card and smart card.Because file system of the present invention has the characteristic of compatible MS-DOS FAT system, therefore promptly can be used for the exploitation of memory card standards interfaces such as USB/SD/MMC, storage SIM file that again can standard, thus smart card finished and storage card is shared storage medium, the function of multi-use card.
The present invention according to the additions and deletions of embedded system characteristic partial function, as delete long filenames, the document time attribute, second unnecessary complex operations such as FAT table, increasing the SIM relational directory judges, SIM document creation, mp3 file such as read at application interface, have realized the smart card document system necessary function with few size of code.
Utilize buffer memory and the write-back function of Cache, functions such as the data integrity of wall scroll APDU and power down protection in the time of can guaranteeing SIM communication.
Utilize the characteristic of its management polylith FLASH, the SIM card memory range can be expanded, make information stores such as high capacity short message telephone book become possibility.
Utilize its stratification, structurized architecture and unified DLL (dynamic link library), can be flexibly, efficiently, apace develop and field newly use, new business.

Claims (18)

1, a kind of embedded file system that is applicable to smart card application environment is characterized in that:
In the class DOS partition, comprise: boot sector, file allocation list area, root directory area and data field;
Described file system comprises as lower module:
Document management module is used to provide the related application that file is operated interface;
The directory management module is used to provide the related application that catalogue is operated interface;
The file allocation table administration module is used to provide the related application that bunch chain is operated interface;
The File Directory Table administration module is used to preserve the attribute information of file and catalogue, and the related application that catalogue is operated interface is provided;
The Logical Disk administration module is used to preserve the essential information of Logical Disk, and the related application that Logical Disk is operated interface is provided;
The cache management module is used for high-speed cache is carried out dynamic assignment, makes the sector content carry out mutual read-write operation in Logical Disk and high-speed cache.
2, the system as claimed in claim 1 is characterized in that, further comprises:
Application program module is used for by calls application interface, realizes the operation to file and catalogue;
The bsp driver module is used to provide and device-independent interface, makes system pass through the hardware of this interface accessing reality.
3, the system as claimed in claim 1 is characterized in that, includes only a file allocation table in the described file allocation list area, is depositing taking and idle condition of all blocks in this document allocation table, and the storage link structure of each file.
4, the system as claimed in claim 1 is characterized in that, the application programming interfaces that described document management module provides comprise:
Be used to the interface creating, open file;
The interface that is used for close file;
Be used to read the interface of file;
The interface that writes that is used for file;
The interface that is used for the searching of file, pointer location;
Be used to obtain the interface of current file pointer position;
Be used to check whether file arrives the interface of tail;
The interface that is used for deleted file;
The interface that is used for the file operation of smart card special applications.
5, the system as claimed in claim 1 is characterized in that, the application programming interfaces that described directory management module provides comprise:
The interface that is used to create directory;
The interface that is used to deltree;
The interface that is used to change the current directory;
Be used to obtain the interface of file attribute;
Be used for the application-specific interface operable.
6, the system as claimed in claim 1 is characterized in that, the application programming interfaces that described file allocation table administration module provides comprise:
Be used to obtain down the interface of cluster bunch number;
Be used to be provided with down the interface of cluster bunch number;
Be used to delete the interface of a bunch of chain;
Be used to increase the interface of a bunch of chain.
7, the system as claimed in claim 1 is characterized in that, the application programming interfaces that described File Directory Table administration module provides comprise:
Be used for and specify the interface of bunch all data zero clearings;
Be used to increase the interface of File Directory Table information;
The interface that is used for the deleted file catalogue listing;
Be used to change the interface of File Directory Table information;
Be used to obtain the interface of File Directory Table information;
The interface that is used for locating file catalogue listing information.
8, the system as claimed in claim 1 is characterized in that, the application programming interfaces that described Logical Disk administration module provides comprise:
The interface that is used for the loading of Logical Disk driven management;
Be used to unload the interface that Logical Disk drives;
The initialized interface that is used for disc information.
9, the system as claimed in claim 1 is characterized in that, described cache management module is based on the distribution of least unit to the dynamic assignment that high-speed cache carries out, and the piece number that distributes is counted.
10, the system as claimed in claim 1 is characterized in that, described cache management module comprises:
Be used for the initialized unit of cache information;
Be used for when designated sector is carried out cache assignment, by searching the unit that the respective stored space is found in identical big or small sector or other sectors of merging/decomposition;
Be used for the appointment Logical Disk unit that the data of designated sector are read by high-speed cache;
Be used for the appointment Logical Disk, sectors of data is labeled as the unit that can write;
Be used for that whole cache memory section data are labeled as the sector that can write and be written to unit in the storage medium by high-speed cache.
11, the system as claimed in claim 1 is characterized in that, in the attribute information that described File Directory Table administration module is preserved, ignores long filenames information.
12, the system as claimed in claim 1 is characterized in that, in the attribute information that described File Directory Table administration module is preserved, ignores the attribute information with time correlation.
13, the system as claimed in claim 1 is characterized in that, in the attribute information that described File Directory Table administration module is preserved, ignore read-only, file, implicit, system property information.
14, system as claimed in claim 2, it is characterized in that, described bsp driver module that provide with device-independent interface, be used for Logical Disk by appointment, the sector of appointment is read buffer zone with the content in the storage medium or buffer contents is written back in the storage medium.
15, system as claimed in claim 4 is characterized in that, the described interface creating, open file of being used to is ignored long filenames when file operation.
16, system as claimed in claim 4 is characterized in that, the described interface creating, open file of being used to increases corresponding number of clusters according to designated length when document creation, and adds the length setting in the attribute byte of its parent directory.
17, system as claimed in claim 4 is characterized in that, the described interface that writes that is used for file checks whether write address size exceeds the proper length that the smart card file is determined when each write operation.
18, system as claimed in claim 5 is characterized in that, the described application-specific interface operable that is used for comprises the interface of the relation that is used to judge assigned catalogue/file and current directory.
CNA2007101776344A 2007-11-19 2007-11-19 Embedded type file system suitable for smart card application environment Pending CN101441634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101776344A CN101441634A (en) 2007-11-19 2007-11-19 Embedded type file system suitable for smart card application environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101776344A CN101441634A (en) 2007-11-19 2007-11-19 Embedded type file system suitable for smart card application environment

Publications (1)

Publication Number Publication Date
CN101441634A true CN101441634A (en) 2009-05-27

Family

ID=40726072

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101776344A Pending CN101441634A (en) 2007-11-19 2007-11-19 Embedded type file system suitable for smart card application environment

Country Status (1)

Country Link
CN (1) CN101441634A (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777077A (en) * 2010-02-26 2010-07-14 四川长虹电器股份有限公司 Method for implementing file system of embedded device
WO2012031441A1 (en) * 2010-09-08 2012-03-15 中兴通讯股份有限公司 Method and apparatus for reducing erasing and writing operation times of subscriber identity module card files
CN102567501A (en) * 2011-12-22 2012-07-11 广州中大微电子有限公司 File management system in small storage space
CN103092876A (en) * 2011-11-01 2013-05-08 镇江华扬信息科技有限公司 Embedded file system based on CF (compact flash)
CN103124276A (en) * 2011-11-18 2013-05-29 中国移动通信集团公司 Method for expanding storage space of communication terminal and communication terminal
US20140074932A1 (en) * 2012-09-13 2014-03-13 Akihiro Mihara Communication system, information processing device, and terminal
CN104050251A (en) * 2014-06-11 2014-09-17 深圳市茁壮网络股份有限公司 File management method and management system
CN104298697A (en) * 2014-01-08 2015-01-21 凯迈(洛阳)测控有限公司 FAT32-format data file managing system
CN104462999A (en) * 2014-12-12 2015-03-25 北京航星机器制造有限公司 Data encryption method for FAT32 file system
CN104778053A (en) * 2014-01-14 2015-07-15 国民技术股份有限公司 Initialization control method and device of smart card
CN104951569A (en) * 2015-07-21 2015-09-30 成都傅立叶电子科技有限公司 File system and file management method employing same
CN105335502A (en) * 2015-10-28 2016-02-17 迈普通信技术股份有限公司 File attribute management method and device
CN105824580A (en) * 2016-03-18 2016-08-03 福州瑞芯微电子股份有限公司 Writing method of video files and recording equipment
CN106250775A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 For the smart card in TEE file management method and management system
CN107239526A (en) * 2017-05-27 2017-10-10 河南思维轨道交通技术研究院有限公司 File system implementation method, scrap cleaning method, operating position localization method
CN107463652A (en) * 2017-07-27 2017-12-12 北京小米移动软件有限公司 The connection control method and device of external storage equipment
CN107562841A (en) * 2017-08-25 2018-01-09 北京智行鸿远汽车有限公司 A kind of Fatfs systems based on MPC5748 chip EMMC cards
CN107908364A (en) * 2017-11-13 2018-04-13 中国电子科技集团公司第三十研究所 A kind of embedded file system based on norflash
CN108038024A (en) * 2018-01-04 2018-05-15 西安锐益达风电技术有限公司 A kind of reliable static programming file system towards NandFlash
CN108880792A (en) * 2018-05-31 2018-11-23 北京智芯微电子科技有限公司 The close intelligent code key application interface implementation method of state and device
CN109656881A (en) * 2018-12-26 2019-04-19 山东华辰泰尔信息科技股份有限公司 A kind of method and system for realizing file dynamic management based on FAT16 technology
CN112181898A (en) * 2020-09-23 2021-01-05 北京百汇安科技有限公司 Embedded security file management system
CN112181918A (en) * 2020-09-30 2021-01-05 上海商米科技集团股份有限公司 Quick pre-allocation method for video file of camera for embedded system
CN112328180A (en) * 2020-11-16 2021-02-05 深圳市永联科技股份有限公司 File management method based on single chip microcomputer
WO2022068298A1 (en) * 2020-09-30 2022-04-07 北京智芯微电子科技有限公司 Usb flash disk access method and usb flash disk

Cited By (40)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777077A (en) * 2010-02-26 2010-07-14 四川长虹电器股份有限公司 Method for implementing file system of embedded device
CN101777077B (en) * 2010-02-26 2012-08-15 四川长虹电器股份有限公司 Method for implementing file system of embedded device
CN102402698B (en) * 2010-09-08 2016-08-03 中兴通讯股份有限公司 A kind of method and device reducing the erasable number of operations of Subscriber Identity Module file
WO2012031441A1 (en) * 2010-09-08 2012-03-15 中兴通讯股份有限公司 Method and apparatus for reducing erasing and writing operation times of subscriber identity module card files
CN102402698A (en) * 2010-09-08 2012-04-04 中兴通讯股份有限公司 Method and device for reducing erasing and writing operation times of user identification card file
CN103092876A (en) * 2011-11-01 2013-05-08 镇江华扬信息科技有限公司 Embedded file system based on CF (compact flash)
CN103124276A (en) * 2011-11-18 2013-05-29 中国移动通信集团公司 Method for expanding storage space of communication terminal and communication terminal
CN102567501A (en) * 2011-12-22 2012-07-11 广州中大微电子有限公司 File management system in small storage space
CN102567501B (en) * 2011-12-22 2014-12-31 广州中大微电子有限公司 File management system in small storage space
US20140074932A1 (en) * 2012-09-13 2014-03-13 Akihiro Mihara Communication system, information processing device, and terminal
CN104298697A (en) * 2014-01-08 2015-01-21 凯迈(洛阳)测控有限公司 FAT32-format data file managing system
CN104778053A (en) * 2014-01-14 2015-07-15 国民技术股份有限公司 Initialization control method and device of smart card
CN104050251B (en) * 2014-06-11 2017-03-08 深圳市茁壮网络股份有限公司 A kind of file management method and management system
CN104050251A (en) * 2014-06-11 2014-09-17 深圳市茁壮网络股份有限公司 File management method and management system
CN104462999A (en) * 2014-12-12 2015-03-25 北京航星机器制造有限公司 Data encryption method for FAT32 file system
CN104951569A (en) * 2015-07-21 2015-09-30 成都傅立叶电子科技有限公司 File system and file management method employing same
CN104951569B (en) * 2015-07-21 2018-09-25 成都傅立叶电子科技有限公司 File system and the file management method for using this document system
CN105335502A (en) * 2015-10-28 2016-02-17 迈普通信技术股份有限公司 File attribute management method and device
CN105335502B (en) * 2015-10-28 2018-09-25 迈普通信技术股份有限公司 A kind of management method and device of file attribute
CN105824580A (en) * 2016-03-18 2016-08-03 福州瑞芯微电子股份有限公司 Writing method of video files and recording equipment
CN105824580B (en) * 2016-03-18 2018-11-02 福州瑞芯微电子股份有限公司 Video file write method and recording arrangement
CN106250775A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 For the smart card in TEE file management method and management system
CN107239526B (en) * 2017-05-27 2020-11-13 河南思维轨道交通技术研究院有限公司 File system implementation method, defragmentation method and operation position positioning method
CN107239526A (en) * 2017-05-27 2017-10-10 河南思维轨道交通技术研究院有限公司 File system implementation method, scrap cleaning method, operating position localization method
CN107463652A (en) * 2017-07-27 2017-12-12 北京小米移动软件有限公司 The connection control method and device of external storage equipment
CN107562841A (en) * 2017-08-25 2018-01-09 北京智行鸿远汽车有限公司 A kind of Fatfs systems based on MPC5748 chip EMMC cards
CN107908364A (en) * 2017-11-13 2018-04-13 中国电子科技集团公司第三十研究所 A kind of embedded file system based on norflash
CN107908364B (en) * 2017-11-13 2020-10-23 中国电子科技集团公司第三十研究所 Embedded file system based on norflash
CN108038024B (en) * 2018-01-04 2021-03-02 西安锐益达风电技术有限公司 Reliable static planning file system for NandFlash
CN108038024A (en) * 2018-01-04 2018-05-15 西安锐益达风电技术有限公司 A kind of reliable static programming file system towards NandFlash
CN108880792A (en) * 2018-05-31 2018-11-23 北京智芯微电子科技有限公司 The close intelligent code key application interface implementation method of state and device
CN109656881A (en) * 2018-12-26 2019-04-19 山东华辰泰尔信息科技股份有限公司 A kind of method and system for realizing file dynamic management based on FAT16 technology
CN109656881B (en) * 2018-12-26 2023-06-20 山东华辰泰尔信息科技股份有限公司 Method and system for realizing dynamic file management based on FAT16 technology
CN112181898A (en) * 2020-09-23 2021-01-05 北京百汇安科技有限公司 Embedded security file management system
CN112181898B (en) * 2020-09-23 2023-12-29 北京百汇安科技有限公司 Embedded security file management system
WO2022068298A1 (en) * 2020-09-30 2022-04-07 北京智芯微电子科技有限公司 Usb flash disk access method and usb flash disk
CN112181918B (en) * 2020-09-30 2023-03-03 上海商米科技集团股份有限公司 Quick pre-allocation method for video file of camera for embedded system
CN112181918A (en) * 2020-09-30 2021-01-05 上海商米科技集团股份有限公司 Quick pre-allocation method for video file of camera for embedded system
CN112328180A (en) * 2020-11-16 2021-02-05 深圳市永联科技股份有限公司 File management method based on single chip microcomputer
CN112328180B (en) * 2020-11-16 2024-05-10 深圳市永联科技股份有限公司 File management method based on single chip microcomputer

Similar Documents

Publication Publication Date Title
CN101441634A (en) Embedded type file system suitable for smart card application environment
AU2007239066B2 (en) Describing and querying discrete regions of flash storage
US6587915B1 (en) Flash memory having data blocks, spare blocks, a map block and a header block and a method for controlling the same
US10140461B2 (en) Reducing resource consumption associated with storage and operation of containers
US7558907B2 (en) Virtual memory card controller
CN100561452C (en) A method for operating a card operating system on data files and a smart card
CN111881107B (en) Distributed storage method supporting mounting of multi-file system
US11803517B2 (en) File system for anonymous write
JP2004355660A (en) Method of storing data object, using small object data stream
EP2972747B1 (en) Data storage, file and volume system providing mutliple tiers
EP2646921A2 (en) Efficient cache management
CN102541619A (en) Management device and method for virtual machine
CN109766312A (en) A blockchain storage method, system, device and computer-readable storage medium
US20050086203A1 (en) Database access system, method of accessing a database, and method of designing a database access system
CN107239526A (en) File system implementation method, scrap cleaning method, operating position localization method
US20080034182A1 (en) Data storage device, memory management method and program
CN101986649A (en) Shared data center used in telecommunication industry billing system
US20250077122A1 (en) File system improvements for zoned storage device operations
CN101110026A (en) Resource limited equipment and data access method
CN102169418A (en) Resource limited equipment and data access method
CN101373473B (en) Method and system for reducing file quantity in embedded system flash memory
Rubini Kernel Korner: The" Virtual File System" in Linux
CN102622301A (en) Method and system for reading and updating flash-memory files
CN100444166C (en) Position-based interface access method and device for FAT file system
mouli Yalamanchili Technical Insights into the zOS file system and datasets

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: RDA MICROELECTRONICS (SHANGHAI) CO., LTD.

Free format text: FORMER OWNER: PHOENIX MICROELECTRONICS (CHINA) CO., LTD.

Effective date: 20100423

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100084 18/F, TOWER A, SCIENCE BUILDING, QINGHUA SCIENCE PARK, ZHONGGUANCUN EAST ROAD, HAIDIAN DISTRICT, BEIJING CITY TO: 201203 ROOM 302, BUILDING 2, NO.690, BIBO ROAD, ZHANGJIANG HIGH-TECH PARK, SHANGHAI CITY

TA01 Transfer of patent application right

Effective date of registration: 20100423

Address after: 201203, room 2, building 690, No. 302 blue wave road, Zhangjiang hi tech park, Shanghai

Applicant after: RDA Microelectronics (Shanghai) Corp. Ltd.

Address before: 100084, Beijing Road, Zhongguancun, Haidian District science and Technology Park, Tsinghua Science and technology building, block A, 18

Applicant before: Poenix Mcroelectronic (China) Co., Ltd.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20090527