Cafe OS
Cafe OS is the operating system running on the PowerPC in Wii U mode. It consists of the Cafe OS kernel, the executable loader, and system libraries. Unlike on the Wii, where games ran with full hardware access, Wii U applications run under the supervision of the kernel, isolating them from each other. All applications are modified ELFs, as are the libraries themselves, and applications dynamically link with them to gain access to OS services. Cafe OS also contains a few system processes, like the home menu and error handler.
Architecture
Kernel
From initial analysis it seems to be a microkernel (.text is about 128 kB) and provides basic syscalls for running processes.
Loader
The loader is responsible for loading RPL formatted libraries and executables into memory. It is a standard ELF executable named loader.elf. It includes a statically linked copy of zlib, probably for decompressing sections of RPL files.
Libraries
Cafe OS applications dynamically link with system libraries to get access to OS services. These OS services include memory management, graphics, audio, and controller input. All libraries are RPL files, a modification of the standard ELF format with compressed sections and more Windows-like dynamic linking. The main system libraries are listed below, with some having their own pages of documentation:
- avm.rpl - Audio/Video Manager
- camera.rpl - Gamepad camera
- coreinit.rpl - Kernel, memory, and FS
- dc.rpl - Display Controller
- dmae.rpl - DMA (Direct Memory Access)
- drmapp.rpl - Digital Rights Management
- erreula.rpl - Error Viewer
- gx2.rpl - Graphics
- h264.rpl - Support for H.264
- lzma920.rpl - LZMA compression
- mic.rpl - Gamepad microphone
- nfc.rpl - Low-level NFC library
- nio_prof.rpl - IO Profiler
- nlibcurl.rpl - libcurl 7.21.7, functions match official library
- nlibnss.rpl - libnss
- nlibnss2.rpl
- nn_ac.rpl - Nintendo Network Auto Connection
- nn_acp.rpl - Nintendo Network Account/Access Protection
- nn_act.rpl - Nintendo Network Accounts
- nn_aoc.rpl - Nintendo Network Add-On Content
- nn_boss.rpl - Nintendo Network BOSS (Streetpass)
- nn_ccr.rpl
- nn_cmpt.rpl - Nintendo Network Compatibility ???
- nn_ec.rpl - Nintendo Network E-Commerce
- nn_fp.rpl - Nintendo Network Friend Presence
- nn_hai.rpl
- nn_hpad.rpl - Something related to controllers
- nn_idbe.rpl - Downloads and decrypts game icons from an online icon database
- nn_ndm.rpl - Daemons???
- nn_nets2.rpl - More network functions
- nn_nfp.rpl - Nintendo Network Nintendo Figurine Platform (Amiibo)
- nn_nim.rpl
- nn_olv.rpl - Olive/OLV - Miiverse
- nn_pdm.rpl - System Play related data (play times etc.)
- nn_save.rpl - Savefile access
- nn_sl.rpl
- nn_spm.rpl - Storage related functions (USB?)
- nn_temp.rpl - TEMP library (for temporary files)
- nn_uds.rpl - UDS/Local Connection library
- nn_vctl.rpl
- nsysccr.rpl - DRH communication (input and RPC)
- nsyshid.rpl - Human Interface Device library
- nsyskbd.rpl - USB keyboard library
- nsysnet.rpl - BSD sockets
- nsysuhs.rpl - Low-level USB access
- nsysuvd.rpl
- ntag.rpl - NTAG high level NFC library
- padscore.rpl - Wii Remote and Balance Board
- proc_ui.rpl
- snd_core.rpl
- snd_user.rpl
- sndcore2.rpl
- snduser2.rpl
- swkbd.rpl - Onscreen keyboard
- sysapp.rpl
- tcl.rpl - Texture Core library
- tve.rpl - TV Engine
- uac.rpl - DRH communication (Gamepad microphone)
- uac_rpl.rpl
- usb_mic.rpl
- uvc.rpl - DRH communication (Gamepad camera)
- uvd.rpl - AMD's OpenVideo Decode library, with some different function names
- vpad.rpl - Gamepad input
- vpadbase.rpl - Gamepad base library
- zlib125.rpl - ZLIB 1.2.5, functions match official library
Virtual Memory Map
- 0x01000000 - 0x01?????? Loader and system libraries
- 0x10000000 - 0x10?????? User-mode OS globals
- 0xe0000000 - 0xe4000000 Some sort of hardware communication area
- 0xf4000000 - 0xf6000000 MEM1
- 0xf6000000 - 0xf6800000 Unknown
- 0xf8000000 - 0xfb000000 Read-only shared data (system fonts mostly)
- 0xffee0000 - 0xfff20000 Kernel code
- 0xffffffe0(?) - 0xfffffffc(?) Per-thread data (e.g. pointer to thread descriptor and thread queue)