Line 365:
Line 365:
| 0x05 || 0x05 || IOSProcessId || GetProcessId ||
| 0x05 || 0x05 || IOSProcessId || GetProcessId ||
|-
|-
−
| 0x06 || 0x06 || IOSError || GetProcessName || IOSProcessId id, char *name
+
| 0x06 || 0x06 || IOSError || GetProcessName || IOSProcessId pid, char *name
|-
|-
| 0x07 || 0x07 || IOSError || IOS_StartThread || IOSThreadId id
| 0x07 || 0x07 || IOSError || IOS_StartThread || IOSThreadId id
Line 379:
Line 379:
| 0x0C || 0x0C || [[#IOSMessageQueueId|IOSMessageQueueId]] || IOS_CreateMessageQueue || [[#IOSMessage|IOSMessage]] *ptr, u32 count
| 0x0C || 0x0C || [[#IOSMessageQueueId|IOSMessageQueueId]] || IOS_CreateMessageQueue || [[#IOSMessage|IOSMessage]] *ptr, u32 count
|-
|-
−
| 0x0D || 0x0D || IOSError || IOS_DestroyMessageQueue || [[#IOSMessageQueueId|IOSMessageQueueId]] id
+
| 0x0D || 0x0D || IOSError || IOS_DestroyMessageQueue || [[#IOSMessageQueueId|IOSMessageQueueId]] mqid
|-
|-
−
| 0x0E || 0x0E || IOSError || IOS_SendMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] message, u32 flags
+
| 0x0E || 0x0E || IOSError || IOS_SendMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] message, u32 flags
|-
|-
−
| 0x0F || 0x0F || IOSError || IOS_JamMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] message, u32 flags
+
| 0x0F || 0x0F || IOSError || IOS_JamMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] message, u32 flags
|-
|-
−
| 0x10 || 0x10 || IOSError || IOS_ReceiveMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] *message, u32 flags
+
| 0x10 || 0x10 || IOSError || IOS_ReceiveMessage || [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] *message, u32 flags
|-
|-
−
| 0x11 || 0x11 || IOSError || IOS_HandleEvent || [[#IOSEvent|IOSEvent]] event, [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] message
+
| 0x11 || 0x11 || IOSError || IOS_HandleEvent || [[#IOSEvent|IOSEvent]] event, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] message
|-
|-
| 0x12 || 0x12 || IOSError || UnhandleEvent || [[#IOSEvent|IOSEvent]] event
| 0x12 || 0x12 || IOSError || UnhandleEvent || [[#IOSEvent|IOSEvent]] event
|-
|-
−
| 0x13 || 0x13 || IOSTimerId || IOS_CreateTimer || IOSTime time, IOSTime interval, [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] message
+
| 0x13 || 0x13 || IOSTimerId || IOS_CreateTimer || IOSTime time, IOSTime interval, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] message
|-
|-
| 0x14 || 0x14 || IOSError || IOS_RestartTimer || IOSTimerId id, IOSTime time, IOSTime interval
| 0x14 || 0x14 || IOSError || IOS_RestartTimer || IOSTimerId id, IOSTime time, IOSTime interval
Line 415:
Line 415:
| 0x1E || 0x1E || IOSError || [[#IOS_GetAbsTimeStruct|IOS_GetAbsTimeStruct]] || [[#IOSTimeStruct|IOSTimeStruct]] *out
| 0x1E || 0x1E || IOSError || [[#IOS_GetAbsTimeStruct|IOS_GetAbsTimeStruct]] || [[#IOSTimeStruct|IOSTimeStruct]] *out
|-
|-
−
| 0x1F || 0x1F || IOSError || [[#DisableExceptionPanic|DisableExceptionPanic]] || IOSProcessId id, bool enable
+
| 0x1F || 0x1F || IOSError || [[#DisableExceptionPanic|DisableExceptionPanic]] || IOSProcessId pid, bool enable
|-
|-
| 0x20 || 0x20 || IOSError || IsDevelopment ||
| 0x20 || 0x20 || IOSError || IsDevelopment ||
Line 441:
Line 441:
| 0x2B || 0x2B || IOSError || ReAlloc || IOSHeapId id, void *ptr, u32 size
| 0x2B || 0x2B || IOSError || ReAlloc || IOSHeapId id, void *ptr, u32 size
|-
|-
−
| 0x2C || 0x2C || IOSError || IOS_RegisterResourceManager || const char* path, [[#IOSMessageQueueId|IOSMessageQueueId]] id
+
| 0x2C || 0x2C || IOSError || IOS_RegisterResourceManager || const char* path, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid
|-
|-
| 0x2D || 0x2D || IOSError || [[#AssociateResourceManager|AssociateResourceManager]] || const char* path, u32 id
| 0x2D || 0x2D || IOSError || [[#AssociateResourceManager|AssociateResourceManager]] || const char* path, u32 id
Line 447:
Line 447:
| 0x2E || 0x2E || IOSError || SetResourceManagerFlags || const char* path, u32 flags
| 0x2E || 0x2E || IOSError || SetResourceManagerFlags || const char* path, u32 flags
|-
|-
−
| 0x2F || 0x2F || IOSError || SetClientCapabilities || IOSProcessId id, u32 feature_id, u32 *masks
+
| 0x2F || 0x2F || IOSError || SetClientCapabilities || [[#IOSProcessId|IOSProcessId]] pid, u32 feature_id, u32 *masks
|-
|-
−
| 0x30 || 0x30 || IOSError || ClearClientCapabilities || IOSProcessId id
+
| 0x30 || 0x30 || IOSError || ClearClientCapabilities || [[#IOSProcessId|IOSProcessId]] pid
|-
|-
−
| 0x31 || 0x31 || IOSError || GetResourceClientCapabilityByFeatureId || IOSProcessId id, u32 feature_id, u32 *masks
+
| 0x31 || 0x31 || IOSError || GetResourceClientCapabilityByFeatureId || [[#IOSProcessId|IOSProcessId]] pid, u32 feature_id, u32 *masks
|-
|-
| 0x32 || 0x32 || IOSError || GetResourceManagersByFeatureId || u32 feature_id, u32 max_count, [[#IOSResourceManager|IOSResourceManager]] *out
| 0x32 || 0x32 || IOSError || GetResourceManagersByFeatureId || u32 feature_id, u32 max_count, [[#IOSResourceManager|IOSResourceManager]] *out
Line 469:
Line 469:
| 0x39 || 0x39 || IOSError || IOS_Ioctlv || [[#IOSFd|IOSFd]] fd, s32 cmd, u32 vector_count_in, u32 vector_count_out, IOSIoVector *vector
| 0x39 || 0x39 || IOSError || IOS_Ioctlv || [[#IOSFd|IOSFd]] fd, s32 cmd, u32 vector_count_in, u32 vector_count_out, IOSIoVector *vector
|-
|-
−
| 0x3A || 0x3A || [[#IOSFd|IOSFd]] || IOS_OpenAsync || const char* path, u32 flags, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3A || 0x3A || [[#IOSFd|IOSFd]] || IOS_OpenAsync || const char* path, u32 flags, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x3B || 0x3B || IOSError || IOS_CloseAsync || [[#IOSFd|IOSFd]] fd, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3B || 0x3B || IOSError || IOS_CloseAsync || [[#IOSFd|IOSFd]] fd, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x3C || 0x3C || s32 || IOS_ReadAsync || [[#IOSFd|IOSFd]] fd, void *buf, u32 len, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3C || 0x3C || s32 || IOS_ReadAsync || [[#IOSFd|IOSFd]] fd, void *buf, u32 len, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x3D || 0x3D || s32 || IOS_WriteAsync || [[#IOSFd|IOSFd]] fd, void *buf, u32 len, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3D || 0x3D || s32 || IOS_WriteAsync || [[#IOSFd|IOSFd]] fd, void *buf, u32 len, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x3E || 0x3E || s32 || IOS_SeekAsync || [[#IOSFd|IOSFd]] fd, s32 offset, u32 origin, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3E || 0x3E || s32 || IOS_SeekAsync || [[#IOSFd|IOSFd]] fd, s32 offset, u32 origin, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x3F || 0x3F || IOSError || IOS_IoctlAsync || [[#IOSFd|IOSFd]] fd, s32 cmd, void *input_buffer, u32 input_buffer_len, void *output_buffer, u32 output_buffer_len, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x3F || 0x3F || IOSError || IOS_IoctlAsync || [[#IOSFd|IOSFd]] fd, s32 cmd, void *input_buffer, u32 input_buffer_len, void *output_buffer, u32 output_buffer_len, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x40 || 0x40 || IOSError || IOS_IoctlvAsync || [[#IOSFd|IOSFd]] fd, s32 cmd, u32 vector_count_in, u32 vector_count_out, IOSIoVector *vector, [[#IOSMessageQueueId|IOSMessageQueueId]] id, IOSResourceRequest *reply
+
| 0x40 || 0x40 || IOSError || IOS_IoctlvAsync || [[#IOSFd|IOSFd]] fd, s32 cmd, u32 vector_count_in, u32 vector_count_out, IOSIoVector *vector, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x41 || 0x41 || IOSError || OpenAsAsync ||
+
| 0x41 || 0x41 || IOSError || OpenAsyncAs || const char* path, u32 flags, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply, [[#IOSProcessId|IOSProcessId]] pid, IOSNodeId node_id
|-
|-
−
| 0x42 || 0x42 || IOSError || WriteAsAsync ||
+
| 0x42 || 0x42 || IOSError || WriteAsyncAs || [[#IOSFd|IOSFd]] fd, void *buf, u32 len, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply, [[#IOSProcessId|IOSProcessId]] pid, IOSNodeId node_id
|-
|-
−
| 0x43 || 0x43 || IOSError || IpcResume ||
+
| 0x43 || 0x43 || IOSError || Resume || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1
|-
|-
−
| 0x44 || 0x44 || IOSError || IpcSuspend ||
+
| 0x44 || 0x44 || IOSError || Suspend || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1
|-
|-
−
| 0x45 || 0x45 || IOSError || IpcSvcMsg ||
+
| 0x45 || 0x45 || IOSError || SvcMsg || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1, u32 unk2, u32 unk3
|-
|-
−
| 0x46 || 0x46 || IOSError || IpcResumeAsync ||
+
| 0x46 || 0x46 || IOSError || ResumeAsync || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x47 || 0x47 || IOSError || IpcSuspendAsync ||
+
| 0x47 || 0x47 || IOSError || SuspendAsync || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x48 || 0x48 || IOSError || IpcSvcMsgAsync ||
+
| 0x48 || 0x48 || IOSError || SvcMsgAsync || [[#IOSFd|IOSFd]] fd, u32 unk0, u32 unk1, u32 unk2, u32 unk3, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, IOSResourceRequest *reply
|-
|-
−
| 0x49 || 0x49 || IOSError || IOS_ResourceReply || IOSResourceRequest *reply, IOSError result
+
| 0x49 || 0x49 || IOSError || IOS_ResourceReply || [[#IOSResourceTransaction|IOSResourceTransaction]] *txn, [[#IOSFd|IOSFd]] fd
|-
|-
−
| 0x4A || 0x4A || IOSError || SetUidGid || IOSProcessId id, u32 uid_high, u32 uid_low, u32 gid
+
| 0x4A || 0x4A || IOSError || SetUidGid || [[#IOSProcessId|IOSProcessId]] pid, u32 uid_high, u32 uid_low, u32 gid
|-
|-
−
| 0x4B || 0x4B || IOSError || GetUidGid || IOSProcessId id, u32 *uid, u32 *gid
+
| 0x4B || 0x4B || IOSError || GetUidGid || [[#IOSProcessId|IOSProcessId]] pid, u32 *uid, u32 *gid
|-
|-
| 0x4C || 0x4C || IOSError || TryFlushMem || [[#MEM_WB_CLIENTS|MEM_WB_CLIENTS]] client
| 0x4C || 0x4C || IOSError || TryFlushMem || [[#MEM_WB_CLIENTS|MEM_WB_CLIENTS]] client
Line 547:
Line 547:
| 0x60 || 0x56 || void * || VirtualToPhysical || void *address
| 0x60 || 0x56 || void * || VirtualToPhysical || void *address
|-
|-
−
| 0x61 || 0x57 || IOSSemaphore || IOS_CreateSemaphore || u32 max_count, u32 initial_count
+
| 0x61 || 0x57 || IOSSemaphoreId || IOS_CreateSemaphore || u32 max_count, u32 initial_count
|-
|-
−
| 0x62 || 0x58 || IOSError || IOS_WaitSemaphore || IOSSemaphore id, bool try_wait
+
| 0x62 || 0x58 || IOSError || IOS_WaitSemaphore || IOSSemaphoreId id, bool try_wait
|-
|-
−
| 0x63 || 0x59 || IOSError || IOS_SignalSemaphore || IOSSemaphore id
+
| 0x63 || 0x59 || IOSError || IOS_SignalSemaphore || IOSSemaphoreId id
|-
|-
−
| 0x64 || 0x5A || IOSError || IOS_DestroySemaphore || IOSSemaphore id
+
| 0x64 || 0x5A || IOSError || IOS_DestroySemaphore || IOSSemaphoreId id
|-
|-
| 0x65 || 0x5B || IOSError || FlushIpc ||
| 0x65 || 0x5B || IOSError || FlushIpc ||
Line 585:
Line 585:
| 0x73 || 0x67 || IOSError || GetResourceAggregateUtilization || [[#IOSResourceAggregateUtilization|IOSResourceAggregateUtilization]]* out, bool clear
| 0x73 || 0x67 || IOSError || GetResourceAggregateUtilization || [[#IOSResourceAggregateUtilization|IOSResourceAggregateUtilization]]* out, bool clear
|-
|-
−
| 0x74 || 0x68 || IOSError || GetResourcePerProcessUtilization || [[#IOSResourcePerProcessUtilization|IOSResourcePerProcessUtilization]]* out, IOSProcessId id, bool clear
+
| 0x74 || 0x68 || IOSError || GetResourcePerProcessUtilization || [[#IOSResourcePerProcessUtilization|IOSResourcePerProcessUtilization]]* out, [[#IOSProcessId|IOSProcessId]] pid, bool clear
|-
|-
| 0x75 || 0x69 || IOSError || IOS_GetTimerUtilization || [[#IOSTimerUtilization|IOSTimerUtilization]] *out
| 0x75 || 0x69 || IOSError || IOS_GetTimerUtilization || [[#IOSTimerUtilization|IOSTimerUtilization]] *out
Line 593:
Line 593:
| 0x77 || 0x6B || IOSError || GetHeapProfile || IOSHeapId id, [[#IOSHeapProfile|IOSHeapProfile]] *profile
| 0x77 || 0x6B || IOSError || GetHeapProfile || IOSHeapId id, [[#IOSHeapProfile|IOSHeapProfile]] *profile
|-
|-
−
| 0x78 || 0x6C || IOSError || EnableIopClockMultiplier || bool enable
+
| 0x78 || 0x6C || IOSError || EnableIop2xClockMultiplier || bool enable
|-
|-
| 0x79 || 0x6D || IOSError || SetPpcPlatformInfo || [[Cafe_OS#OSPlatformInfo|OSPlatformInfo]] *info
| 0x79 || 0x6D || IOSError || SetPpcPlatformInfo || [[Cafe_OS#OSPlatformInfo|OSPlatformInfo]] *info
Line 623:
Line 623:
| 0x86 || 0x7A || IOSSecurityLevel || GetSecurityLevel ||
| 0x86 || 0x7A || IOSSecurityLevel || GetSecurityLevel ||
|-
|-
−
| 0x87 || 0x7B || IOSError || GetResourceOpenHandles || u32 max_count, [[#IOSResourceOpenHandle|IOSResourceOpenHandle]] *out, IOSProcessId id
+
| 0x87 || 0x7B || IOSError || GetResourceOpenHandles || u32 max_count, [[#IOSResourceOpenHandle|IOSResourceOpenHandle]] *out, IOSProcessId pid
|-
|-
| 0x88 || 0x7C || IOSError || SetMainTitleSdkVersion || u32 version
| 0x88 || 0x7C || IOSError || SetMainTitleSdkVersion || u32 version
Line 631:
Line 631:
| 0x8A || 0x7E || IOSError || IsCrossProcessHeap || void *ptr, u32 size
| 0x8A || 0x7E || IOSError || IsCrossProcessHeap || void *ptr, u32 size
|-
|-
−
| 0x8B || 0x7F || IOSError || HandleDebugInterrupt || const char *dbg_sts, u32 dbg_sts_size, [[#IOSMessageQueueId|IOSMessageQueueId]] id, [[#IOSMessage|IOSMessage]] message
+
| 0x8B || 0x7F || IOSError || HandleDebugInterrupt || const char *dbg_sts, u32 dbg_sts_size, [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, [[#IOSMessage|IOSMessage]] message
|-
|-
−
| 0x8C || 0x80 || IOSError || UnhandleDebugInterrupt || [[#IOSMessageQueueId|IOSMessageQueueId]] id, bool panic
+
| 0x8C || 0x80 || IOSError || UnhandleDebugInterrupt || [[#IOSMessageQueueId|IOSMessageQueueId]] mqid, bool panic
|-
|-
| 0x8D || 0x81 || IOSError || ||
| 0x8D || 0x81 || IOSError || ||
Line 643:
Line 643:
| 0x90 || 0x84 || IOSError || DisableDeviceRegistration || bool disable
| 0x90 || 0x84 || IOSError || DisableDeviceRegistration || bool disable
|-
|-
−
| 0x91 || 0x85 || IOSError || GetPendingResourceRequests || u32 max_count, [[#IOSPendingResourceRequest|IOSPendingResourceRequest]] *requests, IOSProcessId id
+
| 0x91 || 0x85 || IOSError || GetPendingResourceRequests || u32 max_count, [[#IOSPendingResourceRequest|IOSPendingResourceRequest]] *requests, IOSProcessId pid
|-
|-
| 0x92 || 0x86 || IOSError || [[#InitializeIOS|InitializeIOS]] ||
| 0x92 || 0x86 || IOSError || [[#InitializeIOS|InitializeIOS]] ||
Line 1,608:
Line 1,608:
|}
|}
−
== IOSSecurityLevel ==
+
== IOSProcessId ==
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 1,615:
Line 1,615:
|-
|-
| 0
| 0
−
| None
+
| IOS-KERNEL
|-
|-
−
| 10
+
| 1
−
| Test
+
| IOS-MCP
|-
|-
−
| 20
+
| 2
−
| Dev
+
| IOS-BSP
|-
|-
−
| 30
+
| 3
−
| Prod
+
| IOS-CRYPTO
−
|}
−
−
== IOSError ==
−
{| class="wikitable"
|-
|-
−
! Value
+
| 4
−
! Description
+
| IOS-USB
|-
|-
−
| 0
+
| 5
−
| IOS_ERROR_OK
+
| IOS-FS
|-
|-
−
| -1
+
| 6
−
| IOS_ERROR_ACCESS
+
| IOS-PAD
|-
|-
−
| -2
+
| 7
−
| IOS_ERROR_EXISTS
+
| IOS-NET
|-
|-
−
| -3
+
| 8
−
| IOS_ERROR_INTR
+
| IOS-ACP
|-
|-
−
| -4
+
| 9
−
| IOS_ERROR_INVALID
+
| IOS-NSEC
|-
|-
−
| -5
+
| 10
−
| IOS_ERROR_MAX
+
| IOS-AUXIL
|-
|-
−
| -6
+
| 11
−
| IOS_ERROR_NOEXISTS
+
| IOS-NIM-BOSS
|-
|-
−
| -7
+
| 12
−
| IOS_ERROR_QEMPTY
+
| IOS-FPD
|-
|-
−
| -8
+
| 13
−
| IOS_ERROR_QFULL
+
| IOS-TEST
|-
|-
−
| -9
+
| 14
−
| IOS_ERROR_UNKNOWN
+
| COS-KERNEL
|-
|-
−
| -10
+
| 15
−
| IOS_ERROR_NOTREADY
+
| COS-ROOT
|-
|-
−
| -11
+
| 16
−
| IOS_ERROR_ECC
+
| COS-02
|-
|-
−
| -12
+
| 17
−
| IOS_ERROR_ECC_CRIT
+
| COS-03
|-
|-
−
| -13
+
| 18
−
| IOS_ERROR_BADBLOCK
+
| COS-OVERLAY
|-
|-
−
| -14
+
| 19
−
| IOS_ERROR_INVALID_OBJTYPE
+
| COS-HBM
|-
|-
−
| -15
+
| 20
−
| IOS_ERROR_INVALID_RNG
+
| COS-ERROR
|-
|-
−
| -16
+
| 21
−
| IOS_ERROR_INVALID_FLAG
+
| COS-MASTER
+
|}
+
+
== IOSNodeId ==
+
{| class="wikitable"
|-
|-
−
| -17
+
! Value
−
| IOS_ERROR_INVALID_FORMAT
+
! Description
|-
|-
−
| -18
+
| 0
−
| IOS_ERROR_INVALID_VERSION
+
| IOS_NODE_INTERNAL
|-
|-
−
| -19
+
| 1
−
| IOS_ERROR_INVALID_SIGNER
+
| IOS_NODE_EXTERNAL0
|-
|-
−
| -20
+
| 2
−
| IOS_ERROR_FAIL_CHECKVALUE
+
| IOS_NODE_EXTERNAL1
|-
|-
−
| -21
+
| 3
−
| IOS_ERROR_FAIL_INTERNAL
+
| IOS_NODE_EXTERNAL2
+
|}
+
+
== IOSCmdId ==
+
{| class="wikitable"
|-
|-
−
| -22
+
! Value
−
| IOS_ERROR_FAIL_ALLOC
+
! Description
|-
|-
−
| -23
+
| 0
−
| IOS_ERROR_INVALID_SIZE
+
| IOS_COMMAND_INVALID
|-
|-
−
| -24
+
| 1
−
| IOS_ERROR_NO_LINK
+
| IOS_OPEN
|-
|-
−
| -25
+
| 2
−
| IOS_ERROR_AN_FAILED
+
| IOS_CLOSE
|-
|-
−
| -26
+
| 3
−
| IOS_ERROR_MAX_SEM_COUNT
+
| IOS_READ
|-
|-
−
| -27
+
| 4
−
| IOS_ERROR_SEM_UNAVAILABLE
+
| IOS_WRITE
|-
|-
−
| -28
+
| 5
−
| IOS_ERROR_INVALID_HANDLE
+
| IOS_SEEK
|-
|-
−
| -29
+
| 6
−
| IOS_ERROR_INVALID_ARG
+
| IOS_IOCTL
|-
|-
−
| -30
+
| 7
−
| IOS_ERROR_NO_RESOURCE
+
| IOS_IOCTLV
|-
|-
−
| -31
+
| 8
−
| IOS_ERROR_BUSY
+
| IOS_REPLY
|-
|-
−
| -32
+
| 9
−
| IOS_ERROR_TIMEOUT
+
| IOS_IPC_MSG0
|-
|-
−
| -33
+
| 10
−
| IOS_ERROR_ALIGNMENT
+
| IOS_IPC_MSG1
|-
|-
−
| -34
+
| 11
−
| IOS_ERROR_BSP
+
| IOS_IPC_MSG2
|-
|-
−
| -35
+
| 12
−
| IOS_ERROR_DATA_PENDING
+
| IOS_SUSPEND
|-
|-
−
| -36
+
| 13
−
| IOS_ERROR_EXPIRED
+
| IOS_RESUME
|-
|-
−
| -37
+
| 14
−
| IOS_ERROR_NO_R_ACCESS
+
| IOS_SVCMSG
+
|}
+
+
== IOSSecurityLevel ==
+
{| class="wikitable"
|-
|-
−
| -38
+
! Value
−
| IOS_ERROR_NO_W_ACCESS
+
! Description
|-
|-
−
| -39
+
| 0
−
| IOS_ERROR_NO_RW_ACCESS
+
| None
|-
|-
−
| -40
+
| 10
−
| IOS_ERROR_CLIENT_TXN_LIMIT
+
| Test
|-
|-
−
| -41
+
| 20
−
| IOS_ERROR_STALE_HANDLE
+
| Dev
|-
|-
−
| -42
+
| 30
−
| IOS_ERROR_UNKNOWN_VALUE
+
| Prod
|}
|}
−
== MEM_WB_CLIENTS ==
+
== IOSError ==
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 1,770:
Line 1,778:
|-
|-
| 0
| 0
−
| IOS_WB_IOD
+
| IOS_ERROR_OK
|-
|-
−
| 1
+
| -1
−
| IOS_WB_AIM
+
| IOS_ERROR_ACCESS
|-
|-
−
| 2
+
| -2
−
| IOS_WB_FLA
+
| IOS_ERROR_EXISTS
|-
|-
−
| 3
+
| -3
−
| IOS_WB_AES
+
| IOS_ERROR_INTR
|-
|-
−
| 4
+
| -4
−
| IOS_WB_SHA
+
| IOS_ERROR_INVALID
|-
|-
−
| 5
+
| -5
−
| IOS_WB_EHCI
+
| IOS_ERROR_MAX
|-
|-
−
| 6
+
| -6
−
| IOS_WB_OHCI0
+
| IOS_ERROR_NOEXISTS
|-
|-
−
| 7
+
| -7
−
| IOS_WB_OHCI1
+
| IOS_ERROR_QEMPTY
|-
|-
−
| 8
+
| -8
−
| IOS_WB_SD0
+
| IOS_ERROR_QFULL
|-
|-
−
| 9
+
| -9
−
| IOS_WB_SD1
+
| IOS_ERROR_UNKNOWN
|-
|-
−
| 10
+
| -10
−
| IOS_WB_SD2
+
| IOS_ERROR_NOTREADY
|-
|-
−
| 11
+
| -11
−
| IOS_WB_SD3
+
| IOS_ERROR_ECC
|-
|-
−
| 12
+
| -12
−
| IOS_WB_EHC1
+
| IOS_ERROR_ECC_CRIT
|-
|-
−
| 13
+
| -13
−
| IOS_WB_OHCI10
+
| IOS_ERROR_BADBLOCK
|-
|-
−
| 14
+
| -14
−
| IOS_WB_EHC2
+
| IOS_ERROR_INVALID_OBJTYPE
|-
|-
−
| 15
+
| -15
−
| IOS_WB_OHCI20
+
| IOS_ERROR_INVALID_RNG
|-
|-
−
| 16
+
| -16
−
| IOS_WB_SATA
+
| IOS_ERROR_INVALID_FLAG
|-
|-
−
| 17
+
| -17
−
| IOS_WB_AESS
+
| IOS_ERROR_INVALID_FORMAT
|-
|-
−
| 18
+
| -18
−
| IOS_WB_SHAS
+
| IOS_ERROR_INVALID_VERSION
|-
|-
−
| 19
+
| -19
−
| IOS_WB_DMAA
+
| IOS_ERROR_INVALID_SIGNER
|-
|-
−
| 20
+
| -20
−
| IOS_WB_DMAB
+
| IOS_ERROR_FAIL_CHECKVALUE
|-
|-
−
| 21
+
| -21
−
| IOS_WB_DMAC
+
| IOS_ERROR_FAIL_INTERNAL
|-
|-
−
| 22
+
| -22
−
| IOS_WB_ALL
+
| IOS_ERROR_FAIL_ALLOC
−
|}
−
−
== AHM_RB_CLIENTS ==
−
{| class="wikitable"
|-
|-
−
! Value
+
| -23
−
! Description
+
| IOS_ERROR_INVALID_SIZE
|-
|-
−
| 0
+
| -24
−
| IOS_RB_IOD
+
| IOS_ERROR_NO_LINK
|-
|-
−
| 1
+
| -25
−
| IOS_RB_IOI
+
| IOS_ERROR_AN_FAILED
|-
|-
−
| 2
+
| -26
−
| IOS_RB_AIM
+
| IOS_ERROR_MAX_SEM_COUNT
|-
|-
−
| 3
+
| -27
−
| IOS_RB_FLA
+
| IOS_ERROR_SEM_UNAVAILABLE
|-
|-
−
| 4
+
| -28
−
| IOS_RB_AES
+
| IOS_ERROR_INVALID_HANDLE
|-
|-
−
| 5
+
| -29
−
| IOS_RB_SHA
+
| IOS_ERROR_INVALID_ARG
|-
|-
−
| 6
+
| -30
−
| IOS_RB_EHCI
+
| IOS_ERROR_NO_RESOURCE
|-
|-
−
| 7
+
| -31
−
| IOS_RB_OHCI0
+
| IOS_ERROR_BUSY
|-
|-
−
| 8
+
| -32
−
| IOS_RB_OHCI1
+
| IOS_ERROR_TIMEOUT
|-
|-
−
| 9
+
| -33
−
| IOS_RB_SD0
+
| IOS_ERROR_ALIGNMENT
|-
|-
−
| 10
+
| -34
−
| IOS_RB_SD1
+
| IOS_ERROR_BSP
|-
|-
−
| 11
+
| -35
−
| IOS_RB_SD2
+
| IOS_ERROR_DATA_PENDING
|-
|-
−
| 12
+
| -36
−
| IOS_RB_SD3
+
| IOS_ERROR_EXPIRED
|-
|-
−
| 13
+
| -37
−
| IOS_RB_EHC1
+
| IOS_ERROR_NO_R_ACCESS
|-
|-
−
| 14
+
| -38
−
| IOS_RB_OHCI10
+
| IOS_ERROR_NO_W_ACCESS
|-
|-
−
| 15
+
| -39
−
| IOS_RB_EHC2
+
| IOS_ERROR_NO_RW_ACCESS
|-
|-
−
| 16
+
| -40
−
| IOS_RB_OHCI20
+
| IOS_ERROR_CLIENT_TXN_LIMIT
|-
|-
−
| 17
+
| -41
−
| IOS_RB_SATA
+
| IOS_ERROR_STALE_HANDLE
|-
|-
−
| 18
+
| -42
−
| IOS_RB_AESS
+
| IOS_ERROR_UNKNOWN_VALUE
−
|-
−
| 19
−
| IOS_RB_SHAS
|}
|}
−
== Auxiliary Vectors ==
+
== MEM_WB_CLIENTS ==
−
The IOSU elf has a PH_NOTES section which contains a so called "mrg file".
−
This "mrg file" contains auxiliary vectors for IOSU modules.
−
−
The vectors are parsed by IOS-KERNEL, before launching the modules.
−
−
The first 0xc bytes of the notes section make up a Elf32_Nhdr.
−
After that there are 6 auxv_t for each module (14 in 5.5.X).
−
−
The following auxiliary vector types are used:
{| class="wikitable"
{| class="wikitable"
|-
|-
! Value
! Value
−
! Name
! Description
! Description
|-
|-
−
| 0x09
+
| 0
−
| AT_ENTRY
+
| IOS_WB_IOD
−
| Entry point address
|-
|-
−
| 0x0B
+
| 1
−
| AT_UID
+
| IOS_WB_AIM
−
| Module ID
|-
|-
−
| 0x7D
+
| 2
−
| AT_PRIORITY
+
| IOS_WB_FLA
−
| Main thread priority
|-
|-
−
| 0x7E
+
| 3
−
| AT_STACK_SIZE
+
| IOS_WB_AES
−
| Main thread stack size
|-
|-
−
| 0x7F
+
| 4
−
| AT_STACK_ADDR
+
| IOS_WB_SHA
−
| Main thread stack address
|-
|-
−
| 0x80
+
| 5
−
| AT_MEM_PERM_MASK
+
| IOS_WB_EHCI
−
| Memory permission mask
+
|-
−
|}
+
| 6
−
+
| IOS_WB_OHCI0
−
Auxiliary vectors from 5.5.X:
+
|-
−
AT_UID: 0
+
| 7
−
AT_ENTRY: 0xFFFF0000
+
| IOS_WB_OHCI1
−
AT_PRIORITY: 0x0
+
|-
−
AT_STACK_SIZE: 0x0
+
| 8
−
AT_STACK_ADDR: 0x00000000
+
| IOS_WB_SD0
−
AT_MEM_PERM_MASK: 0x00000000
+
|-
−
+
| 9
−
AT_UID: 1
+
| IOS_WB_SD1
−
AT_ENTRY: 0x05056718
+
|-
−
AT_PRIORITY: 0x7C
+
| 10
−
AT_STACK_SIZE: 0x2000
+
| IOS_WB_SD2
−
AT_STACK_ADDR: 0x050BA4A0
+
|-
−
AT_MEM_PERM_MASK: 0x000C0030
+
| 11
−
+
| IOS_WB_SD3
−
AT_UID: 2
+
|-
−
AT_ENTRY: 0xE600F848
+
| 12
−
AT_PRIORITY: 0x7D
+
| IOS_WB_EHC1
−
AT_STACK_SIZE: 0x1000
+
|-
−
AT_STACK_ADDR: 0xE7000000
+
| 13
−
AT_MEM_PERM_MASK: 0x00100000
+
| IOS_WB_OHCI10
−
+
|-
−
AT_UID: 3
+
| 14
−
AT_ENTRY: 0x04015EA4
+
| IOS_WB_EHC2
−
AT_PRIORITY: 0x7B
+
|-
−
AT_STACK_SIZE: 0x1000
+
| 15
−
AT_STACK_ADDR: 0x04028628
+
| IOS_WB_OHCI20
−
AT_MEM_PERM_MASK: 0x000C0030
+
|-
+
| 16
+
| IOS_WB_SATA
+
|-
+
| 17
+
| IOS_WB_AESS
+
|-
+
| 18
+
| IOS_WB_SHAS
+
|-
+
| 19
+
| IOS_WB_DMAA
+
|-
+
| 20
+
| IOS_WB_DMAB
+
|-
+
| 21
+
| IOS_WB_DMAC
+
|-
+
| 22
+
| IOS_WB_ALL
+
|}
−
AT_UID: 4
+
== AHM_RB_CLIENTS ==
−
AT_ENTRY: 0x1012E9E8
+
{| class="wikitable"
−
AT_PRIORITY: 0x6B
+
|-
−
AT_STACK_SIZE: 0x4000
+
! Value
−
AT_STACK_ADDR: 0x104B92C8
+
! Description
−
AT_MEM_PERM_MASK: 0x00038600
+
|-
−
+
| 0
−
AT_UID: 5
+
| IOS_RB_IOD
−
AT_ENTRY: 0x107F6830
+
|-
−
AT_PRIORITY: 0x55
+
| 1
−
AT_STACK_SIZE: 0x4000
+
| IOS_RB_IOI
−
AT_STACK_ADDR: 0x1114117C
+
|-
−
AT_MEM_PERM_MASK: 0x001C5870
+
| 2
−
+
| IOS_RB_AIM
−
AT_UID: 6
+
|-
−
AT_ENTRY: 0x11F82D94
+
| 3
−
AT_PRIORITY: 0x75
+
| IOS_RB_FLA
−
AT_STACK_SIZE: 0x2000
+
|-
−
AT_STACK_ADDR: 0x1214AB4C
+
| 4
−
AT_MEM_PERM_MASK: 0x00008180
+
| IOS_RB_AES
−
+
|-
−
AT_UID: 7
+
| 5
−
AT_ENTRY: 0x123E4174
+
| IOS_RB_SHA
−
AT_PRIORITY: 0x50
+
|-
−
AT_STACK_SIZE: 0x4000
+
| 6
−
AT_STACK_ADDR: 0x12804498
+
| IOS_RB_EHCI
−
AT_MEM_PERM_MASK: 0x00002000
+
|-
−
+
| 7
−
AT_UID: 11
+
| IOS_RB_OHCI0
−
AT_ENTRY: 0xE22602FC
+
|-
−
AT_PRIORITY: 0x32
+
| 8
−
AT_STACK_SIZE: 0x4000
+
| IOS_RB_OHCI1
−
AT_STACK_ADDR: 0xE22CB000
+
|-
−
AT_MEM_PERM_MASK: 0x00000000
+
| 9
−
+
| IOS_RB_SD0
−
AT_UID: 9
+
|-
−
AT_ENTRY: 0xE108E930
+
| 10
−
AT_PRIORITY: 0x32
+
| IOS_RB_SD1
−
AT_STACK_SIZE: 0x1000
+
|-
−
AT_STACK_ADDR: 0xE12E71A4
+
| 11
−
AT_MEM_PERM_MASK: 0x00000000
+
| IOS_RB_SD2
−
+
|-
−
AT_UID: 12
+
| 12
−
AT_ENTRY: 0xE3166B34
+
| IOS_RB_SD3
−
AT_PRIORITY: 0x32
+
|-
−
AT_STACK_SIZE: 0x4000
+
| 13
−
AT_STACK_ADDR: 0xE31AF000
+
| IOS_RB_EHC1
−
AT_MEM_PERM_MASK: 0x00000000
+
|-
+
| 14
+
| IOS_RB_OHCI10
+
|-
+
| 15
+
| IOS_RB_EHC2
+
|-
+
| 16
+
| IOS_RB_OHCI20
+
|-
+
| 17
+
| IOS_RB_SATA
+
|-
+
| 18
+
| IOS_RB_AESS
+
|-
+
| 19
+
| IOS_RB_SHAS
+
|}
−
AT_UID: 8
+
== Auxiliary Vectors ==
−
AT_ENTRY: 0xE00D8290
+
The IOSU elf has a PH_NOTES section which contains a so called "mrg file".
−
AT_PRIORITY: 0x32
+
This "mrg file" contains auxiliary vectors for IOSU modules.
−
AT_STACK_SIZE: 0x4000
−
AT_STACK_ADDR: 0xE0125390
−
AT_MEM_PERM_MASK: 0x00000000
−
AT_UID: 10
+
The vectors are parsed by IOS-KERNEL, before launching the modules.
−
AT_ENTRY: 0xE500D720
−
AT_PRIORITY: 0x46
−
AT_STACK_SIZE: 0x4000
−
AT_STACK_ADDR: 0xE506A900
−
AT_MEM_PERM_MASK: 0x00000000
−
AT_UID: 13
+
The first 0xc bytes of the notes section make up a Elf32_Nhdr.
−
AT_ENTRY: 0xE40168A4
+
After that there are 6 auxv_t for each module (14 in 5.5.X).
−
AT_PRIORITY: 0x4B
−
AT_STACK_SIZE: 0x2000
−
AT_STACK_ADDR: 0xE415623C
−
AT_MEM_PERM_MASK: 0x00000000
−
== Exception Handling ==
+
The following auxiliary vector types are used:
−
The data-abort and prefetch-abort exception handlers will first check whether a certain flag is clear(flagsfield & (1<<PID)). When that bit is clear and the PID is <=13(highest IOSU PID value that exists), it will just return from the function then do a context-switch. Otherwise, iosPanic() is called.
+
{| class="wikitable"
−
+
|-
−
= IPC =
+
! Value
−
PowerPC code is able to call IOSU drivers through an IPC interface. It uses the same call interface as IOSU does internally. Userspace code submits IOSU requests with the IPCKDriver_SubmitRequest() [[Cafe_OS_Kernel_Syscalls|syscall]] in the Cafe OS kernel. The kernel includes information to identify which Cafe OS process sent the request, allowing IOSU to check permissions on a per-app basis. Requests are contained in a struct, sent through a [[Hardware/IPC|hardware interface]], and marshalled by the IOSU kernel to a target process. An example of IOSU IPC from the PowerPC can be found [https://github.com/darksideos/darkside-kernel/blob/wiiu/bal/src/platform/wiiu/ios.c here].
+
! Name
+
! Description
+
|-
+
| 0x09
+
| AT_ENTRY
+
| Entry point address
+
|-
+
| 0x0B
+
| AT_UID
+
| Module ID
+
|-
+
| 0x7D
+
| AT_PRIORITY
+
| Main thread priority
+
|-
+
| 0x7E
+
| AT_STACK_SIZE
+
| Main thread stack size
+
|-
+
| 0x7F
+
| AT_STACK_ADDR
+
| Main thread stack address
+
|-
+
| 0x80
+
| AT_MEM_PERM_MASK
+
| Memory permission mask
+
|}
−
IPC request struct (size = 0x48, align = 0x20)
+
Auxiliary vectors from 5.5.X:
−
+
AT_UID: 0
−
0x00: CMD (1=open, 2=close, 3=read, 4=write, 5=seek, 6=ioctl, 7=ioctlv)
+
AT_ENTRY: 0xFFFF0000
−
0x04: Reply to client
+
AT_PRIORITY: 0x0
−
0x08: Client FD
+
AT_STACK_SIZE: 0x0
−
0x0C: Flags (always 0)
+
AT_STACK_ADDR: 0x00000000
−
0x10: Client CPU (0=ARM internal, 1-3=PPC cores 0-2)
+
AT_MEM_PERM_MASK: 0x00000000
−
0x14: Client PID (PFID in older versions, RAMPID more recently?)
−
0x18: Client group ID (Title ID, upper)
−
0x1C: Client group ID (Title ID, lower)
−
0x20: Server handle (written by IOSU)
−
0x24: Arg0
−
0x28: Arg1
−
0x2C: Arg2
−
0x30: Arg3
−
0x34: Arg4
−
0x38: CMD (previous)
−
0x3C: Client FD (previous)
−
0x40: Virt0 (PPC virtual addresses to be translated)
−
0x44: Virt1 (PPC virtual addresses to be translated)
−
IPC commands
+
AT_UID: 1
−
+
AT_ENTRY: 0x05056718
−
0x00 -> IOS_COMMAND_INVALID
+
AT_PRIORITY: 0x7C
−
0x01 -> IOS_OPEN
+
AT_STACK_SIZE: 0x2000
−
0x02 -> IOS_CLOSE
+
AT_STACK_ADDR: 0x050BA4A0
−
0x03 -> IOS_READ
+
AT_MEM_PERM_MASK: 0x000C0030
−
0x04 -> IOS_WRITE
−
0x05 -> IOS_SEEK
−
0x06 -> IOS_IOCTL
−
0x07 -> IOS_IOCTLV
−
0x08 -> IOS_REPLY (internal to IOSU)
−
0x09 -> IOS_IPC_MSG0 (internal to IOSU)
−
0x0A -> IOS_IPC_MSG1 (internal to IOSU)
−
0x0B -> IOS_IPC_MSG2 (internal to IOSU)
−
0x0C -> IOS_SUSPEND (internal to IOSU)
−
0x0D -> IOS_RESUME (internal to IOSU)
−
0x0E -> IOS_SVCMSG (internal to IOSU)
−
IPC client PIDs
+
AT_UID: 2
−
+
AT_ENTRY: 0xE600F848
−
On older versions of IOSU, it seems to match the PFID list. More recently, it appears to use the RAMPID. See the [http://wiiubrew.org/wiki/Cafe_OS#Processes Cafe OS PID tables].
+
AT_PRIORITY: 0x7D
+
AT_STACK_SIZE: 0x1000
+
AT_STACK_ADDR: 0xE7000000
+
AT_MEM_PERM_MASK: 0x00100000
−
IPC arguments
+
AT_UID: 3
−
+
AT_ENTRY: 0x04015EA4
−
Open CMD: Client FD == 0
+
AT_PRIORITY: 0x7B
−
Arg0 = name
+
AT_STACK_SIZE: 0x1000
−
Arg1 = name_size
+
AT_STACK_ADDR: 0x04028628
−
Arg2 = mode (0 = none, 1 = read, 2 = write)
+
AT_MEM_PERM_MASK: 0x000C0030
−
Arg3-Arg4 = u64 permissions_bitmask for the target IOSU process, loaded by the target IOSU process during fd init. With PPC this originates from the cos.xml of the source process.
+
−
+
AT_UID: 4
−
Close CMD: Client FD != 0
+
AT_ENTRY: 0x1012E9E8
−
+
AT_PRIORITY: 0x6B
−
Read CMD: Client FD != 0
+
AT_STACK_SIZE: 0x4000
−
Arg0 = outPtr
+
AT_STACK_ADDR: 0x104B92C8
−
Arg1 = outLen
+
AT_MEM_PERM_MASK: 0x00038600
−
+
−
Write CMD: Client FD != 0
+
AT_UID: 5
−
Arg0 = inPtr
+
AT_ENTRY: 0x107F6830
−
Arg1 = inLen
+
AT_PRIORITY: 0x55
−
+
AT_STACK_SIZE: 0x4000
−
Seek CMD: Client FD != 0
+
AT_STACK_ADDR: 0x1114117C
−
Arg0 = where
+
AT_MEM_PERM_MASK: 0x001C5870
−
Arg1 = whence
−
−
IOCtl CMD: Client FD != 0
−
Arg0 = cmd
−
Arg1 = inPtr
−
Arg2 = inLen
−
Arg3 = outPtr
−
Arg4 = outLen
−
−
IOCtlv CMD: Client FD != 0
−
Arg0 = cmd
−
Arg1 = readCount
−
Arg2 = writeCount
−
Arg3 = vector
−
= Modules =
+
AT_UID: 6
−
Similarly to the Wii, IOS modules roughly map to processes and drivers inside the kernel. Modules have a locked PID associated with them:
+
AT_ENTRY: 0x11F82D94
+
AT_PRIORITY: 0x75
+
AT_STACK_SIZE: 0x2000
+
AT_STACK_ADDR: 0x1214AB4C
+
AT_MEM_PERM_MASK: 0x00008180
−
{| class="wikitable"
+
AT_UID: 7
−
|-
+
AT_ENTRY: 0x123E4174
−
! PID
+
AT_PRIORITY: 0x50
−
! Name
+
AT_STACK_SIZE: 0x4000
−
|-
+
AT_STACK_ADDR: 0x12804498
−
| 0
+
AT_MEM_PERM_MASK: 0x00002000
−
| IOS-KERNEL
+
−
|-
+
AT_UID: 11
−
| 1
+
AT_ENTRY: 0xE22602FC
−
| IOS-MCP
+
AT_PRIORITY: 0x32
−
|-
+
AT_STACK_SIZE: 0x4000
−
| 2
+
AT_STACK_ADDR: 0xE22CB000
−
| IOS-BSP
+
AT_MEM_PERM_MASK: 0x00000000
−
|-
+
−
| 3
+
AT_UID: 9
−
| IOS-CRYPTO
+
AT_ENTRY: 0xE108E930
−
|-
+
AT_PRIORITY: 0x32
−
| 4
+
AT_STACK_SIZE: 0x1000
−
| IOS-USB
+
AT_STACK_ADDR: 0xE12E71A4
−
|-
+
AT_MEM_PERM_MASK: 0x00000000
−
| 5
+
−
| IOS-FS
+
AT_UID: 12
−
|-
+
AT_ENTRY: 0xE3166B34
−
| 6
+
AT_PRIORITY: 0x32
−
| IOS-PAD
+
AT_STACK_SIZE: 0x4000
−
|-
+
AT_STACK_ADDR: 0xE31AF000
−
| 7
+
AT_MEM_PERM_MASK: 0x00000000
−
| IOS-NET
+
−
|-
+
AT_UID: 8
−
| 8
+
AT_ENTRY: 0xE00D8290
−
| IOS-ACP
+
AT_PRIORITY: 0x32
−
|-
+
AT_STACK_SIZE: 0x4000
−
| 9
+
AT_STACK_ADDR: 0xE0125390
−
| IOS-NSEC
+
AT_MEM_PERM_MASK: 0x00000000
−
|-
+
−
| 10
+
AT_UID: 10
−
| IOS-AUXIL
+
AT_ENTRY: 0xE500D720
−
|-
+
AT_PRIORITY: 0x46
−
| 11
+
AT_STACK_SIZE: 0x4000
−
| IOS-NIM-BOSS
+
AT_STACK_ADDR: 0xE506A900
−
|-
+
AT_MEM_PERM_MASK: 0x00000000
−
| 12
+
−
| IOS-FPD
+
AT_UID: 13
−
|-
+
AT_ENTRY: 0xE40168A4
−
| 13
+
AT_PRIORITY: 0x4B
−
| IOS-TEST
+
AT_STACK_SIZE: 0x2000
−
|-
+
AT_STACK_ADDR: 0xE415623C
−
| 14
+
AT_MEM_PERM_MASK: 0x00000000
−
| COS-KERNEL
+
−
|-
+
== Exception Handling ==
−
| 15
+
The data-abort and prefetch-abort exception handlers will first check whether a certain flag is clear(flagsfield & (1<<PID)). When that bit is clear and the PID is <=13(highest IOSU PID value that exists), it will just return from the function then do a context-switch. Otherwise, iosPanic() is called.
−
| COS-ROOT
+
−
|-
+
= IPC =
−
| 16
+
PowerPC code is able to call IOSU drivers through an IPC interface. It uses the same call interface as IOSU does internally. Userspace code submits IOSU requests with the IPCKDriver_SubmitRequest() [[Cafe_OS_Kernel_Syscalls|syscall]] in the Cafe OS kernel. The kernel includes information to identify which Cafe OS process sent the request, allowing IOSU to check permissions on a per-app basis. Requests are contained in a struct, sent through a [[Hardware/IPC|hardware interface]], and marshalled by the IOSU kernel to a target process. An example of IOSU IPC from the PowerPC can be found [https://github.com/darksideos/darkside-kernel/blob/wiiu/bal/src/platform/wiiu/ios.c here].
−
| COS-02
+
−
|-
+
IPC request struct (size = 0x48, align = 0x20)
−
| 17
+
−
| COS-03
+
0x00: CMD (1=open, 2=close, 3=read, 4=write, 5=seek, 6=ioctl, 7=ioctlv)
−
|-
+
0x04: Reply to client
−
| 18
+
0x08: Client FD
−
| COS-OVERLAY
+
0x0C: Flags (always 0)
−
|-
+
0x10: Client CPU (0=ARM internal, 1-3=PPC cores 0-2)
−
| 19
+
0x14: Client PID (PFID in older versions, RAMPID more recently?)
−
| COS-HBM
+
0x18: Client group ID (Title ID, upper)
−
|-
+
0x1C: Client group ID (Title ID, lower)
−
| 20
+
0x20: Server handle (written by IOSU)
−
| COS-ERROR
+
0x24: Arg0
−
|-
+
0x28: Arg1
−
| 21
+
0x2C: Arg2
−
| COS-MASTER
+
0x30: Arg3
−
|}
+
0x34: Arg4
−
PIDs 14-21 are used for PPC side processes.
+
0x38: CMD (previous)
+
0x3C: Client FD (previous)
+
0x40: Virt0 (PPC virtual addresses to be translated)
+
0x44: Virt1 (PPC virtual addresses to be translated)
+
+
IPC commands
+
+
0x00 -> IOS_COMMAND_INVALID
+
0x01 -> IOS_OPEN
+
0x02 -> IOS_CLOSE
+
0x03 -> IOS_READ
+
0x04 -> IOS_WRITE
+
0x05 -> IOS_SEEK
+
0x06 -> IOS_IOCTL
+
0x07 -> IOS_IOCTLV
+
0x08 -> IOS_REPLY (internal to IOSU)
+
0x09 -> IOS_IPC_MSG0 (internal to IOSU)
+
0x0A -> IOS_IPC_MSG1 (internal to IOSU)
+
0x0B -> IOS_IPC_MSG2 (internal to IOSU)
+
0x0C -> IOS_SUSPEND (internal to IOSU)
+
0x0D -> IOS_RESUME (internal to IOSU)
+
0x0E -> IOS_SVCMSG (internal to IOSU)
+
+
IPC client PIDs
+
+
On older versions of IOSU, it seems to match the PFID list. More recently, it appears to use the RAMPID. See the [http://wiiubrew.org/wiki/Cafe_OS#Processes Cafe OS PID tables].
+
+
IPC arguments
+
+
Open CMD: Client FD == 0
+
Arg0 = name
+
Arg1 = name_size
+
Arg2 = mode (0 = none, 1 = read, 2 = write)
+
Arg3-Arg4 = u64 permissions_bitmask for the target IOSU process, loaded by the target IOSU process during fd init. With PPC this originates from the cos.xml of the source process.
+
+
Close CMD: Client FD != 0
+
+
Read CMD: Client FD != 0
+
Arg0 = outPtr
+
Arg1 = outLen
+
+
Write CMD: Client FD != 0
+
Arg0 = inPtr
+
Arg1 = inLen
+
+
Seek CMD: Client FD != 0
+
Arg0 = where
+
Arg1 = whence
+
+
IOCtl CMD: Client FD != 0
+
Arg0 = cmd
+
Arg1 = inPtr
+
Arg2 = inLen
+
Arg3 = outPtr
+
Arg4 = outLen
+
+
IOCtlv CMD: Client FD != 0
+
Arg0 = cmd
+
Arg1 = readCount
+
Arg2 = writeCount
+
Arg3 = vector
+
+
= Modules =
+
Similarly to the Wii, IOS modules roughly map to processes and drivers inside the kernel.
== IOS-CRYPTO ==
== IOS-CRYPTO ==