Changes

Jump to navigation Jump to search
320 bytes added ,  10:30, 15 March 2012
m
=== 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.
First, there are 8 bytes whose purposes are currently unknown. Then comes the actual blockmap.首先,是8字节目前还不明白其确切意义的数据。然后是实际的blockmap。其结构很简单:The blockmap structure is simple:
<pre>
struct header_entry {
</pre>
There's one entry per sector, counting from physical sector 1 (sector 每个sector有一个入口,从实际的sector1开始计数(sector 0 contains the blockmap包含blockmap/journal).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.
Then comes the journal.然后是journal。其结构如下:The journal structure is as follows:
<pre>
struct sector_entry {

Navigation menu