/dev/fsa

< /dev
Revision as of 00:17, 30 January 2016 by Marionumber1 (talk | contribs) (Start /dev/fsa documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

/dev/fsa is the IOSU device node for the virtual filesystem API. It exposes a generic interface for accessing various filesystems supported by the Wii U, including the internal storage filesystem (ISFS), game disc filesystems, and SD cards. These filesystems can be mounted on directories under /vol and accessed through a common API. Once opened, ioctl() and ioctlv() requests can be issued to the interface, which are documented below.

ioctl() interface

0x0A - FSOpenDir()

0x0B - FSReadDir()

0x0E - FSOpenFile()

ioctlv() interface

0x0F - FSReadFile()

This function is used to read data from an open file. It takes one input buffer through the ioctlv interface, a read request block, and two output buffers, a buffer for file data and a status block.

0x10 - FSWriteFile()

This function is used to read data from an open file. It takes two input buffers through the ioctlv interface, a read request block and a data buffer, and one output buffer, a status block.

Structures

Request Blocks

The parameters to FSA functions are passed in a 0x520-byte request block. While the size is constant, the structure varies by call, as shown below:

/* Read/write request block */
typedef struct
{
    char unknown0[0x4-0x0];
    void *buffer;                  // Not looked at by FSA
    uint32_t size, count;
    char unknown10[0x14-0x10];
    uint32_t handle;
    char unknown18[0x520-0x18];
} rw_req_t;

Status Blocks

All FSA functions return the status of the call in a 0x293-byte buffer.