NPDM: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
| 0xC | | 0xC | ||
| 0x1 | | 0x1 | ||
| | | Flags (bit0 = Is64BitInstruction, bit1 = AddressSpace64BitOld, bit2 = AddressSpace32Bit, bit3 = AddressSpace32BitNoReserved, bit4 = AddressSpace64Bit) | ||
|- | |- | ||
| 0xD | | 0xD | ||
Line 45: | Line 45: | ||
| 0xE | | 0xE | ||
| 0x1 | | 0x1 | ||
| | | MainThreadPriority (0-63) | ||
|- | |- | ||
| 0xF | | 0xF | ||
| 0x1 | | 0x1 | ||
| | | MainThreadCoreNumber | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
Line 65: | Line 65: | ||
| 0x1C | | 0x1C | ||
| 0x4 | | 0x4 | ||
| | | MainThreadStackSize (Must be aligned to 0x1000. In non-nspwn scenarios, values of 0 can also rarely break in Horizon. This might be something auto-adapting or a security feature of some sort?) | ||
|- | |- | ||
| 0x20 | | 0x20 | ||
Line 125: | Line 125: | ||
| 0x20C | | 0x20C | ||
| 0x4 | | 0x4 | ||
| Flags (bit0 = ProductionFlag, bit1 = UnqualifiedApproval, [5.0.0+] bit2-3: | | Flags (bit0 = ProductionFlag, bit1 = UnqualifiedApproval, [5.0.0+] bit2-3: MemoryRegion (for applets set to 0b01, for sysmodules set to 0b10. Exceptions: "starter" is set to 0, "nvservices" is set to 3) | ||
|- | |- | ||
| 0x210 | | 0x210 | ||
| 0x8 | | 0x8 | ||
| | | ProgramIdMin | ||
|- | |- | ||
| 0x218 | | 0x218 | ||
| 0x8 | | 0x8 | ||
| | | ProgramIdMax | ||
|- | |- | ||
| 0x220 | | 0x220 | ||
Line 181: | Line 181: | ||
| 0x10 | | 0x10 | ||
| 0x8 | | 0x8 | ||
| | | ProgramId | ||
|- | |- | ||
| 0x18 | | 0x18 | ||
Line 224: | Line 224: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | 0x4 | ||
| Version (always 1, must be non-zero) | | Version (always 1, must be non-zero) | ||
|- | |- | ||
| 0x4 | | 0x4 | ||
Line 237: | Line 233: | ||
| 0xC | | 0xC | ||
| 0x4 | | 0x4 | ||
| | | ContentOwnerInfoOffset | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
| 0x4 | | 0x4 | ||
| | | ContentOwnerInfoSize | ||
|- | |- | ||
| 0x14 | | 0x14 | ||
| 0x4 | | 0x4 | ||
| | | SaveDataOwnerInfoOffset | ||
|- | |- | ||
| 0x18 | | 0x18 | ||
| 0x4 | | 0x4 | ||
| | | SaveDataOwnerInfoSize | ||
|- | |- | ||
| 0x1C | | 0x1C | ||
Line 463: | Line 459: | ||
Bitmask 0x07 in control_byte is the {length of the service-name without nul-terminator} - 1. | Bitmask 0x07 in control_byte is the {length of the service-name without nul-terminator} - 1. | ||
Bitmask 0x80 in control_byte means service is allowed to be registered. | Bitmask 0x80 in control_byte means IsServer (service is allowed to be registered). | ||
The service string can contain a wildcard <code>*</code> character. | The service string can contain a wildcard <code>*</code> character. | ||
Line 479: | Line 475: | ||
| <code>0bxxxxxxxxxxxx0111</code> | | <code>0bxxxxxxxxxxxx0111</code> | ||
| Bit3 | | Bit3 | ||
| | | ThreadInfo | ||
| Bit31-24: | | Bit31-24: MaxCoreNumber, bit23-16: MinCoreNumber, bit15-10: HighestPriority, bit9-4: LowestPriority. | ||
|- | |- | ||
| <code>0bxxxxxxxxxxx01111</code> | | <code>0bxxxxxxxxxxx01111</code> | ||
| Bit4 | | Bit4 | ||
| | | EnableSystemCalls | ||
| | | Bits29-31: SystemCallId; Bits5-28: Mask. | ||
|- | |- | ||
| <code>0bxxxxxxxxx0111111</code> | | <code>0bxxxxxxxxx0111111</code> | ||
| Bit6 | | Bit6 | ||
| | | MemoryMap | ||
| | | Bits7-30: Alternates between BeginAddress and Size, bit31: Alternates between Permission (MemoryPermission_RO or MemoryPermission_RW) and Type (MemoryType_Io or MemoryType_Static). | ||
|- | |- | ||
| <code>0bxxxxxxxx01111111</code> | | <code>0bxxxxxxxx01111111</code> | ||
| Bit7 | | Bit7 | ||
| | | MemoryMap (RW) | ||
| | | Bits8-31: BeginAddress. | ||
|- | |- | ||
| <code>0bxxxx011111111111</code> | | <code>0bxxxx011111111111</code> | ||
| Bit11 | | Bit11 | ||
| | | EnableInterrupts | ||
| | | Bits12-21: Irq0, bits22-31: Irq1, 0x3FF means empty. | ||
|- | |- | ||
| <code>0bxx01111111111111</code> | | <code>0bxx01111111111111</code> | ||
| Bit13 | | Bit13 | ||
| | | MiscParams | ||
| Bit16-14: | | Bit16-14: ProgramType (0 = System, 1 = Application, 2 = Applet), bit16 ignored. Parsed by [[Process Manager services]]. Defaults to 0 if descriptor doesn't exist. Can only run 1 application at a time. | ||
|- | |- | ||
| <code>0bx011111111111111</code> | | <code>0bx011111111111111</code> | ||
| Bit14 | | Bit14 | ||
| | | KernelVersion | ||
| | | Bits15-18: MinorVersion, bits19-31: MajorVersion. The raw descriptor is compared with 0x80000, when less than an error is returned. This is equivalent to comparing the bits starting at bit15 with 0x10. This enforces a minimum required version, not a maximum. | ||
|- | |- | ||
| <code>0b0111111111111111</code> | | <code>0b0111111111111111</code> | ||
| Bit15 | | Bit15 | ||
| HandleTableSize | | HandleTableSize | ||
| | | Bit16-25: Number of handles the table shall fit. | ||
|- | |- | ||
| <code>0b1111111111111111</code> | | <code>0b1111111111111111</code> | ||
| Bit16 | | Bit16 | ||
| | | MiscFlags | ||
| Bit17: | | Bit17: EnableDebug, bit18: ForceDebug. | ||
|- | |- | ||
| All ones | | All ones |