Difference between revisions of "LOADER:LoadProcess"

From 3dbrew
Jump to navigation Jump to search
(LoadProcess)
 
 
(3 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
|-
 
|-
 
| 1-2
 
| 1-2
| u64, Title
+
| u64, Program Handle
 
|}
 
|}
  
Line 29: Line 29:
  
 
=Description=
 
=Description=
This maps 0x10000000 and reads ExeFS:/.code there, then decompresses it if needed. This then uses svcCreateProcess and svcSetupProcess. Once finished this writes the KProcess handle to cmdreply[3].
+
This maps 0x10000000 and reads ExeFS:/.code there, then decompresses it if needed. It uses the exheader information to find how many pages to allocate for each section (text,rodata,data). The way the allocation works is that it rounds each size field to the nearest page and then assumes that the decompressed ExeFS:/.code fits each section to the rounded size (NOT the size specified in the exheader if that size is not page aligned!). This is different from how the sysmodules (fs,loader,etc) are loaded. The size field for those modules are actually used as-specified. This then uses svcCreateCodeSet and then svcCreateProcess. Once finished this writes the KProcess handle to cmdreply[3].

Latest revision as of 09:06, 20 January 2016

Request[edit]

Index Word Description
0 Header code [0x00010080]
1-2 u64, Program Handle

Response[edit]

Index Word Description
0 Header code
1 Result code
3 KProcess handle

Description[edit]

This maps 0x10000000 and reads ExeFS:/.code there, then decompresses it if needed. It uses the exheader information to find how many pages to allocate for each section (text,rodata,data). The way the allocation works is that it rounds each size field to the nearest page and then assumes that the decompressed ExeFS:/.code fits each section to the rounded size (NOT the size specified in the exheader if that size is not page aligned!). This is different from how the sysmodules (fs,loader,etc) are loaded. The size field for those modules are actually used as-specified. This then uses svcCreateCodeSet and then svcCreateProcess. Once finished this writes the KProcess handle to cmdreply[3].