Difference between revisions of "PGL services"

From Nintendo Switch Brew
Jump to navigation Jump to search
(Created page with "PGL (Program Loader) is a sysmodule designed for encapsulating all program loading logic. = pgl = {| class="wikitable" border="1" |- ! Cmd || Name |- | 0 || LaunchProgram |-...")
 
Line 6: Line 6:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || LaunchProgram
+
| 0 || [[#LaunchProgram]]
 
|-
 
|-
| 1 || TerminateProcess
+
| 1 || [[#TerminateProcess]]
 
|-
 
|-
 
| 2 ||  
 
| 2 ||  
Line 28: Line 28:
 
| 12 ||
 
| 12 ||
 
|-
 
|-
| 20 || GetEventObserver
+
| 20 || [[#GetEventObserver]]
 
|}
 
|}
 +
 +
= LaunchFlags =
 +
 +
The LaunchFlags enum looks like this:
 +
 +
{| class=wikitable
 +
! Bit || Mask || Name
 +
|-
 +
| 0 || 1 || LaunchFlags_EnableDetailedCrashReport
 +
|-
 +
| 1 || 2 || LaunchFlags_EnableCrashReportScreenShotForProduction
 +
|-
 +
| 2 || 4 || LaunchFlags_EnableCrashReportScreenShotForDevelop
 +
|-
 +
|}
 +
 +
 +
== LaunchProgram ==
 +
Takes a [[NCM_services#ProgramLocation|ProgramLocation]], a u32 [[Process_Manager_services#LaunchFlags]] pm launch_flags, and a u8 [[#LaunchFlags|LaunchFlags]] pgl launch_flags.
 +
 +
This calls pm:shell->LaunchProgram with the program location and the input launch flags. If jit_debug!enable_jit_debug is true, LaunchFlags_SignalOnCrash is ORRd into the flags sent to PM.
 +
 +
This then creates a new process tracking structure for the new process id and with the pgl launch flags. If an empty process struct is not allocated from the 0x20 slab heap, pgl aborts.
 +
 +
== TerminateProcess ==
 +
This just calls pm:shell->TerminateProcess with the input process id.
  
 
== GetEventObserver ==
 
== GetEventObserver ==

Revision as of 22:42, 15 April 2020

PGL (Program Loader) is a sysmodule designed for encapsulating all program loading logic.

pgl

Cmd Name
0 #LaunchProgram
1 #TerminateProcess
2
4
5
6
7
8
9
10
12
20 #GetEventObserver

LaunchFlags

The LaunchFlags enum looks like this:

Bit Mask Name
0 1 LaunchFlags_EnableDetailedCrashReport
1 2 LaunchFlags_EnableCrashReportScreenShotForProduction
2 4 LaunchFlags_EnableCrashReportScreenShotForDevelop


LaunchProgram

Takes a ProgramLocation, a u32 Process_Manager_services#LaunchFlags pm launch_flags, and a u8 LaunchFlags pgl launch_flags.

This calls pm:shell->LaunchProgram with the program location and the input launch flags. If jit_debug!enable_jit_debug is true, LaunchFlags_SignalOnCrash is ORRd into the flags sent to PM.

This then creates a new process tracking structure for the new process id and with the pgl launch flags. If an empty process struct is not allocated from the 0x20 slab heap, pgl aborts.

TerminateProcess

This just calls pm:shell->TerminateProcess with the input process id.

GetEventObserver

No input. Returns an #IEventObserver.

IEventObserver

Cmd Name
0
1