NPDM: Difference between revisions
→Flags: 21.0.0+ LoadBrowserCoreDll |
|||
| (23 intermediate revisions by 6 users not shown) | |||
| Line 29: | Line 29: | ||
| 0x0 | | 0x0 | ||
| 0x4 | | 0x4 | ||
| | | Magic ("META") | ||
|- | |- | ||
| 0x4 | | 0x4 | ||
| 0x4 | | 0x4 | ||
| [9.0.0+] | | [9.0.0+] SignatureKeyGeneration | ||
|- | |- | ||
| 0x8 | | 0x8 | ||
| Line 99: | Line 99: | ||
| [[#ACID|AcidSize]] | | [[#ACID|AcidSize]] | ||
|} | |} | ||
== Flags == | == Flags == | ||
| Line 116: | Line 113: | ||
|- | |- | ||
| 4 | | 4 | ||
| OptimizeMemoryAllocation | | [7.0.0+] OptimizeMemoryAllocation | ||
|- | |||
| 5 | |||
| [11.0.0+] DisableDeviceAddressSpaceMerge | |||
|- | |||
| 6 | |||
| [18.0.0+] EnableAliasRegionExtraSize | |||
|- | |||
| 7 | |||
| [19.0.0-19.0.1] PreventCodeReads | |||
|} | |} | ||
| Line 123: | Line 129: | ||
== SystemResourceSize == | == SystemResourceSize == | ||
This | When this is non-zero, the kernel reserves this amount of memory and dynamically uses it as needed for page table pages, KMemoryBlocks, and KBlockInfos. When this is zero, the process uses global shared heaps for these. | ||
This enables a process to sacrifice some of the memory available to it in order to have higher limits on these resources, thus enabling the use of SvcMapPhysicalMemory. | |||
Maximum size as is 0x1FE00000. | |||
== Version == | == Version == | ||
| Line 129: | Line 140: | ||
[8.1.0+] Now set to 1 for certain titles. | [8.1.0+] Now set to 1 for certain titles. | ||
[9.0.0+] Now set to a proper version field for all titles. | |||
== MainThreadStackSize == | == MainThreadStackSize == | ||
Must be aligned to 0x1000. | Must be aligned to 0x1000. If zero, kernel will start the process's initial thread with sp=0. | ||
= ACID = | = ACID = | ||
| Line 152: | Line 163: | ||
| 0x200 | | 0x200 | ||
| 0x4 | | 0x4 | ||
| | | Magic ("ACID") | ||
|- | |- | ||
| 0x204 | | 0x204 | ||
| Line 159: | Line 170: | ||
|- | |- | ||
| 0x208 | | 0x208 | ||
| | | 0x1 | ||
| [9.0.0+] Version | |||
|- | |||
| 0x209 | |||
| 0x1 | |||
| [14.0.0+] | |||
|- | |||
| 0x20A | |||
| 0x2 | |||
| Reserved | | Reserved | ||
|- | |- | ||
| Line 176: | Line 195: | ||
| 0x220 | | 0x220 | ||
| 0x4 | | 0x4 | ||
| [[#FsAccessControl| | | [[#FsAccessControl|FacOffset]] | ||
|- | |- | ||
| 0x224 | | 0x224 | ||
| 0x4 | | 0x4 | ||
| [[#FsAccessControl| | | [[#FsAccessControl|FacSize]] | ||
|- | |- | ||
| 0x228 | | 0x228 | ||
| 0x4 | | 0x4 | ||
| [[#SrvAccessControl| | | [[#SrvAccessControl|SacOffset]] | ||
|- | |- | ||
| 0x22C | | 0x22C | ||
| 0x4 | | 0x4 | ||
| [[#SrvAccessControl| | | [[#SrvAccessControl|SacSize]] | ||
|- | |- | ||
| 0x230 | | 0x230 | ||
| 0x4 | | 0x4 | ||
| [[#KernelCapability| | | [[#KernelCapability|KcOffset]] | ||
|- | |- | ||
| 0x234 | | 0x234 | ||
| 0x4 | | 0x4 | ||
| [[#KernelCapability| | | [[#KernelCapability|KcSize]] | ||
|- | |- | ||
| 0x238 | | 0x238 | ||
| Line 215: | Line 234: | ||
| UnqualifiedApproval | | UnqualifiedApproval | ||
|- | |- | ||
| 2- | | 2-5 | ||
| [5.0.0+ ] MemoryRegion (0 = Application, 1 = Applet, 2 = SecureSystem, 3 = NonSecureSystem) | | [5.0.0+] MemoryRegion (0 = Application, 1 = Applet, 2 = SecureSystem, 3 = NonSecureSystem) | ||
|- | |||
| 6 | |||
| Unused? | |||
|- | |||
| 7 | |||
| [21.0.0+] LoadBrowserCoreDll | |||
|} | |} | ||
MemoryRegion is set to Application for "starter" and NonSecureSystem for "nvservices". | MemoryRegion is set to Application for "starter" and NonSecureSystem for "nvservices". | ||
When LoadBrowserCoreDll flag is set, an additional NPDM + NSOs (wkc0-wkc9) will be loaded from program id 010000000000085D (not present on retail). | |||
= ACI0 = | = ACI0 = | ||
| Line 230: | Line 258: | ||
| 0x0 | | 0x0 | ||
| 0x4 | | 0x4 | ||
| | | Magic ("ACI0") | ||
|- | |- | ||
| 0x4 | | 0x4 | ||
| Line 246: | Line 274: | ||
| 0x20 | | 0x20 | ||
| 0x4 | | 0x4 | ||
| [[#FsAccessControl| | | [[#FsAccessControl|FacOffset]] | ||
|- | |- | ||
| 0x24 | | 0x24 | ||
| 0x4 | | 0x4 | ||
| [[#FsAccessControl| | | [[#FsAccessControl|FacSize]] | ||
|- | |- | ||
| 0x28 | | 0x28 | ||
| 0x4 | | 0x4 | ||
| [[#SrvAccessControl| | | [[#SrvAccessControl|SacOffset]] | ||
|- | |- | ||
| 0x2C | | 0x2C | ||
| 0x4 | | 0x4 | ||
| [[#SrvAccessControl| | | [[#SrvAccessControl|SacSize]] | ||
|- | |- | ||
| 0x30 | | 0x30 | ||
| 0x4 | | 0x4 | ||
| [[#KernelCapability| | | [[#KernelCapability|KcOffset]] | ||
|- | |- | ||
| 0x34 | | 0x34 | ||
| 0x4 | | 0x4 | ||
| [[#KernelCapability| | | [[#KernelCapability|KcSize]] | ||
|- | |- | ||
| 0x38 | | 0x38 | ||
| Line 286: | Line 314: | ||
|- | |- | ||
| 0x1 | | 0x1 | ||
| 0x1 | |||
| [5.0.0+] ContentOwnerIdCount | |||
|- | |||
| 0x2 | |||
| 0x1 | |||
| [5.0.0+] SaveDataOwnerIdCount | |||
|- | |||
| 0x3 | | 0x3 | ||
| 0x1 | |||
| Padding | | Padding | ||
|- | |- | ||
| Line 294: | Line 330: | ||
|- | |- | ||
| 0xC | | 0xC | ||
| | | 0x8 | ||
| | | ContentOwnerIdMin | ||
|- | |||
| 0x14 | |||
| 0x8 | |||
| ContentOwnerIdMax | |||
|- | |||
| 0x1C | |||
| 0x8 | |||
| SaveDataOwnerIdMin | |||
|- | |||
| 0x24 | |||
| 0x8 | |||
| SaveDataOwnerIdMax | |||
|- | |||
| 0x2C | |||
| 0x8 * ContentOwnerIdCount | |||
| [5.0.0+] ContentOwnerIds | |||
|- | |||
| Variable | |||
| 0x8 * SaveDataOwnerIdCount | |||
| [5.0.0+] SaveDataOwnerIds | |||
|} | |} | ||
| Line 335: | Line 391: | ||
| 0x1C | | 0x1C | ||
| 0x4 | | 0x4 | ||
| (Optional) | | (Optional) ContentOwnerIdCount | ||
|- | |- | ||
| 0x1C | | 0x1C | ||
| 0x8 * | | 0x8 * ContentOwnerIdCount | ||
| | | ContentOwnerIds | ||
|- | |- | ||
| Variable | | Variable | ||
| 0x4 | | 0x4 | ||
| | | SaveDataOwnerIdCount | ||
|- | |- | ||
| Variable | | Variable | ||
| 0x1 * | | 0x1 * SaveDataOwnerIdCount | ||
| | | Accessibilities (1=Read, 2=Write, 3=ReadWrite) | ||
|- | |- | ||
| Variable (padded to nearest 4 bytes) | | Variable (padded to nearest 4 bytes) | ||
| 0x8 * | | 0x8 * SaveDataOwnerIdCount | ||
| | | SaveDataOwnerIds | ||
|} | |} | ||
| Line 505: | Line 561: | ||
| | | | ||
|- | |- | ||
| 36-61 | | 36 | ||
| MoveCacheStorage | |||
| | |||
|- | |||
| 37 | |||
| DeviceTreeBlob | |||
| | |||
|- | |||
| 38 | |||
| NotifyErrorContextServiceReady | |||
| | |||
|- | |||
| 39 | |||
| CalibrationSystemData | |||
| | |||
|- | |||
| 40 | |||
| CalibrationLog | |||
| | |||
|- | |||
| 41 | |||
| StorageSecure | |||
| | |||
|- | |||
| 42 | |||
| StorageControl | |||
| | |||
|- | |||
| 43 | |||
| GameCardReport | |||
| | |||
|- | |||
| 44 | |||
| MarkBeforeEraseBis | |||
| | |||
|- | |||
| 45-61 | |||
| Reserved | | Reserved | ||
| | | | ||
| Line 511: | Line 603: | ||
| 62 | | 62 | ||
| Debug | | Debug | ||
| See [[SPL_services#GetConfig|here]]. | | See [[SPL_services#GetConfig|here]]. Ignored on non-DebugMode. | ||
|- | |- | ||
| 63 | | 63 | ||
| FullPermission | | FullPermission | ||
| Enables access to everything: all [[Filesystem_services#Permissions|permission types]] which check a bitmask have this bit set. | | Enables access to everything: all [[Filesystem_services#Permissions|permission types]] which check a bitmask have this bit set. Ignored on non-DebugMode. | ||
|} | |} | ||
| Line 593: | Line 685: | ||
| All ones | | All ones | ||
| | | | ||
| | | Invalid | ||
|} | |} | ||
| Line 631: | Line 723: | ||
== MemoryMap == | == MemoryMap == | ||
MemoryMap entries are stored in pairs. The first pair will contain BeginAddress and PermissionType, while the second pair will contain Size and MappingType. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
| Line 637: | Line 730: | ||
|- | |- | ||
| 7-30 | | 7-30 | ||
| BeginAddress | | BeginAddress | ||
|- | |- | ||
| 31 | | 31 | ||
| | | PermissionType (0=RW, 1=RO) | ||
|} | |} | ||
{| class="wikitable" border="1" | |||
|- | |||
! Bits | |||
! Description | |||
|- | |||
| 7-26 | |||
| Size | |||
|- | |||
| 27-30 | |||
| Reserved | |||
|- | |||
| 31 | |||
| MappingType (0=Io, 1=Static) | |||
|} | |||
=== Restrictions === | === Restrictions === | ||
| Line 696: | Line 802: | ||
| RegionIsReadOnly2 | | RegionIsReadOnly2 | ||
|} | |} | ||
== EnableInterrupts == | == EnableInterrupts == | ||
| Line 739: | Line 843: | ||
|} | |} | ||
This is | This encodes the intended kernel version for the program. | ||
The kernel requires that the intended version is >= the minimum supported version (3.0 for all released kernels), and <= the current version. | |||
Kernel version is derived from/equivalent to SDK version: | |||
* Kernel Major = SDK Major + 4 | |||
* Kernel Minor = SDK Minor | |||
=== Versions === | === Versions === | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! Firmware || Kernel Version || | ! Firmware || Kernel Version || Corresponding SDK Version | ||
|- | |||
| 1.0.0 || 5.0 || 1.0.0.0 | |||
|- | |- | ||
| | | 2.0.0 || 6.1 || 2.1.0.0 | ||
|- | |- | ||
| | | 3.0.0 || 7.4 || 3.4.0.0 | ||
|- | |- | ||
| 3.0. | | 3.0.2 || 7.4 || 3.4.0.0 | ||
|- | |- | ||
| | | 5.0.0 || 9.3 || 5.3.0.0 | ||
|- | |- | ||
| | | 10.0.0 || 14.4 || 10.4.0.0 | ||
|- | |||
| 11.0.0 || 15.4 || 11.4.0.0 | |||
|- | |||
| 11.0.1 || 15.4 || 11.4.0.0 | |||
|} | |} | ||
| Line 777: | Line 893: | ||
|- | |- | ||
| 18 | | 18 | ||
| ForceDebug | | [19.0.0+] ForceDebugProd ([1.0.0-18.1.0] ForceDebug) | ||
|- | |||
| 19 | |||
| [19.0.0+] ForceDebug | |||
|} | |} | ||