Package2: Difference between revisions

Liam (talk | contribs)
Update KIP1 format
Line 145: Line 145:


=== INI1 ===
=== INI1 ===
This is "Initial Process List".
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 152: Line 154:
|-
|-
| 0x0
| 0x0
| u32
| 0x4
| Magic "INI1"
| Magic "INI1"
|-
|-
| 0x4
| 0x4
| u32
| 0x4
| Size
| Size
|-
|-
| 0x8
| 0x8
| u32
| 0x4
| NumberProcesses (Must be <0x51)
| Number of KIPs (Must be lower than 0x51)
|-
|-
| 0xC
| 0xC
| u32
| 0x4
| Padding (zero)
| Reserved
|}
|}


==== KIP1 ====
==== KIP1 ====
Kernel Initial Process.
This is "Kernel Initial Process".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 178: Line 180:
|-
|-
| 0x0
| 0x0
| u32
| 0x4
| Magic "KIP1"
| Magic "KIP1"
|-
|-
| 0x4
| 0x4
| char[12]
| 0xC
| Name
| Name
|-
|-
| 0x10
| 0x10
| u64
| 0x8
| TitleId
| Program ID
|-
|-
| 0x18
| 0x18
| u32
| 0x4
| Process category (0: regular title, 1: kernel built-in). Should be 1 here.
| Version
|-
|-
| 0x1C
| 0x1C
| u8
| 0x1
| Main thread priority
| Main Thread Priority
|-
|-
| 0x1D
| 0x1D
| u8
| 0x1
| Default CPU core
| Main Thread Core Number
|-
|-
| 0x1E
| 0x1E
| u8
| 0x1
| Reserved (unused)
| Reserved
|-
|-
| 0x1F
| 0x1F
| u8
| 0x1
| Flags: bit0-2: compression-enable for each section, when set. Bit3: Is64Bit. Bit4: IsAddrSpace36Bit. Bit5: [2.0.0+] UseSystemPoolPartition (1: System, 0: Application). Bit6, Bit7: reserved (unused)
| Flags (bit0=TextCompress, bit1=RoCompress, bit2=DataCompress, bit3=Is64BitInstruction, bit4=ProcessAddressSpace64Bit, bit5=[2.0.0+] UseSecureMemory)
|-
|-
| 0x20
| 0x20
| [[#SectionHeader]][6]
| 0xC
| Sections: .text, .rodata, .data, .bss and two reserved (ignored) sections.
| Text [[#Segment_Header|Segment Header]]
|-
| 0x2C
| 0x4
| Reserved
|-
| 0x30
| 0xC
| Ro [[#Segment_Header|Segment Header]]
|-
| 0x3C
| 0x4
| Main Thread Stack Size
|-
| 0x40
| 0xC
| Data [[#Segment_Header|Segment Header]]
|-
| 0x4C
| 0x4
| Reserved
|-
| 0x50
| 0xC
| Bss [[#Segment_Header|Segment Header]]
|-
| 0x5C
| 0x24
| Reserved (2 unused [[#Segment_Header|Segment Headers]])
|-
|-
| 0x80
| 0x80
| u32[0x20]
| 0x80
| KernelCaps
| [[NPDM#KernelCapability|Kernel Capability Data]]
|}
|}


===== SectionHeader =====
===== Segment Header =====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset
! Type
! Size
! Description
! Description
|-
|-
| 0x0
| 0x0
| u32
| 0x4
| OutOffset
| Offset
|-
|-
| 0x4
| 0x4
| u32
| 0x4
| DecompressedSize
| Decompressed Size
|-
|-
| 0x8
| 0x8
| u32
| 0x4
| CompressedSize
| Compressed Size
|-
| 0xC
| u32
| Attribute: the size in pages of the main thread's stack for .rodata, reserved otherwise.
|}
|}