Skip to content
Leo Lam edited this page Jul 10, 2017 · 11 revisions

IOS is the Wii's internal operating system running on an ARM coprocessor. Games run on the bare metal but rely on IOS for essential services like DI, USB and power state management.

Emulation

Dolphin does not emulate the Starlet coprocessor at all, except the IPC registers, which are however hardcoded to be routed to IOS HLE. This means that Dolphin is unable to run any IOS or anything running on the Starlet, and instead HLEs IOS. This works fine with anything that doesn't rely on raw hardware access or patching IOS.

Differences between IOS versions are typically not emulated, since they are mostly minor and do not affect anything. The USB modules are currently the only exception.

HLE Overview

Modules

Module Status
Kernel Cannot be implemented with HLE in a way that makes sense.
ES Mostly complete. Does not support consumption tracking and two ioctls that expose kernel internals directly (thread priorities). The latter cannot be implemented with HLE in a way that makes sense.
FFS / FFSP Partially implemented. Does not support filesystem metadata, proper block sizes, boot2 or direct flash access.
--- ---
DIP Implemented as a thin wrapper around Dolphin's DVDInterface.
STM Mostly complete. Screen dimming is not supported.
--- ---
SDI Implemented but somewhat broken. Doesn't handle SDv2 and high capacity cards correctly.
--- ---
EHCI Not implemented (internal).
KBD Not implemented, except on Windows where it uses the host keyboard input.
OH0 Mostly complete
OH1 Complete
USB Not implemented (internal).
USB_HID (v4) Complete
USB_HID (v5) Not implemented (not known to be used by anything).
USB_HUB Not implemented (internal?)
USB_MSC Not implemented (internal)
USB_SHARED Not implemented (internal)
USB_VEN Mostly complete
--- ---
WFSI Partially implemented
WFSKRN Partially implemented
--- ---
ETH Not implemented (internal).
KD Mostly a stub.
NCD Implemented (?)
SO Implemented (uses the host network stack directly).
SSL Implemented. However, Dolphin is unable to use certificates that are built-in to the module.
WD Mostly a stub. Can return fake AP info. No Wi-Fi hardware emulation or DS communication.
WL Not implemented (low-level WLAN driver).

General TODO

  • Implement the remaining functionality.

  • Threading.

    Dolphin currently runs the entirety of IOS HLE on a single thread, including blocking IO such as NAND filesystem access and networking tasks. This causes terrible performance or stuttering depending on what modules are actually used, and more generally affects all titles using the NAND to a lesser extent.

    The difficulty of implementing threading is that IOS uses many threads internally and there is internal IPC. This means that if the ES thread is blocked for example, the USB thread may just carry on serving IPC requests and processing USB transfers. A naïve implementation that just moves IOS HLE to a single separate thread will either cause issues (as requests can time out) or be ineffective at eliminating performance issues (if most requests still end up blocking). Additionally, any threaded implementation must still maintain determinism.

  • Implement more differences between versions.

    We should only expose resource managers that exist in the running version. This may seem irrelevant, until you remember that a game was relying on differences between IOS versions for their anti-piracy system. This applies to ioctls too.

ES TODO

  • Title limits and consumption tracking.

  • Drop the direct WAD launch hack.

    Keeping it forces us to be inefficient since we have to read tons of extra files or keep the entire WAD in memory, and possibly decrypt contents on every single boot. It also requires handling WAD files as a special case and encourages sloppy emulation, as inconsistent results will be returned. Additionally, getting rid of it will us to reuse the ES_LaunchTitle logic much more easily.

References

  • WiiBrew is probably the best (and only) reference for IOS.