Changes

Jump to navigation Jump to search
320 bytes added ,  10:30, 15 March 2012
m
Line 33: Line 33:     
=== Wear leveling ===
 
=== Wear leveling ===
 +
 +
3DS在游戏存档闪存芯片上引入了wear leveling 方案。这是通过使用blockmap和journal来实现的。blockmap在闪存上偏移量为0,其后是journal。初始状态由blockmap指定,然后journal对其进行应用。
    
The 3DS employs a wear leveling scheme on the savegame FLASH chips. This is done through the usage of blockmaps and a journal. The blockmap is located at offset 0 of the flash chip, and is immediately followed by the journal. The initial state is dictated by the blockmap, and the journal is then applied to that.
 
The 3DS employs a wear leveling scheme on the savegame FLASH chips. This is done through the usage of blockmaps and a journal. The blockmap is located at offset 0 of the flash chip, and is immediately followed by the journal. The initial state is dictated by the blockmap, and the journal is then applied to that.
   −
First, there are 8 bytes whose purposes are currently unknown. Then comes the actual blockmap.
+
首先,是8字节目前还不明白其确切意义的数据。然后是实际的blockmap。其结构很简单:
The blockmap structure is simple:
+
 
 
<pre>
 
<pre>
 
struct header_entry {
 
struct header_entry {
Line 46: Line 48:  
</pre>
 
</pre>
   −
There's one entry per sector, counting from physical sector 1 (sector 0 contains the blockmap/journal).
+
每个sector有一个入口,从实际的sector1开始计数(sector 0 包含blockmap/journal)。
    +
blockmap后2字节为最开始的8个字节,以及blockmap的CRC16校验码(开始值为0xFFFF(像modbus))。
 
The 2 bytes that follow the blockmap are the CRC16 (with starting value 0xFFFF (like modbus)) of the first 8 bytes and the blockmap.
 
The 2 bytes that follow the blockmap are the CRC16 (with starting value 0xFFFF (like modbus)) of the first 8 bytes and the blockmap.
   −
Then comes the journal.
+
然后是journal。其结构如下:
The journal structure is as follows:
+
 
 
<pre>
 
<pre>
 
struct sector_entry {
 
struct sector_entry {

Navigation menu