Changes

1,605 bytes added ,  21:25, 19 January 2024
Add section about hai params
Line 12: Line 12:  
=== SDI ===
 
=== SDI ===
 
This modified SDI module adds '''/dev/sdio/MLC01''' to allow reading and writing to the MLC, which is used by DI2SD.
 
This modified SDI module adds '''/dev/sdio/MLC01''' to allow reading and writing to the MLC, which is used by DI2SD.
 +
 +
== Hai params ==
 +
The Wii U mode passes some parameters to this IOS which are referred to as "HaiParam" or "Hai params" (see [[cafe2wii#HAI|HAI mode]]).
 +
 +
=== Format ===
 +
These parameters are stored in memory at 0xfffff000 and their format is described below.
 +
 +
==== Header ====
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| Magic value: "Hai" (0x48616900)
 +
|-
 +
| 0x04
 +
| 2
 +
| Total size of the parameters (including header) in bytes
 +
|-
 +
| 0x06
 +
| 2
 +
| Parameter count
 +
|}
 +
The parameters follow after the header.
 +
 +
==== Parameter ====
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 2
 +
| ID (see table below)
 +
|-
 +
| 0x02
 +
| 2
 +
| Size of parameter data in bytes
 +
|}
 +
The parameter data follows after the structure described above.
 +
 +
==== Parameter IDs ====
 +
{| class="wikitable"
 +
|-
 +
! Key
 +
! Description
 +
|-
 +
| 0x0
 +
| Ticket of the title to boot
 +
|-
 +
| 0x1
 +
| TMD of the title to boot
 +
|-
 +
| 0x100
 +
| This is a string in the following format: <code>target:/path</code>.<br>Where target is either <code>mlc</code>, <code>usb</code>, <code>ahci</code> or <code>file</code> and path is the path to the imginf.bin file containing offsets to the nfs files (usually <code>/shared2/sys/hai/imginf.bin</code> on the slccmpt).
 +
|-
 +
| 0x101
 +
| Unknown (0x10 bytes)
 +
|-
 +
| 0x200
 +
| Unknown (4 byte integer which is either 0 or 1)
 +
|-
 +
| 0x201
 +
| Unknown (4 byte integer)
 +
|-
 +
| 0x300
 +
| Unknown (1 byte which is always set to 1 by the IOSU)
 +
|}
 +
 +
=== Syscall 7A ===
 +
To retrieve these parameters HAI-IOS has an additional syscall in the following format: <code>IOSError syscall_7a(u16 id, void *data, u32 *size)</code>.