LOADER:LoadProcess

LOADER:LoadProcess

Request #

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

Response #

Index WordDescription
0Header code
1Result code
3KProcess handle

Description #

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].