Difference between revisions of "Services API"

From Nintendo Switch Brew
Jump to navigation Jump to search
(40 intermediate revisions by 8 users not shown)
Line 4: Line 4:
  
 
= sm: =
 
= sm: =
 +
This is "nn::sm::detail::IUserInterface".
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 30: Line 32:
  
 
= sm:m =
 
= sm:m =
 +
This is "nn::sm::detail::IManagerInterface".
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 53: Line 56:
 
! scope="col" width="200" | Notes
 
! scope="col" width="200" | Notes
 
|-
 
|-
| acc:u0, acc:u1, acc:aa, acc:su
+
| acc:u0, acc:u1, acc:aa, acc:su, [5.0.0+] dauth:0
 
| [[Account services]]
 
| [[Account services]]
 
| u0: System, u1: User, su: Admin, aa: Baas
 
| u0: System, u1: User, su: Admin, aa: Baas
 
|-
 
|-
| ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, irs, irs:sys, xcd:sys
+
| ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, irs, irs:sys, xcd:sys, [4.0.0+] hid:tmp, [5.0.0+] hidbus
 
| [[HID services]]
 
| [[HID services]]
 
|
 
|
 
|-
 
|-
| appletAE, appletOE, idle:sys, omm, spsm
+
| appletAE, appletOE, idle:sys, omm, spsm, [5.0.0+] tcap, [6.0.0+] caps:su
 
| [[AM services]]
 
| [[AM services]]
|
+
|  
 
|-
 
|-
| [1.0.0+] aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry
+
| [1.0.0-2.3.0] aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry
  
 
[3.0.0+] aoc:u, ns:am2, ns:dev, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, ns:web, ovln:rcv, ovln:snd
 
[3.0.0+] aoc:u, ns:am2, ns:dev, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, ns:web, ovln:rcv, ovln:snd
Line 71: Line 74:
 
| am: Application Manager, su: System Update
 
| am: Application Manager, su: System Update
 
|-
 
|-
| apm, apm:p, apm:sys, fgm, fgm:0, fgm:9, (fgm:dbg?), (aoc:apm??)
+
| apm, apm:p, apm:dbg, apm:sys, fgm, fgm:0, fgm:9, fgm:dbg
| [[APM services]]
+
| [[PPC services]]
|
+
| fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6 and fgm:7 used to exist, but are now deprecated.
 
|-
 
|-
| arp:r, arp:w, bgtc:t, bgtc:sc
+
| arp:r, arp:w, [2.0.0+] bgtc:t, [2.0.0+] bgtc:sc
 
| [[Glue services]]
 
| [[Glue services]]
| r: Reader, w: Writer
+
|  
 
|-
 
|-
| audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u, audrec:a, audrec:d, audrec:u, audctl, codecctl, hwopus
+
| audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u, audrec:a, audrec:d, audrec:u, audctl, codecctl, hwopus, auddebug, [6.0.0+] auddev
 
| [[Audio services]]
 
| [[Audio services]]
 
|
 
|
 
|-
 
|-
 
| <nowiki>banana</nowiki>
 
| <nowiki>banana</nowiki>
| ?
+
| [[Profiler services]]
| Some games on [3.0.0+] have access to this service, but it doesn't appear to be present on retail devices.
+
| Not currently available on retail units.
 
|-
 
|-
| <nowiki>bcat:a, bcat:u, bcat:m, bcat:s, news:a, news:c, news:m, news:p, news:v, prepo:u, prepo:s, prepo:m, prepo:a</nowiki>
+
| <nowiki>bcat:a, bcat:u, bcat:m, bcat:s, news:a, news:c, news:m, news:p, news:v, prepo:u, prepo:s, prepo:m, [1.0.0-5.1.0] prepo:a, [6.0.0+] prepo:a2</nowiki>
 
| [[BCAT services]]
 
| [[BCAT services]]
 
|
 
|
 
|-
 
|-
| bpc, bpc:r, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s
+
| [1.0.0] bpc:c, bpc:b, bpc:r, bpc:w, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s
 +
[2.0.0+] bpc, bpc:r, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s
 
| [[PCV services]]
 
| [[PCV services]]
 
|
 
|
 
|-
 
|-
 
| bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres
 
| bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres
| [[Sockets services]], [[NSD services]]
+
| [[Sockets services]]
 
|
 
|
 
|-
 
|-
| btdrv
+
| btdrv, [5.0.0+] bt
 
| [[Bluetooth Driver services]]
 
| [[Bluetooth Driver services]]
 
|  
 
|  
 
|-
 
|-
| btm, btm:dbg, btm:sys
+
| btm, btm:dbg, btm:sys, [5.0.0+] btm:u
| Battery services
+
| [[BTM services]]
 
|  
 
|  
 
|-
 
|-
| caps:a, caps:c
+
| caps:a, caps:c, [1.0.0] mm:u, [5.0.0+] caps:u
 
| [[Capture services]]
 
| [[Capture services]]
 
| a: AlbumAccessor, c: AlbumControl
 
| a: AlbumAccessor, c: AlbumControl
 
|-
 
|-
| caps:sc, caps:ss, mm:u, vi:m, vi:s, vi:u, cec-mgr
+
| [2.0.0+] caps:sc, [2.0.0+] caps:ss, vi:m, vi:s, vi:u, cec-mgr, [2.0.0+] mm:u, [4.0.0-5.1.0] caps:su
 
| [[Display services]]
 
| [[Display services]]
 
|  
 
|  
Line 118: Line 122:
 
| [[Nvnflinger services]]
 
| [[Nvnflinger services]]
 
|
 
|
 +
|-
 +
| dmnt:-
 +
| [[Debug Monitor services]]
 +
| Not currently available on retail units.
 
|-
 
|-
 
| erpt:c, erpt:r
 
| erpt:c, erpt:r
 
| [[Error Report services]]
 
| [[Error Report services]]
 +
|
 +
|-
 +
| eupld:c, eupld:r
 +
| [[Error Upload services]]
 
|
 
|
 
|-
 
|-
 
| es
 
| es
| ETicket services
+
| [[ETicket services]]
 
|
 
|
 
|-
 
|-
| fan, psm, tc, ts
+
| fan, psm, tc, ts, <nowiki>pcm</nowiki>
 
| [[PTM services]]
 
| [[PTM services]]
|
+
| pcm is not available on retail units.
 
|-
 
|-
 
| fatal:u, fatal:p
 
| fatal:u, fatal:p
 
| [[Fatal services]]
 
| [[Fatal services]]
| u: User, p: Privileged
+
|  
 
|-
 
|-
| friend:u, friend:v, friend:m, friend:s, friend:a
+
| friend:u, friend:v, friend:m, friend:s, friend:a, [5.0.0+] nd:app, nd:sys
| Friend services
+
| [[Friend services]]
 
|
 
|
 
|-
 
|-
Line 143: Line 155:
 
| srv: Main, ldr: Loader, pr: Program Registry
 
| srv: Main, ldr: Loader, pr: Program Registry
 
|-
 
|-
| gpio, i2c, i2c:pcv, pinmux, pwm, uart, [4.0.0+] sasbus
+
| gpio, i2c, i2c:pcv, pinmux, pwm, uart, [3.0.0+] sasbus
 
| [[Bus services]]
 
| [[Bus services]]
 
|
 
|
 
|-
 
|-
| htc, htcs, htc:tenv
+
| htc, htcs, htc:tenv, file_io, gds, tma_log, tmagent
 
| [[TMA services]]
 
| [[TMA services]]
|
+
|  
 +
|-
 +
| jit:u
 +
| [[JIT services]]
 +
| Not currently available on retail units.
 
|-
 
|-
 
| lbl
 
| lbl
Line 155: Line 171:
 
|  
 
|  
 
|-
 
|-
| ldn:m, ldn:s, ldn:u
+
| ldn:m, ldn:s, ldn:u, [5.0.0+] ndd
 
| [[LDN services]]
 
| [[LDN services]]
 
|
 
|
Line 165: Line 181:
 
|
 
|
 
|-
 
|-
| lm
+
| lm, lm:get
 
| [[Log services]]
 
| [[Log services]]
 
|
 
|
Line 178: Line 194:
 
|-
 
|-
 
| nfc:am, nfc:mf:u, nfc:user, nfc:sys, nfp:user, nfp:dbg, nfp:sys
 
| nfc:am, nfc:mf:u, nfc:user, nfc:sys, nfp:user, nfp:dbg, nfp:sys
| NFC services
+
| [[NFC services]]
 
|  
 
|  
 
|-
 
|-
Line 185: Line 201:
 
|  
 
|  
 
|-
 
|-
| nim, nim:shp, ntc
+
| nim, nim:shp, ntc, [5.0.0+] nim:eca, [7.0.0+] nim:ecas
 
| [[NIM services]]
 
| [[NIM services]]
| shp: eShop
+
|  
 
|-
 
|-
 
| npns:u, npns:s
 
| npns:u, npns:s
| NPNS services
+
| [[NPNS services]]
 
|
 
|
 
|-
 
|-
Line 197: Line 213:
 
|
 
|
 
|-
 
|-
| pcie
+
| pcie, [6.0.0+] pcie:log
 
| [[PCIe services]]
 
| [[PCIe services]]
 
|
 
|
Line 209: Line 225:
 
|
 
|
 
|-
 
|-
| psc:c, psc:m
+
| psc:c, psc:m, [5.0.0+] srepo:u, srepo:a
 
| [[PSC services]]
 
| [[PSC services]]
 
|  
 
|  
 
|-
 
|-
| [3.0.0+] ldr:ro, ro:dmnt
+
| [3.0.0+] ldr:ro, ro:dmnt, [7.0.0+] ro:1
 
| [[Loader services|RO services]]
 
| [[Loader services|RO services]]
 
|
 
|
Line 221: Line 237:
 
| cal: calibration, sys: System Settings
 
| cal: calibration, sys: System Settings
 
|-
 
|-
| [3.0.0+] mii:u, mii:e, pdm:ntfy, pdm:qry, pl:u
+
| [3.0.0+] mii:u, mii:e, pdm:ntfy, pdm:qry, pl:u, [5.0.0+] miiimg, [6.0.0+] avm
 
| [[Shared Database services]]
 
| [[Shared Database services]]
 
|
 
|
Line 229: Line 245:
 
|
 
|
 
|-
 
|-
| csrng, spl:
+
| csrng, spl:, [4.0.0+] spl:mig, spl:fs, spl:ssl, spl:es, [5.0.0+] spl:manu
 
| [[SPL services]]
 
| [[SPL services]]
 
|  
 
|  
 
|-
 
|-
| usb:ds, usb:hs, usb:pd, usb:pd:c, usb:pm
+
| sf-uds
 +
| ?
 +
| System debug applet "recovery" has access to this service, but it doesn't appear to exist.
 +
|-
 +
| tspm
 +
| ?
 +
| Applications on [1.0.0] used to have access to this service, but it doesn't appear to be present on retail devices.
 +
|-
 +
| usb:ds, usb:hs, usb:pd, usb:pd:c, [1.0.0] usb:pd:m, usb:pm, [7.0.0+] usb:hs:a, [7.0.0+] usb:qdb
 
| [[USB services]]
 
| [[USB services]]
 
|  
 
|  
 
|-
 
|-
| wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc
+
| wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc, [6.0.0+] wlan:dtc
| WLAN services
+
| [[WLAN services]]
 
|
 
|
 
|-
 
|-
| [4.0.0+] grc:c
+
| [4.0.0+] grc:c, [6.0.0+] grc:d
| GRC services
+
| [[GRC services]]
 
|  
 
|  
 
|-
 
|-
 
| [4.0.0+] mig:usr
 
| [4.0.0+] mig:usr
| Migration services
+
| [[Migration services]]
 
|  
 
|  
 
|-
 
|-
 
| [4.0.0+] caps:dc
 
| [4.0.0+] caps:dc
| Jpegdec services
+
| [[Jpegdec services]]
 +
|
 +
|-
 +
| [6.0.0+] olsc:s
 +
| [[OLSC services]]
 
|  
 
|  
 
|}
 
|}
  
 
[[Category:Services]]
 
[[Category:Services]]

Revision as of 15:50, 29 January 2019

Services are system processes running in the background which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via inter-process communication (each service has a name up to 8 characters).

Handles for services are retrieved from the service manager port, "sm:", and are released via svcCloseHandle or when a process is terminated or crashes. Manager service "sm:m" also exists. Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC. Services are also able to limit the number of handles given to other processes.

sm:

This is "nn::sm::detail::IUserInterface".

Cmd Name
0 #Initialize
1 #GetService
2 #RegisterService
3 #UnregisterService

Initialize

Takes a pid descriptor and a reserved input u64.

GetService

Takes a zero-padded service name encoded as an u64 integer. Returns a handle.

RegisterService

Takes a zero-padded service name encoded as an u64 integer, an u8 bool, and an u32 (session count) at the next word. Returns a handle.

UnregisterService

Takes a zero-padded service name encoded as an u64 integer.

sm:m

This is "nn::sm::detail::IManagerInterface".

Cmd Name
0 #RegisterProcess
1 #UnregisterProcess

RegisterProcess

Takes a pid and two A descriptors with the ACID and ACI0 service lists. That data originates from NPDM.

UnregisterProcess

Takes a pid.

Service List

Service names Description Notes
acc:u0, acc:u1, acc:aa, acc:su, [5.0.0+] dauth:0 Account services u0: System, u1: User, su: Admin, aa: Baas
ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, irs, irs:sys, xcd:sys, [4.0.0+] hid:tmp, [5.0.0+] hidbus HID services
appletAE, appletOE, idle:sys, omm, spsm, [5.0.0+] tcap, [6.0.0+] caps:su AM services
[1.0.0-2.3.0] aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry

[3.0.0+] aoc:u, ns:am2, ns:dev, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, ns:web, ovln:rcv, ovln:snd

NS Services am: Application Manager, su: System Update
apm, apm:p, apm:dbg, apm:sys, fgm, fgm:0, fgm:9, fgm:dbg PPC services fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6 and fgm:7 used to exist, but are now deprecated.
arp:r, arp:w, [2.0.0+] bgtc:t, [2.0.0+] bgtc:sc Glue services
audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u, audrec:a, audrec:d, audrec:u, audctl, codecctl, hwopus, auddebug, [6.0.0+] auddev Audio services
banana Profiler services Not currently available on retail units.
bcat:a, bcat:u, bcat:m, bcat:s, news:a, news:c, news:m, news:p, news:v, prepo:u, prepo:s, prepo:m, [1.0.0-5.1.0] prepo:a, [6.0.0+] prepo:a2 BCAT services
[1.0.0] bpc:c, bpc:b, bpc:r, bpc:w, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s

[2.0.0+] bpc, bpc:r, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s

PCV services
bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres Sockets services
btdrv, [5.0.0+] bt Bluetooth Driver services
btm, btm:dbg, btm:sys, [5.0.0+] btm:u BTM services
caps:a, caps:c, [1.0.0] mm:u, [5.0.0+] caps:u Capture services a: AlbumAccessor, c: AlbumControl
[2.0.0+] caps:sc, [2.0.0+] caps:ss, vi:m, vi:s, vi:u, cec-mgr, [2.0.0+] mm:u, [4.0.0-5.1.0] caps:su Display services
dispdrv Nvnflinger services
dmnt:- Debug Monitor services Not currently available on retail units.
erpt:c, erpt:r Error Report services
eupld:c, eupld:r Error Upload services
es ETicket services
fan, psm, tc, ts, pcm PTM services pcm is not available on retail units.
fatal:u, fatal:p Fatal services
friend:u, friend:v, friend:m, friend:s, friend:a, [5.0.0+] nd:app, nd:sys Friend services
fsp-srv, fsp-ldr, fsp-pr Filesystem services srv: Main, ldr: Loader, pr: Program Registry
gpio, i2c, i2c:pcv, pinmux, pwm, uart, [3.0.0+] sasbus Bus services
htc, htcs, htc:tenv, file_io, gds, tma_log, tmagent TMA services
jit:u JIT services Not currently available on retail units.
lbl Backlight services
ldn:m, ldn:s, ldn:u, [5.0.0+] ndd LDN services
[1.0.0+] ldr:pm, ldr:ro, ldr:shel, ldr:dmnt

[3.0.0+] ldr:pm, ldr:shel, ldr:dmnt

Loader services
lm, lm:get Log services
manu Manu Services "Manufacturing", present in factory firmware but not installed on retail systems.
lr, ncm, ncm:v NCM services
nfc:am, nfc:mf:u, nfc:user, nfc:sys, nfp:user, nfp:dbg, nfp:sys NFC services
nifm:u, nifm:a, nifm:s Network Interface services
nim, nim:shp, ntc, [5.0.0+] nim:eca, [7.0.0+] nim:ecas NIM services
npns:u, npns:s NPNS services
nvdrv:a, nvdrv:s, nvdrv:t, nvdrv, nvdrvdbg, nvgem:c, nvgem:cd, nvmemp NV services
pcie, [6.0.0+] pcie:log PCIe services
pctl, pctl:a, pctl:s, pctl:r Parental Control services
pm:bm, pm:info, pm:shell Process Manager services
psc:c, psc:m, [5.0.0+] srepo:u, srepo:a PSC services
[3.0.0+] ldr:ro, ro:dmnt, [7.0.0+] ro:1 RO services
set, set:fd, set:cal, set:sys Settings services cal: calibration, sys: System Settings
[3.0.0+] mii:u, mii:e, pdm:ntfy, pdm:qry, pl:u, [5.0.0+] miiimg, [6.0.0+] avm Shared Database services
ssl SSL services
csrng, spl:, [4.0.0+] spl:mig, spl:fs, spl:ssl, spl:es, [5.0.0+] spl:manu SPL services
sf-uds ? System debug applet "recovery" has access to this service, but it doesn't appear to exist.
tspm ? Applications on [1.0.0] used to have access to this service, but it doesn't appear to be present on retail devices.
usb:ds, usb:hs, usb:pd, usb:pd:c, [1.0.0] usb:pd:m, usb:pm, [7.0.0+] usb:hs:a, [7.0.0+] usb:qdb USB services
wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc, [6.0.0+] wlan:dtc WLAN services
[4.0.0+] grc:c, [6.0.0+] grc:d GRC services
[4.0.0+] mig:usr Migration services
[4.0.0+] caps:dc Jpegdec services
[6.0.0+] olsc:s OLSC services