NPLL is a bootloader for all 3 of Nintendo's PowerPC video game consoles:
- GameCube™
- Wii™
- Wii U™
It provides an interface to load Linux on these platforms, all in one universal binary.
_startin src/entry.S, then that entire thing executes from top to bottom (set up virtual memory, stack, SDA/SDA2, clear BSS)initin src/init.c, does hardware detection then hands off belowinitGamecubein src/gamecube/init.c- Go to top-level step 3
initWiiin src/wii/init.c-
Set up USB Gecko debug output for the following steps
-
Map MEM2
-
Set HID4[SBE]
-
Seed initial state for state machine
-
A state machine that does the following:
- (
STATE_ANALYZE) Analyze hardware- Save important state like whether AHBPROT, SRNPROT, and MEM2 are unrestricted
- IOS? ->
STATE_ANALYZE_IOS - MINI? ->
STATE_ANALYZE_MINI
- (
STATE_ANALYZE_IOS) Analyze IOS state- Have not yet initialized IOS IPC core? ->
STATE_IOS_INIT - Ran ARMBootNow already? -> panic
- Ran
/dev/shaexploit but still no hardware perms? -> panic - No perms? ->
STATE_IOS_PRIV_ESC - Have perms? ->
STATE_IOS_ARMBOOTNOW
- Have not yet initialized IOS IPC core? ->
- (
STATE_IOS_INIT) Initialize IOS IPC core- Save IOS version
- Flush IPC transactions
- Close all file descriptors
- Open
/dev/esand make sure it's sane; if it isn't, go back to "Flush IPC transactions" and try again. - ->
STATE_ANALYZE_IOS
- (
STATE_IOS_PRIV_ESC) Gain permissions from IOS- Run the
/dev/shaexploit to gain AHBPROT and SRNPROT permissions - ->
STATE_ANALYZE
- Run the
- (
STATE_IOS_ARMBOOTNOW) Boot MINI from IOS- Use ARMBootNow to hot-patch IOS in SRAM to cause an attempted IOS reload to start MINI instead
- ->
STATE_ANALYZE
- (
STATE_HW_UNRESTRICT) Ensure hardware is fully unrestricted- Enable Broadway access to SRAM
- Detect vWii
- Set up Broadway ownership of GPIOs
- Unrestrict MEM1 and MEM2
- ->
STATE_ANALYZE
- (
STATE_ANALYZE_MINI) Analyze MINI state- MINI IPC core not initialized? ->
STATE_MINI_INIT - IPC initialized, but missing any perms? ->
STATE_MINI_PRIV_ESC - IPC initialized, have perms, booted with MINI, and have not reloaded? ->
STATE_MINI_RELOAD - IPC initialized, have perms, booted with MINI, and have reloaded? ->
STATE_READY - IPC initialized, have perms, booted with IOS, ran ARMBootNow? ->
STATE_POST_IOS_SANITIZE
- MINI IPC core not initialized? ->
- (
STATE_MINI_INIT) Initialize MINI IPC core- Try to initialize MINI IPC
- Success? ->
STATE_ANALYZE - Timeout? ->
STATE_ANALYZE - Other failure? -> panic
- (
STATE_MINI_RELOAD) Reload from unknown copy of MINI into NPLL's bundled copy- Send MINI IPC request to jump to our copy of MINI
- Unmark flags for "MINI IPC initialized", and "currently running MINI"
- ->
STATE_ANALYZE
- (
STATE_MINI_PRIV_ESC) Gain permissions under MINI- Send MINI IPC requests to set up AHBPROT and SRNPROT
- ->
STATE_HW_UNRESTRICT
- (
STATE_POST_IOS_SANITIZE) Clean up hardware after abandoning IOS from ARMBootNow- Reset OHCIs
- ->
STATE_READY
- (
STATE_READY) Ready- Exit state machine
- (
-
Check for HBC return-to-loader stub
-
Set up driver mask
-
Sanity check everything and clean up
-
Go to top-level step 3
-
initWiiUin src/wiiu/init.c- Check AHBPROT
- Set up GPIOs
- Set HID4[SBE], needed to map the majority of MEM2
- Map (most of) MEM2
- Go to top-level step 3
- Common initialization, like exception handling
- Driver initialization - in-order:
- critical (mainly for logging, e.g. EXI, USB Gecko)
- graphics (VI, Latte FB)
- input (SI, PI RSW)
- other (GPIO)
- block (e.g. Hollywood/Latte Front SD)
- Enter main loop, running driver callbacks indefinitely
This codebase uses subsystem IDs for global variables and functions - similar in style to DOOM.
I- InitializationD- DriversH- Current HardwareB- Block devicesM- MemoryFS- FilesystemIN- InputO- OutputV- VideoE- PowerPC Exception handlingELF- ELF binary handlingUI- Menu UIP- Block device partition managementC- Config file handling
For info about the dedicated NPLL config format, see CONFIG_FORMAT.txt.
"Nintendo®" is a registered trademark of Nintendo of America Inc.
"GameCube™" is a trademark of Nintendo of America Inc.
"Wii™" is a trademark of Nintendo of America Inc.
"Wii U™" is a trademark of Nintendo of America Inc.
"PowerPC®" is a registered trademark of International Business Machines Corp.
"Linux®" is the registered trademark of Linus Torvalds in the U.S. and other countries.
All code unless otherwise stated is Copyright (C) 2025-2026 Techflash and NPLL contributors. See the relevant file for additional copyright information.