主权项 |
1. A data processing method, for a memory storage apparatus having a rewritable non-volatile memory module and a smart card chip, wherein the rewritable non-volatile memory module has a plurality of physical blocks, the data processing method comprising:
grouping the physical blocks into at least a data area, a spare area and a system area; configuring a plurality of logical addresses and mapping the logical addresses to the physical blocks of the data area, wherein the logical addresses are formatted into at least a file allocation table area, a root directory area and a file area, and the file allocation table area has a plurality of cluster entry fields, the root directory area has a plurality of directory entry fields, and the file area has a plurality of clusters; storing a communication file in at least one cluster among the clusters of the file area, wherein a start cluster of the at least one cluster is a Kth cluster, and K is a positive integer and smaller than the number of the clusters of the file area; recording a file description block corresponding to the communication file in an Mth directory entry field among the directory entry fields of the root directory area, wherein M is a positive integer and smaller than the number of the directory entry fields; and storing an end of cluster chain mark in a cluster entry field corresponding to a last cluster of the at least one cluster among the cluster entry fields of the file allocation table area, wherein the step of recording the file description block corresponding to the communication file in the Mth directory entry field among the directory entry fields of the root directory area comprises:
receiving a read command from a host system;determining whether a read address indicated by the read command is a logical address corresponding to the root directory area among the logical addresses;selecting a free directory entry field from the directory entry fields when the read address is the logical address corresponding to the root directory area, wherein the free directory entry field is not used;recording the file description block corresponding to the communication file in the free directory entry field; andtransmitting data in the directory entry fields of the root directory area to the host system in response to the read command. |