Overview
Oboromi implements High-Level Emulation (HLE) of Nintendo’s firmware services through thenn:: namespace. Rather than emulating the Switch operating system at a low level, services are implemented directly in Rust, providing faster execution and easier debugging.
Architecture
The service framework consists of three layers:Service Trait System
All services implement a common trait defined incore/src/nn/mod.rs:
Service Registration Macro
Services are defined using a macro that generates boilerplate code:- A module for each service (e.g.,
nn::acc,nn::hid) - A
Statestruct to hold service-specific data - A constructor that receives global system state
- A
run()method that initializes and registers the service
Service Catalog
Oboromi currently defines 160 system services, organized by category:- Core Services
- Audio Services
- Network Services
- System Services
Complete Service List (160 services)
Complete Service List (160 services)
acc, adraw, ahid, aoc, apm, applet_ae, applet_oe, arp, aud, audctl, auddebug, auddev, auddmg, audin, audout, audrec, audren, audsmx, avm, banana, batlog, bcat, bgtc, bpc, bpmpmr, bsd, bsdcfg, bt, btdrv, btm, btp, capmtp, caps, caps2, cec_mgr, chat, clkrst, codecctl, csrng, dauth, disp, dispdrv, dmnt, dns, dt, ectx, erpt, es, eth, ethc, eupld, fan, fatal, fgm, file_io, friend, fs, fsp_ldr, fsp_pr, fsp_srv, gds, gpio, gpuk, grc, gsv, hdcp, hid, hidbus, host1x, hshl, htc, htcs, hwopus, i2c, idle, ifcfg, imf, ins, irs, jit, lbl, ldn, ldr, led, lm, lp2p, lr, manu, mig, mii, miiimg, mm, mnpp, ncm, nd, ndd, ndrm, news, nfc, nfp, ngc, ngct, nifm, nim, notif, npns, ns, nsd, ntc, nvdbg, nvdrv, nvdrvdbg, nvgem, nvmemp, olsc, omm, ommdisp, ovln, pcie, pcm, pctl, pcv, pdm, pgl, pinmux, pl, pm, prepo, psc, psm, pwm, rgltr, ro, rtc, sasbus, set, sf_uds, sfdnsres, spbg, spi, spl, sprof, spsm, srepo, ssl, syncpt, tc, tcap, time, tma_log, tmagent, ts, tspm, uart, usb, vi, vi2, vic, wlan, xcd
System State Management
The global system state is defined incore/src/sys/mod.rs:
Services Container
Option<State> to support lazy initialization.
Service Initialization
All services are initialized through a single entry point:- Services are initialized sequentially (no parallelism currently)
- Service names are provided for debugging/logging
- Each service can access and modify global state during initialization
- Failed initializations propagate through
todo!()panics
Service Implementation Pattern
Here’s how to implement a real service:Service Communication
Services can interact through shared state:Critical Services
Some services are essential for basic emulation:fs - Filesystem
Provides file I/O for game assets, saves, and configuration. Implements RomFS, SaveData, and ContentStorage.
hid - Input
Handles controller input, touchscreen, gyroscope, and other human interface devices.
vi - Display
Manages display surfaces, layer composition, and vsync. Coordinates with GPU for frame presentation.
nvdrv - GPU Driver
Low-level NVIDIA GPU interface. Handles command buffer submission and memory management.
acc - Accounts
User account management. Required for save data isolation and online features.
audren - Audio
Audio rendering pipeline. Processes game audio and outputs to speakers/headphones.
Service Categories
Human Interface Devices
Graphics & Display
Filesystem & Storage
Network Services
Power & System
Current Implementation Status
Priority implementation roadmap:- Phase 1: Core services (fs, hid, vi, nvdrv, acc)
- Phase 2: Audio pipeline (audren, audout)
- Phase 3: Network services (nifm, bsd, ssl)
- Phase 4: Advanced features (applet, friend, news)
Design Rationale
Why HLE over LLE?
- Performance
- Maintainability
- Accuracy
High-Level Emulation:
- Direct Rust implementation
- No instruction-by-instruction emulation
- Native code execution speeds
- Must emulate ARM64 firmware
- Interprets or JITs every instruction
- 10-100x slower for system calls
Hybrid Approach
Oboromi uses HLE by default but could support LLE for specific services:Service Discovery
Games discover services through thesm: (Service Manager) service:
Debugging Services
Testing Services
Related Components
- IPC Mechanism - Inter-process communication
- SVC Handler - Supervisor call emulation
- Service Proxy - Guest-to-host service bridge
Source Files
- Service Framework:
core/src/nn/mod.rs:1-224 - System State:
core/src/sys/mod.rs:1-180 - Module Definition:
core/src/lib.rs:5
