<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peachy</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peachy"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Peachy"/>
	<updated>2026-04-04T18:50:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=23627</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=23627"/>
		<updated>2025-07-29T00:19:36Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Add AAC decoder to DSP category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&#039;&#039;Also note that some things about the AAC firmware still need to be properly tested and/or reverse engineered.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;br /&gt;
&lt;br /&gt;
=Message Format=&lt;br /&gt;
Below is the message format used for communicating with the AAC decoder. The same format is both when making requests and for responses, though the &amp;quot;request/response data&amp;quot; field changes appropriately.&lt;br /&gt;
&lt;br /&gt;
Size : 0x20 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u16&lt;br /&gt;
| Mode (Seems to be 0 = None, 1 = Decode AAC, 2 = Encode AAC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| DecoderCommand&lt;br /&gt;
| Command to be handled by the decoder (See information on DecoderCommand structure below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Result Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| Request/Response data&lt;br /&gt;
| A 24-byte chunk of data containing information about the request/response. See below for more info.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;enum DecoderCommand : u16&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| Initialize (Initialize AAC decoder)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| DecodeEncode (Decode or encode an AAC stream)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Shutdown&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| LoadState&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| SaveState&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Request/Response Data=&lt;br /&gt;
The 24-byte &amp;quot;request/response data&amp;quot; chunk can take on one of the formats listed below, depending on what sort of message it&#039;s found in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AAC Decode request&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Size : 24 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of input AAC stream&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Byte size of input AAC stream&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address to output decoded PCM16 samples to (In the case of stereo audio, this corresponds to the left channel)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address to output decoded PCM16 samples for the right channel&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AAC Decode command response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Size : 24 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| enum SampleRate&lt;br /&gt;
| Sample rate of the decoded AAC stream (Note: This is an enum, NOT a numerical value for the sample rate)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Channel count (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| u32&lt;br /&gt;
| Number of decoded samples (?)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Sample rate enum=&lt;br /&gt;
&#039;&#039;&#039;enum SampleRate : u32&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| 48000Hz (48KHz)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 44100Hz (44.1KHz)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 32000Hz (32KHz)&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 24000Hz (24KHz)&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 22050Hz (22.05KHz)&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 16000Hz (16KHz)&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 12000Hz (12KHz)&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11025Hz (11.025KHz)&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 8000Hz (8KHz)&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:DSP]]&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=22774</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=22774"/>
		<updated>2024-09-28T19:00:44Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only. A 32 byte long structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u16&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Number of dropped frames&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| 28 bytes&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Left-channel Samples&lt;br /&gt;
|-&lt;br /&gt;
| 320&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Right-channel Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This structure has separate arrays for the left and right channels.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadraphonic audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| IntermediateSample[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In contrast to the final output samples, this structure has the left/right channels interleaved.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate sample ===&lt;br /&gt;
&lt;br /&gt;
A quadraphonic sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel B&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;br /&gt;
&lt;br /&gt;
[[Category:DSP]]&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22773</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22773"/>
		<updated>2024-09-28T18:39:58Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* Request/Response Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&#039;&#039;Also note that some things about the AAC firmware still need to be properly tested and/or reverse engineered.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;br /&gt;
&lt;br /&gt;
=Message Format=&lt;br /&gt;
Below is the message format used for communicating with the AAC decoder. The same format is both when making requests and for responses, though the &amp;quot;request/response data&amp;quot; field changes appropriately.&lt;br /&gt;
&lt;br /&gt;
Size : 0x20 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u16&lt;br /&gt;
| Mode (Seems to be 0 = None, 1 = Decode AAC, 2 = Encode AAC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| DecoderCommand&lt;br /&gt;
| Command to be handled by the decoder (See information on DecoderCommand structure below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Result Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| Request/Response data&lt;br /&gt;
| A 24-byte chunk of data containing information about the request/response. See below for more info.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;enum DecoderCommand : u16&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| Initialize (Initialize AAC decoder)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| DecodeEncode (Decode or encode an AAC stream)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Shutdown&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| LoadState&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| SaveState&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Request/Response Data=&lt;br /&gt;
The 24-byte &amp;quot;request/response data&amp;quot; chunk can take on one of the formats listed below, depending on what sort of message it&#039;s found in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AAC Decode request&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Size : 24 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of input AAC stream&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Byte size of input AAC stream&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address to output decoded PCM16 samples to (In the case of stereo audio, this corresponds to the left channel)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address to output decoded PCM16 samples for the right channel&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AAC Decode command response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Size : 24 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| enum SampleRate&lt;br /&gt;
| Sample rate of the decoded AAC stream (Note: This is an enum, NOT a numerical value for the sample rate)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Channel count (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| u32&lt;br /&gt;
| Number of decoded samples (?)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Sample rate enum=&lt;br /&gt;
&#039;&#039;&#039;enum SampleRate : u32&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| 48000Hz (48KHz)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 44100Hz (44.1KHz)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 32000Hz (32KHz)&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 24000Hz (24KHz)&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 22050Hz (22.05KHz)&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 16000Hz (16KHz)&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 12000Hz (12KHz)&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11025Hz (11.025KHz)&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 8000Hz (8KHz)&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22772</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22772"/>
		<updated>2024-09-28T18:36:18Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&#039;&#039;Also note that some things about the AAC firmware still need to be properly tested and/or reverse engineered.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;br /&gt;
&lt;br /&gt;
=Message Format=&lt;br /&gt;
Below is the message format used for communicating with the AAC decoder. The same format is both when making requests and for responses, though the &amp;quot;request/response data&amp;quot; field changes appropriately.&lt;br /&gt;
&lt;br /&gt;
Size : 0x20 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u16&lt;br /&gt;
| Mode (Seems to be 0 = None, 1 = Decode AAC, 2 = Encode AAC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| DecoderCommand&lt;br /&gt;
| Command to be handled by the decoder (See information on DecoderCommand structure below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Result Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| Request/Response data&lt;br /&gt;
| A 24-byte chunk of data containing information about the request/response. See below for more info.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;enum DecoderCommand : u16&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| Initialize (Initialize AAC decoder)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| DecodeEncode (Decode or encode an AAC stream)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Shutdown&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| LoadState&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| SaveState&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Request/Response Data=&lt;br /&gt;
The 24-byte &amp;quot;request/response data&amp;quot; chunk can take on one of the formats listed below, depending on what sort of message it&#039;s found in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AAC Decode command response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Size : 24 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| enum SampleRate&lt;br /&gt;
| Sample rate of the decoded AAC stream (Note: This is an enum, NOT a numerical value for the sample rate)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Channel count (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| u32&lt;br /&gt;
| Number of decoded samples (?)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Sample rate enum=&lt;br /&gt;
&#039;&#039;&#039;enum SampleRate : u32&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| 48000Hz (48KHz)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 44100Hz (44.1KHz)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 32000Hz (32KHz)&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 24000Hz (24KHz)&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| 22050Hz (22.05KHz)&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| 16000Hz (16KHz)&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| 12000Hz (12KHz)&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 11025Hz (11.025KHz)&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| 8000Hz (8KHz)&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22771</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22771"/>
		<updated>2024-09-28T18:25:33Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;br /&gt;
&lt;br /&gt;
=Message Format=&lt;br /&gt;
Below is the message format used for communicating with the AAC decoder. The same format is both when making requests and for responses, though the &amp;quot;request/response data&amp;quot; field changes appropriately.&lt;br /&gt;
&lt;br /&gt;
Size : 0x20 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u16&lt;br /&gt;
| Mode (Seems to be 0 = None, 1 = Decode AAC, 2 = Encode AAC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| DecoderCommand&lt;br /&gt;
| Command to be handled by the decoder (See information on DecoderCommand structure below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Result Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| Request/Response data&lt;br /&gt;
| A 24-byte chunk of data containing information about the request/response. See below for more info.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;enum DecoderCommand : u16&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Enum&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| Initialize (Initialize AAC decoder)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| DecodeEncode (Decode or encode an AAC stream)&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Shutdown&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| LoadState&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| SaveState&lt;br /&gt;
| 3&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22770</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22770"/>
		<updated>2024-09-28T18:22:30Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;br /&gt;
&lt;br /&gt;
=Message Format=&lt;br /&gt;
Below is the message format used for communicating with the AAC decoder. The same format is both when making requests and for responses, though the &amp;quot;request/response data&amp;quot; field changes appropriately.&lt;br /&gt;
&lt;br /&gt;
Size : 0x20 bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset in bytes&lt;br /&gt;
! Type&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u16&lt;br /&gt;
| Mode (Seems to be 0 = None, 1 = Decode AAC, 2 = Encode AAC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| DecoderCommand&lt;br /&gt;
| Command to be handled by the decoder (See information on DecoderCommand structure below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Result Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| Request/Response data&lt;br /&gt;
| A 24-byte chunk of data containing information about the request/response. See below for more info.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22769</id>
		<title>DSP AAC Decoder</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_AAC_Decoder&amp;diff=22769"/>
		<updated>2024-09-28T18:12:17Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Documentation of the DSP AAC firmware&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Some versions of the DSP firmware contain a decoder for the AAC audio codec. Such firmware may be dumped from specific games, like Pokemon X/Y or Rhythm Heaven Megamix. Interfacing with the AAC decoder (sending requests/receiving responses) happens via the DSP binary pipe (pipe 3)&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=HID_Shared_Memory&amp;diff=22352</id>
		<title>HID Shared Memory</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=HID_Shared_Memory&amp;diff=22352"/>
		<updated>2023-09-15T18:36:52Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Add HID 3D slider field&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the format of the [[HID_Services|HID]] shared memory.&lt;br /&gt;
&lt;br /&gt;
The data for each of the below entries(PAD state, circle-pad, touch-screen, etc) is originally written by the HID module at different times per frame.&lt;br /&gt;
&lt;br /&gt;
size: 0x2b0 (System-version v4.4 - [[9.0.0-20]])&lt;br /&gt;
&lt;br /&gt;
=Offset 0x0=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index in the following array which was last updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| 3D slider state as f32 (0.0f = completely off, 1.0f = max)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Current [[PAD]] state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| Raw circle-pad info.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x80&lt;br /&gt;
| Array of 8 entries, where each entry(see below) is 0x10-bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.&lt;br /&gt;
&lt;br /&gt;
==PAD State==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| A&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| B&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Select&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Start&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Right&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Left&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Up&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Down&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| R&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| L&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| X&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Y&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Inverted value of [[GPIO_Services|GPIO]] bit0.&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Inverted value of [[GPIO_Services|GPIO]] bit14.&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Circle pad right (X &amp;gt;= 41)&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Circle pad left (X &amp;lt;= -41)&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Circle pad up (Y &amp;gt;= 41)&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Circle pad down (Y &amp;lt;= -41)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit set = button pressed, bit clear = button not pressed. Bit28-31 only apply to the PAD fields in the array entries. Bit28-31 are set by HID module depending on data from a codec command, these are not included with the [[PAD]] register itself. Likewise for Bit12-13, except these are set depending on data from a GPIO command, and are likely used with the sharedmem PAD-state field too(this was originally implemented in an old HID module version / initial module version).&lt;br /&gt;
&lt;br /&gt;
==Entry format==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Current PAD state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| PAD state for buttons which were pressed(bitmasks which changed from value 0 to value 1) since the last HID update.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| PAD state for buttons which were released(bitmasks which changed from value 1 to value 0) since the last HID update.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| This stores circle-pad info: the low s16 is the X coordinate, the high s16 is the Y coordinate. The circle-pad center is approximately 0 for these fields. The range for these fields is approximately: -0x9C(bottom/left) - 0x9C(top/right).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Offset 0xA8=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index in the following array which was last updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x8&lt;br /&gt;
| Touch-screen entry, which contains the raw coordinate data prior to being converted to pixel coordinates.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x40&lt;br /&gt;
| 8 Touch-screen entries, containing pixel coordinates.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This 0x60-byte region stores state for touch-screen related info. Each touch-screen entry is all-zero when the touch-screen is not being touched.&lt;br /&gt;
&lt;br /&gt;
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.&lt;br /&gt;
&lt;br /&gt;
==Entry format==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| X coordinate.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Y coordinate.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| The u8 at +0 here is 0x0 when this entry doesn&#039;t contain any actual data, value 0x1 indicates that this entry contains actual data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Offset 0x108=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index in the following array which was last updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x6&lt;br /&gt;
| Current accelerometer state entry, contains the raw accelerometer output data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x30&lt;br /&gt;
| Array containing 8 accelerometer entries. Each entry when updated contains accelerometer data converted from the above entry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The size of this region is 0x50-bytes. This contains the accelerometer state. The data stored under these entries is loaded from [[MCU|MCUHID]] service commands.&lt;br /&gt;
&lt;br /&gt;
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.&lt;br /&gt;
&lt;br /&gt;
==Entry format==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| s16. X?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| s16. Y?&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| s16. Z?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Offset 0x158=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index in the following array which was last updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x6&lt;br /&gt;
| Current gyroscope state entry.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0xC0&lt;br /&gt;
| Array containing 32 gyroscrope entries.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The size of this region is 0xE0-bytes. Initially this contains 0xFF/0x00 bytes. This contains the gyroscope state. The [[I2C]] gyroscope device is used for this.&lt;br /&gt;
&lt;br /&gt;
HID module first updates index0, then index1, and so on. When updating the array when the index is already 31, the index is reset to 0.&lt;br /&gt;
&lt;br /&gt;
==Entry format==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| s16 X/roll(This the raw byte-swapped data from I2C, for the entry at +0x18 and the array entries).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Entry at +0x18: s16 Y/pitch. Array entries: s16 Z/yaw.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Entry at +0x18: s16 Z/yaw. Array entries: s16 Y/pitch, from the raw byte-swapped I2C data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Offset 0x238=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index in the following array which was last updated by HID module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x60&lt;br /&gt;
| Array containing 8 entries, see below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The size of this region is 0x78-bytes. Initially this contains 0xFF/0x00 bytes. The data stored under these entries is for the DebugPad. [[I2C]] deviceid 12 is used for this.&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t have any HID service commands for enabling/disabling this. HID module only updates this state when reading the DebugPad state from hardware via the service command was successful. Since the DebugPad hardware is not available on retail units, this sharedmem section is not updated by HID module on retail units.&lt;br /&gt;
&lt;br /&gt;
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.&lt;br /&gt;
&lt;br /&gt;
==Entry format==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Relative offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Keys held&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Keys just pressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Keys just released&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x1&lt;br /&gt;
| Left Stick X (range roughly -32 to +31)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| 0x1&lt;br /&gt;
| Left Stick Y (range roughly -32 to +31)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Right Stick X (range roughly -16 to +15)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Right Stick Y (range roughly -16 to +15)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding, not written by HID module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: there is code in hid sysmodule where holding +, -, DPAD Left, and A will recallibrate the sticks to zero.&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=BOSSU:RegisterNewArrivalEvent&amp;diff=22312</id>
		<title>BOSSU:RegisterNewArrivalEvent</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=BOSSU:RegisterNewArrivalEvent&amp;diff=22312"/>
		<updated>2023-08-17T18:18:41Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{{IPC/Request}}&lt;br /&gt;
{{#vardefine:ipc_offset|0}}&lt;br /&gt;
{{IPC/RequestEntry|Header code [0x00080002]}}&lt;br /&gt;
{{IPC/RequestEntry|KEvent event}}&lt;br /&gt;
{{IPC/RequestEnd}}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{{IPC/Request}}&lt;br /&gt;
{{#vardefine:ipc_offset|0}}&lt;br /&gt;
{{IPC/RequestEntry|Header code}}&lt;br /&gt;
{{IPC/RequestEntry|Result code}}&lt;br /&gt;
{{IPC/RequestEnd}}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=BOSS_Services&amp;diff=22311</id>
		<title>BOSS Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=BOSS_Services&amp;diff=22311"/>
		<updated>2023-08-17T18:16:47Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==BOSS Service &amp;quot;boss:U&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010082&lt;br /&gt;
| [[BOSSU:InitializeSession|InitializeSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| [[BOSS:SetStorageInfo|SetStorageInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| [[BOSS:UnregisterStorage|UnregisterStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| GetTaskStorageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 Size0, u32 Size1, ((Size0&amp;lt;&amp;lt;4) | 10), Buf0, ((Size1&amp;lt;&amp;lt;4) | 10), Buf1)&amp;lt;/nowiki&amp;gt; This writes the content of the input buffers into files &amp;quot;bossdb:/%s_CL&amp;quot; and &amp;quot;bossdb:/%s_CLK&amp;quot;, where &amp;quot;%s&amp;quot; is generated from the programID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080002&lt;br /&gt;
| [[BOSS:RegisterNewArrivalEvent|RegisterNewArrivalEvent]]: Used for sending a handle. This is used with a table of programIDs etc with a maximum of 5 entries.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| [[BOSS:SetOptoutFlag|SetOptoutFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| [[BOSS:GetOptoutFlag|GetOptoutFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B00C2&lt;br /&gt;
| [[BOSSU:RegisterTask|RegisterTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0082&lt;br /&gt;
| [[BOSSU:UnregisterTask|UnregisterTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0082&lt;br /&gt;
| [[BOSSU:ReconfigureTask|ReconfigureTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[BOSSU:GetTaskIdList|GetTaskIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100102&lt;br /&gt;
| [[BOSSU:GetNsDataIdList|GetNsDataIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110102&lt;br /&gt;
| [[BOSS:GetNsDataIdList1|GetNsDataIdList1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120102&lt;br /&gt;
| [[BOSS:GetNsDataIdList2|GetNsDataIdList2]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130102&lt;br /&gt;
| [[BOSS:GetNsDataIdList3|GetNsDataIdList3]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140082&lt;br /&gt;
| [[BOSSU:SendProperty|SendProperty]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150042&lt;br /&gt;
| [[BOSSU:SendPropertyHandle|SendPropertyHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160082&lt;br /&gt;
| [[BOSSU:ReceiveProperty|ReceiveProperty]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180082&lt;br /&gt;
| UpdateTaskCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0042&lt;br /&gt;
| GetTaskCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0042&lt;br /&gt;
| GetTaskServiceStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0042&lt;br /&gt;
| [[BOSSU:StartTask|StartTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0042&lt;br /&gt;
| [[BOSSU:StartTaskImmediate|StartTaskImmediate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0042&lt;br /&gt;
| [[BOSSU:CancelTask|CancelTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0000&lt;br /&gt;
| [[BOSS:GetTaskFinishHandle|GetTaskFinishHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200082&lt;br /&gt;
| [[BOSSU:GetTaskState|GetTaskState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210042&lt;br /&gt;
| GetTaskResult&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002300C2&lt;br /&gt;
| GetTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00250082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260040&lt;br /&gt;
| [[BOSS:DeleteNsData|DeleteNsData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002700C2&lt;br /&gt;
| [[BOSSU:GetNsDataHeaderInfo|GetNsDataHeaderInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280102&lt;br /&gt;
| [[BOSSU:ReadNsData|ReadNsData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0040&lt;br /&gt;
| Unknown. Writes an output u32 to cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0080&lt;br /&gt;
| SetNsDataNewFlag&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0040&lt;br /&gt;
| GetNsDataNewFlag&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0040&lt;br /&gt;
| (u32 NsDataId) Writes an output u64 to cmdreply[2-3], from the content file in extdata.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E0040&lt;br /&gt;
| [[BOSS:GetErrorCode|GetErrorCode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F0140&lt;br /&gt;
| RegisterStorageEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x00300000&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x00310100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00320000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00330042&lt;br /&gt;
| [[BOSS:StartBgImmediate|StartBgImmediate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00340042&lt;br /&gt;
| [[BOSS:GetTaskProperty0|GetTaskProperty0]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003500C2&lt;br /&gt;
| RegisterImmediateTask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00360084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 TaskID_Size, u32 BufSize, ((TaskID_Size&amp;lt;&amp;lt;4) | 10), TaskID_buf, ((BufSize&amp;lt;&amp;lt;4) | 10), Buf)&amp;lt;/nowiki&amp;gt; BufSize must match 0x60.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00370084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 TaskID_Size, u32 BufSize, ((TaskID_Size&amp;lt;&amp;lt;4) | 10), TaskID_buf, ((BufSize&amp;lt;&amp;lt;4) | 10), Buf)&amp;lt;/nowiki&amp;gt; BufSize must match 0x60.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Privileged BOSS Service &amp;quot;boss:P&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04010082&lt;br /&gt;
| [[BOSSP:InitializeSessionPrivileged|InitializeSessionPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040080&lt;br /&gt;
| [[BOSSP:GetAppNewFlag|GetAppNewFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040500C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040600C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04070080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04090102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040B0080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040D0182&lt;br /&gt;
| [[BOSSP:GetNsDataIdListPrivileged|GetNsDataIdListPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040E0182&lt;br /&gt;
| [[BOSSP:GetNsDataIdListPrivileged1|GetNsDataIdListPrivileged1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04130082&lt;br /&gt;
| [[BOSSP:SendPropertyPrivileged|SendPropertyPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041500C0&lt;br /&gt;
| DeleteNsDataPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x04160142&lt;br /&gt;
| [[BOSSP:GetNsDataHeaderInfoPrivileged|GetNsDataHeaderInfoPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04170182&lt;br /&gt;
| [[BOSSP:ReadNsDataPrivileged|ReadNsDataPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041A0100&lt;br /&gt;
| SetNsDataNewFlagPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x041B00C0&lt;br /&gt;
| GetNsDataNewFlagPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x041C00C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x042E00C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x042F00C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x043000C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04490142&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x044A0180&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x044D0080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04500102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04540102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x045500C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04580104&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
boss:P also contains all of the commands from boss:U.&lt;br /&gt;
&lt;br /&gt;
When Home Menu loads the SpotPass [[CBMD]] with [[Extended_Banner]], it uses bossP command 0x040D0182 first. Then it uses GetNsDataHeaderInfoPrivileged, then ReadNsDataPrivileged for loading the actual banner data.&lt;br /&gt;
&lt;br /&gt;
==BOSS Service &amp;quot;boss:M&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
==programIDs==&lt;br /&gt;
BOSS uses programIDs raw without any handling for the New3DS programID-low bitmask. For example, attempting a NsDataId listing with the New3DS bitmask set will fail, if BOSS is only setup for that programID with the New3DS bitmask clear.&lt;br /&gt;
&lt;br /&gt;
When [[BOSSU:InitializeSession|initializing]] BOSS with the default programID, the New3DS programID-low bitmask is always clear for New3DS titles since that&#039;s how it was originally registered with [[Filesystem_services|FS]]. Hence, the programID in the [[SpotPass|BOSS-container]] must always have the New3DS bitmask clear. This also means everything using the BOSSP commands with the raw programIDs loaded from AM title-listing are broken with New3DS titles, for example [[Extended_Banner]].&lt;br /&gt;
&lt;br /&gt;
==Content Data Storage==&lt;br /&gt;
SpotPass content for each application is stored under the extdata specified by [[BOSS:SetStorageInfo]]. Certain commands verify that the PID associated with the current service session has access to the specified extdata by using [[FS:CheckAuthorityToAccessExtSaveData]], returning an error on failure. This basically renders SpotPass unusable under user-processes(when initialized under those processes) which don&#039;t have access to any SD extdata(unless NAND extdata is used instead).&lt;br /&gt;
&lt;br /&gt;
All of these commands using [[FS:CheckAuthorityToAccessExtSaveData]] are: [[BOSS:SetStorageInfo]] and RegisterStorageEntry, for both BOSSU and BOSSP.&lt;br /&gt;
&lt;br /&gt;
BOSS-container content is stored in the extdata registered for the programID specified in the BOSS-container, what task it&#039;s associated with / what title registered it is irrelevant with BOSS-container data storage.&lt;br /&gt;
&lt;br /&gt;
==Custom SpotPass content==&lt;br /&gt;
SpotPass supports raw content download without using the encrypted+signed SpotPass container(raw content is used by [[Home Menu]] SpotPass VersionList for example). However, this is incompatible with the data-loading method used with SpotPass-container content(NsData commands can&#039;t be used with it).&lt;br /&gt;
&lt;br /&gt;
When writing the raw content, it firsts deletes and creates the &amp;quot;&amp;lt;taskID&amp;gt;&amp;quot; file under the data-storage extdata with normal extdata(not the separate boss archive). Once successful, the final filename specified by the task config will be deleted if needed, then the &amp;quot;&amp;lt;taskID&amp;gt;&amp;quot; file will be renamed to the final filename. Afterwards, the user-process can access the final file just like any other extdata file.&lt;br /&gt;
&lt;br /&gt;
For using custom content with the SpotPass container(like official titles), the only known ways to do so is: &amp;quot;CFW&amp;quot; / ARM11-kernelhax with the sigchecks for this patched, or some sort of BOSS-sysmodule exploit if there&#039;s any vulns to begin with.&lt;br /&gt;
&lt;br /&gt;
==HTTP upload==&lt;br /&gt;
SpotPass tasks can be used for uploading data via HTTP POST. The exact method varies, but the main one is a [[HTTPC:SendPOSTDataRawTimeout|raw]] POST.&lt;br /&gt;
&lt;br /&gt;
The content data is loaded from the following path: snprintf(outpath, outpathsize, &amp;quot;%s/%s%02x.up&amp;quot;, archivepath, taskidstr_probably, unk);&lt;br /&gt;
&lt;br /&gt;
The archivepath can be either &amp;quot;bossdb:&amp;quot;(BOSS-sysmodule NAND savedata) or the content-data-storage extdata. Certain other paths in the BOSS savedata can be used too.&lt;br /&gt;
&lt;br /&gt;
==BOSS Tasks==&lt;br /&gt;
The TaskID is a 8-byte buffer containing a string including NUL-terminator(taskIDs are compared with: strncmp(str0, str1, 7)).&lt;br /&gt;
&lt;br /&gt;
When disabling SpotPass, applications use [[BOSSU:CancelTask]] then [[BOSSU:UnregisterTask]], to delete each task.&lt;br /&gt;
&lt;br /&gt;
Each process can only access tasks which it created, not other processes&#039; tasks(even when using bossP with [[BOSSP:InitializeSessionPrivileged|init_programID]]=0).&lt;br /&gt;
&lt;br /&gt;
After registration, tasks will not automatically run until they are started using one of the start-task commands.&lt;br /&gt;
&lt;br /&gt;
==NsDataId==&lt;br /&gt;
This is an u32 ID for SpotPass content, used with the NsData service commands etc.&lt;br /&gt;
&lt;br /&gt;
==NsDataHeaderInfo==&lt;br /&gt;
When the input type is not one of the below or when the specified output size doesn&#039;t match the expected size for this type, an error is returned.&lt;br /&gt;
&lt;br /&gt;
===Type0===&lt;br /&gt;
Total size is 0x8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| programID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type1===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type2===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content data-type, originally from the [[SpotPass|BOSS-container]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type3===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type4===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type5===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type6===&lt;br /&gt;
Total size is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| programID. Same data as Type0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Same data as Type1.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Same data as Type3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PropertyIDs==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Example values used by official titles: 0x7D, 0xAA, ...&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Usually 0x1?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown. Usually 0x0?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x4&lt;br /&gt;
| Interval in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Duration(?), ~0 = infinite. 0x1 can be used for running the task just once. Usually set to 0x64(100). When not set to ~0 this is decreased by 1 each time the task runs(or at least when it fails). Task processing is skipped when the current state value is already 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Usually 0x2?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| 0x200&lt;br /&gt;
| URL&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xB&lt;br /&gt;
| 0x200&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| &lt;br /&gt;
| [[BOSSU:SendPropertyHandle]] is used for this. This property is only setup for HTTP uploads? This can be used with [[BOSSU:SendProperty]] too but that&#039;s not the intended use.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| 0x360&lt;br /&gt;
| Contains additional HTTP headers to send in the request, otherwise this is all-zero. This is an array of 3 entries: +0x0 size 0x20 is the header name, and +0x20 size 0x100 is the header value. Example: header-name &amp;quot;Content-Type&amp;quot; at 0x0, with header-value &amp;quot;application/octet-stream&amp;quot; at offset 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| 0x4&lt;br /&gt;
| This u32 is passed directly as an u32 certID for [[HTTPC:SetClientCertDefault]](without masking to u8), even when this field is set to 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| 0xC&lt;br /&gt;
| 3 words. Last word is unknown, normally 0(non-zero doesn&#039;t seem to affect any HTTPC commands). [[HTTPC:AddDefaultCert]] is called twice for each of the first two words which are used as certIDs(not masked to u8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| When non-zero this enables loading the client cert+privk from FS, requires the filepaths to be actually set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x1&lt;br /&gt;
| When non-zero this enables loading a trusted rootCA cert DER from FS, requires the filepath to be actually set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x13&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 0x40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| 0x2&lt;br /&gt;
| u16 total_tasks. [[BOSSU:GetTaskIdList]] is used before [[BOSSU:ReceiveProperty|reading]] this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| 0x400&lt;br /&gt;
| List of TaskIDs. [[BOSSU:GetTaskIdList]] is used before [[BOSSU:ReceiveProperty|reading]] this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x200&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only valid PropertyIDs for [[BOSSU:SendProperty]] are the ones listed above, except 0x35 and 0x36. If the specified size for the command is larger than the property size, it will use the actual property size instead. When the specified size is less than the actual property size, all of the property data that won&#039;t be written to is cleared.&lt;br /&gt;
&lt;br /&gt;
==TaskStatus==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Last task run was successful?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Task started.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| Task not started(also the initial state immediately after task creation).&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Task processing failed(such as network error).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This u8 is returned by [[BOSSU:GetTaskState]].&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Error-code&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F833&lt;br /&gt;
| taskID not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F836&lt;br /&gt;
| taskID already exists, for task creation.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F842&lt;br /&gt;
| The specified programID is not setup for BOSS.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F843&lt;br /&gt;
| The specified NsDataId was not found.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=BOSSU:RegisterNewArrivalEvent&amp;diff=22310</id>
		<title>BOSSU:RegisterNewArrivalEvent</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=BOSSU:RegisterNewArrivalEvent&amp;diff=22310"/>
		<updated>2023-08-17T18:12:45Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Created page with &amp;quot;I will update this in a sec&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I will update this in a sec&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22309</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22309"/>
		<updated>2023-08-17T12:24:10Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* File and directory access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Services =&lt;br /&gt;
== Filesystem service &amp;quot;fs:USER&amp;quot; ==&lt;br /&gt;
You can at most have 32 FS archive handles.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version &lt;br /&gt;
!  Description&lt;br /&gt;
!   scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; | Required [[NCCH/Extended_Header|exheader]] access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Dummy1|Dummy1]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Control|Control]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Initialize|Initialize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080201C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFile|OpenFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030204&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFileDirectly|OpenFileDirectly]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteFile|DeleteFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameFile|RenameFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectory|DeleteDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectoryRecursively|DeleteDirectoryRecursively]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080202&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateFile|CreateFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateDirectory|CreateDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameDirectory|RenameDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenDirectory|OpenDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenArchive|OpenArchive]]&lt;br /&gt;
| Each archive ID code has separate access info bitmasks, if it has any&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0144&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ControlArchive|ControlArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CloseArchive|CloseArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatThisUserSaveData|Obsoleted_2_0_FormatThisUserSaveData]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100200&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSystemSaveData|Obsoleted_3_0_CreateSystemSaveData]]&lt;br /&gt;
| 0x4, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSystemSaveData|Obsoleted_3_0_DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFreeBytes|GetFreeBytes]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetCardType|GetCardType]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcArchiveResource|GetSdmcArchiveResource]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandArchiveResource|GetNandArchiveResource]]&lt;br /&gt;
| 0x1007&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcFatfsError|GetSdmcFatfsError]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcDetected|IsSdmcDetected]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcWritable|IsSdmcWritable]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCid|GetSdmcCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandCid|GetNandCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcSpeedInfo|GetSdmcSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandSpeedInfo|GetNandSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcLog|GetSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandLog|GetNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearSdmcLog|ClearSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearNandLog|ClearNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotIsInserted|CardSlotIsInserted]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOn|CardSlotPowerOn]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOff|CardSlotPowerOff]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotGetCardIFPowerStatus|CardSlotGetCardIFPowerStatus]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommand|CardNorDirectCommand]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommandWithAddress|CardNorDirectCommandWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead|CardNorDirectRead]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectReadWithAddress|CardNorDirectReadWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWrite|CardNorDirectWrite]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082A00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWriteWithAddress|CardNorDirectWriteWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead_4xIO|CardNorDirectRead_4xIO]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082C0082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCpuWriteWithoutVerify|CardNorDirectCpuWriteWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082D0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectSectorEraseWithoutVerify|CardNorDirectSectorEraseWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082E0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProductInfo|GetProductInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x082F0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08300182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateExtSaveData|Obsoleted_3_0_CreateExtSaveData]]&lt;br /&gt;
| 0xC, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08310180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSharedExtSaveData|Obsoleted_3_0_CreateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08320102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_ReadExtSaveDataIcon|Obsoleted_3_0_ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08330082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateExtSaveData|Obsoleted_3_0_EnumerateExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08340082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateSharedExtSaveData|Obsoleted_3_0_EnumerateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08350080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteExtSaveData|Obsoleted_3_0_DeleteExtSaveData]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08360080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSharedExtSaveData|Obsoleted_3_0_DeleteSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08370040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBaudRate|SetCardSpiBaudRate]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08380040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBusMode|SetCardSpiBusMode]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08390000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SendInitializeInfoTo9|SendInitializeInfoTo9]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083A0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialContentIndex|GetSpecialContentIndex]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x083B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader|GetLegacyRomHeader]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyBannerData|GetLegacyBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083D0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CheckAuthorityToAccessExtSaveData|CheckAuthorityToAccessExtSaveData]]&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x083E00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:QueryTotalQuotaSize|QueryTotalQuotaSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083F00C0&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_GetExtDataBlockSize|Obsoleted_3_0_GetExtDataBlockSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08400040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:AbnegateAccessRight|AbnegateAccessRight]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08410000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteSdmcRoot|DeleteSdmcRoot]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08420040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteAllExtSaveDataOnNand|DeleteAllExtSaveDataOnNand]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08430000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:InitializeCtrFileSystem|InitializeCtrFileSystem]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08440000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateSeed|CreateSeed]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x084500C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFormatInfo|GetFormatInfo]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08460102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader2|GetLegacyRomHeader2]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x08470180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatCtrCardUserSaveData|Obsoleted_2_0_FormatCtrCardUserSaveData]]&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x08480042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCtrRootPath|GetSdmcCtrRootPath]]&lt;br /&gt;
| 0x100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08490040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetArchiveResource|GetArchiveResource]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x084A0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ExportIntegrityVerificationSeed|ExportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084B0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ImportIntegrityVerificationSeed|ImportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084C0242&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatSaveData|FormatSaveData]]&lt;br /&gt;
| 0x6, in some cases this write isn&#039;t needed however&lt;br /&gt;
|-&lt;br /&gt;
| 0x084D0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacySubBannerData|GetLegacySubBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x084E0342&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:UpdateSha256Context|UpdateSha256Context]]&lt;br /&gt;
| 0x5&lt;br /&gt;
|-&lt;br /&gt;
| 0x084F0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ReadSpecialFile|ReadSpecialFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08500040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialFileSize|GetSpecialFileSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08510242&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateExtSaveData|CreateExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x08520100&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteExtSaveData|DeleteExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0x10100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08530142&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ReadExtSaveDataIcon|ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x085400C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetExtDataBlockSize|GetExtDataBlockSize]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08550102&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateExtSaveData|EnumerateExtSaveData]]&lt;br /&gt;
| 0x101005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08560240&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]&lt;br /&gt;
| 0x4 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08570080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteSystemSaveData|DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08580000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsSource|StartDeviceMoveAsSource]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08590200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsDestination|StartDeviceMoveAsDestination]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x085A00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetArchivePriority|SetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085B0080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetArchivePriority|GetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085C00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetCtrCardLatencyParameter|SetCtrCardLatencyParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085D01C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetFsCompatibilityInfo|SetFsCompatibilityInfo]]&lt;br /&gt;
| 0x100001&lt;br /&gt;
|-&lt;br /&gt;
| 0x085E0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ResetCardCompatibilityParameter|ResetCardCompatibilityParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085F0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SwitchCleanupInvalidSaveData|SwitchCleanupInvalidSaveData]]&lt;br /&gt;
| 0x12004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08600042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateSystemSaveData|EnumerateSystemSaveData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08610042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:InitializeWithSdkVersion|InitializeWithSdkVersion]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08620040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetPriority|SetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08630000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetPriority|GetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08640000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandInfo|Obsoleted_4_0_GetNandInfo]]&lt;br /&gt;
| Stubbed, this returns an error&lt;br /&gt;
|-&lt;br /&gt;
| 0x08650140&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:SetSaveDataSecureValue|SetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086600C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetSaveDataSecureValue|GetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086700C4&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ControlSecureSave|ControlSecureSave]]&lt;br /&gt;
| 0x121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08680000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetMediaType|GetMediaType]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08690000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandEraseCount|Obsoleted_4_0_GetNandEraseCount]]&lt;br /&gt;
| Stubbed, this returns an error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x086A0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ReadNandReport|ReadNandReport]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086B00C2&lt;br /&gt;
|?&lt;br /&gt;
|SetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086C00C2&lt;br /&gt;
|?&lt;br /&gt;
|GetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086D0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00020004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086E00C0&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|SetThisSaveDataSecureValue&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x086F0040&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|GetThisSaveDataSecureValue&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x087000C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08710100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x087201C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x087300C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08740000&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08750140&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087600C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08770100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087800C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087900C2&lt;br /&gt;
| ?&lt;br /&gt;
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.&lt;br /&gt;
| 0x00101015&lt;br /&gt;
|-&lt;br /&gt;
| 0x087A0180&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| [[FS:AddSeed|AddSeed]]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087B....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Wrapper for the code internally used for command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087C....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087D0000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| GetNumSeeds. Writes the number of seeds to cmdreply[2]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087E0042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12), outbufptr)&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087F....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0880....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0881....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0882....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08830000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an output value to cmdreply[2].&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08840042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0885....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x088600C0&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]&lt;br /&gt;
| 0x00080000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The question marks from Dummy1 to GetSpecialFileSize on the &amp;quot;available since system version&amp;quot; field are mainly there because I think that most of these are necessary for the main system to function, so theoretically that would mean that since the creation of the 3DS these were available, or since launch if that makes more sense. But because of the peculiar nature of some of the functions, they will remain question marks until they can be confirmed 100%.&lt;br /&gt;
&lt;br /&gt;
When access rights are required for a command, at least one of the bits in the process access info specified in the above table for the command must be set. Error 0xD9004676 is returned when a process attempts to use a command which it doesn&#039;t have access rights for the command. The exheader access info field is all zero&#039;s for most applications. Note that the permissions listed in the above table is for system-version v2.x, therefore permission bit(s) added with newer FIRM may be missing from this.&lt;br /&gt;
&lt;br /&gt;
Each session for fs:USER has separate permissions, initially these are set to all zero&#039;s for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).&lt;br /&gt;
&lt;br /&gt;
== Filesystem service &amp;quot;fs:LDR&amp;quot; ==&lt;br /&gt;
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.&lt;br /&gt;
&lt;br /&gt;
== ProgramRegistry service &amp;quot;fs:REG&amp;quot; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSReg:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040103C0&lt;br /&gt;
| [[FSReg:Register|Register]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[FSReg:Unregister|Unregister]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040300C0&lt;br /&gt;
| [[FSReg:GetProgramInfo|GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040100&lt;br /&gt;
| [[FSReg:LoadProgram|LoadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050080&lt;br /&gt;
| [[FSReg:UnloadProgram|UnloadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060080&lt;br /&gt;
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.&lt;br /&gt;
&lt;br /&gt;
=File and directory access=&lt;br /&gt;
==Files==&lt;br /&gt;
File session handles obtained via [[FS:OpenFile]] and [[FS:OpenFileDirectly]] can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]]. To use this service-like interface, simply call the SendSyncRequest SVC with a file session handle, using the IPC buffer in thread-local storage for parameters and responses, just like you would with a proper service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSFile:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[FSFile:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| [[FSFile:OpenSubFile|OpenSubFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| [[FSFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| [[FSFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| [[FSFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| [[FSFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| [[FSFile:GetAttributes|GetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070040&lt;br /&gt;
| [[FSFile:SetAttributes|SetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[FSFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| [[FSFile:Flush|Flush]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0040&lt;br /&gt;
| [[FSFile:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| [[FSFile:GetPriority|GetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| [[FSFile:OpenLinkFile|OpenLinkFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C010100&lt;br /&gt;
| [[FSFile:GetAvailable|GetAvailable]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Directories==&lt;br /&gt;
Directory session handles obtained via [[FS:OpenDirectory]] are usable via a service-like interface, following the exact same procedure described above for file sessions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030040&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:GetPriority|GetPriority]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Archives =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ArchiveId&lt;br /&gt;
!  Description&lt;br /&gt;
!  Accessible via [[Filesystem_services|FS]]&lt;br /&gt;
!  Accessible via [[Filesystem_services_PXI|FSPXI]]&lt;br /&gt;
!  Only accessible by Process9 internally&lt;br /&gt;
!  Requires binary [[FS:OpenFile|Lowpath]]&lt;br /&gt;
!  Required exheader FS access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000003&lt;br /&gt;
| SelfNCCH (including [[#RomFS|RomFS]])&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000004&lt;br /&gt;
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process&#039; exheader)&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000006&lt;br /&gt;
| ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x100D, when the input extdataID isn&#039;t listed in the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000007&lt;br /&gt;
| Shared ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000008&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x4, when the input saveID doesn&#039;t match the exheader system-saveID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000009&lt;br /&gt;
| SDMC&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x8E&lt;br /&gt;
|-&lt;br /&gt;
| 0x0000000A&lt;br /&gt;
| SDMC Write-Only&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x808E&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345678&lt;br /&gt;
| ExtSaveData for BOSS&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345679&lt;br /&gt;
| CARD SPI FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x16&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567B&lt;br /&gt;
| ExtSaveData, and ExtSaveData for BOSS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567C&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567D&lt;br /&gt;
| NAND RW&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x800&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567E&lt;br /&gt;
| NAND RO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567F&lt;br /&gt;
| NAND RO Write FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345680&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345681&lt;br /&gt;
| Unknown. Accessed by FS service.&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345682&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678A&lt;br /&gt;
| Used for accessing general NCCH data. With FSPXI this also allows savedata access.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678B&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678C&lt;br /&gt;
| Used internally to access [[Title_Database|/dbs]] files?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678D&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678E&lt;br /&gt;
| FSPXI: Similar to archive 0x2345678A. For fs:LDR(used by the &amp;quot;loader&amp;quot; FIRM ARM11-process), only ExeFS. Not accessible with fs:USER.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None, see description.&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AB&lt;br /&gt;
| NAND CTR FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AC&lt;br /&gt;
| TWL PHOTO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AD&lt;br /&gt;
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AE&lt;br /&gt;
| NAND TWL FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AF&lt;br /&gt;
| NAND W FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B0&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B1&lt;br /&gt;
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B2&lt;br /&gt;
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B4&lt;br /&gt;
| Similar to 0x567890B2 but can only access Accessible Save specified in [[NCCH/Extended_Header#Storage_Info|exheader]]?&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].&lt;br /&gt;
&lt;br /&gt;
The above permission bitmasks are from v2.x, see the above Services section for how these are handled.&lt;br /&gt;
&lt;br /&gt;
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process&#039; exheader accessinfo.&lt;br /&gt;
&lt;br /&gt;
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka &amp;quot;cardspi:/&amp;quot; in [[FIRM|Process9]]), the file lowpath must be WCHAR &amp;quot;/&amp;quot;. The &amp;quot;NAND W FS&amp;quot; archive allows access to the raw NAND image(aka &amp;quot;wnand:/&amp;quot; in Process9), the file lowpath must be WCHAR &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Filenames and Paths =&lt;br /&gt;
PathType:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| Returned internally by Process9, when errors occur it seems(in particular when no nul-terminator was found in the input path). The data ptr is set to NULL.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| INVALID - Specifies an invalid path&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| EMPTY - Specifies an empty path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| BINARY - Non-text based path. Meaning is per-archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| UTF16 - Text-based path with UTF-16 characters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In IPC requests, sizes of ASCII and UTF16 paths must include space for the null-terminator. &lt;br /&gt;
&lt;br /&gt;
== Binary LowPath ==&lt;br /&gt;
The format of the data that a binary LowPath points to is custom per archive.&lt;br /&gt;
&lt;br /&gt;
=== SelfNCCH File Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| Type:&lt;br /&gt;
* 0x0: RomFS&lt;br /&gt;
* 0x1: error 0xD9004676&lt;br /&gt;
* 0x2: ExeFS&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module crashes on this&lt;br /&gt;
* 0x5: Update RomFS?&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| File name for ExeFS (&amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;). &amp;quot;.code&amp;quot; is not allowed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that ExeFS files only support reading from offset=0 and with size=file_size. &lt;br /&gt;
&lt;br /&gt;
=== SystemSaveData Archive Path Data Format ===&lt;br /&gt;
==== FS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
==== FSPXI ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|}&lt;br /&gt;
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.&lt;br /&gt;
&lt;br /&gt;
=== UserSaveDataForCheck Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be non-zero)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
=== 0x567890B4 Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Lower_word_saveid &amp;gt;&amp;gt; 8&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown. Game calculate this using formula &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;0xFFFFFF00 | unknown_b&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ExtSaveData Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the &amp;quot;/extdata/&amp;lt;ExtdataIDHigh&amp;gt;/&amp;lt;ExtdataIDLow&amp;gt;&amp;quot; directory on SD/NAND, for the cleartext extdata image to mount.&lt;br /&gt;
&lt;br /&gt;
=== 0x2345678A Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Lower word programID&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Upper word programID&lt;br /&gt;
|-&lt;br /&gt;
| 2 &lt;br /&gt;
| ([[Mediatypes|Mediatype]] &amp;amp; 0xFF) | (uninitialized_data? &amp;amp; 0xFFFFFF00)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Number of something? Hardcoded per-archive, 0 for ExeFS, 200 for area:, 100 for rate:, 40 for eula:, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 for NCCH data, 1 for savedata. The latter is only valid for FSPXI. Value 2 is allowed via archive 0x3, it&#039;s unknown what this is.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TMD content index / NCSD partition index.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Type: 0=romfs(0 for non-NCCH as well), 1=exefs &amp;quot;.code&amp;quot;(?), 2=exefs &amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;, 3=unknown, 4=unknown, 5=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| Filename for ExeFS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 0x14-byte lowpath is all-zero for accessing the title&#039;s main RomFS.&lt;br /&gt;
&lt;br /&gt;
=== [[RomFS]] ===&lt;br /&gt;
&lt;br /&gt;
Archives 0x3 and 0x2345678E both allow for accessing the [[RomFS#Level_3_Format|level-3 IVFC images]] for RomFS access. The main CXI RomFS is accessible via an all-zero 0xc-byte binary file-lowpath. The update RomFS can be accessed with the first u32 in the binary file-lowpath being set to 0x5. The user must handle parsing the filesystem used in the exposed image itself.&lt;br /&gt;
&lt;br /&gt;
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.&lt;br /&gt;
&lt;br /&gt;
The 0x3 archive is an interface for the 0x2345678E archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678E-archive file_lowpath+0, with the rest of that lowpath set to all-zero(lowpath is different from archive 0x2345678A). File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| See above. The only values which FS-module doesn&#039;t allow to be used here are:&lt;br /&gt;
* 0x1: Error 0xE0E046BE.&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module executes svcBreak when using this.&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| See above. Not validated by FS-module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=SEEDDB=&lt;br /&gt;
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.&lt;br /&gt;
&lt;br /&gt;
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
&lt;br /&gt;
= Common Types =&lt;br /&gt;
== MediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Game Card&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemMediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| CTR NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TWL NAND&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| TWL Photo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Read&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Write&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Create&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Hidden&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Read-Only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WriteOption ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Flush&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update Time Stamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DirectoryEntry ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x20C&lt;br /&gt;
| UTF-16 Entry Name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C&lt;br /&gt;
| 0xA&lt;br /&gt;
| 8.3 short filename name&lt;br /&gt;
|-&lt;br /&gt;
| 0x216&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8.3 short filename extension&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x21B&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x21C&lt;br /&gt;
| 0x4&lt;br /&gt;
| [[Filesystem_services#Attributes|Attributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x220&lt;br /&gt;
| 0x8&lt;br /&gt;
| Entry Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArchiveResource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sector byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Cluster byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Partition capacity in clusters&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Available free space in clusters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProgramInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProductInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| Product Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Company Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Remaster Version&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IntegrityVerificationSeed ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x120&lt;br /&gt;
|  The [[nand/private/movable.sed]], encrypted with AES-CBC using the above MAC for the counter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SecureValueSlot ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SD Application&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBaudRate ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 512KHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 1MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 2MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 4MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 16MHz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBusMode ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 1-bit&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 4-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SpecialContentType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Manual&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| DLP Child&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceMoveContext ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  IVs&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Encrypt Parameter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Filesystem_services_PXI]].&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22308</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22308"/>
		<updated>2023-08-17T12:22:28Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Services =&lt;br /&gt;
== Filesystem service &amp;quot;fs:USER&amp;quot; ==&lt;br /&gt;
You can at most have 32 FS archive handles.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version &lt;br /&gt;
!  Description&lt;br /&gt;
!   scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; | Required [[NCCH/Extended_Header|exheader]] access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Dummy1|Dummy1]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Control|Control]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Initialize|Initialize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080201C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFile|OpenFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030204&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFileDirectly|OpenFileDirectly]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteFile|DeleteFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameFile|RenameFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectory|DeleteDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectoryRecursively|DeleteDirectoryRecursively]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080202&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateFile|CreateFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateDirectory|CreateDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameDirectory|RenameDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenDirectory|OpenDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenArchive|OpenArchive]]&lt;br /&gt;
| Each archive ID code has separate access info bitmasks, if it has any&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0144&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ControlArchive|ControlArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CloseArchive|CloseArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatThisUserSaveData|Obsoleted_2_0_FormatThisUserSaveData]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100200&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSystemSaveData|Obsoleted_3_0_CreateSystemSaveData]]&lt;br /&gt;
| 0x4, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSystemSaveData|Obsoleted_3_0_DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFreeBytes|GetFreeBytes]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetCardType|GetCardType]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcArchiveResource|GetSdmcArchiveResource]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandArchiveResource|GetNandArchiveResource]]&lt;br /&gt;
| 0x1007&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcFatfsError|GetSdmcFatfsError]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcDetected|IsSdmcDetected]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcWritable|IsSdmcWritable]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCid|GetSdmcCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandCid|GetNandCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcSpeedInfo|GetSdmcSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandSpeedInfo|GetNandSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcLog|GetSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandLog|GetNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearSdmcLog|ClearSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearNandLog|ClearNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotIsInserted|CardSlotIsInserted]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOn|CardSlotPowerOn]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOff|CardSlotPowerOff]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotGetCardIFPowerStatus|CardSlotGetCardIFPowerStatus]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommand|CardNorDirectCommand]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommandWithAddress|CardNorDirectCommandWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead|CardNorDirectRead]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectReadWithAddress|CardNorDirectReadWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWrite|CardNorDirectWrite]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082A00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWriteWithAddress|CardNorDirectWriteWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead_4xIO|CardNorDirectRead_4xIO]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082C0082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCpuWriteWithoutVerify|CardNorDirectCpuWriteWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082D0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectSectorEraseWithoutVerify|CardNorDirectSectorEraseWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082E0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProductInfo|GetProductInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x082F0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08300182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateExtSaveData|Obsoleted_3_0_CreateExtSaveData]]&lt;br /&gt;
| 0xC, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08310180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSharedExtSaveData|Obsoleted_3_0_CreateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08320102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_ReadExtSaveDataIcon|Obsoleted_3_0_ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08330082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateExtSaveData|Obsoleted_3_0_EnumerateExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08340082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateSharedExtSaveData|Obsoleted_3_0_EnumerateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08350080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteExtSaveData|Obsoleted_3_0_DeleteExtSaveData]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08360080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSharedExtSaveData|Obsoleted_3_0_DeleteSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08370040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBaudRate|SetCardSpiBaudRate]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08380040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBusMode|SetCardSpiBusMode]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08390000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SendInitializeInfoTo9|SendInitializeInfoTo9]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083A0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialContentIndex|GetSpecialContentIndex]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x083B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader|GetLegacyRomHeader]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyBannerData|GetLegacyBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083D0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CheckAuthorityToAccessExtSaveData|CheckAuthorityToAccessExtSaveData]]&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x083E00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:QueryTotalQuotaSize|QueryTotalQuotaSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083F00C0&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_GetExtDataBlockSize|Obsoleted_3_0_GetExtDataBlockSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08400040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:AbnegateAccessRight|AbnegateAccessRight]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08410000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteSdmcRoot|DeleteSdmcRoot]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08420040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteAllExtSaveDataOnNand|DeleteAllExtSaveDataOnNand]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08430000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:InitializeCtrFileSystem|InitializeCtrFileSystem]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08440000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateSeed|CreateSeed]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x084500C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFormatInfo|GetFormatInfo]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08460102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader2|GetLegacyRomHeader2]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x08470180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatCtrCardUserSaveData|Obsoleted_2_0_FormatCtrCardUserSaveData]]&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x08480042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCtrRootPath|GetSdmcCtrRootPath]]&lt;br /&gt;
| 0x100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08490040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetArchiveResource|GetArchiveResource]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x084A0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ExportIntegrityVerificationSeed|ExportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084B0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ImportIntegrityVerificationSeed|ImportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084C0242&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatSaveData|FormatSaveData]]&lt;br /&gt;
| 0x6, in some cases this write isn&#039;t needed however&lt;br /&gt;
|-&lt;br /&gt;
| 0x084D0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacySubBannerData|GetLegacySubBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x084E0342&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:UpdateSha256Context|UpdateSha256Context]]&lt;br /&gt;
| 0x5&lt;br /&gt;
|-&lt;br /&gt;
| 0x084F0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ReadSpecialFile|ReadSpecialFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08500040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialFileSize|GetSpecialFileSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08510242&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateExtSaveData|CreateExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x08520100&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteExtSaveData|DeleteExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0x10100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08530142&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ReadExtSaveDataIcon|ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x085400C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetExtDataBlockSize|GetExtDataBlockSize]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08550102&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateExtSaveData|EnumerateExtSaveData]]&lt;br /&gt;
| 0x101005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08560240&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]&lt;br /&gt;
| 0x4 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08570080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteSystemSaveData|DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08580000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsSource|StartDeviceMoveAsSource]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08590200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsDestination|StartDeviceMoveAsDestination]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x085A00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetArchivePriority|SetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085B0080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetArchivePriority|GetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085C00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetCtrCardLatencyParameter|SetCtrCardLatencyParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085D01C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetFsCompatibilityInfo|SetFsCompatibilityInfo]]&lt;br /&gt;
| 0x100001&lt;br /&gt;
|-&lt;br /&gt;
| 0x085E0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ResetCardCompatibilityParameter|ResetCardCompatibilityParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085F0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SwitchCleanupInvalidSaveData|SwitchCleanupInvalidSaveData]]&lt;br /&gt;
| 0x12004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08600042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateSystemSaveData|EnumerateSystemSaveData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08610042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:InitializeWithSdkVersion|InitializeWithSdkVersion]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08620040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetPriority|SetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08630000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetPriority|GetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08640000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandInfo|Obsoleted_4_0_GetNandInfo]]&lt;br /&gt;
| Stubbed, this returns an error&lt;br /&gt;
|-&lt;br /&gt;
| 0x08650140&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:SetSaveDataSecureValue|SetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086600C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetSaveDataSecureValue|GetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086700C4&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ControlSecureSave|ControlSecureSave]]&lt;br /&gt;
| 0x121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08680000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetMediaType|GetMediaType]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08690000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandEraseCount|Obsoleted_4_0_GetNandEraseCount]]&lt;br /&gt;
| Stubbed, this returns an error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x086A0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ReadNandReport|ReadNandReport]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086B00C2&lt;br /&gt;
|?&lt;br /&gt;
|SetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086C00C2&lt;br /&gt;
|?&lt;br /&gt;
|GetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086D0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00020004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086E00C0&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|SetThisSaveDataSecureValue&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x086F0040&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|GetThisSaveDataSecureValue&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x087000C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08710100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x087201C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x087300C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08740000&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08750140&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087600C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08770100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087800C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087900C2&lt;br /&gt;
| ?&lt;br /&gt;
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.&lt;br /&gt;
| 0x00101015&lt;br /&gt;
|-&lt;br /&gt;
| 0x087A0180&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| [[FS:AddSeed|AddSeed]]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087B....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Wrapper for the code internally used for command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087C....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087D0000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| GetNumSeeds. Writes the number of seeds to cmdreply[2]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087E0042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12), outbufptr)&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087F....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0880....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0881....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0882....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08830000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an output value to cmdreply[2].&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08840042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0885....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x088600C0&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]&lt;br /&gt;
| 0x00080000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The question marks from Dummy1 to GetSpecialFileSize on the &amp;quot;available since system version&amp;quot; field are mainly there because I think that most of these are necessary for the main system to function, so theoretically that would mean that since the creation of the 3DS these were available, or since launch if that makes more sense. But because of the peculiar nature of some of the functions, they will remain question marks until they can be confirmed 100%.&lt;br /&gt;
&lt;br /&gt;
When access rights are required for a command, at least one of the bits in the process access info specified in the above table for the command must be set. Error 0xD9004676 is returned when a process attempts to use a command which it doesn&#039;t have access rights for the command. The exheader access info field is all zero&#039;s for most applications. Note that the permissions listed in the above table is for system-version v2.x, therefore permission bit(s) added with newer FIRM may be missing from this.&lt;br /&gt;
&lt;br /&gt;
Each session for fs:USER has separate permissions, initially these are set to all zero&#039;s for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).&lt;br /&gt;
&lt;br /&gt;
== Filesystem service &amp;quot;fs:LDR&amp;quot; ==&lt;br /&gt;
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.&lt;br /&gt;
&lt;br /&gt;
== ProgramRegistry service &amp;quot;fs:REG&amp;quot; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSReg:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040103C0&lt;br /&gt;
| [[FSReg:Register|Register]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[FSReg:Unregister|Unregister]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040300C0&lt;br /&gt;
| [[FSReg:GetProgramInfo|GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040100&lt;br /&gt;
| [[FSReg:LoadProgram|LoadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050080&lt;br /&gt;
| [[FSReg:UnloadProgram|UnloadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060080&lt;br /&gt;
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.&lt;br /&gt;
&lt;br /&gt;
=File and directory access=&lt;br /&gt;
==Files==&lt;br /&gt;
File session handles obtained via [[FS:OpenFile]] and [[FS:OpenFileDirectly]] can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]]. To use this service-like interface, simply call the SendSyncRequest SVC with a file session handle, using the IPC buffer in thread-local storage for parameters and responses, just like you would with a proper service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSFile:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[FSFile:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| [[FSFile:OpenSubFile|OpenSubFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| [[FSFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| [[FSFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| [[FSFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| [[FSFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| [[FSFile:GetAttributes|GetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070040&lt;br /&gt;
| [[FSFile:SetAttributes|SetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[FSFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| [[FSFile:Flush|Flush]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0040&lt;br /&gt;
| [[FSFile:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| [[FSFile:GetPriority|GetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| [[FSFile:OpenLinkFile|OpenLinkFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C010100&lt;br /&gt;
| [[FSFile:GetAvailable|GetAvailable]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Directories==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030040&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:GetPriority|GetPriority]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Archives =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ArchiveId&lt;br /&gt;
!  Description&lt;br /&gt;
!  Accessible via [[Filesystem_services|FS]]&lt;br /&gt;
!  Accessible via [[Filesystem_services_PXI|FSPXI]]&lt;br /&gt;
!  Only accessible by Process9 internally&lt;br /&gt;
!  Requires binary [[FS:OpenFile|Lowpath]]&lt;br /&gt;
!  Required exheader FS access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000003&lt;br /&gt;
| SelfNCCH (including [[#RomFS|RomFS]])&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000004&lt;br /&gt;
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process&#039; exheader)&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000006&lt;br /&gt;
| ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x100D, when the input extdataID isn&#039;t listed in the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000007&lt;br /&gt;
| Shared ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000008&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x4, when the input saveID doesn&#039;t match the exheader system-saveID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000009&lt;br /&gt;
| SDMC&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x8E&lt;br /&gt;
|-&lt;br /&gt;
| 0x0000000A&lt;br /&gt;
| SDMC Write-Only&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x808E&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345678&lt;br /&gt;
| ExtSaveData for BOSS&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345679&lt;br /&gt;
| CARD SPI FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x16&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567B&lt;br /&gt;
| ExtSaveData, and ExtSaveData for BOSS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567C&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567D&lt;br /&gt;
| NAND RW&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x800&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567E&lt;br /&gt;
| NAND RO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567F&lt;br /&gt;
| NAND RO Write FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345680&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345681&lt;br /&gt;
| Unknown. Accessed by FS service.&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345682&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678A&lt;br /&gt;
| Used for accessing general NCCH data. With FSPXI this also allows savedata access.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678B&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678C&lt;br /&gt;
| Used internally to access [[Title_Database|/dbs]] files?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678D&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678E&lt;br /&gt;
| FSPXI: Similar to archive 0x2345678A. For fs:LDR(used by the &amp;quot;loader&amp;quot; FIRM ARM11-process), only ExeFS. Not accessible with fs:USER.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None, see description.&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AB&lt;br /&gt;
| NAND CTR FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AC&lt;br /&gt;
| TWL PHOTO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AD&lt;br /&gt;
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AE&lt;br /&gt;
| NAND TWL FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AF&lt;br /&gt;
| NAND W FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B0&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B1&lt;br /&gt;
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B2&lt;br /&gt;
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B4&lt;br /&gt;
| Similar to 0x567890B2 but can only access Accessible Save specified in [[NCCH/Extended_Header#Storage_Info|exheader]]?&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].&lt;br /&gt;
&lt;br /&gt;
The above permission bitmasks are from v2.x, see the above Services section for how these are handled.&lt;br /&gt;
&lt;br /&gt;
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process&#039; exheader accessinfo.&lt;br /&gt;
&lt;br /&gt;
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka &amp;quot;cardspi:/&amp;quot; in [[FIRM|Process9]]), the file lowpath must be WCHAR &amp;quot;/&amp;quot;. The &amp;quot;NAND W FS&amp;quot; archive allows access to the raw NAND image(aka &amp;quot;wnand:/&amp;quot; in Process9), the file lowpath must be WCHAR &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Filenames and Paths =&lt;br /&gt;
PathType:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| Returned internally by Process9, when errors occur it seems(in particular when no nul-terminator was found in the input path). The data ptr is set to NULL.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| INVALID - Specifies an invalid path&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| EMPTY - Specifies an empty path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| BINARY - Non-text based path. Meaning is per-archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| UTF16 - Text-based path with UTF-16 characters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In IPC requests, sizes of ASCII and UTF16 paths must include space for the null-terminator. &lt;br /&gt;
&lt;br /&gt;
== Binary LowPath ==&lt;br /&gt;
The format of the data that a binary LowPath points to is custom per archive.&lt;br /&gt;
&lt;br /&gt;
=== SelfNCCH File Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| Type:&lt;br /&gt;
* 0x0: RomFS&lt;br /&gt;
* 0x1: error 0xD9004676&lt;br /&gt;
* 0x2: ExeFS&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module crashes on this&lt;br /&gt;
* 0x5: Update RomFS?&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| File name for ExeFS (&amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;). &amp;quot;.code&amp;quot; is not allowed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that ExeFS files only support reading from offset=0 and with size=file_size. &lt;br /&gt;
&lt;br /&gt;
=== SystemSaveData Archive Path Data Format ===&lt;br /&gt;
==== FS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
==== FSPXI ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|}&lt;br /&gt;
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.&lt;br /&gt;
&lt;br /&gt;
=== UserSaveDataForCheck Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be non-zero)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
=== 0x567890B4 Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Lower_word_saveid &amp;gt;&amp;gt; 8&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown. Game calculate this using formula &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;0xFFFFFF00 | unknown_b&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ExtSaveData Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the &amp;quot;/extdata/&amp;lt;ExtdataIDHigh&amp;gt;/&amp;lt;ExtdataIDLow&amp;gt;&amp;quot; directory on SD/NAND, for the cleartext extdata image to mount.&lt;br /&gt;
&lt;br /&gt;
=== 0x2345678A Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Lower word programID&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Upper word programID&lt;br /&gt;
|-&lt;br /&gt;
| 2 &lt;br /&gt;
| ([[Mediatypes|Mediatype]] &amp;amp; 0xFF) | (uninitialized_data? &amp;amp; 0xFFFFFF00)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Number of something? Hardcoded per-archive, 0 for ExeFS, 200 for area:, 100 for rate:, 40 for eula:, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 for NCCH data, 1 for savedata. The latter is only valid for FSPXI. Value 2 is allowed via archive 0x3, it&#039;s unknown what this is.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TMD content index / NCSD partition index.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Type: 0=romfs(0 for non-NCCH as well), 1=exefs &amp;quot;.code&amp;quot;(?), 2=exefs &amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;, 3=unknown, 4=unknown, 5=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| Filename for ExeFS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 0x14-byte lowpath is all-zero for accessing the title&#039;s main RomFS.&lt;br /&gt;
&lt;br /&gt;
=== [[RomFS]] ===&lt;br /&gt;
&lt;br /&gt;
Archives 0x3 and 0x2345678E both allow for accessing the [[RomFS#Level_3_Format|level-3 IVFC images]] for RomFS access. The main CXI RomFS is accessible via an all-zero 0xc-byte binary file-lowpath. The update RomFS can be accessed with the first u32 in the binary file-lowpath being set to 0x5. The user must handle parsing the filesystem used in the exposed image itself.&lt;br /&gt;
&lt;br /&gt;
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.&lt;br /&gt;
&lt;br /&gt;
The 0x3 archive is an interface for the 0x2345678E archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678E-archive file_lowpath+0, with the rest of that lowpath set to all-zero(lowpath is different from archive 0x2345678A). File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| See above. The only values which FS-module doesn&#039;t allow to be used here are:&lt;br /&gt;
* 0x1: Error 0xE0E046BE.&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module executes svcBreak when using this.&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| See above. Not validated by FS-module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=SEEDDB=&lt;br /&gt;
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.&lt;br /&gt;
&lt;br /&gt;
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
&lt;br /&gt;
= Common Types =&lt;br /&gt;
== MediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Game Card&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemMediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| CTR NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TWL NAND&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| TWL Photo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Read&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Write&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Create&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Hidden&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Read-Only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WriteOption ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Flush&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update Time Stamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DirectoryEntry ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x20C&lt;br /&gt;
| UTF-16 Entry Name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C&lt;br /&gt;
| 0xA&lt;br /&gt;
| 8.3 short filename name&lt;br /&gt;
|-&lt;br /&gt;
| 0x216&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8.3 short filename extension&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x21B&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x21C&lt;br /&gt;
| 0x4&lt;br /&gt;
| [[Filesystem_services#Attributes|Attributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x220&lt;br /&gt;
| 0x8&lt;br /&gt;
| Entry Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArchiveResource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sector byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Cluster byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Partition capacity in clusters&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Available free space in clusters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProgramInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProductInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| Product Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Company Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Remaster Version&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IntegrityVerificationSeed ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x120&lt;br /&gt;
|  The [[nand/private/movable.sed]], encrypted with AES-CBC using the above MAC for the counter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SecureValueSlot ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SD Application&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBaudRate ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 512KHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 1MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 2MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 4MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 16MHz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBusMode ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 1-bit&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 4-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SpecialContentType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Manual&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| DLP Child&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceMoveContext ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  IVs&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Encrypt Parameter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Filesystem_services_PXI]].&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22307</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22307"/>
		<updated>2023-08-17T12:21:15Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Services =&lt;br /&gt;
== Filesystem service &amp;quot;fs:USER&amp;quot; ==&lt;br /&gt;
You can at most have 32 FS archive handles.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version &lt;br /&gt;
!  Description&lt;br /&gt;
!   scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; | Required [[NCCH/Extended_Header|exheader]] access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Dummy1|Dummy1]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Control|Control]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Initialize|Initialize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080201C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFile|OpenFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030204&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFileDirectly|OpenFileDirectly]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteFile|DeleteFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameFile|RenameFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectory|DeleteDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectoryRecursively|DeleteDirectoryRecursively]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080202&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateFile|CreateFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateDirectory|CreateDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameDirectory|RenameDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenDirectory|OpenDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenArchive|OpenArchive]]&lt;br /&gt;
| Each archive ID code has separate access info bitmasks, if it has any&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0144&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ControlArchive|ControlArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CloseArchive|CloseArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatThisUserSaveData|Obsoleted_2_0_FormatThisUserSaveData]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100200&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSystemSaveData|Obsoleted_3_0_CreateSystemSaveData]]&lt;br /&gt;
| 0x4, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSystemSaveData|Obsoleted_3_0_DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFreeBytes|GetFreeBytes]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetCardType|GetCardType]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcArchiveResource|GetSdmcArchiveResource]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandArchiveResource|GetNandArchiveResource]]&lt;br /&gt;
| 0x1007&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcFatfsError|GetSdmcFatfsError]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcDetected|IsSdmcDetected]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcWritable|IsSdmcWritable]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCid|GetSdmcCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandCid|GetNandCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcSpeedInfo|GetSdmcSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandSpeedInfo|GetNandSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcLog|GetSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandLog|GetNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearSdmcLog|ClearSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearNandLog|ClearNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotIsInserted|CardSlotIsInserted]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOn|CardSlotPowerOn]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOff|CardSlotPowerOff]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotGetCardIFPowerStatus|CardSlotGetCardIFPowerStatus]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommand|CardNorDirectCommand]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommandWithAddress|CardNorDirectCommandWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead|CardNorDirectRead]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectReadWithAddress|CardNorDirectReadWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWrite|CardNorDirectWrite]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082A00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWriteWithAddress|CardNorDirectWriteWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead_4xIO|CardNorDirectRead_4xIO]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082C0082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCpuWriteWithoutVerify|CardNorDirectCpuWriteWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082D0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectSectorEraseWithoutVerify|CardNorDirectSectorEraseWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082E0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProductInfo|GetProductInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x082F0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08300182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateExtSaveData|Obsoleted_3_0_CreateExtSaveData]]&lt;br /&gt;
| 0xC, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08310180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSharedExtSaveData|Obsoleted_3_0_CreateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08320102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_ReadExtSaveDataIcon|Obsoleted_3_0_ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08330082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateExtSaveData|Obsoleted_3_0_EnumerateExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08340082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateSharedExtSaveData|Obsoleted_3_0_EnumerateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08350080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteExtSaveData|Obsoleted_3_0_DeleteExtSaveData]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08360080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSharedExtSaveData|Obsoleted_3_0_DeleteSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08370040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBaudRate|SetCardSpiBaudRate]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08380040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBusMode|SetCardSpiBusMode]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08390000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SendInitializeInfoTo9|SendInitializeInfoTo9]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083A0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialContentIndex|GetSpecialContentIndex]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x083B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader|GetLegacyRomHeader]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyBannerData|GetLegacyBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083D0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CheckAuthorityToAccessExtSaveData|CheckAuthorityToAccessExtSaveData]]&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x083E00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:QueryTotalQuotaSize|QueryTotalQuotaSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083F00C0&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_GetExtDataBlockSize|Obsoleted_3_0_GetExtDataBlockSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08400040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:AbnegateAccessRight|AbnegateAccessRight]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08410000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteSdmcRoot|DeleteSdmcRoot]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08420040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteAllExtSaveDataOnNand|DeleteAllExtSaveDataOnNand]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08430000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:InitializeCtrFileSystem|InitializeCtrFileSystem]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08440000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateSeed|CreateSeed]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x084500C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFormatInfo|GetFormatInfo]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08460102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader2|GetLegacyRomHeader2]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x08470180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatCtrCardUserSaveData|Obsoleted_2_0_FormatCtrCardUserSaveData]]&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x08480042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCtrRootPath|GetSdmcCtrRootPath]]&lt;br /&gt;
| 0x100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08490040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetArchiveResource|GetArchiveResource]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x084A0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ExportIntegrityVerificationSeed|ExportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084B0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ImportIntegrityVerificationSeed|ImportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084C0242&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatSaveData|FormatSaveData]]&lt;br /&gt;
| 0x6, in some cases this write isn&#039;t needed however&lt;br /&gt;
|-&lt;br /&gt;
| 0x084D0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacySubBannerData|GetLegacySubBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x084E0342&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:UpdateSha256Context|UpdateSha256Context]]&lt;br /&gt;
| 0x5&lt;br /&gt;
|-&lt;br /&gt;
| 0x084F0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ReadSpecialFile|ReadSpecialFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08500040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialFileSize|GetSpecialFileSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08510242&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateExtSaveData|CreateExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x08520100&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteExtSaveData|DeleteExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0x10100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08530142&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ReadExtSaveDataIcon|ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x085400C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetExtDataBlockSize|GetExtDataBlockSize]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08550102&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateExtSaveData|EnumerateExtSaveData]]&lt;br /&gt;
| 0x101005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08560240&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]&lt;br /&gt;
| 0x4 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08570080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteSystemSaveData|DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08580000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsSource|StartDeviceMoveAsSource]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08590200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsDestination|StartDeviceMoveAsDestination]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x085A00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetArchivePriority|SetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085B0080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetArchivePriority|GetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085C00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetCtrCardLatencyParameter|SetCtrCardLatencyParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085D01C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetFsCompatibilityInfo|SetFsCompatibilityInfo]]&lt;br /&gt;
| 0x100001&lt;br /&gt;
|-&lt;br /&gt;
| 0x085E0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ResetCardCompatibilityParameter|ResetCardCompatibilityParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085F0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SwitchCleanupInvalidSaveData|SwitchCleanupInvalidSaveData]]&lt;br /&gt;
| 0x12004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08600042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateSystemSaveData|EnumerateSystemSaveData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08610042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:InitializeWithSdkVersion|InitializeWithSdkVersion]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08620040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetPriority|SetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08630000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetPriority|GetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08640000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandInfo|Obsoleted_4_0_GetNandInfo]]&lt;br /&gt;
| Stubbed, this returns an error&lt;br /&gt;
|-&lt;br /&gt;
| 0x08650140&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:SetSaveDataSecureValue|SetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086600C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetSaveDataSecureValue|GetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086700C4&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ControlSecureSave|ControlSecureSave]]&lt;br /&gt;
| 0x121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08680000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetMediaType|GetMediaType]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08690000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandEraseCount|Obsoleted_4_0_GetNandEraseCount]]&lt;br /&gt;
| Stubbed, this returns an error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x086A0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ReadNandReport|ReadNandReport]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086B00C2&lt;br /&gt;
|?&lt;br /&gt;
|SetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086C00C2&lt;br /&gt;
|?&lt;br /&gt;
|GetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086D0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00020004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086E00C0&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|SetThisSaveDataSecureValue&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x086F0040&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|GetThisSaveDataSecureValue&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x087000C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08710100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x087201C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x087300C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08740000&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08750140&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087600C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08770100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087800C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087900C2&lt;br /&gt;
| ?&lt;br /&gt;
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.&lt;br /&gt;
| 0x00101015&lt;br /&gt;
|-&lt;br /&gt;
| 0x087A0180&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| [[FS:AddSeed|AddSeed]]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087B....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Wrapper for the code internally used for command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087C....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087D0000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| GetNumSeeds. Writes the number of seeds to cmdreply[2]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087E0042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12), outbufptr)&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087F....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0880....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0881....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0882....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08830000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an output value to cmdreply[2].&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08840042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0885....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x088600C0&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]&lt;br /&gt;
| 0x00080000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The question marks from Dummy1 to GetSpecialFileSize on the &amp;quot;available since system version&amp;quot; field are mainly there because I think that most of these are necessary for the main system to function, so theoretically that would mean that since the creation of the 3DS these were available, or since launch if that makes more sense. But because of the peculiar nature of some of the functions, they will remain question marks until they can be confirmed 100%.&lt;br /&gt;
&lt;br /&gt;
When access rights are required for a command, at least one of the bits in the process access info specified in the above table for the command must be set. Error 0xD9004676 is returned when a process attempts to use a command which it doesn&#039;t have access rights for the command. The exheader access info field is all zero&#039;s for most applications. Note that the permissions listed in the above table is for system-version v2.x, therefore permission bit(s) added with newer FIRM may be missing from this.&lt;br /&gt;
&lt;br /&gt;
Each session for fs:USER has separate permissions, initially these are set to all zero&#039;s for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).&lt;br /&gt;
&lt;br /&gt;
== Filesystem service &amp;quot;fs:LDR&amp;quot; ==&lt;br /&gt;
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.&lt;br /&gt;
&lt;br /&gt;
== ProgramRegistry service &amp;quot;fs:REG&amp;quot; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSReg:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040103C0&lt;br /&gt;
| [[FSReg:Register|Register]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[FSReg:Unregister|Unregister]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040300C0&lt;br /&gt;
| [[FSReg:GetProgramInfo|GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040100&lt;br /&gt;
| [[FSReg:LoadProgram|LoadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050080&lt;br /&gt;
| [[FSReg:UnloadProgram|UnloadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060080&lt;br /&gt;
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.&lt;br /&gt;
&lt;br /&gt;
=File and directory access=&lt;br /&gt;
==Files==&lt;br /&gt;
File session handles obtained via [[FS:OpenFile]] and [[FS:OpenFileDirectly]] can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]]. To use this service-like interface, simply call SendSyncRequest with a file session handle, using the IPC buffer in thread-local storage, just like you would with a proper service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSFile:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[FSFile:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| [[FSFile:OpenSubFile|OpenSubFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| [[FSFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| [[FSFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| [[FSFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| [[FSFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| [[FSFile:GetAttributes|GetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070040&lt;br /&gt;
| [[FSFile:SetAttributes|SetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[FSFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| [[FSFile:Flush|Flush]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0040&lt;br /&gt;
| [[FSFile:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| [[FSFile:GetPriority|GetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| [[FSFile:OpenLinkFile|OpenLinkFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C010100&lt;br /&gt;
| [[FSFile:GetAvailable|GetAvailable]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Directories==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030040&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:GetPriority|GetPriority]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Archives =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ArchiveId&lt;br /&gt;
!  Description&lt;br /&gt;
!  Accessible via [[Filesystem_services|FS]]&lt;br /&gt;
!  Accessible via [[Filesystem_services_PXI|FSPXI]]&lt;br /&gt;
!  Only accessible by Process9 internally&lt;br /&gt;
!  Requires binary [[FS:OpenFile|Lowpath]]&lt;br /&gt;
!  Required exheader FS access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000003&lt;br /&gt;
| SelfNCCH (including [[#RomFS|RomFS]])&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000004&lt;br /&gt;
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process&#039; exheader)&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000006&lt;br /&gt;
| ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x100D, when the input extdataID isn&#039;t listed in the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000007&lt;br /&gt;
| Shared ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000008&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x4, when the input saveID doesn&#039;t match the exheader system-saveID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000009&lt;br /&gt;
| SDMC&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x8E&lt;br /&gt;
|-&lt;br /&gt;
| 0x0000000A&lt;br /&gt;
| SDMC Write-Only&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x808E&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345678&lt;br /&gt;
| ExtSaveData for BOSS&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345679&lt;br /&gt;
| CARD SPI FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x16&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567B&lt;br /&gt;
| ExtSaveData, and ExtSaveData for BOSS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567C&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567D&lt;br /&gt;
| NAND RW&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x800&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567E&lt;br /&gt;
| NAND RO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567F&lt;br /&gt;
| NAND RO Write FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345680&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345681&lt;br /&gt;
| Unknown. Accessed by FS service.&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345682&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678A&lt;br /&gt;
| Used for accessing general NCCH data. With FSPXI this also allows savedata access.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678B&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678C&lt;br /&gt;
| Used internally to access [[Title_Database|/dbs]] files?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678D&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678E&lt;br /&gt;
| FSPXI: Similar to archive 0x2345678A. For fs:LDR(used by the &amp;quot;loader&amp;quot; FIRM ARM11-process), only ExeFS. Not accessible with fs:USER.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None, see description.&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AB&lt;br /&gt;
| NAND CTR FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AC&lt;br /&gt;
| TWL PHOTO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AD&lt;br /&gt;
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AE&lt;br /&gt;
| NAND TWL FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AF&lt;br /&gt;
| NAND W FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B0&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B1&lt;br /&gt;
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B2&lt;br /&gt;
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B4&lt;br /&gt;
| Similar to 0x567890B2 but can only access Accessible Save specified in [[NCCH/Extended_Header#Storage_Info|exheader]]?&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].&lt;br /&gt;
&lt;br /&gt;
The above permission bitmasks are from v2.x, see the above Services section for how these are handled.&lt;br /&gt;
&lt;br /&gt;
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process&#039; exheader accessinfo.&lt;br /&gt;
&lt;br /&gt;
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka &amp;quot;cardspi:/&amp;quot; in [[FIRM|Process9]]), the file lowpath must be WCHAR &amp;quot;/&amp;quot;. The &amp;quot;NAND W FS&amp;quot; archive allows access to the raw NAND image(aka &amp;quot;wnand:/&amp;quot; in Process9), the file lowpath must be WCHAR &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Filenames and Paths =&lt;br /&gt;
PathType:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| Returned internally by Process9, when errors occur it seems(in particular when no nul-terminator was found in the input path). The data ptr is set to NULL.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| INVALID - Specifies an invalid path&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| EMPTY - Specifies an empty path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| BINARY - Non-text based path. Meaning is per-archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| UTF16 - Text-based path with UTF-16 characters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In IPC requests, sizes of ASCII and UTF16 paths must include space for the null-terminator. &lt;br /&gt;
&lt;br /&gt;
== Binary LowPath ==&lt;br /&gt;
The format of the data that a binary LowPath points to is custom per archive.&lt;br /&gt;
&lt;br /&gt;
=== SelfNCCH File Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| Type:&lt;br /&gt;
* 0x0: RomFS&lt;br /&gt;
* 0x1: error 0xD9004676&lt;br /&gt;
* 0x2: ExeFS&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module crashes on this&lt;br /&gt;
* 0x5: Update RomFS?&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| File name for ExeFS (&amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;). &amp;quot;.code&amp;quot; is not allowed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that ExeFS files only support reading from offset=0 and with size=file_size. &lt;br /&gt;
&lt;br /&gt;
=== SystemSaveData Archive Path Data Format ===&lt;br /&gt;
==== FS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
==== FSPXI ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|}&lt;br /&gt;
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.&lt;br /&gt;
&lt;br /&gt;
=== UserSaveDataForCheck Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be non-zero)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
=== 0x567890B4 Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Lower_word_saveid &amp;gt;&amp;gt; 8&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown. Game calculate this using formula &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;0xFFFFFF00 | unknown_b&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ExtSaveData Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the &amp;quot;/extdata/&amp;lt;ExtdataIDHigh&amp;gt;/&amp;lt;ExtdataIDLow&amp;gt;&amp;quot; directory on SD/NAND, for the cleartext extdata image to mount.&lt;br /&gt;
&lt;br /&gt;
=== 0x2345678A Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Lower word programID&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Upper word programID&lt;br /&gt;
|-&lt;br /&gt;
| 2 &lt;br /&gt;
| ([[Mediatypes|Mediatype]] &amp;amp; 0xFF) | (uninitialized_data? &amp;amp; 0xFFFFFF00)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Number of something? Hardcoded per-archive, 0 for ExeFS, 200 for area:, 100 for rate:, 40 for eula:, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 for NCCH data, 1 for savedata. The latter is only valid for FSPXI. Value 2 is allowed via archive 0x3, it&#039;s unknown what this is.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TMD content index / NCSD partition index.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Type: 0=romfs(0 for non-NCCH as well), 1=exefs &amp;quot;.code&amp;quot;(?), 2=exefs &amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;, 3=unknown, 4=unknown, 5=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| Filename for ExeFS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 0x14-byte lowpath is all-zero for accessing the title&#039;s main RomFS.&lt;br /&gt;
&lt;br /&gt;
=== [[RomFS]] ===&lt;br /&gt;
&lt;br /&gt;
Archives 0x3 and 0x2345678E both allow for accessing the [[RomFS#Level_3_Format|level-3 IVFC images]] for RomFS access. The main CXI RomFS is accessible via an all-zero 0xc-byte binary file-lowpath. The update RomFS can be accessed with the first u32 in the binary file-lowpath being set to 0x5. The user must handle parsing the filesystem used in the exposed image itself.&lt;br /&gt;
&lt;br /&gt;
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.&lt;br /&gt;
&lt;br /&gt;
The 0x3 archive is an interface for the 0x2345678E archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678E-archive file_lowpath+0, with the rest of that lowpath set to all-zero(lowpath is different from archive 0x2345678A). File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| See above. The only values which FS-module doesn&#039;t allow to be used here are:&lt;br /&gt;
* 0x1: Error 0xE0E046BE.&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module executes svcBreak when using this.&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| See above. Not validated by FS-module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=SEEDDB=&lt;br /&gt;
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.&lt;br /&gt;
&lt;br /&gt;
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
&lt;br /&gt;
= Common Types =&lt;br /&gt;
== MediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Game Card&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemMediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| CTR NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TWL NAND&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| TWL Photo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Read&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Write&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Create&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Hidden&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Read-Only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WriteOption ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Flush&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update Time Stamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DirectoryEntry ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x20C&lt;br /&gt;
| UTF-16 Entry Name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C&lt;br /&gt;
| 0xA&lt;br /&gt;
| 8.3 short filename name&lt;br /&gt;
|-&lt;br /&gt;
| 0x216&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8.3 short filename extension&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x21B&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x21C&lt;br /&gt;
| 0x4&lt;br /&gt;
| [[Filesystem_services#Attributes|Attributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x220&lt;br /&gt;
| 0x8&lt;br /&gt;
| Entry Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArchiveResource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sector byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Cluster byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Partition capacity in clusters&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Available free space in clusters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProgramInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProductInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| Product Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Company Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Remaster Version&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IntegrityVerificationSeed ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x120&lt;br /&gt;
|  The [[nand/private/movable.sed]], encrypted with AES-CBC using the above MAC for the counter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SecureValueSlot ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SD Application&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBaudRate ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 512KHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 1MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 2MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 4MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 16MHz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBusMode ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 1-bit&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 4-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SpecialContentType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Manual&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| DLP Child&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceMoveContext ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  IVs&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Encrypt Parameter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Filesystem_services_PXI]].&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22306</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=22306"/>
		<updated>2023-08-17T12:20:44Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* File and directory access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Services =&lt;br /&gt;
== Filesystem service &amp;quot;fs:USER&amp;quot; ==&lt;br /&gt;
You can at most have 32 FS archive handles.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version &lt;br /&gt;
!  Description&lt;br /&gt;
!   scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; | Required [[NCCH/Extended_Header|exheader]] access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Dummy1|Dummy1]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Control|Control]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Initialize|Initialize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080201C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFile|OpenFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030204&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFileDirectly|OpenFileDirectly]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteFile|DeleteFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameFile|RenameFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectory|DeleteDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectoryRecursively|DeleteDirectoryRecursively]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080202&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateFile|CreateFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateDirectory|CreateDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameDirectory|RenameDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenDirectory|OpenDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenArchive|OpenArchive]]&lt;br /&gt;
| Each archive ID code has separate access info bitmasks, if it has any&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0144&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ControlArchive|ControlArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CloseArchive|CloseArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatThisUserSaveData|Obsoleted_2_0_FormatThisUserSaveData]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100200&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSystemSaveData|Obsoleted_3_0_CreateSystemSaveData]]&lt;br /&gt;
| 0x4, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSystemSaveData|Obsoleted_3_0_DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFreeBytes|GetFreeBytes]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetCardType|GetCardType]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcArchiveResource|GetSdmcArchiveResource]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandArchiveResource|GetNandArchiveResource]]&lt;br /&gt;
| 0x1007&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcFatfsError|GetSdmcFatfsError]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcDetected|IsSdmcDetected]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcWritable|IsSdmcWritable]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCid|GetSdmcCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandCid|GetNandCid]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcSpeedInfo|GetSdmcSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandSpeedInfo|GetNandSpeedInfo]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcLog|GetSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandLog|GetNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearSdmcLog|ClearSdmcLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ClearNandLog|ClearNandLog]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotIsInserted|CardSlotIsInserted]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOn|CardSlotPowerOn]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotPowerOff|CardSlotPowerOff]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotGetCardIFPowerStatus|CardSlotGetCardIFPowerStatus]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommand|CardNorDirectCommand]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCommandWithAddress|CardNorDirectCommandWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead|CardNorDirectRead]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectReadWithAddress|CardNorDirectReadWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWrite|CardNorDirectWrite]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082A00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectWriteWithAddress|CardNorDirectWriteWithAddress]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectRead_4xIO|CardNorDirectRead_4xIO]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082C0082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectCpuWriteWithoutVerify|CardNorDirectCpuWriteWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082D0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardNorDirectSectorEraseWithoutVerify|CardNorDirectSectorEraseWithoutVerify]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082E0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProductInfo|GetProductInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x082F0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08300182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateExtSaveData|Obsoleted_3_0_CreateExtSaveData]]&lt;br /&gt;
| 0xC, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08310180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_CreateSharedExtSaveData|Obsoleted_3_0_CreateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08320102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_ReadExtSaveDataIcon|Obsoleted_3_0_ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08330082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateExtSaveData|Obsoleted_3_0_EnumerateExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08340082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_EnumerateSharedExtSaveData|Obsoleted_3_0_EnumerateSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08350080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteExtSaveData|Obsoleted_3_0_DeleteExtSaveData]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08360080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_DeleteSharedExtSaveData|Obsoleted_3_0_DeleteSharedExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08370040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBaudRate|SetCardSpiBaudRate]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08380040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SetCardSpiBusMode|SetCardSpiBusMode]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08390000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:SendInitializeInfoTo9|SendInitializeInfoTo9]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083A0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialContentIndex|GetSpecialContentIndex]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x083B00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader|GetLegacyRomHeader]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyBannerData|GetLegacyBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083D0100&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CheckAuthorityToAccessExtSaveData|CheckAuthorityToAccessExtSaveData]]&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x083E00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:QueryTotalQuotaSize|QueryTotalQuotaSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083F00C0&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_3_0_GetExtDataBlockSize|Obsoleted_3_0_GetExtDataBlockSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08400040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:AbnegateAccessRight|AbnegateAccessRight]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08410000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteSdmcRoot|DeleteSdmcRoot]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08420040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteAllExtSaveDataOnNand|DeleteAllExtSaveDataOnNand]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08430000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:InitializeCtrFileSystem|InitializeCtrFileSystem]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08440000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateSeed|CreateSeed]]&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x084500C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFormatInfo|GetFormatInfo]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08460102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacyRomHeader2|GetLegacyRomHeader2]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x08470180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Obsoleted_2_0_FormatCtrCardUserSaveData|Obsoleted_2_0_FormatCtrCardUserSaveData]]&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x08480042&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcCtrRootPath|GetSdmcCtrRootPath]]&lt;br /&gt;
| 0x100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08490040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetArchiveResource|GetArchiveResource]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x084A0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ExportIntegrityVerificationSeed|ExportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084B0002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ImportIntegrityVerificationSeed|ImportIntegrityVerificationSeed]]&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084C0242&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatSaveData|FormatSaveData]]&lt;br /&gt;
| 0x6, in some cases this write isn&#039;t needed however&lt;br /&gt;
|-&lt;br /&gt;
| 0x084D0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetLegacySubBannerData|GetLegacySubBannerData]]&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x084E0342&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:UpdateSha256Context|UpdateSha256Context]]&lt;br /&gt;
| 0x5&lt;br /&gt;
|-&lt;br /&gt;
| 0x084F0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ReadSpecialFile|ReadSpecialFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08500040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSpecialFileSize|GetSpecialFileSize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08510242&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateExtSaveData|CreateExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x08520100&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteExtSaveData|DeleteExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0x10100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08530142&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ReadExtSaveDataIcon|ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x085400C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetExtDataBlockSize|GetExtDataBlockSize]]&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08550102&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateExtSaveData|EnumerateExtSaveData]]&lt;br /&gt;
| 0x101005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08560240&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]&lt;br /&gt;
| 0x4 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08570080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:DeleteSystemSaveData|DeleteSystemSaveData]]&lt;br /&gt;
| 0x1004 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08580000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsSource|StartDeviceMoveAsSource]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08590200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:StartDeviceMoveAsDestination|StartDeviceMoveAsDestination]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x085A00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetArchivePriority|SetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085B0080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetArchivePriority|GetArchivePriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085C00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetCtrCardLatencyParameter|SetCtrCardLatencyParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085D01C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetFsCompatibilityInfo|SetFsCompatibilityInfo]]&lt;br /&gt;
| 0x100001&lt;br /&gt;
|-&lt;br /&gt;
| 0x085E0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:ResetCardCompatibilityParameter|ResetCardCompatibilityParameter]]&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085F0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SwitchCleanupInvalidSaveData|SwitchCleanupInvalidSaveData]]&lt;br /&gt;
| 0x12004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08600042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateSystemSaveData|EnumerateSystemSaveData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08610042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:InitializeWithSdkVersion|InitializeWithSdkVersion]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08620040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:SetPriority|SetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08630000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetPriority|GetPriority]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08640000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandInfo|Obsoleted_4_0_GetNandInfo]]&lt;br /&gt;
| Stubbed, this returns an error&lt;br /&gt;
|-&lt;br /&gt;
| 0x08650140&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:SetSaveDataSecureValue|SetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086600C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetSaveDataSecureValue|GetSaveDataSecureValue]]&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086700C4&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ControlSecureSave|ControlSecureSave]]&lt;br /&gt;
| 0x121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08680000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:GetMediaType|GetMediaType]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08690000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:Obsoleted_4_0_GetNandEraseCount|Obsoleted_4_0_GetNandEraseCount]]&lt;br /&gt;
| Stubbed, this returns an error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x086A0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[FS:ReadNandReport|ReadNandReport]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086B00C2&lt;br /&gt;
|?&lt;br /&gt;
|SetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086C00C2&lt;br /&gt;
|?&lt;br /&gt;
|GetOtherSaveDataSecureValue&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086D0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00020004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086E00C0&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|SetThisSaveDataSecureValue&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x086F0040&lt;br /&gt;
|Related to Secure Value? Used in Pokemon Sun/Moon.&lt;br /&gt;
|GetThisSaveDataSecureValue&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x087000C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08710100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x087201C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x087300C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08740000&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08750140&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087600C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08770100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087800C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087900C2&lt;br /&gt;
| ?&lt;br /&gt;
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.&lt;br /&gt;
| 0x00101015&lt;br /&gt;
|-&lt;br /&gt;
| 0x087A0180&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| [[FS:AddSeed|AddSeed]]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087B....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Wrapper for the code internally used for command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087C....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087D0000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| GetNumSeeds. Writes the number of seeds to cmdreply[2]&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087E0042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12), outbufptr)&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087F....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0880....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0881....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0882....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08830000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an output value to cmdreply[2].&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08840042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0885....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x088600C0&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]&lt;br /&gt;
| 0x00080000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The question marks from Dummy1 to GetSpecialFileSize on the &amp;quot;available since system version&amp;quot; field are mainly there because I think that most of these are necessary for the main system to function, so theoretically that would mean that since the creation of the 3DS these were available, or since launch if that makes more sense. But because of the peculiar nature of some of the functions, they will remain question marks until they can be confirmed 100%.&lt;br /&gt;
&lt;br /&gt;
When access rights are required for a command, at least one of the bits in the process access info specified in the above table for the command must be set. Error 0xD9004676 is returned when a process attempts to use a command which it doesn&#039;t have access rights for the command. The exheader access info field is all zero&#039;s for most applications. Note that the permissions listed in the above table is for system-version v2.x, therefore permission bit(s) added with newer FIRM may be missing from this.&lt;br /&gt;
&lt;br /&gt;
Each session for fs:USER has separate permissions, initially these are set to all zero&#039;s for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).&lt;br /&gt;
&lt;br /&gt;
== Filesystem service &amp;quot;fs:LDR&amp;quot; ==&lt;br /&gt;
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.&lt;br /&gt;
&lt;br /&gt;
== ProgramRegistry service &amp;quot;fs:REG&amp;quot; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSReg:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040103C0&lt;br /&gt;
| [[FSReg:Register|Register]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[FSReg:Unregister|Unregister]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040300C0&lt;br /&gt;
| [[FSReg:GetProgramInfo|GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040100&lt;br /&gt;
| [[FSReg:LoadProgram|LoadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050080&lt;br /&gt;
| [[FSReg:UnloadProgram|UnloadProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060080&lt;br /&gt;
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.&lt;br /&gt;
&lt;br /&gt;
=File and directory access=&lt;br /&gt;
==Files==&lt;br /&gt;
File session handles obtained via [[FS:OpenFile]] and [[FS:OpenFileDirectly]] et al can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]]. To use this service-like interface, simply call SendSyncRequest with a file session handle, using the IPC buffer in thread-local storage, just like you would with a proper service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[FSFile:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[FSFile:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| [[FSFile:OpenSubFile|OpenSubFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| [[FSFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| [[FSFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| [[FSFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| [[FSFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| [[FSFile:GetAttributes|GetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070040&lt;br /&gt;
| [[FSFile:SetAttributes|SetAttributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[FSFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| [[FSFile:Flush|Flush]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0040&lt;br /&gt;
| [[FSFile:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| [[FSFile:GetPriority|GetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| [[FSFile:OpenLinkFile|OpenLinkFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C010100&lt;br /&gt;
| [[FSFile:GetAvailable|GetAvailable]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Directories==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Dummy1|Dummy1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Control|Control]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030040&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:SetPriority|SetPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| ?&lt;br /&gt;
| [[FSDir:GetPriority|GetPriority]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Archives =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ArchiveId&lt;br /&gt;
!  Description&lt;br /&gt;
!  Accessible via [[Filesystem_services|FS]]&lt;br /&gt;
!  Accessible via [[Filesystem_services_PXI|FSPXI]]&lt;br /&gt;
!  Only accessible by Process9 internally&lt;br /&gt;
!  Requires binary [[FS:OpenFile|Lowpath]]&lt;br /&gt;
!  Required exheader FS access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000003&lt;br /&gt;
| SelfNCCH (including [[#RomFS|RomFS]])&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000004&lt;br /&gt;
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process&#039; exheader)&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000006&lt;br /&gt;
| ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x100D, when the input extdataID isn&#039;t listed in the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000007&lt;br /&gt;
| Shared ExtSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000008&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x4, when the input saveID doesn&#039;t match the exheader system-saveID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000009&lt;br /&gt;
| SDMC&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x8E&lt;br /&gt;
|-&lt;br /&gt;
| 0x0000000A&lt;br /&gt;
| SDMC Write-Only&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x808E&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345678&lt;br /&gt;
| ExtSaveData for BOSS&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345679&lt;br /&gt;
| CARD SPI FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x16&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567B&lt;br /&gt;
| ExtSaveData, and ExtSaveData for BOSS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567C&lt;br /&gt;
| SystemSaveData&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567D&lt;br /&gt;
| NAND RW&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x800&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567E&lt;br /&gt;
| NAND RO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| 0x1234567F&lt;br /&gt;
| NAND RO Write FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345680&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345681&lt;br /&gt;
| Unknown. Accessed by FS service.&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x12345682&lt;br /&gt;
| Unknown. There&#039;s code for this in spider v9.9, but that code isn&#039;t actually used.&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678A&lt;br /&gt;
| Used for accessing general NCCH data. With FSPXI this also allows savedata access.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678B&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678C&lt;br /&gt;
| Used internally to access [[Title_Database|/dbs]] files?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678D&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x2345678E&lt;br /&gt;
| FSPXI: Similar to archive 0x2345678A. For fs:LDR(used by the &amp;quot;loader&amp;quot; FIRM ARM11-process), only ExeFS. Not accessible with fs:USER.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| None, see description.&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AB&lt;br /&gt;
| NAND CTR FS&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AC&lt;br /&gt;
| TWL PHOTO&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AD&lt;br /&gt;
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AE&lt;br /&gt;
| NAND TWL FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890AF&lt;br /&gt;
| NAND W FS&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B0&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B1&lt;br /&gt;
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B2&lt;br /&gt;
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x567890B4&lt;br /&gt;
| Similar to 0x567890B2 but can only access Accessible Save specified in [[NCCH/Extended_Header#Storage_Info|exheader]]?&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].&lt;br /&gt;
&lt;br /&gt;
The above permission bitmasks are from v2.x, see the above Services section for how these are handled.&lt;br /&gt;
&lt;br /&gt;
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process&#039; exheader accessinfo.&lt;br /&gt;
&lt;br /&gt;
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka &amp;quot;cardspi:/&amp;quot; in [[FIRM|Process9]]), the file lowpath must be WCHAR &amp;quot;/&amp;quot;. The &amp;quot;NAND W FS&amp;quot; archive allows access to the raw NAND image(aka &amp;quot;wnand:/&amp;quot; in Process9), the file lowpath must be WCHAR &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Filenames and Paths =&lt;br /&gt;
PathType:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| Returned internally by Process9, when errors occur it seems(in particular when no nul-terminator was found in the input path). The data ptr is set to NULL.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| INVALID - Specifies an invalid path&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| EMPTY - Specifies an empty path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| BINARY - Non-text based path. Meaning is per-archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| UTF16 - Text-based path with UTF-16 characters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In IPC requests, sizes of ASCII and UTF16 paths must include space for the null-terminator. &lt;br /&gt;
&lt;br /&gt;
== Binary LowPath ==&lt;br /&gt;
The format of the data that a binary LowPath points to is custom per archive.&lt;br /&gt;
&lt;br /&gt;
=== SelfNCCH File Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| Type:&lt;br /&gt;
* 0x0: RomFS&lt;br /&gt;
* 0x1: error 0xD9004676&lt;br /&gt;
* 0x2: ExeFS&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module crashes on this&lt;br /&gt;
* 0x5: Update RomFS?&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| File name for ExeFS (&amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;). &amp;quot;.code&amp;quot; is not allowed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that ExeFS files only support reading from offset=0 and with size=file_size. &lt;br /&gt;
&lt;br /&gt;
=== SystemSaveData Archive Path Data Format ===&lt;br /&gt;
==== FS ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
==== FSPXI ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)&lt;br /&gt;
|}&lt;br /&gt;
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.&lt;br /&gt;
&lt;br /&gt;
=== UserSaveDataForCheck Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]] (must be non-zero)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.&lt;br /&gt;
&lt;br /&gt;
=== 0x567890B4 Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Lower_word_saveid &amp;gt;&amp;gt; 8&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown. Game calculate this using formula &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;0xFFFFFF00 | unknown_b&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ExtSaveData Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
| [[Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Lower word saveid&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Upper word saveid&lt;br /&gt;
|}&lt;br /&gt;
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the &amp;quot;/extdata/&amp;lt;ExtdataIDHigh&amp;gt;/&amp;lt;ExtdataIDLow&amp;gt;&amp;quot; directory on SD/NAND, for the cleartext extdata image to mount.&lt;br /&gt;
&lt;br /&gt;
=== 0x2345678A Archive Path Data Format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Lower word programID&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Upper word programID&lt;br /&gt;
|-&lt;br /&gt;
| 2 &lt;br /&gt;
| ([[Mediatypes|Mediatype]] &amp;amp; 0xFF) | (uninitialized_data? &amp;amp; 0xFFFFFF00)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Number of something? Hardcoded per-archive, 0 for ExeFS, 200 for area:, 100 for rate:, 40 for eula:, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 for NCCH data, 1 for savedata. The latter is only valid for FSPXI. Value 2 is allowed via archive 0x3, it&#039;s unknown what this is.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TMD content index / NCSD partition index.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Type: 0=romfs(0 for non-NCCH as well), 1=exefs &amp;quot;.code&amp;quot;(?), 2=exefs &amp;quot;icon&amp;quot;/&amp;quot;banner&amp;quot;/&amp;quot;logo&amp;quot;, 3=unknown, 4=unknown, 5=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| Filename for ExeFS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 0x14-byte lowpath is all-zero for accessing the title&#039;s main RomFS.&lt;br /&gt;
&lt;br /&gt;
=== [[RomFS]] ===&lt;br /&gt;
&lt;br /&gt;
Archives 0x3 and 0x2345678E both allow for accessing the [[RomFS#Level_3_Format|level-3 IVFC images]] for RomFS access. The main CXI RomFS is accessible via an all-zero 0xc-byte binary file-lowpath. The update RomFS can be accessed with the first u32 in the binary file-lowpath being set to 0x5. The user must handle parsing the filesystem used in the exposed image itself.&lt;br /&gt;
&lt;br /&gt;
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.&lt;br /&gt;
&lt;br /&gt;
The 0x3 archive is an interface for the 0x2345678E archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678E-archive file_lowpath+0, with the rest of that lowpath set to all-zero(lowpath is different from archive 0x2345678A). File lowpath:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| See above. The only values which FS-module doesn&#039;t allow to be used here are:&lt;br /&gt;
* 0x1: Error 0xE0E046BE.&lt;br /&gt;
* 0x3: Error 0xE0E046BE.&lt;br /&gt;
* 0x4: FS-module executes svcBreak when using this.&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| See above. Not validated by FS-module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=SEEDDB=&lt;br /&gt;
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.&lt;br /&gt;
&lt;br /&gt;
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
&lt;br /&gt;
= Common Types =&lt;br /&gt;
== MediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Game Card&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemMediaType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| CTR NAND&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| TWL NAND&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SD&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| TWL Photo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Read&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Write&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Create&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Hidden&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Archive&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Is Read-Only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WriteOption ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Flush&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update Time Stamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DirectoryEntry ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x20C&lt;br /&gt;
| UTF-16 Entry Name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C&lt;br /&gt;
| 0xA&lt;br /&gt;
| 8.3 short filename name&lt;br /&gt;
|-&lt;br /&gt;
| 0x216&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8.3 short filename extension&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x21B&lt;br /&gt;
| 0x1&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x21C&lt;br /&gt;
| 0x4&lt;br /&gt;
| [[Filesystem_services#Attributes|Attributes]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x220&lt;br /&gt;
| 0x8&lt;br /&gt;
| Entry Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArchiveResource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sector byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Cluster byte-size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Partition capacity in clusters&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Available free space in clusters&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProgramInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProductInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| Product Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Company Code&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Remaster Version&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IntegrityVerificationSeed ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x120&lt;br /&gt;
|  The [[nand/private/movable.sed]], encrypted with AES-CBC using the above MAC for the counter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemSaveDataInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[Filesystem_services#MediaType|Media Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SecureValueSlot ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SD Application&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBaudRate ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 512KHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 1MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 2MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 4MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 8MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 16MHz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CardSpiBusMode ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 1-bit&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 4-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SpecialContentType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Manual&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| DLP Child&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceMoveContext ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x10&lt;br /&gt;
|  IVs&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Encrypt Parameter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Filesystem_services_PXI]].&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Cfg:SecureInfoGetRegion&amp;diff=22303</id>
		<title>Cfg:SecureInfoGetRegion</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Cfg:SecureInfoGetRegion&amp;diff=22303"/>
		<updated>2023-08-13T14:02:23Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00020000] (Alternate headers: &amp;quot;cfg:s&amp;quot;/&amp;quot;cfg:i&amp;quot; = 0x04060000, &amp;quot;cfg:i&amp;quot; = 0x08160000)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u8 region value loaded from [[Nandrw/sys/SecureInfo_A|SecureInfo]] offset 0x100, from the already-loaded SecureInfo buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In addition to the region lock enforced by Home Menu, some 3DS software will use this function to enforce additional region-lock in case you use an alternate launcher. As such, region spoofing is often necessary&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22302</id>
		<title>Multi-threading</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22302"/>
		<updated>2023-08-12T08:41:56Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Undo my derp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents all kernel functionality for managing multiple processes and threads as well as handling synchronization between them.&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
&lt;br /&gt;
Each process is given an array of [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capability descriptors]] upon creation (see CreateProcess). Official software forwards the descriptors specified in the [[NCCH#Extended_Header|NCCH exheader]].&lt;br /&gt;
&lt;br /&gt;
Any process can only use SVCs which are enabled in its kernel capability descriptors. This is enforced by the ARM11 kernel SVC handler by checking the syscall access control mask stored on the SVC-mode stack. If the SVC isn&#039;t enabled, a kernelpanic() is triggered. Each process has a separate SVC-mode stack; this stack and the syscall access mask stored here are initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of which is stored in the kernel capability descriptor. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current process.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateCodeSet ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Allocates memory for a process according to the given CodeSetInfo contents and copies the segment data from the given memory locations to the allocated memory.&lt;br /&gt;
&lt;br /&gt;
=== CreateProcess ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up a process using the segments managed by the given CodeSet handle.&lt;br /&gt;
&lt;br /&gt;
This system call furthermore processes the [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capabilities]] from the [[NCCH/Extended_Header|ExHeader]], hence setting up virtual address mappings, CPU clock frequency/L2 cache configuration, and other things.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up the main process thread and appends it to the scheduler queue.&lt;br /&gt;
&lt;br /&gt;
The argc, argv, and envp fields from the given StartupInfo structure are ignored.&lt;br /&gt;
&lt;br /&gt;
== struct CodeSetInfo ==&lt;br /&gt;
All addresses are given virtual for the process to be created.&lt;br /&gt;
All sizes are given in 0x1000-pages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Codeset Name&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown, this is written to field 0x5A of KCodeSet&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text addr&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata start&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW addr (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW size (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .text pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .rodata pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total RW pages (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Program ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KThread]].&lt;br /&gt;
&lt;br /&gt;
Though it is possible to run multi-threaded programs, running those on different cores is not possible &amp;quot;as-is&amp;quot;. One core is always dedicated to the OS, hence you will never get 100% of both cores.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread only if the reference count reaches 0.&lt;br /&gt;
&lt;br /&gt;
Lower priority values give the thread higher priority. For userland apps, priorities between 0x18 and 0x3F are allowed. The priority of the app&#039;s main thread seems to be 0x30.&lt;br /&gt;
&lt;br /&gt;
The [[Glossary#appcore|appcore]] thread scheduler primarily uses a cooperative design, therefore if a thread takes up all the CPU time (for example if it enters an endless loop), all the other threads that run on the same CPU core won&#039;t get a chance to run. The main way of yielding another thread is using an address arbiter. In certain cases, execution of the current task may be preempted regardless, for instance when a thread was waiting on svcSendSyncRequest to return.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8000 is a handle alias for the currently active thread.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x08&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configuration&#039;&#039;&#039;&lt;br /&gt;
 R0=s32 threadpriority&lt;br /&gt;
 R1=func entrypoint&lt;br /&gt;
 R2=u32 arg&lt;br /&gt;
 R3=u32 stacktop&lt;br /&gt;
 R4=s32 processorid&lt;br /&gt;
&lt;br /&gt;
 Result result=R0&lt;br /&gt;
 Handle* thread=R1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Creates a new thread in the current process which will begin execution at the given entrypoint. The SP CPU register will be initialized to stacktop, while r0 will be initialized to the given arg.&lt;br /&gt;
&lt;br /&gt;
The input address used for Entrypoint_Param and StackTop are normally the same, but they may be chosen arbitrarily. For the main thread (created in svcRun), the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
The stacktop must be aligned to 0x8-bytes, otherwise when not aligned to 0x8-bytes the ARM11 kernel clears the low 3-bits of the stacktop address.&lt;br /&gt;
&lt;br /&gt;
The processorid parameter specifies which processor the thread can run on. Non-negative values correspond to a specific CPU. (e.g. 0 for the Appcore and 1 for the Syscore on Old3DS. On New3DS, IDs 2 and 3 are also valid, referring to the 2 additional CPU cores) Special value -1 means all CPUs, and -2 means the default CPU for the process (Read from the [[NCCH/Extended Header|Exheader]], usually 0 for applications, 1 for system services). Games usually create threads using -2.&lt;br /&gt;
&lt;br /&gt;
The thread priority value must be in the range 0x0..0x3F. Otherwise, error 0xE0E01BFD is returned.&lt;br /&gt;
&lt;br /&gt;
With the Old3DS kernel, the s32 processorid must be &amp;lt;=2 (for the processorid validation check in the kernel). With the New3DS kernel, the processorid validation check requires processorid to be less than or equal to &amp;lt;total cores(MPCore &amp;quot;SCU Configuration Register&amp;quot; CPU number value + 1)&amp;gt;, and a number of additional constraints apply: When processorid==0x2 and the process is not a BASE mem-region process, exheader kernel-flags bitmask 0x2000 must be set (otherwise error 0xD9001BEA is returned). When processorid==0x3 and the process is not a BASE mem-region process, error 0xD9001BEA is returned. These are the only restriction checks done by the kernel for processorid.&lt;br /&gt;
&lt;br /&gt;
=== ExitThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x09&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void ExitThread(void);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Makes the currently running thread exit. When a thread exits, all mutex objects it owns are released and made available to other threads.&lt;br /&gt;
&lt;br /&gt;
=== SleepThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void SleepThread(s64 nanoseconds);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadPriority(s32* priority, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asm&#039;&#039;&#039;&lt;br /&gt;
 .global svcGetThreadPriority&lt;br /&gt;
 .type svcGetThreadPriority, %function&lt;br /&gt;
 svcGetThreadPriority:&lt;br /&gt;
 	str r0, [sp, #-0x4]!&lt;br /&gt;
 	svc 0x0B&lt;br /&gt;
 	ldr r3, [sp], #4&lt;br /&gt;
 	str r1, [r3]&lt;br /&gt;
 	bx  lr&lt;br /&gt;
&lt;br /&gt;
=== SetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadPriority(Handle thread, s32 priority);&lt;br /&gt;
&lt;br /&gt;
=== OpenThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x34&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result OpenThread(Handle* thread, Handle process, u32 threadId);&lt;br /&gt;
&lt;br /&gt;
=== GetProcessIdOfThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x36&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetProcessIdOfThread(u32* processId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadId ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x37&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadId(u32* threadId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
It seems that only the thread itself or one of its parent can get the ID. Calling this on the handle of a sibling or parent seems to always yield the ID 0.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadInfo ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x2C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Details &#039;&#039;&#039;&lt;br /&gt;
This requests always return an error when called, it only checks if the handle is a thread or not. &lt;br /&gt;
Hence, it will return 0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle, 0xD8E007F7 (BAD_HANDLE) if it isn&#039;t.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadContext ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x3B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadContext(ThreadContext* context, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
Stubbed?&lt;br /&gt;
&lt;br /&gt;
== Core affinity == &lt;br /&gt;
&lt;br /&gt;
The cores are numbered from 0 to 1 for Old 3DS and 0 to 3 for the new 3DS.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0E&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0F&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadIdealProcessor(s32* processorid, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x10&lt;br /&gt;
&lt;br /&gt;
=== APT:SetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:SetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
You are not able to use the system core (core1) by default. You have to first assign the amount of time dedicated to the system.&lt;br /&gt;
The value is in percent, the higher it is, the more the system will be available for your application. &lt;br /&gt;
&lt;br /&gt;
For example if you set this value to 25%, it means that your application will be able to use 25% of the system core at most, even if you never issue system calls.&lt;br /&gt;
&lt;br /&gt;
If you set the value to a non-zero value, you will not be able to set it back to 0%.&lt;br /&gt;
Keep in mind that if your application is heavily dependant on the system, setting a high value for your application might yield poorer performance than if you had set a low value.&lt;br /&gt;
&lt;br /&gt;
=== APT:GetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:GetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
== Debug == &lt;br /&gt;
&lt;br /&gt;
=== GetThreadList ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== SetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadParam ===&lt;br /&gt;
&lt;br /&gt;
= Synchronization =&lt;br /&gt;
&lt;br /&gt;
Synchronization can be performed via WaitSynchronization on any handles deriving from [[KSynchronizationObject]]. The semantic meaning of the call depends on the particular object type referred to by the given handle:&lt;br /&gt;
&lt;br /&gt;
* KClientPort: Wakes if max sessions not reached (free session available)&lt;br /&gt;
* KClientSession: Always false?&lt;br /&gt;
* KDebug: Waits until a debug event is signaled (the user should then use svcGetProcessDebugEvent to get the debug event info)&lt;br /&gt;
* KDmaObject: ???&lt;br /&gt;
* KEvent: Waits until the event is signaled&lt;br /&gt;
* KMutex: Acquires a lock on the mutex (blocks until this succeeds)&lt;br /&gt;
* KProcess: Waits until the process exits/is terminated&lt;br /&gt;
* KSemaphore: This consumes a value from the semaphore count, if possible, otherwise continues to wait&lt;br /&gt;
* KServerPort: Waits for a new client connection, upon which svcAcceptSession is ready to be called&lt;br /&gt;
* KServerSession: Waits for an IPC command to be submitted to the server process&lt;br /&gt;
* KThread: Waits until the thread terminates&lt;br /&gt;
* KTimer: Wakes when timer activates (this also clears the timer if it is oneshot)&lt;br /&gt;
&lt;br /&gt;
Most synchronization systems seem to have both a &amp;quot;normal&amp;quot; and &amp;quot;light-weight&amp;quot; version&lt;br /&gt;
&lt;br /&gt;
== Mutex ==&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KMutex]]&lt;br /&gt;
&lt;br /&gt;
===  CreateMutex ===&lt;br /&gt;
&lt;br /&gt;
/!\ It seems that the mutex will not be available once the thread that created it is destroyed &lt;br /&gt;
&lt;br /&gt;
=== ReleaseMutex ===&lt;br /&gt;
&lt;br /&gt;
== Semaphore ==&lt;br /&gt;
&lt;br /&gt;
== Event ==&lt;br /&gt;
&lt;br /&gt;
== Address Arbiters ==&lt;br /&gt;
&lt;br /&gt;
Address arbiters are a low-level primitive to implement synchronization based on a counter stored at some user-specified virtual memory address. Address arbiters are used to put the current thread to sleep until the counter is signaled. Both of these tasks are implemented in ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
Address arbiters are implemented by [[KAddressArbiter]].&lt;br /&gt;
&lt;br /&gt;
===CreateAddressArbiter===&lt;br /&gt;
 Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
&lt;br /&gt;
Creates an address arbiter handle for use with ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
=== ArbitrateAddress ===&lt;br /&gt;
 Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds)&lt;br /&gt;
&lt;br /&gt;
if &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; is SIGNAL, the ArbitrateAddress call will resume up to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; of the threads waiting on &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; using an arbiter, starting with the highest-priority threads. If &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is negative, all of these threads are released. &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; remains unused in this mode.&lt;br /&gt;
&lt;br /&gt;
The other modes are used to (conditionally) put the current thread to sleep based on the memory word at virtual address &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; until another thread signals that address using ArbitrateAddress with the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; SIGNAL. WAIT_IF_LESS_THAN will put the current thread to sleep if that word is smaller than &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. DECREMENT_AND_WAIT_IF_LESS_THAN will furthermore decrement the memory value before the comparison. WAIT_IF_LESS_THAN_TIMEOUT and DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT will do the same as their counterparts, but will have thread execution resume if &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; nanoseconds pass without &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; being signaled.&lt;br /&gt;
&lt;br /&gt;
=== enum ArbitrationType ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Address arbitration type&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| SIGNAL&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22301</id>
		<title>Multi-threading</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22301"/>
		<updated>2023-08-12T08:41:20Z</updated>

		<summary type="html">&lt;p&gt;Peachy: /* ExitThread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents all kernel functionality for managing multiple processes and threads as well as handling synchronization between them.&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
&lt;br /&gt;
Each process is given an array of [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capability descriptors]] upon creation (see CreateProcess). Official software forwards the descriptors specified in the [[NCCH#Extended_Header|NCCH exheader]].&lt;br /&gt;
&lt;br /&gt;
Any process can only use SVCs which are enabled in its kernel capability descriptors. This is enforced by the ARM11 kernel SVC handler by checking the syscall access control mask stored on the SVC-mode stack. If the SVC isn&#039;t enabled, a kernelpanic() is triggered. Each process has a separate SVC-mode stack; this stack and the syscall access mask stored here are initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of which is stored in the kernel capability descriptor. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current process.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateCodeSet ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Allocates memory for a process according to the given CodeSetInfo contents and copies the segment data from the given memory locations to the allocated memory.&lt;br /&gt;
&lt;br /&gt;
=== CreateProcess ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up a process using the segments managed by the given CodeSet handle.&lt;br /&gt;
&lt;br /&gt;
This system call furthermore processes the [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capabilities]] from the [[NCCH/Extended_Header|ExHeader]], hence setting up virtual address mappings, CPU clock frequency/L2 cache configuration, and other things.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up the main process thread and appends it to the scheduler queue.&lt;br /&gt;
&lt;br /&gt;
The argc, argv, and envp fields from the given StartupInfo structure are ignored.&lt;br /&gt;
&lt;br /&gt;
== struct CodeSetInfo ==&lt;br /&gt;
All addresses are given virtual for the process to be created.&lt;br /&gt;
All sizes are given in 0x1000-pages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Codeset Name&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown, this is written to field 0x5A of KCodeSet&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text addr&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata start&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW addr (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW size (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .text pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .rodata pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total RW pages (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Program ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KThread]].&lt;br /&gt;
&lt;br /&gt;
Though it is possible to run multi-threaded programs, running those on different cores is not possible &amp;quot;as-is&amp;quot;. One core is always dedicated to the OS, hence you will never get 100% of both cores.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread only if the reference count reaches 0.&lt;br /&gt;
&lt;br /&gt;
Lower priority values give the thread higher priority. For userland apps, priorities between 0x18 and 0x3F are allowed. The priority of the app&#039;s main thread seems to be 0x30.&lt;br /&gt;
&lt;br /&gt;
The [[Glossary#appcore|appcore]] thread scheduler primarily uses a cooperative design, therefore if a thread takes up all the CPU time (for example if it enters an endless loop), all the other threads that run on the same CPU core won&#039;t get a chance to run. The main way of yielding another thread is using an address arbiter. In certain cases, execution of the current task may be preempted regardless, for instance when a thread was waiting on svcSendSyncRequest to return.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8000 is a handle alias for the currently active thread.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x08&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configuration&#039;&#039;&#039;&lt;br /&gt;
 R0=s32 threadpriority&lt;br /&gt;
 R1=func entrypoint&lt;br /&gt;
 R2=u32 arg&lt;br /&gt;
 R3=u32 stacktop&lt;br /&gt;
 R4=s32 processorid&lt;br /&gt;
&lt;br /&gt;
 Result result=R0&lt;br /&gt;
 Handle* thread=R1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Creates a new thread in the current process which will begin execution at the given entrypoint. The SP CPU register will be initialized to stacktop, while r0 will be initialized to the given arg.&lt;br /&gt;
&lt;br /&gt;
The input address used for Entrypoint_Param and StackTop are normally the same, but they may be chosen arbitrarily. For the main thread (created in svcRun), the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
The stacktop must be aligned to 0x8-bytes, otherwise when not aligned to 0x8-bytes the ARM11 kernel clears the low 3-bits of the stacktop address.&lt;br /&gt;
&lt;br /&gt;
The processorid parameter specifies which processor the thread can run on. Non-negative values correspond to a specific CPU. (e.g. 0 for the Appcore and 1 for the Syscore on Old3DS. On New3DS, IDs 2 and 3 are also valid, referring to the 2 additional CPU cores) Special value -1 means all CPUs, and -2 means the default CPU for the process (Read from the [[NCCH/Extended Header|Exheader]], usually 0 for applications, 1 for system services). Games usually create threads using -2.&lt;br /&gt;
&lt;br /&gt;
The thread priority value must be in the range 0x0..0x3F. Otherwise, error 0xE0E01BFD is returned.&lt;br /&gt;
&lt;br /&gt;
With the Old3DS kernel, the s32 processorid must be &amp;lt;=2 (for the processorid validation check in the kernel). With the New3DS kernel, the processorid validation check requires processorid to be less than or equal to &amp;lt;total cores(MPCore &amp;quot;SCU Configuration Register&amp;quot; CPU number value + 1)&amp;gt;, and a number of additional constraints apply: When processorid==0x2 and the process is not a BASE mem-region process, exheader kernel-flags bitmask 0x2000 must be set (otherwise error 0xD9001BEA is returned). When processorid==0x3 and the process is not a BASE mem-region process, error 0xD9001BEA is returned. These are the only restriction checks done by the kernel for processorid.&lt;br /&gt;
&lt;br /&gt;
=== ExitThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x09&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void ExitThread(void);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
 Makes the currently running thread exit. When a thread exits, all mutex objects it owns are released and made available to other threads.&lt;br /&gt;
&lt;br /&gt;
=== SleepThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void SleepThread(s64 nanoseconds);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadPriority(s32* priority, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asm&#039;&#039;&#039;&lt;br /&gt;
 .global svcGetThreadPriority&lt;br /&gt;
 .type svcGetThreadPriority, %function&lt;br /&gt;
 svcGetThreadPriority:&lt;br /&gt;
 	str r0, [sp, #-0x4]!&lt;br /&gt;
 	svc 0x0B&lt;br /&gt;
 	ldr r3, [sp], #4&lt;br /&gt;
 	str r1, [r3]&lt;br /&gt;
 	bx  lr&lt;br /&gt;
&lt;br /&gt;
=== SetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadPriority(Handle thread, s32 priority);&lt;br /&gt;
&lt;br /&gt;
=== OpenThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x34&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result OpenThread(Handle* thread, Handle process, u32 threadId);&lt;br /&gt;
&lt;br /&gt;
=== GetProcessIdOfThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x36&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetProcessIdOfThread(u32* processId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadId ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x37&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadId(u32* threadId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
It seems that only the thread itself or one of its parent can get the ID. Calling this on the handle of a sibling or parent seems to always yield the ID 0.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadInfo ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x2C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Details &#039;&#039;&#039;&lt;br /&gt;
This requests always return an error when called, it only checks if the handle is a thread or not. &lt;br /&gt;
Hence, it will return 0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle, 0xD8E007F7 (BAD_HANDLE) if it isn&#039;t.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadContext ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x3B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadContext(ThreadContext* context, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
Stubbed?&lt;br /&gt;
&lt;br /&gt;
== Core affinity == &lt;br /&gt;
&lt;br /&gt;
The cores are numbered from 0 to 1 for Old 3DS and 0 to 3 for the new 3DS.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0E&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0F&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadIdealProcessor(s32* processorid, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x10&lt;br /&gt;
&lt;br /&gt;
=== APT:SetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:SetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
You are not able to use the system core (core1) by default. You have to first assign the amount of time dedicated to the system.&lt;br /&gt;
The value is in percent, the higher it is, the more the system will be available for your application. &lt;br /&gt;
&lt;br /&gt;
For example if you set this value to 25%, it means that your application will be able to use 25% of the system core at most, even if you never issue system calls.&lt;br /&gt;
&lt;br /&gt;
If you set the value to a non-zero value, you will not be able to set it back to 0%.&lt;br /&gt;
Keep in mind that if your application is heavily dependant on the system, setting a high value for your application might yield poorer performance than if you had set a low value.&lt;br /&gt;
&lt;br /&gt;
=== APT:GetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:GetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
== Debug == &lt;br /&gt;
&lt;br /&gt;
=== GetThreadList ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== SetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadParam ===&lt;br /&gt;
&lt;br /&gt;
= Synchronization =&lt;br /&gt;
&lt;br /&gt;
Synchronization can be performed via WaitSynchronization on any handles deriving from [[KSynchronizationObject]]. The semantic meaning of the call depends on the particular object type referred to by the given handle:&lt;br /&gt;
&lt;br /&gt;
* KClientPort: Wakes if max sessions not reached (free session available)&lt;br /&gt;
* KClientSession: Always false?&lt;br /&gt;
* KDebug: Waits until a debug event is signaled (the user should then use svcGetProcessDebugEvent to get the debug event info)&lt;br /&gt;
* KDmaObject: ???&lt;br /&gt;
* KEvent: Waits until the event is signaled&lt;br /&gt;
* KMutex: Acquires a lock on the mutex (blocks until this succeeds)&lt;br /&gt;
* KProcess: Waits until the process exits/is terminated&lt;br /&gt;
* KSemaphore: This consumes a value from the semaphore count, if possible, otherwise continues to wait&lt;br /&gt;
* KServerPort: Waits for a new client connection, upon which svcAcceptSession is ready to be called&lt;br /&gt;
* KServerSession: Waits for an IPC command to be submitted to the server process&lt;br /&gt;
* KThread: Waits until the thread terminates&lt;br /&gt;
* KTimer: Wakes when timer activates (this also clears the timer if it is oneshot)&lt;br /&gt;
&lt;br /&gt;
Most synchronization systems seem to have both a &amp;quot;normal&amp;quot; and &amp;quot;light-weight&amp;quot; version&lt;br /&gt;
&lt;br /&gt;
== Mutex ==&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KMutex]]&lt;br /&gt;
&lt;br /&gt;
===  CreateMutex ===&lt;br /&gt;
&lt;br /&gt;
/!\ It seems that the mutex will not be available once the thread that created it is destroyed &lt;br /&gt;
&lt;br /&gt;
=== ReleaseMutex ===&lt;br /&gt;
&lt;br /&gt;
== Semaphore ==&lt;br /&gt;
&lt;br /&gt;
== Event ==&lt;br /&gt;
&lt;br /&gt;
== Address Arbiters ==&lt;br /&gt;
&lt;br /&gt;
Address arbiters are a low-level primitive to implement synchronization based on a counter stored at some user-specified virtual memory address. Address arbiters are used to put the current thread to sleep until the counter is signaled. Both of these tasks are implemented in ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
Address arbiters are implemented by [[KAddressArbiter]].&lt;br /&gt;
&lt;br /&gt;
===CreateAddressArbiter===&lt;br /&gt;
 Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
&lt;br /&gt;
Creates an address arbiter handle for use with ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
=== ArbitrateAddress ===&lt;br /&gt;
 Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds)&lt;br /&gt;
&lt;br /&gt;
if &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; is SIGNAL, the ArbitrateAddress call will resume up to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; of the threads waiting on &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; using an arbiter, starting with the highest-priority threads. If &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is negative, all of these threads are released. &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; remains unused in this mode.&lt;br /&gt;
&lt;br /&gt;
The other modes are used to (conditionally) put the current thread to sleep based on the memory word at virtual address &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; until another thread signals that address using ArbitrateAddress with the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; SIGNAL. WAIT_IF_LESS_THAN will put the current thread to sleep if that word is smaller than &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. DECREMENT_AND_WAIT_IF_LESS_THAN will furthermore decrement the memory value before the comparison. WAIT_IF_LESS_THAN_TIMEOUT and DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT will do the same as their counterparts, but will have thread execution resume if &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; nanoseconds pass without &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; being signaled.&lt;br /&gt;
&lt;br /&gt;
=== enum ArbitrationType ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Address arbitration type&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| SIGNAL&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Kernel_ABI&amp;diff=22299</id>
		<title>Kernel ABI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Kernel_ABI&amp;diff=22299"/>
		<updated>2023-08-12T08:35:45Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Specify GetSystemTick ABI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Inputs are read from registers starting from r0 and outputs are written back to the same registers (also starting with r0).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Name&lt;br /&gt;
!  Inputs&lt;br /&gt;
!  Outputs&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| ControlMemory&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[[Memory Management#enum_MemoryOperation|MemoryOperation]] operation&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32/void* addr0&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32/void* addr1&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r3&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32 size&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r4&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[[Memory Management#enum_MemoryPermission|MemoryPermission]] permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32/void* addr_out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| QueryMemory&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;?: &amp;lt;code&amp;gt;u32/void* addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32 base_process_virtual_address&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32 size&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r3&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[[Memory Management#enum_MemoryPermission|MemoryPermission]] permission&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r4&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[[Memory_Management#enum_MemoryState|MemoryState]] state&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r5&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[[Memory_Management#enum_PageFlags|PageFlags]] page_flags&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| ExitProcess&lt;br /&gt;
| None&lt;br /&gt;
| None, doesn&#039;t return&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| GetProcessAffinityMask&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[out] u8* affinitymask&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KProcess]]&amp;gt; process&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorcount&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| SetProcessAffinityMask&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KProcess]]&amp;gt; process&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[in] const u8* affinitymask&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorcount&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x06&lt;br /&gt;
| GetProcessIdealProcessor&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;?: &amp;lt;code&amp;gt;Handle&amp;lt;[[KProcess]]&amp;gt; process&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorid&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: Clobbered?&lt;br /&gt;
|-&lt;br /&gt;
| 0x07&lt;br /&gt;
| SetProcessIdealProcessor&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KProcess]]&amp;gt; process&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorid&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| CreateThread&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 thread_priority&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;ThreadFunc entrypoint&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32 arg&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r3&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;u32/void* stack_top&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r4&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processor_id&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x09&lt;br /&gt;
| ExitThread&lt;br /&gt;
| None&lt;br /&gt;
| None, doesn&#039;t return&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| SleepThread&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0-r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s64 nanoseconds&amp;lt;/code&amp;gt;&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B&lt;br /&gt;
| GetThreadPriority&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: Ignored?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle thread_handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 thread_priority&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: Clobbered?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| SetThreadPriority&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 thread_priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| GetThreadAffinityMask&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[out] u8* affinitymask&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorcount&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| SetThreadAffinityMask&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;[in] const u8* affinitymask&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorcount&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F&lt;br /&gt;
| GetThreadIdealProcessor&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: Ignored?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorid&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| SetThreadIdealProcessor&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KThread]]&amp;gt; thread_handle&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorid&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| GetProcessorID&lt;br /&gt;
|&lt;br /&gt;
None&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s32 processorid&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Handle&amp;lt;[[KSynchronizationObject]]&amp;gt; handle&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;r2-r3&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;s64 timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| SetTimer&lt;br /&gt;
| Timer handle, initial_low, interval_low, initial_high, interval_high&lt;br /&gt;
| Result&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| GetSystemTick&lt;br /&gt;
| None&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Low 32 bits of the tick count&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;High 32 bits of the tick count&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D&lt;br /&gt;
| ConnectToPort&lt;br /&gt;
| ??&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;pointer to port name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;r1&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;handle to [[KClientSession]]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| SendSyncRequest&lt;br /&gt;
| &amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;handle to [[KClientSession]]&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;r0&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Result&amp;lt;code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=BOSS_Services&amp;diff=22298</id>
		<title>BOSS Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=BOSS_Services&amp;diff=22298"/>
		<updated>2023-08-12T08:24:15Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Add function name according to Citra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==BOSS Service &amp;quot;boss:U&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010082&lt;br /&gt;
| [[BOSSU:InitializeSession|InitializeSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| [[BOSS:SetStorageInfo|SetStorageInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| [[BOSS:UnregisterStorage|UnregisterStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| GetTaskStorageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 Size0, u32 Size1, ((Size0&amp;lt;&amp;lt;4) | 10), Buf0, ((Size1&amp;lt;&amp;lt;4) | 10), Buf1)&amp;lt;/nowiki&amp;gt; This writes the content of the input buffers into files &amp;quot;bossdb:/%s_CL&amp;quot; and &amp;quot;bossdb:/%s_CLK&amp;quot;, where &amp;quot;%s&amp;quot; is generated from the programID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080002&lt;br /&gt;
| RegisterNewArrivalEvent: Used for sending a handle. This is used with a table of programIDs etc with a maximum of 5 entries.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| [[BOSS:SetOptoutFlag|SetOptoutFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| [[BOSS:GetOptoutFlag|GetOptoutFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B00C2&lt;br /&gt;
| [[BOSSU:RegisterTask|RegisterTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0082&lt;br /&gt;
| [[BOSSU:UnregisterTask|UnregisterTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0082&lt;br /&gt;
| [[BOSSU:ReconfigureTask|ReconfigureTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[BOSSU:GetTaskIdList|GetTaskIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100102&lt;br /&gt;
| [[BOSSU:GetNsDataIdList|GetNsDataIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110102&lt;br /&gt;
| [[BOSS:GetNsDataIdList1|GetNsDataIdList1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120102&lt;br /&gt;
| [[BOSS:GetNsDataIdList2|GetNsDataIdList2]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130102&lt;br /&gt;
| [[BOSS:GetNsDataIdList3|GetNsDataIdList3]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140082&lt;br /&gt;
| [[BOSSU:SendProperty|SendProperty]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150042&lt;br /&gt;
| [[BOSSU:SendPropertyHandle|SendPropertyHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160082&lt;br /&gt;
| [[BOSSU:ReceiveProperty|ReceiveProperty]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180082&lt;br /&gt;
| UpdateTaskCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0042&lt;br /&gt;
| GetTaskCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0042&lt;br /&gt;
| GetTaskServiceStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0042&lt;br /&gt;
| [[BOSSU:StartTask|StartTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0042&lt;br /&gt;
| [[BOSSU:StartTaskImmediate|StartTaskImmediate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0042&lt;br /&gt;
| [[BOSSU:CancelTask|CancelTask]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0000&lt;br /&gt;
| [[BOSS:GetTaskFinishHandle|GetTaskFinishHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200082&lt;br /&gt;
| [[BOSSU:GetTaskState|GetTaskState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210042&lt;br /&gt;
| GetTaskResult&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220042&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002300C2&lt;br /&gt;
| GetTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00250082&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260040&lt;br /&gt;
| [[BOSS:DeleteNsData|DeleteNsData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002700C2&lt;br /&gt;
| [[BOSSU:GetNsDataHeaderInfo|GetNsDataHeaderInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280102&lt;br /&gt;
| [[BOSSU:ReadNsData|ReadNsData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0040&lt;br /&gt;
| Unknown. Writes an output u32 to cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0080&lt;br /&gt;
| SetNsDataNewFlag&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0040&lt;br /&gt;
| GetNsDataNewFlag&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0040&lt;br /&gt;
| (u32 NsDataId) Writes an output u64 to cmdreply[2-3], from the content file in extdata.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E0040&lt;br /&gt;
| [[BOSS:GetErrorCode|GetErrorCode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F0140&lt;br /&gt;
| RegisterStorageEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x00300000&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x00310100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00320000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00330042&lt;br /&gt;
| [[BOSS:StartBgImmediate|StartBgImmediate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00340042&lt;br /&gt;
| [[BOSS:GetTaskProperty0|GetTaskProperty0]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003500C2&lt;br /&gt;
| RegisterImmediateTask&lt;br /&gt;
|-&lt;br /&gt;
| 0x00360084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 TaskID_Size, u32 BufSize, ((TaskID_Size&amp;lt;&amp;lt;4) | 10), TaskID_buf, ((BufSize&amp;lt;&amp;lt;4) | 10), Buf)&amp;lt;/nowiki&amp;gt; BufSize must match 0x60.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00370084&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;(u32 TaskID_Size, u32 BufSize, ((TaskID_Size&amp;lt;&amp;lt;4) | 10), TaskID_buf, ((BufSize&amp;lt;&amp;lt;4) | 10), Buf)&amp;lt;/nowiki&amp;gt; BufSize must match 0x60.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Privileged BOSS Service &amp;quot;boss:P&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04010082&lt;br /&gt;
| [[BOSSP:InitializeSessionPrivileged|InitializeSessionPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040080&lt;br /&gt;
| [[BOSSP:GetAppNewFlag|GetAppNewFlag]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040500C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040600C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04070080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04090102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040B0080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x040D0182&lt;br /&gt;
| [[BOSSP:GetNsDataIdListPrivileged|GetNsDataIdListPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040E0182&lt;br /&gt;
| [[BOSSP:GetNsDataIdListPrivileged1|GetNsDataIdListPrivileged1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04130082&lt;br /&gt;
| [[BOSSP:SendPropertyPrivileged|SendPropertyPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041500C0&lt;br /&gt;
| DeleteNsDataPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x04160142&lt;br /&gt;
| [[BOSSP:GetNsDataHeaderInfoPrivileged|GetNsDataHeaderInfoPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04170182&lt;br /&gt;
| [[BOSSP:ReadNsDataPrivileged|ReadNsDataPrivileged]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041A0100&lt;br /&gt;
| SetNsDataNewFlagPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x041B00C0&lt;br /&gt;
| GetNsDataNewFlagPrivileged&lt;br /&gt;
|-&lt;br /&gt;
| 0x041C00C0&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x042E00C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x042F00C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x043000C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04490142&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x044A0180&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x044D0080&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04500102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04540102&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x045500C2&lt;br /&gt;
| unknown...&lt;br /&gt;
|-&lt;br /&gt;
| 0x04580104&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
boss:P also contains all of the commands from boss:U.&lt;br /&gt;
&lt;br /&gt;
When Home Menu loads the SpotPass [[CBMD]] with [[Extended_Banner]], it uses bossP command 0x040D0182 first. Then it uses GetNsDataHeaderInfoPrivileged, then ReadNsDataPrivileged for loading the actual banner data.&lt;br /&gt;
&lt;br /&gt;
==BOSS Service &amp;quot;boss:M&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
==programIDs==&lt;br /&gt;
BOSS uses programIDs raw without any handling for the New3DS programID-low bitmask. For example, attempting a NsDataId listing with the New3DS bitmask set will fail, if BOSS is only setup for that programID with the New3DS bitmask clear.&lt;br /&gt;
&lt;br /&gt;
When [[BOSSU:InitializeSession|initializing]] BOSS with the default programID, the New3DS programID-low bitmask is always clear for New3DS titles since that&#039;s how it was originally registered with [[Filesystem_services|FS]]. Hence, the programID in the [[SpotPass|BOSS-container]] must always have the New3DS bitmask clear. This also means everything using the BOSSP commands with the raw programIDs loaded from AM title-listing are broken with New3DS titles, for example [[Extended_Banner]].&lt;br /&gt;
&lt;br /&gt;
==Content Data Storage==&lt;br /&gt;
SpotPass content for each application is stored under the extdata specified by [[BOSS:SetStorageInfo]]. Certain commands verify that the PID associated with the current service session has access to the specified extdata by using [[FS:CheckAuthorityToAccessExtSaveData]], returning an error on failure. This basically renders SpotPass unusable under user-processes(when initialized under those processes) which don&#039;t have access to any SD extdata(unless NAND extdata is used instead).&lt;br /&gt;
&lt;br /&gt;
All of these commands using [[FS:CheckAuthorityToAccessExtSaveData]] are: [[BOSS:SetStorageInfo]] and RegisterStorageEntry, for both BOSSU and BOSSP.&lt;br /&gt;
&lt;br /&gt;
BOSS-container content is stored in the extdata registered for the programID specified in the BOSS-container, what task it&#039;s associated with / what title registered it is irrelevant with BOSS-container data storage.&lt;br /&gt;
&lt;br /&gt;
==Custom SpotPass content==&lt;br /&gt;
SpotPass supports raw content download without using the encrypted+signed SpotPass container(raw content is used by [[Home Menu]] SpotPass VersionList for example). However, this is incompatible with the data-loading method used with SpotPass-container content(NsData commands can&#039;t be used with it).&lt;br /&gt;
&lt;br /&gt;
When writing the raw content, it firsts deletes and creates the &amp;quot;&amp;lt;taskID&amp;gt;&amp;quot; file under the data-storage extdata with normal extdata(not the separate boss archive). Once successful, the final filename specified by the task config will be deleted if needed, then the &amp;quot;&amp;lt;taskID&amp;gt;&amp;quot; file will be renamed to the final filename. Afterwards, the user-process can access the final file just like any other extdata file.&lt;br /&gt;
&lt;br /&gt;
For using custom content with the SpotPass container(like official titles), the only known ways to do so is: &amp;quot;CFW&amp;quot; / ARM11-kernelhax with the sigchecks for this patched, or some sort of BOSS-sysmodule exploit if there&#039;s any vulns to begin with.&lt;br /&gt;
&lt;br /&gt;
==HTTP upload==&lt;br /&gt;
SpotPass tasks can be used for uploading data via HTTP POST. The exact method varies, but the main one is a [[HTTPC:SendPOSTDataRawTimeout|raw]] POST.&lt;br /&gt;
&lt;br /&gt;
The content data is loaded from the following path: snprintf(outpath, outpathsize, &amp;quot;%s/%s%02x.up&amp;quot;, archivepath, taskidstr_probably, unk);&lt;br /&gt;
&lt;br /&gt;
The archivepath can be either &amp;quot;bossdb:&amp;quot;(BOSS-sysmodule NAND savedata) or the content-data-storage extdata. Certain other paths in the BOSS savedata can be used too.&lt;br /&gt;
&lt;br /&gt;
==BOSS Tasks==&lt;br /&gt;
The TaskID is a 8-byte buffer containing a string including NUL-terminator(taskIDs are compared with: strncmp(str0, str1, 7)).&lt;br /&gt;
&lt;br /&gt;
When disabling SpotPass, applications use [[BOSSU:CancelTask]] then [[BOSSU:UnregisterTask]], to delete each task.&lt;br /&gt;
&lt;br /&gt;
Each process can only access tasks which it created, not other processes&#039; tasks(even when using bossP with [[BOSSP:InitializeSessionPrivileged|init_programID]]=0).&lt;br /&gt;
&lt;br /&gt;
After registration, tasks will not automatically run until they are started using one of the start-task commands.&lt;br /&gt;
&lt;br /&gt;
==NsDataId==&lt;br /&gt;
This is an u32 ID for SpotPass content, used with the NsData service commands etc.&lt;br /&gt;
&lt;br /&gt;
==NsDataHeaderInfo==&lt;br /&gt;
When the input type is not one of the below or when the specified output size doesn&#039;t match the expected size for this type, an error is returned.&lt;br /&gt;
&lt;br /&gt;
===Type0===&lt;br /&gt;
Total size is 0x8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| programID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type1===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type2===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content data-type, originally from the [[SpotPass|BOSS-container]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type3===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type4===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type5===&lt;br /&gt;
Total size is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Type6===&lt;br /&gt;
Total size is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| programID. Same data as Type0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Same data as Type1.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Same data as Type3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PropertyIDs==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Example values used by official titles: 0x7D, 0xAA, ...&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Usually 0x1?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown. Usually 0x0?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x4&lt;br /&gt;
| Interval in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Duration(?), ~0 = infinite. 0x1 can be used for running the task just once. Usually set to 0x64(100). When not set to ~0 this is decreased by 1 each time the task runs(or at least when it fails). Task processing is skipped when the current state value is already 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Usually 0x2?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| 0x200&lt;br /&gt;
| URL&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xB&lt;br /&gt;
| 0x200&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| &lt;br /&gt;
| [[BOSSU:SendPropertyHandle]] is used for this. This property is only setup for HTTP uploads? This can be used with [[BOSSU:SendProperty]] too but that&#039;s not the intended use.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| 0x360&lt;br /&gt;
| Contains additional HTTP headers to send in the request, otherwise this is all-zero. This is an array of 3 entries: +0x0 size 0x20 is the header name, and +0x20 size 0x100 is the header value. Example: header-name &amp;quot;Content-Type&amp;quot; at 0x0, with header-value &amp;quot;application/octet-stream&amp;quot; at offset 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| 0x4&lt;br /&gt;
| This u32 is passed directly as an u32 certID for [[HTTPC:SetClientCertDefault]](without masking to u8), even when this field is set to 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| 0xC&lt;br /&gt;
| 3 words. Last word is unknown, normally 0(non-zero doesn&#039;t seem to affect any HTTPC commands). [[HTTPC:AddDefaultCert]] is called twice for each of the first two words which are used as certIDs(not masked to u8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| When non-zero this enables loading the client cert+privk from FS, requires the filepaths to be actually set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x1&lt;br /&gt;
| When non-zero this enables loading a trusted rootCA cert DER from FS, requires the filepath to be actually set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x13&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 0x40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| 0x2&lt;br /&gt;
| u16 total_tasks. [[BOSSU:GetTaskIdList]] is used before [[BOSSU:ReceiveProperty|reading]] this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| 0x400&lt;br /&gt;
| List of TaskIDs. [[BOSSU:GetTaskIdList]] is used before [[BOSSU:ReceiveProperty|reading]] this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x200&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only valid PropertyIDs for [[BOSSU:SendProperty]] are the ones listed above, except 0x35 and 0x36. If the specified size for the command is larger than the property size, it will use the actual property size instead. When the specified size is less than the actual property size, all of the property data that won&#039;t be written to is cleared.&lt;br /&gt;
&lt;br /&gt;
==TaskStatus==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Last task run was successful?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| Task started.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| Task not started(also the initial state immediately after task creation).&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Task processing failed(such as network error).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This u8 is returned by [[BOSSU:GetTaskState]].&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Error-code&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F833&lt;br /&gt;
| taskID not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F836&lt;br /&gt;
| taskID already exists, for task creation.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F842&lt;br /&gt;
| The specified programID is not setup for BOSS.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0F843&lt;br /&gt;
| The specified NsDataId was not found.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22297</id>
		<title>Multi-threading</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Multi-threading&amp;diff=22297"/>
		<updated>2023-08-12T08:21:05Z</updated>

		<summary type="html">&lt;p&gt;Peachy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents all kernel functionality for managing multiple processes and threads as well as handling synchronization between them.&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
&lt;br /&gt;
Each process is given an array of [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capability descriptors]] upon creation (see CreateProcess). Official software forwards the descriptors specified in the [[NCCH#Extended_Header|NCCH exheader]].&lt;br /&gt;
&lt;br /&gt;
Any process can only use SVCs which are enabled in its kernel capability descriptors. This is enforced by the ARM11 kernel SVC handler by checking the syscall access control mask stored on the SVC-mode stack. If the SVC isn&#039;t enabled, a kernelpanic() is triggered. Each process has a separate SVC-mode stack; this stack and the syscall access mask stored here are initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of which is stored in the kernel capability descriptor. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current process.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateCodeSet ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Allocates memory for a process according to the given CodeSetInfo contents and copies the segment data from the given memory locations to the allocated memory.&lt;br /&gt;
&lt;br /&gt;
=== CreateProcess ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up a process using the segments managed by the given CodeSet handle.&lt;br /&gt;
&lt;br /&gt;
This system call furthermore processes the [[NCCH/Extended_Header#ARM11_Kernel_Capabilities|kernel capabilities]] from the [[NCCH/Extended_Header|ExHeader]], hence setting up virtual address mappings, CPU clock frequency/L2 cache configuration, and other things.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(behavior unconfirmed)&lt;br /&gt;
&lt;br /&gt;
Sets up the main process thread and appends it to the scheduler queue.&lt;br /&gt;
&lt;br /&gt;
The argc, argv, and envp fields from the given StartupInfo structure are ignored.&lt;br /&gt;
&lt;br /&gt;
== struct CodeSetInfo ==&lt;br /&gt;
All addresses are given virtual for the process to be created.&lt;br /&gt;
All sizes are given in 0x1000-pages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Codeset Name&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown, this is written to field 0x5A of KCodeSet&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text addr&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata start&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW addr (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW size (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .text pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .rodata pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total RW pages (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Program ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KThread]].&lt;br /&gt;
&lt;br /&gt;
Though it is possible to run multi-threaded programs, running those on different cores is not possible &amp;quot;as-is&amp;quot;. One core is always dedicated to the OS, hence you will never get 100% of both cores.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread only if the reference count reaches 0.&lt;br /&gt;
&lt;br /&gt;
Lower priority values give the thread higher priority. For userland apps, priorities between 0x18 and 0x3F are allowed. The priority of the app&#039;s main thread seems to be 0x30.&lt;br /&gt;
&lt;br /&gt;
The [[Glossary#appcore|appcore]] thread scheduler primarily uses a cooperative design, therefore if a thread takes up all the CPU time (for example if it enters an endless loop), all the other threads that run on the same CPU core won&#039;t get a chance to run. The main way of yielding another thread is using an address arbiter. In certain cases, execution of the current task may be preempted regardless, for instance when a thread was waiting on svcSendSyncRequest to return.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8000 is a handle alias for the currently active thread.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== CreateThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x08&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configuration&#039;&#039;&#039;&lt;br /&gt;
 R0=s32 threadpriority&lt;br /&gt;
 R1=func entrypoint&lt;br /&gt;
 R2=u32 arg&lt;br /&gt;
 R3=u32 stacktop&lt;br /&gt;
 R4=s32 processorid&lt;br /&gt;
&lt;br /&gt;
 Result result=R0&lt;br /&gt;
 Handle* thread=R1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Creates a new thread in the current process which will begin execution at the given entrypoint. The SP CPU register will be initialized to stacktop, while r0 will be initialized to the given arg.&lt;br /&gt;
&lt;br /&gt;
The input address used for Entrypoint_Param and StackTop are normally the same, but they may be chosen arbitrarily. For the main thread (created in svcRun), the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
The stacktop must be aligned to 0x8-bytes, otherwise when not aligned to 0x8-bytes the ARM11 kernel clears the low 3-bits of the stacktop address.&lt;br /&gt;
&lt;br /&gt;
The processorid parameter specifies which processor the thread can run on. Non-negative values correspond to a specific CPU. (e.g. 0 for the Appcore and 1 for the Syscore on Old3DS. On New3DS, IDs 2 and 3 are also valid, referring to the 2 additional CPU cores) Special value -1 means all CPUs, and -2 means the default CPU for the process (Read from the [[NCCH/Extended Header|Exheader]], usually 0 for applications, 1 for system services). Games usually create threads using -2.&lt;br /&gt;
&lt;br /&gt;
The thread priority value must be in the range 0x0..0x3F. Otherwise, error 0xE0E01BFD is returned.&lt;br /&gt;
&lt;br /&gt;
With the Old3DS kernel, the s32 processorid must be &amp;lt;=2 (for the processorid validation check in the kernel). With the New3DS kernel, the processorid validation check requires processorid to be less than or equal to &amp;lt;total cores(MPCore &amp;quot;SCU Configuration Register&amp;quot; CPU number value + 1)&amp;gt;, and a number of additional constraints apply: When processorid==0x2 and the process is not a BASE mem-region process, exheader kernel-flags bitmask 0x2000 must be set (otherwise error 0xD9001BEA is returned). When processorid==0x3 and the process is not a BASE mem-region process, error 0xD9001BEA is returned. These are the only restriction checks done by the kernel for processorid.&lt;br /&gt;
&lt;br /&gt;
=== ExitThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x09&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void ExitThread(void);&lt;br /&gt;
&lt;br /&gt;
=== SleepThread  ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 void SleepThread(s64 nanoseconds);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadPriority(s32* priority, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asm&#039;&#039;&#039;&lt;br /&gt;
 .global svcGetThreadPriority&lt;br /&gt;
 .type svcGetThreadPriority, %function&lt;br /&gt;
 svcGetThreadPriority:&lt;br /&gt;
 	str r0, [sp, #-0x4]!&lt;br /&gt;
 	svc 0x0B&lt;br /&gt;
 	ldr r3, [sp], #4&lt;br /&gt;
 	str r1, [r3]&lt;br /&gt;
 	bx  lr&lt;br /&gt;
&lt;br /&gt;
=== SetThreadPriority ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadPriority(Handle thread, s32 priority);&lt;br /&gt;
&lt;br /&gt;
=== OpenThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x34&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result OpenThread(Handle* thread, Handle process, u32 threadId);&lt;br /&gt;
&lt;br /&gt;
=== GetProcessIdOfThread ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x36&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetProcessIdOfThread(u32* processId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadId ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x37&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadId(u32* threadId, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
It seems that only the thread itself or one of its parent can get the ID. Calling this on the handle of a sibling or parent seems to always yield the ID 0.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadInfo ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x2C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Details &#039;&#039;&#039;&lt;br /&gt;
This requests always return an error when called, it only checks if the handle is a thread or not. &lt;br /&gt;
Hence, it will return 0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle, 0xD8E007F7 (BAD_HANDLE) if it isn&#039;t.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadContext ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x3B&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadContext(ThreadContext* context, Handle thread);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details&#039;&#039;&#039;&lt;br /&gt;
Stubbed?&lt;br /&gt;
&lt;br /&gt;
== Core affinity == &lt;br /&gt;
&lt;br /&gt;
The cores are numbered from 0 to 1 for Old 3DS and 0 to 3 for the new 3DS.&lt;br /&gt;
&lt;br /&gt;
=== GetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadAffinityMask ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0E&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount);&lt;br /&gt;
&lt;br /&gt;
=== GetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x0F&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Signature&#039;&#039;&#039;&lt;br /&gt;
 Result GetThreadIdealProcessor(s32* processorid, Handle thread);&lt;br /&gt;
&lt;br /&gt;
=== SetThreadIdealProcessor ===&lt;br /&gt;
&#039;&#039;&#039;svc&#039;&#039;&#039; : 0x10&lt;br /&gt;
&lt;br /&gt;
=== APT:SetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:SetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
You are not able to use the system core (core1) by default. You have to first assign the amount of time dedicated to the system.&lt;br /&gt;
The value is in percent, the higher it is, the more the system will be available for your application. &lt;br /&gt;
&lt;br /&gt;
For example if you set this value to 25%, it means that your application will be able to use 25% of the system core at most, even if you never issue system calls.&lt;br /&gt;
&lt;br /&gt;
If you set the value to a non-zero value, you will not be able to set it back to 0%.&lt;br /&gt;
Keep in mind that if your application is heavily dependant on the system, setting a high value for your application might yield poorer performance than if you had set a low value.&lt;br /&gt;
&lt;br /&gt;
=== APT:GetApplicationCpuTimeLimit ===&lt;br /&gt;
&lt;br /&gt;
See [[APT:GetApplicationCpuTimeLimit]].&lt;br /&gt;
&lt;br /&gt;
== Debug == &lt;br /&gt;
&lt;br /&gt;
=== GetThreadList ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== SetDebugThreadContext ===&lt;br /&gt;
&lt;br /&gt;
=== GetDebugThreadParam ===&lt;br /&gt;
&lt;br /&gt;
= Synchronization =&lt;br /&gt;
&lt;br /&gt;
Synchronization can be performed via WaitSynchronization on any handles deriving from [[KSynchronizationObject]]. The semantic meaning of the call depends on the particular object type referred to by the given handle:&lt;br /&gt;
&lt;br /&gt;
* KClientPort: Wakes if max sessions not reached (free session available)&lt;br /&gt;
* KClientSession: Always false?&lt;br /&gt;
* KDebug: Waits until a debug event is signaled (the user should then use svcGetProcessDebugEvent to get the debug event info)&lt;br /&gt;
* KDmaObject: ???&lt;br /&gt;
* KEvent: Waits until the event is signaled&lt;br /&gt;
* KMutex: Acquires a lock on the mutex (blocks until this succeeds)&lt;br /&gt;
* KProcess: Waits until the process exits/is terminated&lt;br /&gt;
* KSemaphore: This consumes a value from the semaphore count, if possible, otherwise continues to wait&lt;br /&gt;
* KServerPort: Waits for a new client connection, upon which svcAcceptSession is ready to be called&lt;br /&gt;
* KServerSession: Waits for an IPC command to be submitted to the server process&lt;br /&gt;
* KThread: Waits until the thread terminates&lt;br /&gt;
* KTimer: Wakes when timer activates (this also clears the timer if it is oneshot)&lt;br /&gt;
&lt;br /&gt;
Most synchronization systems seem to have both a &amp;quot;normal&amp;quot; and &amp;quot;light-weight&amp;quot; version&lt;br /&gt;
&lt;br /&gt;
== Mutex ==&lt;br /&gt;
&lt;br /&gt;
For Kernel implementation details, see [[KMutex]]&lt;br /&gt;
&lt;br /&gt;
===  CreateMutex ===&lt;br /&gt;
&lt;br /&gt;
/!\ It seems that the mutex will not be available once the thread that created it is destroyed &lt;br /&gt;
&lt;br /&gt;
=== ReleaseMutex ===&lt;br /&gt;
&lt;br /&gt;
== Semaphore ==&lt;br /&gt;
&lt;br /&gt;
== Event ==&lt;br /&gt;
&lt;br /&gt;
== Address Arbiters ==&lt;br /&gt;
&lt;br /&gt;
Address arbiters are a low-level primitive to implement synchronization based on a counter stored at some user-specified virtual memory address. Address arbiters are used to put the current thread to sleep until the counter is signaled. Both of these tasks are implemented in ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
Address arbiters are implemented by [[KAddressArbiter]].&lt;br /&gt;
&lt;br /&gt;
===CreateAddressArbiter===&lt;br /&gt;
 Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
&lt;br /&gt;
Creates an address arbiter handle for use with ArbitrateAddress.&lt;br /&gt;
&lt;br /&gt;
=== ArbitrateAddress ===&lt;br /&gt;
 Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds)&lt;br /&gt;
&lt;br /&gt;
if &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; is SIGNAL, the ArbitrateAddress call will resume up to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; of the threads waiting on &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; using an arbiter, starting with the highest-priority threads. If &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is negative, all of these threads are released. &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; remains unused in this mode.&lt;br /&gt;
&lt;br /&gt;
The other modes are used to (conditionally) put the current thread to sleep based on the memory word at virtual address &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; until another thread signals that address using ArbitrateAddress with the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; SIGNAL. WAIT_IF_LESS_THAN will put the current thread to sleep if that word is smaller than &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. DECREMENT_AND_WAIT_IF_LESS_THAN will furthermore decrement the memory value before the comparison. WAIT_IF_LESS_THAN_TIMEOUT and DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT will do the same as their counterparts, but will have thread execution resume if &amp;lt;code&amp;gt;nanoseconds&amp;lt;/code&amp;gt; nanoseconds pass without &amp;lt;code&amp;gt;addr&amp;lt;/code&amp;gt; being signaled.&lt;br /&gt;
&lt;br /&gt;
=== enum ArbitrationType ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Address arbitration type&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| SIGNAL&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SSLC:GenerateRandomData&amp;diff=22296</id>
		<title>SSLC:GenerateRandomData</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SSLC:GenerateRandomData&amp;diff=22296"/>
		<updated>2023-08-12T08:18:52Z</updated>

		<summary type="html">&lt;p&gt;Peachy: Fix size parameter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00110042]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| (Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Pointer to output data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This can only be used if this session was previously initialized with [[SSLC:Initialize]] or [[SSLC:InitializeConnectionSession]]. After that, this just uses [[Process_Services|ps:ps]] GenerateRandomData.&lt;/div&gt;</summary>
		<author><name>Peachy</name></author>
	</entry>
</feed>