/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 1 input buffer through the ioctlv interface, a read request block, and 2 output buffers, a buffer for file data and a status block.

0x10 - FSWriteFile()

This function is used to write data to an open file. It takes 2 input buffers through the ioctlv interface, a read request block and a data buffer, and 1 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[0x1c-0x18];
    uint32_t unknown1c;            // Always 0x6e000000
    char unknown20[0x284-0x20];
    uint32_t unknown284;           // Always 0x77000000
    char unknown288[0x294-0x288];
    uint32_t unknown294;           // Always 0x660
    char unknown298[0x520-0x298];
} rw_req_t;

Status Blocks

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


List of functions (Ioctl/Ioctlv/IoctlAsync)

Command Function Ioctl Ioctlv IoctlAsync Notes
0x01 FSMount No Yes No
0x01 FSAMount No Yes No
0x01 FSMountAsync No Yes No
0x01 FSBindMount No Yes No
0x02 FSUnmount Yes No No
0x02 FSAUnmount No Yes No
0x02 FSUnmountAsync No Yes No
0x02 FSBindUnmount Yes No No
0x02 FSBindUnmountAsync Yes Yes No
0x03 FSGetVolumeInfo Yes No No
0x03 FSAGetVolumeInfo No Yes No
0x03 FSGetVolumeInfoAsync No Yes No
0x04 FSInit No No Yes
0x04 FSAInit No No Yes
0x05 FSChangeDir Yes No No
0x05 FSAChangeDir No Yes No
0x05 FSChangeDirAsync No Yes No
0x06 FSGetCwd Yes No No
0x06 FSAGetCwd Yes No No
0x06 FSGetCwd Async Yes No No
0x07 FSMakeDir Yes Yes No
0x08 FSRemove Yes Yes No
0x09 FSRename No Yes No
0x0A FSOpenDir Yes Yes No
0x0B FSReadDir Yes No No
0x0C FSRewindDir Yes No No
0x0D FSCloseDir Yes No No
0x0E FSOpenFile No Yes No
0x0E FSOpenFileEx No Yes No
0x0F FSReadFile No Yes No
0x0F FSReadFileWith Pos No Yes No
0x10 FSWriteFile No Yes No
0x10 FSWriteFileWithPos No Yes No
0x11 FSGetPosFile Yes No No
0x12 FSSetPosFile Yes No No
0x13 FSIsEof Yes No No
0x14 FSGetStatFile Yes No No
0x15 FSCloseFile Yes No No
0x16 FSAGetError No Yes No
0x17 FSFlushFile Yes No No
0x18 FSGetStat Yes Yes No
0x18 FSGetFreeSpaceSize Yes Yes No
0x18 FSGetEntryNum Yes Yes No
0x18 FSGetFileSystemInfo Yes Yes No
0x19 FSAppendFile Yes No No
0x19 FSAppendFileEx Yes No No
0x1A FSTruncateFile Yes No No
0x1B FSAFlushVolume Yes Yes No
0x1C FSARollbackVolume Yes Yes No
0x1D FSMakeQuota Yes Yes No
0x1E FSFlushQuota Yes Yes No
0x1F FSRollbackQuota Yes Yes No
0x1F FSARollbackQuotaForce Yes Yes No
0x20 FSChangeMode Yes Yes No
0x21 FSOpenFileByStat No Yes No
0x22 FSRegisterFlushQuota Yes Yes No
0x23 FSFlushMultiQuota Yes Yes No
0x25 FSGetFileBlockAddress No Yes No
0x6E Unknowm Yes No No
0x6F Unknown No Yes No
0x72 FSRemoveQuota Yes Yes No
0x75 FSMakeLinkAsync Yes Yes No
0x76 HIOInit (Not FS Command??) ?? ?? ??
0x?? FSAddClientEx No No Yes Used with 0x01 and 0x02 ?? (maybe)