Unser Zeichen: H 159 / 22 MBOur sign: H 159/22 MB
Verfahren zur Verwaltung von SpeicherinformationenMethod for managing storage information
Die Erfindung betrifft ein Verfahren zur Verwaltung von charakterisie¬ renden Speicherinformationen in einem sektorweise beschreibbaren und blockweise löschbaren nichtflüchtigen Speicher, der zur Reorganisation eine Rekonstruktionstabelle enthält, die zyklisch neu geschrieben wird.The invention relates to a method for the management of characteristic memory information in a sector-wise writable and block-erasable nonvolatile memory which contains a reconstruction table for reorganization, which is rewritten cyclically.
Die weit verbreiteten nichtflüchtigen Halbleiterspeicher (Flashspeicher) sind in Blöcken und in Sektoren organisiert, wobei ein Block z.B. aus 32 Sektoren mit je 512 Bytes besteht. Die Speicher besitzen die Eigenschaft, dass neue Informationen sektorweise geschrieben werden und nur vorher gelöschte Sektoren geschrieben werden können. Das Löschen erfolgt jeweils fiir einen Block für alle Sektoren gemeinsam. Das Schreiben eines Sektors in den Speicher dauert länger als das Lesen und eine Löschoperation eines Blockes erfordert eine lange Zeit, z.B. mehrere Millisekunden. Ein Verfahren zur Reorganisation eines nichtflüchtigen Speichers mittels einer Rekonstruktionstabelle ist aus der unveröffentlichten deutschen Patentanmeldung 10227255.7 bekannt.Widely used non-volatile semiconductor memories (flash memories) are organized in blocks and in sectors, one block being e.g. consists of 32 sectors with 512 bytes each. The memories have the property that new information can be written sector by sector and only previously deleted sectors can be written. The deletion takes place in common for one block for all sectors. The writing of a sector into the memory takes longer than the reading and an erasing operation of a block requires a long time, e.g. several milliseconds. A method for reorganizing a nonvolatile memory by means of a reconstruction table is known from the unpublished German patent application 10227255.7.
Im nichtfiüchtigen Speicher werden ein oder mehrere Datenblöcke reserviert, in die eine Rekonstruktionstabelle geschrieben wird. Diese Rekonstruktionstabelle besitzt eine definierte Länge von z.B. 128In the non-volatile memory one or more data blocks are reserved in which a reconstruction table is written. This reconstruction table has a defined length of e.g. 128
Sektoren. In einem flüchtigen Merkspeicher werden für die Speicher¬ blöcke, die beschrieben werden, Verwaltungsdatensätze erstellt, in denen unter anderem die logischen und physikalischen Blockadressen vermerkt sind, sowie die Adressen der Λusweichblöcke, in die aktuell geschrieben wird. Werden nun neue Speicherblöcke beschrieben oder neue Aus¬ weichblöcke bereitgestellt und veraltete Zuordnungen von logischen zu physikalischen Blockadressen aufgelöst, wird fortlaufend je ein Eintrag in die Rekonstruktionstabelle geschrieben. Der jeweilige Eintrag in der Rekonstruktionstabelle enthält mindestens die logische Blockadresse, die
physikalische Blockadresse des originären Speicherblocks sowie die Adresse des eventuell benutzten Ausweichblocks. Wenn nun nach einem Stromausfall ein Wiederanlauf des Speicher¬ systems stattfindet, werden vom Programm des Speichercontrollers die
Verwaltungsdatensätze im flüchtigen Merkspeicher leer initialisiert und dann die Rekonstruktionstabelle vom Anfang an durchgegangen und die Zuordnungen entsprechend jedes Eintrags in der Rekonstruktionstäbelle in die Verwaltungsdatensätze eingetragen. Dies wird für jeden Eintrag in der Rekonstruktionstabelle wiederholt, bis, das Ende dieser Tabelle erreicht ist. Dabei ist es durchaus möglich, dass einige Zuordnungen mehrfach überschrieben werden, da sie auch im Laufe der ursprünglichen Speicherungen aktualisiert wurden. Es wird aber am Ende des Wiederanlaufs der aktuelle Stand der Adresszuordnungen in den Verwaltungsdatensätzen wieder hergestellt, wie er vor dem Stromausfall bestanden hat.Sectors. In a volatile memory memory for the Speicher¬ blocks to be described, administrative records are created in which, inter alia, the logical and physical block addresses are noted, as well as the addresses of Λusweichblöcke in which is currently written. If new memory blocks are now described or new soft blocks are provided and obsolete assignments of logical to physical block addresses are resolved, one entry is continuously written to the reconstruction table. The respective entry in the reconstruction table contains at least the logical block address which physical block address of the original memory block as well as the address of the possibly used alternative block. If, after a power failure, a restart of the storage system takes place, the program of the storage controller initiates the ![Figure imgf000003_0001](https://patentimages.storage.***apis.com/1f/1d/9e/89426203138047/imgf000003_0001.png)
Initialized administrative records in the volatile memory store empty and then gone through the reconstruction table from the beginning and entered the assignments corresponding to each entry in the reconstruction bar in the administrative records. This is repeated for each entry in the reconstruction table until the end of this table is reached. It is quite possible that some assignments are overwritten several times, because they were also updated in the course of the original storage. However, at the end of the restart, the current status of the address assignments is restored to the administrative data records as it existed prior to the power failure.
In der beschriebenen Ausführung der Rekonstruktionstabelle ist diese so aufgebaut, dass jeder Eintrag in der Tabelle genau einen Sektor lang ist, auch wenn nicht alle Bytes des Sektors gefüllt sind. Da der Speicher immer sektorweise geschrieben wird, ist kein Zusatzaufwand für eine Datenaufbereitung erforderlich. Auch wenn einiger Speicherplatz auf diese Weise nicht genutzt wird, fällt dies bei der Größe des gesamten Speichers nicht ins Gewicht. Da auch alle Sektoren ab dem aktuellen Eintrag in der Tabelle gelöscht sind, wird ohne weiteren Aufwand der nächste Eintrag direkt in die Tabelle geschrieben. Da die Rekonstruktionstabelle eine definierte Länge besitzt, z.B. 128 Einträge, wird sie im normalen Speicherbetrieb bis fast an das Ende gefüllt. Vorteilhafterweise wird, wenn der vorletzte Eintrag geschrieben wurde, eine Reorganisation gestartet. Dazu wird ein Vermerk über die Reorganisation als letzter Eintrag in die Rekonstruktionstäbelle geschrieben. Dann werden alle Adresszuordnungen, wie sie in denIn the described execution of the reconstruction table, it is constructed so that each entry in the table is exactly one sector long, even if not all the bytes of the sector are filled. Since the memory is always written sector by sector, no additional effort for data preparation is required. Even if some storage space is not used in this way, this does not affect the size of the entire storage. Since all sectors are also deleted from the current entry in the table, the next entry is written directly to the table without any further effort. Since the reconstruction table has a defined length, e.g. 128 entries, it is filled in the normal memory mode until almost at the end. Advantageously, when the penultimate entry has been written, a reorganization is started. For this purpose, a note about the reorganization is written as the last entry in the reconstruction bar. Then all the address mappings as they are in the
Verwaltungsdatensätzen aktuell aufgeführt sind, aufgelöst und damit ein definierter Grundzustand in den Verwaltungsdatensätzen hergestellt, wie er auch bei einem Wiederanlauf des Systems als erstes initialisiert würde.
Nach einer erfolgreichen Reorganisation wird ein Fertig-Eintrag in die Rekonstruktionstabelle geschrieben. Dieser Fertig-Eintrag wird vorteilhafterweise mit einem Zählwert versehen, der bei jeder Reorganisation hochgezählt wird und damit die Gesamtanzahl der Reorganisationen des Speichers seit Fertigung anzeigt.Administrative records are currently listed resolved and thus a defined default state in the administrative records produced as it would be initialized at a restart of the system first. After a successful reorganization, a done entry is written to the reconstruction table. This finished entry is advantageously provided with a count value which is incremented at each reorganization and thus indicates the total number of reorganizations of the memory since production.
Bei jeder Reorganisation wird eine neue Rekonstruktionstabelle in anderen Speicherblöcken angelegt. Diese werden aus dem Vorrat an gelöschten Speicherblöcken genommen, die entweder noch ursprünglich gelöscht sind oder von einem Hintergrundprogramm gelöscht wurden. Der Fertig-Eintrag wird als erster Eintrag in die neue Rekonstruktions¬ tabelle geschrieben. Die bisherigen Blöcke für die Rekonstruktionstabelle werden dann freigegeben und damit so gekennzeichnet, dass sie von dem Hintergrundprogramm für das Löschen bearbeitet werden. Falls bei dem Vorgang der Reorganisation der Strom ausfällt und noch kein neuer Fertig-Eintrag geschrieben wurde, wird beim Wiederanlauf des Systems die Reorganisation neu gestartet. Die Reorganisation ist beliebig oft wiederholbar.Each reorganization creates a new reconstruction table in other memory blocks. These are taken from the supply of deleted memory blocks that are either originally deleted or deleted by a background program. The finished entry is written as the first entry in the new reconstruction table. The previous blocks for the reconstruction table are then released and marked so that they are processed by the background program for deletion. If the power fails during the process of reorganization and no new finished entry has yet been written, the reorganization is restarted when the system restarts. The reorganization can be repeated as often as you like.
Falls der Fertig-Eintrag schon geschrieben wurde, aber die bisherige Rekonstruktionstabelle noch nicht freigegeben wurde, kann es vorkommen, dass bei dem Wiederanlauf des Systems zweiIf the finished entry has already been written, but the previous reconstruction table has not yet been released, it can happen that when the system is restarted two
Reorganisationstabellen, die bisherige und die neue, gefunden werden. Dann wird anhand des Zählwertes im Fertig-Eintrag der Rekonstruktionstabelle festgestellt, welches die neuere Tabelle ist, und der Reorganisationsvorgang wird entsprechend fortgesetzt. Somit wird auch in solchen Fällen das korrekte Weiterarbeiten des Speichersystems sichergestellt.Reorganization tables, the former and the new, are found. Then it is determined based on the count in the finished entry of the reconstruction table, which is the newer table, and the reorganization process is continued accordingly. Thus, the correct further work of the storage system is ensured even in such cases.
In dem beschriebenen Verfahren sind aber keine Vorkehrungen getroffen, charakterisierende Speicherinformationen, wie Konfigura-
tionsdaten über die Speicheraufteilung und/oder Chiffre-Schlüssel, effizient zu speichern. Das sichere Führen solcher Informationen ist besonders mit dem Aufkommen von sogenannten Secure Digital Cards wichtig geworden, die in geschützte und ungeschützte Bereiche geteilt sind.
Es ist Aufgabe der Erfindung, das bekannte Verfahren der Reorgani¬ sation von nichtflüchtigen Speichern so zu erweitern, dass die charakterisierenden Speicherinformationen effizient gehalten werden und zu beliebigen Zeitpunkten geändert werden können.In the method described, however, no provision is made for characterizing storage information, such as configuration data. tion data about the memory allocation and / or cipher keys to save efficiently. The secure management of such information has become particularly important with the emergence of so-called Secure Digital Cards, which are divided into protected and unprotected areas. It is an object of the invention to extend the known method of reorganization of nonvolatile memories so that the characterizing memory information is kept efficient and can be changed at arbitrary times.
Gelöst wird diese Aufgabe dadurch, dass die charakterisierenden Speicherinformation in einem vorbestimmten Eintrag der Rekonstrukti¬ onstabelle gehalten sind.This problem is solved in that the characterizing memory information is kept in a predetermined entry of the Rekonstrukti¬ ontable.
Vorteilhafte Ausgestaltungen der Erfindung sind in den Unteransprüchen angegeben.Advantageous embodiments of the invention are specified in the subclaims.
Die Rekonstruktionstabelle wird im nichtflüchtigen Speicher gehalten und sektorweise beschrieben. Ein Eintrag in einem Sektor enthält eine Kennung für die Art des Eintrags und Informationen über die geschriebenen und gelöschten Speicherblöcke, aus denen bei einem Wiederanlauf des Speichers der aktuelle Zustand rekonstruiert wird. Eine Kennung für einen Eintrag stellt der Fertig-Eintrag dar. Er wird bei jeder Reorganisation des Speichers an den Anfang einer neuen Reorganisationstäbelle geschrieben. Er enthält neben anderen Daten Platz für Verwaltungsdaten, der für die charakterisierenden Speicherinforma¬ tionen genutzt wird.The reconstruction table is kept in non-volatile memory and described sector by sector. An entry in a sector contains an identifier for the type of entry and information about the written and deleted memory blocks from which the current state is reconstructed when the memory is restarted. An identifier for an entry is the ready entry. It is written to the beginning of a new reorganization table each time the memory is reorganized. It contains, among other data, space for administration data, which is used for the characterizing memory information.
Die charakterisierenden Speicherinformationen sind verschiedene permanente Daten, welche die Aufteilung und die Nutzung des Speichers beschreiben. Eine Aufteilung schafft z.B. eine variable Grenze zwischen einem geschützten und einem ungeschützten Speicherbereich. Auch das Abbild von Konfigurationsregistern können in diesen Informationen enthalten sein. Weitere Nutzerdaten darin können auch Chiffrierschlüssel sein, die zur Ver- und Entschlüsselung von Speicherbereichen dienen.The characterizing memory information is a variety of persistent data describing the partitioning and usage of the memory. A division creates e.g. a variable border between a protected and an unprotected storage area. The image of configuration registers may also be included in this information. Other user data in it can also be encryption keys that are used for encryption and decryption of memory areas.
Falls diese charakterisierenden Speicherinformationen geändert werden, werden die neuen Informationen durch ein übergeordnetes Betriebs-
system in einem entsprechend gekennzeichneten Eintrag in der Rekonstruktionstabelle vermerkt.If this characterizing memory information is changed, the new information is replaced by a parent operating memory. system is noted in a correspondingly marked entry in the reconstruction table.
Beim Anlauf des Speichersystems werden die Daten aus dem aktuellen Fertig-Eintrag gelesen und eventuell durch in der Rekonstruktionstabelle nachfolgende, entsprechend gekennzeichnete Einträge aktualisiert.When the storage system starts up, the data is read from the current finished entry and possibly updated by entries marked accordingly in the reconstruction table.
Bei einer Reorganisation des Speichers wird die aktualisierte Fassung der charakterisierenden Speicherinformationen in den neuen Fertig-Eintrag geschrieben.Upon reorganization of the memory, the updated version of the characterizing memory information is written to the new ready entry.
Eine vorteilhafte Ausführung der Erfindung ist in der Figur 1 beschrieben.An advantageous embodiment of the invention is described in FIG.
Fig. 1 zeigt eine Rekonstruktionstabelle RKT mit 128 Einträgen. Der erste Eintrag ist ein Fertig-Eintrag, gekennzeichnet durch FE. Dieser Eintrag enthält neben einem Fertig-Zähler FZ der Anzahl der erfolgten Reorganisationen und allgemeinen Verwaltungsdaten VD die charakteri¬ sierenden Speicherinformationen CSI.Fig. 1 shows a reconstruction table RKT with 128 entries. The first entry is a done entry, indicated by FE. This entry contains not only a finished counter FZ of the number of reorganisations performed and general administrative data VD, the characterizing storage information CSI.
Die normalen Rekόnstruktionseinträge sind mit RE gekennzeichnet und enthalten die logischen Blockadressen LBA und die Speicherblockadres- sen SBA sowie die Ausweichblockadressen ABA von Schreibvorgängen in den Speicher. Auch dort ist Platz für allgemeine Verwaltungsdaten vorgesehen.The normal reconnect entries are labeled RE and include the logical block addresses LBA and the memory block addresses SBA and the alternate block addresses ABA of writes to memory. There is also space for general administrative data.
Ein Eintrag mit geänderten charakterisierenden Speicherinformationen CSI ist mit dem Kennzeichen SD versehen. Auch in diesem Eintrag ist Platz für allgemeine Verwaltungsdaten VD geschaffen.An entry with modified characterizing memory information CSI is provided with the identifier SD. Also in this entry space for general administrative data VD is created.
Das Ende einer Rekonstruktionstabelle RKT ist durch den Eintrag OE gekennzeichnet, der auch weitere Verwaltungsdaten enthalten kann.
The end of a reconstruction table RKT is identified by the entry OE, which may also contain further administration data.