Safemode: Difference between revisions
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
= Initialization = | = Initialization = | ||
It calls [[Settings_services#set:sys|GetServiceDiscoveryControlSettings]] to check | It calls [[Settings_services#set:sys|GetServiceDiscoveryControlSettings]] to check if '''IsChangeEnvironmentIdentifierDisabled''' is set. If not, it calls [[PCV_services#bpc|RebootSystem]], otherwise the process continues. | ||
It creates and starts a new thread with the sole purpose of setting up the display and showing a progress bar using raw graphics data embedded in the sysmodule's binary. | It creates and starts a new thread with the sole purpose of setting up the display and showing a progress bar using raw graphics data embedded in the sysmodule's binary. | ||
Line 47: | Line 47: | ||
Safemode sets up service sessions for [[NS_Services|ns:su]] and [[Network_Interface_services#nifm:u|nifm:u]]. | Safemode sets up service sessions for [[NS_Services|ns:su]] and [[Network_Interface_services#nifm:u|nifm:u]]. | ||
It calls [[Network_Interface_services#nifm:u|CreateRequest ]] with '''request_id''' 0x02. | It calls [[Network_Interface_services#nifm:u|CreateRequest]] with '''request_id''' 0x02. | ||
Then calls [[Network_Interface_services#nifm:u|GetSystemEventReadableHandles]] on the returned [[Network_Interface_services#IRequest|IRequest]] and creates an event object. | Then calls [[Network_Interface_services#nifm:u|GetSystemEventReadableHandles]] on the returned [[Network_Interface_services#IRequest|IRequest]] and creates an event object. | ||
Line 55: | Line 55: | ||
After submitting the first request, safemode repeats the request process again and waits for it to finish. If the request fails to finish at this point, [[PCV_services#bpc|RebootSystem]] is called. | After submitting the first request, safemode repeats the request process again and waits for it to finish. If the request fails to finish at this point, [[PCV_services#bpc|RebootSystem]] is called. | ||
It calls [[NS_Services#ns:su| | It calls [[NS_Services#ns:su|OpenSystemUpdateControl]] and creates a system update event by calling: | ||
* [[Network_Interface_services#nifm:u|GetClientId]] to obtain the current client's ID; | * [[Network_Interface_services#nifm:u|GetClientId]] to obtain the current client's ID; | ||
* [[Network_Interface_services#nifm:u|IsAnyInternetRequestAccepted]] with the returned client ID (if no request was accepted, error 0x2A810 is returned); | * [[Network_Interface_services#nifm:u|IsAnyInternetRequestAccepted]] with the returned client ID (if no request was accepted, error 0x2A810 is returned); | ||
* [[NS_Services# | * [[NS_Services#ISystemUpdateControl|RequestDownloadLatestUpdate]]. | ||
After this, an event object is created and safemode loops waiting on it while calling [[NS_Services#ns:su| | After this, an event object is created and safemode loops waiting on it while calling [[NS_Services#ns:su|GetDownloadProgress]]. | ||
When the system update event is signalled, safemode calls [[NS_Services#ns:su| | When the system update event is signalled, safemode calls [[NS_Services#ns:su|GetBackgroundNetworkUpdateState]] and if this fails, [[PCV_services#bpc|RebootSystem]] is called. | ||
Finally, [[NS_Services# | Finally, [[NS_Services#ISystemUpdateControl|ApplyDownloadedUpdate]] is called and the process exits. |