RO:LoadExeCRO: Difference between revisions

No edit summary
Unknown (talk | contribs)
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
|-
|-
| 0
| 0
| Header code [0x000402C2]
| Header code [0x000402C2] ([0x000902C2] for the new version)
|-
|-
| 1
| 1
Line 18: Line 18:
|-
|-
| 4
| 4
| Process-memory buffer address to use for the CRO <data-section0>, all CRO <data-section0> addresses are automatically adjusted to use this address.
| Process-memory buffer address to use for the CRO .data section, all CRO .data section addresses are automatically adjusted to use this address.
|-
|-
| 5
| 5
Line 24: Line 24:
|-
|-
| 6
| 6
| ?
| .data section buffer size.
|-
|-
| 7
| 7
| Process-memory buffer address to use for the CRO <data-section1>, all CRO <data-section1> addresses are automatically adjusted to use this address.
| Process-memory buffer address to use for the CRO .bss section, all CRO .bss section addresses are automatically adjusted to use this address.
|-
|-
| 8-11
| 8
| Unknown
| .bss section buffer size.
|-
| 9
| Register as auto-link module if non-zero.
|-
| 10
| Fix level.
|-
| 11
| Usually zero?
|-
|-
| 12
| 12
| Must be zero
| Must be zero ([[IPC#Message_Structure|translation descriptor]])
|-
|-
| 13
| 13
Line 52: Line 61:
|-
|-
| 2
| 2
| Unknown
| CRO size after fixing
|}
|}


=Description=
=Description=
This loads a [[CRO0|CRO]], and maps virtual memory for it with the required memory-permissions. The address for cmdword[2] is calculated by the user-process like so: when cmdword[1](inputaddr) is <0x08000000, the address used is the same one from inputaddr. Otherwise, the address is: mapvaddr = inputaddr - (0x08000000 - <main-process .text address + .text, .rodata, .data, and .bss size aligned to pagesize>);
This loads a [[CRO0|CRO]], and maps virtual memory for it with the required memory-permissions.