Changes

Jump to navigation Jump to search
4,230 bytes added ,  06:52, 11 April 2019
Line 1: Line 1:  
= NAND structure =
 
= NAND structure =
The Switch's eMMC storage features a large user area, two smaller boot partitions, and a replay-protected memory block which is unused (no authentication key is programmed).
+
The Switch's eMMC storage features a large user area, two smaller boot partitions and a replay-protected memory block which is unused (no authentication key is programmed).
 +
 
 +
All official partition names come from [[SystemInitializer]].
    
== Boot Partitions ==
 
== Boot Partitions ==
    
'''Boot Partition 0 (0 of 1)'''
 
'''Boot Partition 0 (0 of 1)'''
 +
 +
The official name for this partition is "BootPartition1Root" and it has [[Filesystem_services|Bis]] Partition ID == 0.
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 13: Line 18:  
|  0x000000
 
|  0x000000
 
|  0x4000
 
|  0x4000
Title 0100000000000819 [[BCT|BCT]]
+
Normal Firmware [[BCT|BCT]] from [[Title_list#System_Data_Archives|Title 0100000000000819]]
 
|-
 
|-
 
|  0x004000
 
|  0x004000
 
|  0x4000
 
|  0x4000
Title 010000000000081A [[BCT|BCT]]
+
SafeMode Firmware [[BCT|BCT]] from [[Title_list#System_Data_Archives|Title 010000000000081A]]
 
|-
 
|-
 
|  0x008000
 
|  0x008000
 
|  0x4000
 
|  0x4000
Title 0100000000000819 [[BCT|BCT]]
+
Normal Firmware [[BCT|BCT]] from [[Title_list#System_Data_Archives|Title 0100000000000819]] (backup)
 
|-
 
|-
 
|  0x00C000
 
|  0x00C000
 
|  0x4000
 
|  0x4000
Title 010000000000081A [[BCT|BCT]]
+
SafeMode Firmware [[BCT|BCT]] from [[Title_list#System_Data_Archives|Title 010000000000081A]] (backup)
 
|-
 
|-
 
|  0x010000
 
|  0x010000
0xF0000
+
0xEC000
60 additional BCTs, normally unused/empty on retail systems.
+
59 additional BCTs, normally unused/empty on retail systems.
 +
|-
 +
|  0x0FC000
 +
|  0x4000
 +
|  [[#System Update Control|System Update Control area]]
 
|-
 
|-
 
|  0x100000
 
|  0x100000
 
|  0x40000
 
|  0x40000
|  Title 0100000000000819 "package1"
+
Normal Firmware [[Package1|package1]] from [[Title_list#System_Data_Archives|Title 0100000000000819]]
 
|-
 
|-
 
|  0x140000
 
|  0x140000
 
|  0x40000
 
|  0x40000
|  Title 0100000000000819 "package1" (Backup)
+
Normal Firmware [[Package1|package1]] from [[Title_list#System_Data_Archives|Title 0100000000000819]] (backup)
 
|-
 
|-
 
|  0x180000
 
|  0x180000
Line 44: Line 53:  
|-
 
|-
 
|  0x184000
 
|  0x184000
0x20
+
0x200
Unknown pseudorandom data, often changes on reboot. All zero on 1.0.
+
[2.0.0+] [[#NAND Patrol|NAND Patrol area]]
|-
  −
|  0x184020
  −
| 0x8?
  −
| Increments on every boot until hitting a certain number? Bottom 10 bits (0x3FF) are always zero. All zero on 1.0.
   
|}
 
|}
    
'''Boot Partition 1 (1 of 1)'''
 
'''Boot Partition 1 (1 of 1)'''
 +
 +
The official name for this partition is "BootPartition2Root" and it has [[Filesystem_services|Bis]] Partition ID == 10.
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 61: Line 69:  
|  0x000000
 
|  0x000000
 
|  0x40000
 
|  0x40000
|  Title 010000000000081A "package1"
+
SafeMode Firmware [[Package1|package1]] from [[Title_list#System_Data_Archives|Title 010000000000081A]]
 
|-
 
|-
 
|  0x040000
 
|  0x040000
 
|  0x40000
 
|  0x40000
|  Title 010000000000081A "package1" (Backup)
+
SafeMode Firmware [[Package1|package1]] from [[Title_list#System_Data_Archives|Title 010000000000081A]] (backup)
 
|-
 
|-
 
|  0x080000
 
|  0x080000
 
|  0x40000
 
|  0x40000
|
+
| Reserved
 
|-
 
|-
 
|  0x0C0000
 
|  0x0C0000
 
|  0x40000
 
|  0x40000
|
+
| Reserved
 +
|}
 +
 
 +
=== System Update Control ===
 +
The 0x4000 bytes at offset 0xFC000 are used by [[NS_Services|NS]] and [[Boot|boot]] for keeping track of the status of a system update. This area is used by the [[NS_Services#ns:su|ISystemUpdateControl]] commands "ApplyDownloadedUpdate", "ApplyCardUpdate" and "ApplyReceivedUpdate".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x1
 +
| BootImages status. Set to 1 by [[NS_Services|NS]] during a system update and cleared by [[Boot|boot]] after restarting.
 +
|-
 +
| 0x1
 +
| 0x1
 +
| BootImagesSafe status. Set to 1 by [[NS_Services|NS]] during a system update and cleared by [[Boot|boot]] after restarting.
 
|}
 
|}
    
=== Keyblob ===
 
=== Keyblob ===
Starting at offset 0x180000 is an array of 0x200-byte entries, for a total of 32 keyblobs. Each one is unique compared to the others and they are all console unique.
+
Starting at offset 0x180000 is an array of 0x200-byte entries, for a total of 32 keyblobs. Each one is unique compared to the others and they are all console unique. This is officially known as the "EKS" (encryption key source) area.
    
From each 0x200-byte entry only the first 0xB0 bytes effectively form the keyblob as below.
 
From each 0x200-byte entry only the first 0xB0 bytes effectively form the keyblob as below.
Line 108: Line 134:     
[[Boot]] also uses this index for repairing corrupt sectors.
 
[[Boot]] also uses this index for repairing corrupt sectors.
 +
 +
The currently active keyblob is officially known as "SecureInfo".
 +
 +
=== NAND Patrol ===
 +
The 0x200 bytes at offset 0x184000 are used by [[Filesystem_services|FS]] for keeping track of NAND patrolling.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x20
 +
| HMAC-SHA-256 over the next 0x1E0 bytes
 +
|-
 +
| 0x20
 +
| 0x4
 +
| Last patrolled NAND block's offset
 +
|-
 +
| 0x24
 +
| 0x4
 +
| NAND patrol count
 +
|-
 +
| 0x28
 +
| 0x1D8
 +
| Unused, all-zero.
 +
|}
    
== User Partitions ==
 
== User Partitions ==
Line 124: Line 178:  
|  20
 
|  20
 
|  No
 
|  No
|  GPT header, Bis-storage also allows raw access to the entire NAND eMMC sectors starting at sector0. The official name for this partitionID from [[SystemInitializer]] is "nn::fs::BisPartitionId::UserDataRoot".
+
|  GPT header, Bis-storage also allows raw access to the entire NAND eMMC sectors starting at sector0. The official name for this partition is "UserDataRoot".
 
|-
 
|-
|  PRODINFO
+
[[Calibration|PRODINFO]]
 
|  0x00004400
 
|  0x00004400
 
|  0x003FBC00
 
|  0x003FBC00
 
|  27
 
|  27
|  Yes
+
|  Yes (Bis key 0)
|  "CAL0" raw partition containing set:cal data.
+
|  "CAL0" raw partition containing set:cal data. The official name for this partition is "CalibrationBinary".
 
|-
 
|-
|  PRODINFOF
+
[[Calibration|PRODINFOF]]
 
|  0x00400000
 
|  0x00400000
 
|  0x00400000
 
|  0x00400000
 
|  28
 
|  28
|  Yes
+
|  Yes (Bis key 0)
|  FAT12 filesystem, additional calibration.
+
|  FAT12 filesystem, additional calibration. The official name for this partition is "CalibrationFile".
 
|-
 
|-
 
|  BCPKG2-1-Normal-Main
 
|  BCPKG2-1-Normal-Main
Line 145: Line 199:  
|  21
 
|  21
 
|  No
 
|  No
For all these packages, data starts at offset 0x4000 and is not console-unique. This is installed from "package2" in firmware package A (0100000000000819) by default. With the exFAT update installed, this is switched to firmware package C (010000000000081B). The data stored here matches the raw /nx/package2 file stored in the 81[9AB] data archives -- there is no additional encryption. "BCPKG2" is "BootConfigAndPackage2": for example, from [[Factory_Setup|SystemInitializer]]: "BootConfigAndPackage2Part1".
+
Raw partition where the first 0x4000 bytes (usually empty) contain the [[BootConfig]] and the remaining space contains the [[Package2|package2]] image from [[Title_list#System_Data_Archives|Title 0100000000000819]] by default. With the exFAT update installed, the [[Package2|package2]] image is switched to the one from [[Title_list#System_Data_Archives|Title 010000000000081B]]. The official name for this partition is "BootConfigAndPackage2Part1".
 
|-
 
|-
 
|  BCPKG2-2-Normal-Sub
 
|  BCPKG2-2-Normal-Sub
Line 152: Line 206:  
|  22
 
|  22
 
|  No
 
|  No
Identical to BCPKG2-1-Normal-Main, probably used as a backup partition.
+
Backup partition for BCPKG2-1-Normal-Main. The official name for this partition is "BootConfigAndPackage2Part2".
 
|-
 
|-
 
|  BCPKG2-3-SafeMode-Main
 
|  BCPKG2-3-SafeMode-Main
Line 159: Line 213:  
|  23
 
|  23
 
|  No
 
|  No
This is installed from "package2" in firmware package B (010000000000081A).
+
Raw partition where the first 0x4000 bytes (usually empty) contain the [[BootConfig]] and the remaining space contains the [[Package2|package2]] image from [[Title_list#System_Data_Archives|Title 010000000000081A]] by default. On [4.0.0+] and with the exFAT update installed, the [[Package2|package2]] image is switched to the one from [[Title_list#System_Data_Archives|Title 010000000000081C]]. The official name for this partition is "BootConfigAndPackage2Part3".
 
|-
 
|-
 
|  BCPKG2-4-SafeMode-Sub
 
|  BCPKG2-4-SafeMode-Sub
Line 166: Line 220:  
|  24
 
|  24
 
|  No
 
|  No
Identical to BCPKG2-3-SafeMode-Main.
+
Backup partition for BCPKG2-3-SafeMode-Main. The official name for this partition is "BootConfigAndPackage2Part4".
 
|-
 
|-
 
|  BCPKG2-5-Repair-Main
 
|  BCPKG2-5-Repair-Main
Line 173: Line 227:  
|  25
 
|  25
 
|  No
 
|  No
|  Installed at the factory, never written afterwards on retail. In one case this is identical to normal [[1.0.0]] pkg2, except this has encrypted data at the end padded for 0x1000-byte alignment.
+
|  Installed at the factory, never written afterwards on retail. In one case this is identical to normal [[1.0.0]] [[Package2|package2]], except this has encrypted data at the end padded for 0x1000-byte alignment. The official name for this partition is "BootConfigAndPackage2Part5".
 
|-
 
|-
 
|  BCPKG2-6-Repair-Sub
 
|  BCPKG2-6-Repair-Sub
Line 180: Line 234:  
|  26
 
|  26
 
|  No
 
|  No
Identical to BCPKG2-5-Repair-Main.
+
Backup partition for BCPKG2-5-Repair-Main. The official name for this partition is "BootConfigAndPackage2Part6".
 
|-
 
|-
 
|  SAFE
 
|  SAFE
Line 186: Line 240:  
|  0x04000000
 
|  0x04000000
 
|  29
 
|  29
|  Yes
+
|  Yes (Bis key 1)
|  FAT32 filesystem.
+
|  FAT32 filesystem. The official name for this partition is "SafeMode".
 
|-
 
|-
 
|  SYSTEM
 
|  SYSTEM
 
|  0x07800000  
 
|  0x07800000  
 
|  0xA0000000
 
|  0xA0000000
|  31 and 32
+
|  31, 32 and 33
|  Yes
+
|  Yes (Bis key 2)
|  FAT32 filesystem.
+
|  FAT32 filesystem. The official names for these partitions are "System", "SystemProperEncryption" and "SystemProperPartition".
 
|-
 
|-
 
|  USER
 
|  USER
Line 200: Line 254:  
|  0x680000000
 
|  0x680000000
 
|  30
 
|  30
|  Yes
+
|  Yes (Bis key 3)
 
|  FAT32 filesystem.
 
|  FAT32 filesystem.
 
|-
 
|-
Line 208: Line 262:  
|  
 
|  
 
|  No
 
|  No
| This is the backup GPT header specified by the main GPT header. This is also the last sector readable with Bis-storage paritionID 20.
+
| This is the backup GPT header specified by the main GPT header. This is also the last sector readable with Bis-storage paritionID 20.
 
|}
 
|}
    
If the client process lacks the relevant permission for any of the above partition IDs, error 0x2EE202 is returned.
 
If the client process lacks the relevant permission for any of the above partition IDs, error 0x2EE202 is returned.
   −
[[NCA]]s stored in NAND are raw, identical to the data readable with [[Content_Manager_services#ReadEntryRaw]].
+
[[NCA]]s stored in NAND are raw, identical to the data readable with [[NCM_services#ReadContentIdFile]].
    
The filenames for saveimages is just "<lower-case hex u64 saveID>". SYSTEM-partition saveIDs are specified by [[Filesystem_services|FS]] commands, while USER-partition saveIDs are determined by FS-module internally. The high u32 of the saveID is normally either 0x00000000 or 0x80000000.
 
The filenames for saveimages is just "<lower-case hex u64 saveID>". SYSTEM-partition saveIDs are specified by [[Filesystem_services|FS]] commands, while USER-partition saveIDs are determined by FS-module internally. The high u32 of the saveID is normally either 0x00000000 or 0x80000000.
   −
Encrypted partitions use AES-XTS using the same non-standard (endian-swapped) tweak as other Nintendo AES-XTS code, initial_sector == 0, and sector size 0x4000. All encrypted partitions use console unique keydata.
+
Encrypted partitions use AES-XTS using the same non-standard tweak (tweak[0] = sectorIdx[MSB] .. tweak[15] = sectorIdx[LSB], if using 32bit sectorIdx that means tweak[0]..tweak[11] are 0, with tweak[12]..tweak[15] containing big-endian sectorIdx) as other Nintendo AES-XTS code, initial_sector = 0, and sector size 0x4000. All encrypted partitions use console unique keydata.
    
=== PRODINFOF ===
 
=== PRODINFOF ===
Line 301: Line 355:  
! SaveID || Owner || Mount || Notes
 
! SaveID || Owner || Mount || Notes
 
|-
 
|-
| 0x8000000000000000 || || ||  
+
| 0x8000000000000000 || fs || <nowiki>saveDataIxrDb:/</nowiki>, <nowiki>saveDataIxrDbSf:/</nowiki>, <nowiki>saveDataIxrDbPr:/</nowiki>, <nowiki>saveDataIxrDbSd:/</nowiki> || Contains [[IMKV|imkvdb.arc]] and "lastPublishedId".
 
|-
 
|-
 
| 0x8000000000000010 || account || <nowiki>account:/</nowiki> || Account database.
 
| 0x8000000000000010 || account || <nowiki>account:/</nowiki> || Account database.
Line 321: Line 375:  
| 0x8000000000000044 || ns || <nowiki>ns_sysup:/</nowiki> || Content update context.
 
| 0x8000000000000044 || ns || <nowiki>ns_sysup:/</nowiki> || Content update context.
 
|-
 
|-
| 0x8000000000000045 || ns || <nowiki>vmdb:/</nowiki> || Version List/Required Version List storage.
+
| 0x8000000000000045 || ns || <nowiki>vmdb:/</nowiki> || Required Version List storage. Also contained Version List storage before 7.0.0.
 
|-
 
|-
 
| 0x8000000000000046 || ns || <nowiki>dtlman:/</nowiki> ||
 
| 0x8000000000000046 || ns || <nowiki>dtlman:/</nowiki> ||
Line 328: Line 382:  
|-
 
|-
 
| 0x8000000000000048 || ns || <nowiki>ns_systemseed:/</nowiki> ||
 
| 0x8000000000000048 || ns || <nowiki>ns_systemseed:/</nowiki> ||
 +
|-
 +
| 0x8000000000000049 || ns || <nowiki>ns_ssversion:/</nowiki> || Safe System version.
 
|-
 
|-
 
| 0x8000000000000050 || settings || <nowiki>SystemSettings:/</nowiki> ||
 
| 0x8000000000000050 || settings || <nowiki>SystemSettings:/</nowiki> ||
Line 353: Line 409:  
| 0x8000000000000075 || nim || <nowiki>nim_vac:/</nowiki> ||
 
| 0x8000000000000075 || nim || <nowiki>nim_vac:/</nowiki> ||
 
|-
 
|-
| 0x8000000000000080 || friends || <nowiki>friends:/</nowiki> ||
+
| 0x8000000000000076 || nim || <nowiki>nim_local:/</nowiki> ||
 +
|-
 +
| 0x8000000000000077 || nim || <nowiki>nim_lsys:/</nowiki> ||
 +
|-
 +
| 0x8000000000000078 || nim || <nowiki>nim_eca_dbg:/</nowiki> ||
 +
|-
 +
| 0x8000000000000080 || friends || <nowiki>friends:/</nowiki> || Per-user savedata.
 
|-
 
|-
 
| 0x8000000000000081 || friends || <nowiki>friends-sys:/</nowiki> ||
 
| 0x8000000000000081 || friends || <nowiki>friends-sys:/</nowiki> ||
Line 368: Line 430:  
|-
 
|-
 
| 0x80000000000000A1 || bcat || <nowiki>prepo:/</nowiki> || Play Report msgpack archives.
 
| 0x80000000000000A1 || bcat || <nowiki>prepo:/</nowiki> || Play Report msgpack archives.
 +
|-
 +
| 0x80000000000000A2 || bcat || <nowiki>prepo-ap:/</nowiki> ||
 
|-
 
|-
 
| 0x80000000000000B0 || bsdsockets || <nowiki>nsdsave:/</nowiki> || Socket configuration saved data.
 
| 0x80000000000000B0 || bsdsockets || <nowiki>nsdsave:/</nowiki> || Socket configuration saved data.
Line 383: Line 447:  
| 0x80000000000000E2 || es || <nowiki>espersonalized:/</nowiki> ||
 
| 0x80000000000000E2 || es || <nowiki>espersonalized:/</nowiki> ||
 
|-
 
|-
| 0x80000000000000F0 || ns || <nowiki>pdm:/</nowiki> || Play Data log.
+
| 0x80000000000000E3 || es || <nowiki>esmetarecord:/</nowiki> ||
 +
|-
 +
| 0x80000000000000E4 || es || <nowiki>eselicense:/</nowiki> ||
 +
|-
 +
| 0x80000000000000F0 || ns || <nowiki>pdm:/</nowiki> || Play Data log. Per-user savedata.
 
|-
 
|-
 
| 0x8000000000000100 || pctl || <nowiki>pctlss:/</nowiki> || Parental Control settings.
 
| 0x8000000000000100 || pctl || <nowiki>pctlss:/</nowiki> || Parental Control settings.
Line 395: Line 463:  
| 0x8000000000000122 || || ||  
 
| 0x8000000000000122 || || ||  
 
|-
 
|-
| 0x8000000000001010 || || ||
+
| 0x8000000000000130 || migration || <nowiki>state:/</nowiki> ||  
|-
  −
| 0x8000000000001040 || || ||
  −
|-
  −
| 0x8000000000001050 || || ||  
   
|-
 
|-
| 0x8000000000001070 || || ||  
+
| 0x8000000000000131 || migration || <nowiki>context:/</nowiki> ||  
 
|-
 
|-
| 0x80000000000010B0 || || ||  
+
| 0x8000000000000140 || capsrv || <nowiki>TM:/</nowiki> ||  
 
|-
 
|-
| 0x0000000000000001 || || ||  
+
| 0x8000000000000150 || olsc || ? ||  
 
|-
 
|-
| 0x0000000000000003 || || ||  
+
| 0x8000000000000180 || sdb || ? || Version list was moved here in 7.0.0 or 7.0.1
 
|-
 
|-
| 0x0000000000000004 || || ||  
+
| 0x8000000000001010 || qlaunch || || Contains "savedata.dat".
 
|-
 
|-
| 0x0000000000000005 || || ||  
+
| 0x8000000000001020 || swkbd || || Per-user savedata.
 
|-
 
|-
| 0x0000000000000006 || || ||  
+
| 0x8000000000001040 || miiEdit || ||  
 
|-
 
|-
| 0x0000000000000007 || || ||  
+
| 0x8000000000001050 || miiEdit || || Contains "database.dat". Possibly Mii data and Mii texture data?
 
|-
 
|-
| 0x0000000000000008 || || ||  
+
| 0x8000000000001060 || shop || ||  
 
|-
 
|-
| 0x0000000000000009 || || ||  
+
| 0x8000000000001061 || shop || || Per-user savedata.
 
|-
 
|-
| 0x000000000000000A || || ||  
+
| 0x8000000000001070 || web || ||  
 
|-
 
|-
| 0x8000000000001060 || || ||  
+
| 0x8000000000001071 || web || || Per-user savedata.
 
|-
 
|-
| 0x000000000000000C || || ||  
+
| 0x8000000000001091 || loginShare || || Per-user savedata.
 
|-
 
|-
| 0x000000000000000D || || ||  
+
| 0x80000000000010B0 || playerSelect || || Contains "savedata.dat". Per-user savedata.
 
|-
 
|-
 +
| 0x80000000000010C0 || myPage || || Per-user savedata.
 
|}
 
|}
2

edits

Navigation menu