Jump to navigation Jump to search
311 bytes added ,  02:28, 11 April 2011
=== Wearleveling ===
The 3DS employs a wearleveling scheme on the savegame FLASH chips. This is done trough blockmapsand a journal. Depending on the size of the flashchip, these are The blockmap is located somewhere at the beginning offset 0 of the flashchipflash chip, in and is immediately followed by the first sectorjournal. The structure initial state is dictated by the blockmap, and the journal is as follows:then applied to that.
The blockmap structure is simple:
struct header_entry {
uint8_t chksums[8];
uint8_t phys_sec;
uint8_t alloc_cnt;
} __attribute__((__packed__));
The journal structure is as follows:
struct sector_entry {
uint8_t phys_sec; // Mapped from sector
uint8_t prev_phys_sec; // Virtual sector previously mapped to
uint8_t phys_realloc_cnt; // Amount of times physical sector has been remapped uint8_t virt_realloc_cnt; // Amount of times virtual sector has been remapped
uint8_t chksums[8];
} __attribute__((packed__packed__));
struct long_sector_entry {
struct sector_entry sector;
struct sector_entry dupe;
uint32_t magic;


Navigation menu