Filesystem services: Difference between revisions

Ootulp (talk | contribs)
Ootulp (talk | contribs)
mNo edit summary
Line 335: Line 335:
|}
|}


== Permissions ==
Every time permissions are checked, the process registration [[#fsp-pr]] is loaded using the session processID. The permission data is populated with data from the [[NPDM]].
If the processID is <= 6 (which happens only for built-in sysmodules), it will use a hardcoded registration data. The default mask in this case is 0x8000000000000000.
Note that the functions check whether or not at least one bit is set in the mask. This means that, you don't need to set 0xFFFFFFFFFFFFFFFF to get all permissions: it suffices to set 0x8000000000000000.
If the code were to request an invalid input type, panic. But this never happens.
The output values for [[#ReadWrite]] CanMountRegisteredUpdatePartition and [[#Call]] CanRegisterUpdatePartition are masked with the cached value of [[SMC#IsDebugMode|DebugMode]].
=== ReadWrite ===
{| class="wikitable" border="1"
|-
! AccessibilityType || Name || Mask || Permission || Used by
|-
| 0x0 || CanMountLogo || 0x8000000000000801 || R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x1 || CanMountContentMeta || 0x8000000000000801 || R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x2 || CanMountContentControl || 0x8000000000000801 || R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x3 || CanMountContentManual || 0x8000000000000801 || R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x4 || CanMountContentData || 0x8000000000000801 || R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x5 || CanMountApplicationPackage || 0x8000000000000801 ||  R- || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]
|-
| 0x6 || CanMountSaveDataStorage || 0x8000000000000000 || RW ||
|-
| 0x7 || CanMountContentStorage || 0x8000000000000800 || RW || [[#OpenContentStorageFileSystem]]
|-
| 0x8 || CanMountImageAndVideoStorage ||0x8000000000001000 || RW || [[#OpenImageDirectoryFileSystem]]
|-
| 0x9 || CanMountCustomStorage0 || 0x8000000000000000 || RW || OpenCustomStorageFileSystem
|-
| 0xA || CanMountBisCalibrationFile || 0x8000000000000084 || RW || [[#OpenBisFileSystem]]
|-
| 0xB || CanMountBisSafeMode || 0x8000000000000080 || RW || [[#OpenBisFileSystem]]
|-
| 0xC || CanMountBisUser || 0x8000000000008080 || RW || [[#OpenBisFileSystem]]
|-
| 0xD || CanMountBisSystem || 0x8000000000008080 || RW || [[#OpenBisFileSystem]]
|-
| 0xE || CanMountBisSystemProperEncryption || 0x8000000000000080 || RW || [[#OpenBisFileSystem]]
|-
| 0xF || CanMountBisSystemProperPartition || 0x8000000000000080 || RW || [[#OpenBisFileSystem]]
|-
| 0x10 || CanMountSdCard || 0xC000000000200000 || RW || [[#OpenSdCardFileSystem]]
|-
| 0x11 || CanMountGameCard || 0x8000000000000010 || R- || [[#OpenGameCardFileSystem]]
|-
| 0x12 || CanMountDeviceSaveData || 0x8000000000040020 || RW || [[#OpenSaveDataFileSystem]]
|-
| 0x13 || CanMountSystemSaveData || 0x8000000000000028 || RW || [[#OpenSaveDataFileSystemBySystemSaveDataId]]
|-
| 0x14 || CanMountOthersSaveData || 0x8000000000000020 || RW || [[#OpenSaveDataFileSystem]]
|-
| 0x15 || CanMountOthersSystemSaveData || 0x8000000000000020 || RW || [[#OpenSaveDataFileSystemBySystemSaveDataId]]
|-
| 0x16 || CanOpenBisPartitionBootPartition1Root || 0x8000000000010082 || RW || [[#OpenBisStorage]]
|-
| 0x17 || CanOpenBisPartitionBootPartition2Root || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x18 || CanOpenBisPartitionUserDataRoot || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x19 || CanOpenBisPartitionBootConfigAndPackage2Part1 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1A || CanOpenBisPartitionBootConfigAndPackage2Part2 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1B || CanOpenBisPartitionBootConfigAndPackage2Part3 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1C || CanOpenBisPartitionBootConfigAndPackage2Part4 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1D || CanOpenBisPartitionBootConfigAndPackage2Part5 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1E || CanOpenBisPartitionBootConfigAndPackage2Part6 || 0x8000000000010080 || RW || [[#OpenBisStorage]]
|-
| 0x1F || CanOpenBisPartitionCalibrationBinary || 0x8000000000000084 || RW || [[#OpenBisStorage]]
|-
| 0x20 || CanOpenBisPartitionCalibrationFile || 0x8000000000000084 || RW || [[#OpenBisStorage]]
|-
| 0x21 || CanOpenBisPartitionSafeMode || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x22 || CanOpenBisPartitionUser || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x23 || CanOpenBisPartitionSystem || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x24 || CanOpenBisPartitionSystemProperEncryption || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x25 || CanOpenBisPartitionSystemProperPartition || 0x8000000000000080 || RW || [[#OpenBisStorage]]
|-
| 0x26 || CanOpenBisPartitionDeviceTreeBlob || 0x8000002000000080 || RW || [[#OpenBisStorage]]
|-
| [3.0.0+] 0x27 || CanOpenSdCardStorage || 0xC000000000200000 || RW ||
|-
| [3.0.0+] 0x28 || CanOpenGameCardStorage || 0x8000000000000100 || RW || [[#OpenGameCardStorage]], [[#EraseGameCard]] (bit1), [[#WriteToGameCard]] (bit1), [[#GetGameCardErrorInfo]] (bit1), [[#EraseAndWriteParamDirectly]] (bit1), [[#ReadParamDirectly]] (bit1), [[#ForceEraseGameCard]] (bit1)
|-
| [4.0.0+] 0x29 || CanMountSystemDataPrivate || 0x8000000000100008 || R- || [[#OpenFileSystem]], [[#OpenDataStorageByDataId]]
|-
| [5.0.0+] 0x2A || CanMountHost || 0xC000000000400000 || RW || [[#OpenHostFileSystem]]
|-
| [6.0.0+] 0x2B || CanMountRegisteredUpdatePartition || 0x8000000000010000 || R- || [[#OpenRegisteredUpdatePartition]]
|-
| [7.0.0+] 0x2C || CanOpenSaveDataInternalStorage || 0x8000000000000000 || RW || [[#OpenSaveDataInternalStorageFileSystem]]
|-
| [7.0.0+] 0x2D || CanMountTemporaryDirectory || 0xC000000000000000 || RW ||
|-
| [11.0.0+] 0x2E || CanMountAllBaseFilesystem || 0x8000000000000000 || RW || OpenBaseFileSystem
|-
| [15.0.0+] 0x2F || CanNotMount || 0x0000000000000000 || -- || OpenCustomStorageFileSystem
|}
=== Call ===
== Permissions ==
== Permissions ==
Every time permissions are checked, the process registration [[#fsp-pr]] is loaded using the session processID. The permission data is populated with data from the [[NPDM]].
Every time permissions are checked, the process registration [[#fsp-pr]] is loaded using the session processID. The permission data is populated with data from the [[NPDM]].