Changes

2,987 bytes added ,  22:24, 3 May 2019
Layout Variants
Line 13: Line 13:     
The file allocation table (FAT) forms several linked lists inside, each of which represents a "file" allocated in the data region. Please refer to the File Allocation Table section below for more detail. In some variants, the directory entry table and the file entry table are also allocated as two special "files" in the data region, managed by the FAT, while in others they are stand-alone tables located outside the data region.
 
The file allocation table (FAT) forms several linked lists inside, each of which represents a "file" allocated in the data region. Please refer to the File Allocation Table section below for more detail. In some variants, the directory entry table and the file entry table are also allocated as two special "files" in the data region, managed by the FAT, while in others they are stand-alone tables located outside the data region.
 +
 +
== Layout Variants ==
 +
Four variants of the file system layout has been identified. A summary diagram can be found here: [https://github.com/wwylele/3ds-save-tool/raw/master/inner-fat.png]
 +
 +
=== Savegame, <code>duplicate data = true</code> ===
 +
 +
Such savegame is a single DISA container that only has one partition which is always configured as external IVFC level 4 disabled (see [[DISA and DIFF|DISA]] format for details). All components are stored in this partition as
 +
 +
* filesystem header at the beginning
 +
* directory hash table
 +
* file hash table
 +
* file allocation table
 +
* data region
 +
** directory entry table is allocated inside data region
 +
** file entry table as well
 +
** all file data is also allocated here
 +
 +
In this layout, all data is duplicated by DISA's DPFS tree, which is what the parameter <code>duplicate data</code> implies.
 +
 +
=== Savegame, <code>duplicate data = false</code> ===
 +
Such savegame is a single DISA container that has two partitions. Partition A is always configured as external IVFC level 4 disabled, and partition B is configured as it enabled. Components are stored among the two partitions as
 +
 +
* Partition A
 +
** filesystem header at the beginning.
 +
** directory hash table
 +
** file hash table
 +
** (stand-alone) file allocation table
 +
** (stand-alone) directory entry table
 +
** file entry table
 +
* Partition B
 +
** used as data region entirely, and only has file data allocated.
 +
 +
In this layout, all file system metadata is duplicated by partition A DPFS tree, but file data is not as partition B has external IVFC level 4.
 +
 +
=== Extdata ===
 +
An extdata consists of several DIFF containers (device files), among which the special device file <code>00000000/00000001</code> contains the inner FAT system, while other devices contains normal subfiles of the extdata. Please refer to [[Extdata]] for detail. The special file <code>00000000/00000001</code> contists of the following components
 +
 +
* filesystem header at the beginning
 +
* directory hash table
 +
* file hash table
 +
* file allocation table (degenerate, because the data region only has two "files": the directory entry table and the file entry table)
 +
* data region
 +
** directory entry table allocated inside data region
 +
** file entry table as well
 +
** normal subfiles are NOT in the data region. They are in their DIFF containers instead.
 +
 +
=== Title database ===
 +
All [[Title Database]] files are DIFF containers. Except for <code>certs.db</code>, all of them uses this filesystem in the DIFF inner data, which consists of
 +
 +
* database-specific pre-header at the beginning (See [[Title Database]])
 +
* filesystem header
 +
* directory Hash Table (degenerate and always has only one bucket, as there is only one directory for "root")
 +
* file Hash Table
 +
* file allocation table
 +
* data region
 +
** directory entry table allocated inside data region (degenerate, as there is only one directory for "root")
 +
** file entry table as well
 +
** title entries (title info or ticket) are allocated as normal files in the data region as well.
242

edits