How switchbrew/libnx works
libnx is a Nintendo Switch AArch64 userland library: it gives homebrew applications runtime support and C APIs for kernel operations, system services, applets, and hardware-facing features. The typical path is application code → libnx runtime or feature API → IPC/syscall boundary → Horizon services or kernel → result returned to the application. The tree and excerpts support the major capability areas below; many individual service implementations were not sampled, so their internal wiring is intentionally summarized.
Main entry points: kernel Kernel APIs · services System services · service.h Service IPC · init.c Runtime setup
Components 18
Runtime and kernel
- Runtime setup
nx/source/runtime/init.c - Runtime devices
nx/source/runtime/devices - Kernel APIs
nx/include/switch/kernel
IPC and services
- Service IPC
nx/include/switch/sf/service.h - Session manager
nx/source/sf/sessionmgr.c - System services
nx/source/services - Applet service
nx/source/services/applet.c - Filesystem service
nx/source/services/fs.c
User-facing features
- Applet wrappers
nx/source/applets
Hardware APIs
- Display and buffers
nx/source/display - Audio engine
nx/source/audio - NVIDIA GPU
nx/source/nvidia
Utility APIs
- Cryptography
nx/source/crypto - Network runtime
nx/source/runtime - Bluetooth runtime
nx/source/runtime/btdev.c
Other components
- Homebrew application
- Horizon kernel
- Horizon services
Connections 17
- Homebrew application → Runtime setup: starts through
- Homebrew application → Kernel APIs: uses
- Homebrew application → System services: calls
- Homebrew application → Applet wrappers: launches
- Runtime setup → Kernel APIs: initializes
- Runtime devices → Kernel APIs: uses
- Kernel APIs → Horizon kernel: issues syscalls
- System services → Service IPC: sends requests
- Service IPC → Horizon services: transfers IPC
- Session manager → Kernel APIs: synchronizes via
- Applet wrappers → Applet service: launches through
- Applet service → Service IPC: sends requests
- Display and buffers → System services: uses services
- Audio engine → System services: uses services
- NVIDIA GPU → Kernel APIs: uses syscalls
- Bluetooth runtime → System services: calls
- Filesystem service → Service IPC: sends requests