Line 2:
Line 2:
{{Stub}}
{{Stub}}
−
'''cafe2wii''' is the process in [[IOSU]] used to transition to [[WiiMode]]. It shuts down IOSU, lowers the [[Hardware/Espresso|Espresso]]'s clock speed, disables [[Hardware/Starbuck|Starbuck]] access to Wii U-exclusive hardware, then launches [https://wiibrew.org/wiki/IOS80 IOS80].
+
'''cafe2wii''' is the process used to transition to [[WiiMode]].
+
It lowers the [[Hardware/Espresso|Espresso]]'s clock speed, disables [[Hardware/Starbuck|Starbuck]] access to Wii U-exclusive hardware, then launches the loaded IOS.
+
+
== Launching cafe2wii ==
+
cafe2wii is launched by the MCP module of the IOSU.
+
MCP-CMPT will load multiple binaries from OSv0/v1 into MEM1.
+
It then launches the c2w.img, which prepares those binaries in memory.<br>
+
There are 3 different launch modes for booting into vWii: "NORMAL", "SIMPLE_DOL" and "HAI". All launch modes load the OSv0/v1 c2w.img and foot.bin and read the Wii EEPROM using the "/dev/crpyto" ioctl 0x1e.
+
+
=== NORMAL (0) ===
+
This mode uses the c2w.img and font.bin from OSv0.<br>
+
It reads and parses the TMD of the vWii System Menu stored in the SLCCMPT. Using the boot index of the TMD it loads the System Menu Ancast image into memory.<br>
+
It also reads the TMD of the IOS specified by the System Menu and loads its boot content into memory.
+
+
=== SIMPLE_DOL (1) ===
+
+
=== HAI (2) ===
+
This mode uses the c2w.img and font.bin from OSv1.<br>
+
It loads the COMPAT-BS Ancast image (boot.bin) from OSv1 into memory and an IOS named fw.img from the launched title.<br>
+
It also prepares a structure with hai parameters in memory. Those parameters will be parsed by the loaded IOS.