Difference between revisions of "Services API"
From Nintendo Switch Brew
(→Service List) |
|||
| (58 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
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). | 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:". Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC. | + | Handles for services are retrieved from the service manager port, "sm:". 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. |
= sm: = | = sm: = | ||
| Line 14: | Line 14: | ||
| 2 || [[#RegisterService]] | | 2 || [[#RegisterService]] | ||
|- | |- | ||
| − | | 3 || | + | | 3 || [[#UnregisterService]] |
|} | |} | ||
| Line 30: | Line 30: | ||
| 0-1 || Pid | | 0-1 || Pid | ||
|- style="border-top: double" | |- style="border-top: double" | ||
| − | | 0 || " | + | | 0 || "SFCI" |
|- | |- | ||
| 1 || 0x00000000 | | 1 || 0x00000000 | ||
| Line 46: | Line 46: | ||
| 1 || 0x0000000A | | 1 || 0x0000000A | ||
|- style="border-top: double" | |- style="border-top: double" | ||
| − | | 0 || " | + | | 0 || "SFCI" |
|- | |- | ||
| 1 || 0x00000001 | | 1 || 0x00000001 | ||
| Line 62: | Line 62: | ||
| 1 || 0x0000000C | | 1 || 0x0000000C | ||
|- style="border-top: double" | |- style="border-top: double" | ||
| − | | 0 || " | + | | 0 || "SFCI" |
|- | |- | ||
| 1 || 0x00000002 | | 1 || 0x00000002 | ||
| Line 72: | Line 72: | ||
| 4 || Unknown bool | | 4 || Unknown bool | ||
|} | |} | ||
| + | |||
| + | == UnregisterService == | ||
| + | {| class="wikitable" border="1" | ||
| + | |- | ||
| + | ! Word || Value | ||
| + | |- | ||
| + | | 0 || 0x00000004 | ||
| + | |- | ||
| + | | 1 || 0x0000000A | ||
| + | |- style="border-top: double" | ||
| + | | 0 || "SFCI" | ||
| + | |- | ||
| + | | 1 || 0x00000003 | ||
| + | |- | ||
| + | | 2 || Service name, zero padded and casted to u64. | ||
| + | |} | ||
| + | |||
| + | = sm:m = | ||
| + | This service is presumably equivalent to 3DS "srv:pm". | ||
= Service List = | = Service List = | ||
| Line 80: | Line 99: | ||
! scope="col" width="200" | Notes | ! scope="col" width="200" | Notes | ||
|- | |- | ||
| − | | acc:u1, acc:su | + | | acc:u0, acc:u1, acc:aa, acc:su |
| [[Account services]] | | [[Account services]] | ||
| − | | u1: | + | | u0: System, u1: User, su: Admin, aa: Baas |
|- | |- | ||
| − | | | + | | ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, (htc?), irs, irs:sys, xcd:sys |
| − | | | + | | [[HID services]] |
| | | | ||
|- | |- | ||
| − | | | + | | appletAE, appletOE, idle:sys, omm, spsm |
| − | | | + | | Applet services, [[OMM services]] |
| | | | ||
|- | |- | ||
| − | | audren:u | + | | aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry |
| − | | Audio | + | | [[NS Services]] |
| + | | am: Application Manager, su: System Update | ||
| + | |- | ||
| + | | apm, apm:p, apm:sys, fgm, fgm:0, fgm:9, (fgm:dbg?) | ||
| + | | [[APM services]] | ||
| + | | | ||
| + | |- | ||
| + | | arp:r, arp:w, bgtc:t, bgtc:sc | ||
| + | | 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 | ||
| + | | Audio services | ||
| | | | ||
|- | |- | ||
| − | | | + | | <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> |
| − | | | + | | [[BCAT services]] |
| | | | ||
|- | |- | ||
| − | | | + | | bpc, bpc:r, pcv, pcv:imm, time:u, time:a, time:s |
| − | | | + | | [[BPC services]] |
| | | | ||
|- | |- | ||
| − | | bsd:u, bsd:s | + | | bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres |
| − | | Sockets services | + | | [[Sockets services]], [[NSD services]] |
| | | | ||
|- | |- | ||
| − | | caps:a, caps:c | + | | btdrv |
| − | | Capture services | + | | Bluetooth Driver services |
| − | | a: | + | | |
| + | |- | ||
| + | | btm, btm:dbg, btm:sys | ||
| + | | Battery services | ||
| + | | | ||
| + | |- | ||
| + | | caps:a, caps:c | ||
| + | | [[Capture services]] | ||
| + | | a: AlbumAccessor, c: AlbumControl | ||
| + | |- | ||
| + | | caps:sc, caps:ss, mm:u, vi:m, vi:s, vi:u, cec-mgr | ||
| + | | [[Display services]] | ||
| + | | | ||
|- | |- | ||
| − | | fatal:u | + | | csrng |
| + | | [[Secure RNG services]] | ||
| + | | | ||
| + | |- | ||
| + | | dispdrv | ||
| + | | Nvnflinger services | ||
| + | | | ||
| + | |- | ||
| + | | erpt:c, erpt:r | ||
| + | | Error Report services | ||
| + | | | ||
| + | |- | ||
| + | | es | ||
| + | | ETicket services | ||
| + | | | ||
| + | |- | ||
| + | | fan, psm, tc, ts | ||
| + | | PTM services | ||
| + | | | ||
| + | |- | ||
| + | | fatal:u, fatal:p | ||
| Fatal Error services | | Fatal Error 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 | ||
| Line 120: | Line 183: | ||
| | | | ||
|- | |- | ||
| − | | fsp-srv | + | | fsp-srv, fsp-ldr, fsp-pr |
| [[Filesystem services]] | | [[Filesystem services]] | ||
| + | | srv: Main, ldr: Loader, pr: Program Registry | ||
| + | |- | ||
| + | | gpio, i2c, i2c:pcv, pinmux, pwm, uart | ||
| + | | [[Bus services]] | ||
| | | | ||
|- | |- | ||
| − | | | + | | lbl |
| − | | [[ | + | | [[Backlight services]] |
| − | | | + | | |
|- | |- | ||
| − | | ldn:m | + | | ldn:m, ldn:s, ldn:u |
| − | | Local Network Monitor services | + | | [[Local Network Monitor services]] |
| | | | ||
|- | |- | ||
| − | | ldr:ro, ldr:shel | + | | ldr:pm, ldr:ro, ldr:shel, ldr:dmnt |
| [[Loader services]] | | [[Loader services]] | ||
| | | | ||
| Line 140: | Line 207: | ||
| | | | ||
|- | |- | ||
| − | | lr | + | | lr, ncm, ncm:v |
| − | | | + | | [[Location Resolver services]] |
| | | | ||
|- | |- | ||
| − | | | + | | nfc:am, nfc:mf:u, nfc:user, nfc:sys |
| − | + | | NFC services | |
| − | + | | | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | | | ||
| − | | | ||
|- | |- | ||
| nifm:u, nifm:a, nifm:s | | nifm:u, nifm:a, nifm:s | ||
| − | | Network Interface services | + | | [[Network Interface services]] |
| − | | | + | | |
|- | |- | ||
| − | | nim:shp | + | | nim, nim:shp, ntc |
| − | | NIM services | + | | [[NIM services]] |
| shp: eShop | | shp: eShop | ||
|- | |- | ||
| − | | | + | | npns:u, npns:s |
| − | + | | NPNS services | |
| − | |||
| − | |||
| − | |||
| − | | | ||
| | | | ||
|- | |- | ||
| − | | nvdrv:a, nvmemp | + | | nvdrv:a, nvdrv:s, nvdrv:t, nvdrv, nvdrvdbg, nvgem:c, nvgem:cd, nvmemp |
| [[NV services]] | | [[NV services]] | ||
| | | | ||
|- | |- | ||
| − | | | + | | pcie |
| − | | | + | | [[PCIe services]] |
| | | | ||
|- | |- | ||
| Line 184: | Line 239: | ||
| | | | ||
|- | |- | ||
| − | | | + | | pm:bm, pm:info, pm:shell |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| [[Process Manager services]] | | [[Process Manager services]] | ||
| | | | ||
|- | |- | ||
| − | | | + | | psc:c, psc:m |
| − | | | + | | PSC services |
| − | | | + | | |
|- | |- | ||
| − | | set, set:sys | + | | set, set:fd, set:cal, set:sys |
| − | | Settings services | + | | [[Settings services]] |
| − | | sys: System | + | | cal: calibration, sys: System Settings |
|- | |- | ||
| − | | | + | | ssl |
| − | | | + | | [[SSL services]] |
| | | | ||
|- | |- | ||
| − | | | + | | spl: |
| − | | | + | | [[SPL services]] |
| − | | | + | | |
|- | |- | ||
| − | | | + | | usb:ds, usb:hs, usb:pd, usb:pd:c, usb:pm |
| − | | | + | | USB services |
| − | | | + | | |
|- | |- | ||
| − | | | + | | wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc |
| − | | | + | | WLAN services |
| | | | ||
|} | |} | ||
| + | |||
| + | [[Category:Services]] | ||
Latest revision as of 21:23, 12 July 2017
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:". 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.
Contents
sm:
| Cmd | Name |
|---|---|
| 0 | #Initialize |
| 1 | #GetService |
| 2 | #RegisterService |
| 3 | #UnregisterService |
Initialize
| Word | Value |
|---|---|
| 0 | 0x00000004 |
| 1 | 0x8000000A |
| 2 | 0x00000001 |
| 0-1 | Pid |
| 0 | "SFCI" |
| 1 | 0x00000000 |
| 2 | Always 0. |
GetService
| Word | Value |
|---|---|
| 0 | 0x00000004 |
| 1 | 0x0000000A |
| 0 | "SFCI" |
| 1 | 0x00000001 |
| 2 | Service name, zero padded and casted to u64. |
RegisterService
| Word | Value |
|---|---|
| 0 | 0x00000004 |
| 1 | 0x0000000C |
| 0 | "SFCI" |
| 1 | 0x00000002 |
| 2 | Service name, zero padded and casted to u64. |
| 3 | Max sessions? 32-bit integer. |
| 4 | Unknown bool |
UnregisterService
| Word | Value |
|---|---|
| 0 | 0x00000004 |
| 1 | 0x0000000A |
| 0 | "SFCI" |
| 1 | 0x00000003 |
| 2 | Service name, zero padded and casted to u64. |
sm:m
This service is presumably equivalent to 3DS "srv:pm".
Service List
| Service names | Description | Notes |
|---|---|---|
| acc:u0, acc:u1, acc:aa, acc:su | Account services | u0: System, u1: User, su: Admin, aa: Baas |
| ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, (htc?), irs, irs:sys, xcd:sys | HID services | |
| appletAE, appletOE, idle:sys, omm, spsm | Applet services, OMM services | |
| aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry | NS Services | am: Application Manager, su: System Update |
| apm, apm:p, apm:sys, fgm, fgm:0, fgm:9, (fgm:dbg?) | APM services | |
| arp:r, arp:w, bgtc:t, bgtc:sc | 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 | Audio services | |
| 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 | BCAT services | |
| bpc, bpc:r, pcv, pcv:imm, time:u, time:a, time:s | BPC services | |
| bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres | Sockets services, NSD services | |
| btdrv | Bluetooth Driver services | |
| btm, btm:dbg, btm:sys | Battery services | |
| caps:a, caps:c | Capture services | a: AlbumAccessor, c: AlbumControl |
| caps:sc, caps:ss, mm:u, vi:m, vi:s, vi:u, cec-mgr | Display services | |
| csrng | Secure RNG services | |
| dispdrv | Nvnflinger services | |
| erpt:c, erpt:r | Error Report services | |
| es | ETicket services | |
| fan, psm, tc, ts | PTM services | |
| fatal:u, fatal:p | Fatal Error services | u: User, p: Privileged |
| friend:u, friend:v, friend:m, friend:s, friend:a | Friend services | |
| fsp-srv, fsp-ldr, fsp-pr | Filesystem services | srv: Main, ldr: Loader, pr: Program Registry |
| gpio, i2c, i2c:pcv, pinmux, pwm, uart | Bus services | |
| lbl | Backlight services | |
| ldn:m, ldn:s, ldn:u | Local Network Monitor services | |
| ldr:pm, ldr:ro, ldr:shel, ldr:dmnt | Loader services | |
| lm | Log services | |
| lr, ncm, ncm:v | Location Resolver services | |
| nfc:am, nfc:mf:u, nfc:user, nfc:sys | NFC services | |
| nifm:u, nifm:a, nifm:s | Network Interface services | |
| nim, nim:shp, ntc | NIM services | shp: eShop |
| npns:u, npns:s | NPNS services | |
| nvdrv:a, nvdrv:s, nvdrv:t, nvdrv, nvdrvdbg, nvgem:c, nvgem:cd, nvmemp | NV services | |
| pcie | 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 | PSC services | |
| set, set:fd, set:cal, set:sys | Settings services | cal: calibration, sys: System Settings |
| ssl | SSL services | |
| spl: | SPL services | |
| usb:ds, usb:hs, usb:pd, usb:pd:c, usb:pm | USB services | |
| wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc | WLAN services |