Cafe OS: Difference between revisions

Spletz (talk | contribs)
m "uac_rpl.rpl" -> "uac.rpl"
 
(30 intermediate revisions by 3 users not shown)
Line 18: Line 18:
RAMPIDs 0 (Kernel), 2, and 3 all use an empty table, while RAMPID 1 (root.rpx) has its own table with a few unique calls. RAMPIDs 4 (background app), 5 (home menu), and 6 (error display) share the same table and RAMPID 7 (foreground app) has it's own.
RAMPIDs 0 (Kernel), 2, and 3 all use an empty table, while RAMPID 1 (root.rpx) has its own table with a few unique calls. RAMPIDs 4 (background app), 5 (home menu), and 6 (error display) share the same table and RAMPID 7 (foreground app) has it's own.


Below is a list of what all of them, as well as the loader which has its own bare-bones table, have access to call. (sp) indicates that the loader uses a separate function for that syscall. Additionally, the loader uses the same function for IPCKDriver_Open/Close.
=== ProcessSysCallTable ===
 
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! scope="col" | #
! scope="col" | #
! scope="col" | Name
! scope="col" | Name
! scope="col" style="width: 24px;" | root
! scope="col" style="width: 24px;" | Root
! scope="col" style="width: 24px;" | Sys
! scope="col" style="width: 24px;" | SystemService
! scope="col" style="width: 24px;" | App
! scope="col" style="width: 24px;" | Browser
! scope="col" style="width: 24px;" | Ldr
! scope="col" style="width: 24px;" | Game
|-
|-
| 0x0 || ConsoleWrite || X || X || X || X (sp)
| 0x0 || KeConsoleWrite || X || X || X || X
|-
|-
| 0x100 || AppPanic || X || X || X || X
| 0x100 || KeAppPanic || X || X || X || X
|-
|-
| 0x200 || EffectiveToPhysical || X || X || X ||  
| 0x200 || KeEffectiveToPhysical || X || X || X || X
|-
|-
| 0x300 || PhysicalToEffectiveCached || X || X || X ||  
| 0x300 || KePhysicalToEffectiveCached || X || X || X || X
|-
|-
| 0x400 || PhysicalToEffectiveUncached || X || X || X ||  
| 0x400 || KePhysicalToEffectiveUncached || X || X || X || X
|-
|-
| 0x500 || ValidateAddressSpaceRange || X || X || X || X
| 0x500 || KeValidateAddressSpaceRange || X || X || X || X
|-
|-
| 0x600 || UpdateCoretime || X || X || X ||  
| 0x600 || KeUpdateCoretime || X || X || X || X
|-
|-
| 0x700 || - || - || - || - || -  
| 0x700 || - || - || - || - || -  
|-
|-
| 0x800 || SetUserModeExHandler || X || X || X ||  
| 0x800 || KeSetUserModeExHandler || X || X || X || X
|-
| 0x900-0xA00 || - || - || - || - || -
|-
| 0xB00 || KeAllocateTimer || X || X || X || X
|-
| 0xC00 || KeFreeTimer || X || X || X || X
|-
| 0xD00 || KePrimeTimer || X || X || X || X
|-
| 0xE00 || KeStopTimer || X || X || X || X
|-
| 0xF00 || KeDumpModuleList || X || X || X || X
|-
| 0x1000 || KeSetInterruptHandler || X || X || X || X
|-
| 0x1100 || KeGetInterruptHandler || X || X || X || X
|-
| 0x1200 || KeDisableInterrupt || X || X || X || X
|-
| 0x1300 || KeEnableInterrupt || X || X || X || X
|-
| 0x1400 || KeClearAndEnableInterrupt || X || X || X || X
|-
| 0x1500 || KeGetInterruptStatus || X || X || X || X
|-
| 0x1600 || KeClearInterruptStatus || X || X || X || X
|-
| 0x1700 || KeFindClosestRPLandSymbol || X || X || X || X
|-
| 0x1800 || KeTestAssist ||  ||  ||  ||
|-
| 0x1900 || KeAppExit || X || X || X || X
|-
| 0x1A00 || KeGetInfo || X || X || X || X
|-
|-
| 0x900 || - || - || - || - || -
| 0x1B00 || KeSetInfo || X || X || X || X
|-
|-
| 0xA00 || - || - || - || - || -
| 0x1C00 || KeReleaseCore || X || X || X || X
|-
|-
| 0xB00 || AllocateTimer || X || X || X ||  
| 0x1D00 || KeSendICI || X || X || X || X
|-
|-
| 0xC00 || FreeTimer || X || X || X ||  
| 0x1E00 || KeIPCKDriver_UserOpen || X || X || X || X
|-
|-
| 0xD00 || PrimeTimer || X || X || X ||  
| 0x1F00 || KeIPCKDriver_UserClose || X || X || X || X
|-
|-
| 0xE00 || StopTimer || X || X || X ||  
| 0x2000 || KeIPCKDriver_SubmitUserRequest || X || X || X || X
|-
|-
| 0xF00 || DynLoad_DumpModuleList || X || X || X ||  
| 0x2100 || KeFindRPLExport || X || X || X || X
|-
|-
| 0x1000 || SetInterruptHandler || X || X || X ||  
| 0x2200 || KiGetEnvironmentVariable || X || X || X || X
|-
|-
| 0x1100 || GetInterruptHandler || X || X || X ||  
| 0x2300-0x2600 || - || - || - || - || -
|-
|-
| 0x1200 || DisableInterrupt || X || X || X ||  
| 0x2700 || KeGetProcNotifyTarget || X || X || X || X
|-
|-
| 0x1300 || EnableInterrupt || X || X || X ||  
| 0x2800 || KeProcReleaseForeground || X || X || X || X
|-
|-
| 0x1400 || ClearAndEnableInterrupt || X || X || X ||  
| 0x2900 || KeProcGetForeground || X || X || X || X
|-
|-
| 0x1500 || GetInterruptStatus || X || X || X ||  
| 0x2A00 || KeProcRequestSwitch || X || X || X || X
|-
|-
| 0x1600 || ClearInterruptStatus || X || X || X ||  
| 0x2B00 || KeLaunchTitle || X || X || X || X
|-
|-
| 0x1700 || FindClosestSymbol || X || X || X || X (sp)
| 0x2C00 || KeProcYieldCore || X || X || X || X
|-
|-
| 0x1800 || Test_Assist || || || ||  
| 0x2D00 || - || - || - || - || -
|-
|-
| 0x1900 || Exit || X || X || X ||  
| 0x2E00 || KeProcGetSysMessage || X || X || X || X
|-
|-
| 0x1A00 || GetInfo || X || X || X ||  
| 0x2F00 || KeProcGetCallArgs || X || X || X || X
|-
|-
| 0x1B00 || SetInfo || X || X || X ||  
| 0x3000 || KeGetAbsoluteSystemTime || X || X || X || X
|-
|-
| 0x1C00 || ReleaseCore || X || X || X ||  
| 0x3100 || KeSetAbsoluteSystemTime || X || X || X || X
|-
|-
| 0x1D00 || SendICI || X || X || X ||  
| 0x3200 || KeProcDriverGetInstance || X || X || X || X
|-
|-
| 0x1E00 || IPCKDriver_<nowiki>{Loader|User}</nowiki>Open || X || X || X || X (sp)
| 0x3300 || KeProcDriverPurgeMaster || X || X || X || X
|-
|-
| 0x1F00 || IPCKDriver_<nowiki>{Loader|User}</nowiki>Close || X || X || X || X (sp)
| 0x3400-0x3700 || - || - || - || - || -
|-
|-
| 0x2000 || IPCKDriver_SubmitRequest || X || X || X || X (sp)
| 0x3800 || KeAllocVirtAddr || X || X || X || X
|-
|-
| 0x2100 || - || - || - || - || -
| 0x3900 || KeFreeVirtAddr || X || X || X || X
|-
|-
| 0x2200 || GetEnvironmentVariable || X || X || X ||  
| 0x3A00 || KeGetMapVirtAddrRange || X || X || X || X
|-
|-
| 0x2300 || - || - || - || - || -
| 0x3B00 || KeGetDataPhysAddrRange || X || X || X || X
|-
|-
| 0x2400 || - || - || - || - || -
| 0x3C00 || KeGetAvailPhysAddrRange || X || X || X || X
|-
|-
| 0x2500 || - || - || - || - || -
| 0x3D00 || KeMapMemory || X || X || X || X
|-
|-
| 0x2600 || - || - || - || - || -
| 0x3E00 || KeUnmapMemory || X || X || X || X
|-
|-
| 0x2700 || Proc_GetNotifyTarget || X || X || X ||  
| 0x3F00 || KeLogBuffer || X || X || X || X
|-
|-
| 0x2800 || Proc_ReleaseForeground || X || X || X ||  
| 0x4000 || KeLogArgs || X || X || X || X
|-
|-
| 0x2900 || Proc_GetForegroundBucket || X || X || X ||  
| 0x4100 || KeLogFunc || X || X || X || X
|-
|-
| 0x2A00 || Proc_RequestSwitch || X || X || X ||  
| 0x4200 || KeLogReport || X || X || X || X
|-
|-
| 0x2B00 || LaunchTitleArgvStr || X || X || X ||  
| 0x4300 || KeLogRetrieve || X || X || X || X
|-
|-
| 0x2C00 || Proc_YieldCore || X || X || X ||  
| 0x4400 || KeDeferLoadContext || X || X || X || X
|-
|-
| 0x2D00 || - || - || - || - || -  
| 0x4500 || KeDeferYieldCore || X || X || X || X
|-
| 0x4600 || KeFlushFPUContext || X || X || X || X
|-
| 0x4700 || KeProcDriverCopyFromSave || X || X || X || X
|-
| 0x4800 || KeProcDriverCopyToSave || X || X || X || X
|-
| 0x4900 || KeProcReadyToRelease || X || X || X || X
|-
| 0x4A00 || KeDeliverInterrupts || X || X || X || X
|-
| 0x4B00 || KeSetDABR || X || X || X || X
|-
| 0x4C00 || KeSetIABR || X || X || X || X
|-
| 0x4D00 || KeGetProcessInfo || X || X || X || X
|-
| 0x4E00 || KeGetCodegenVirtAddrRange || X || X || X || X
|-
| 0x4F00 || KeRPLLoaderEntry || X || X || X || X
|-
| 0x5000-0x5800 || - || - || - || - || -
|-
|-
| 0x2E00 || Proc_GetSystemMessage || X || X || X ||  
| 0x5900 || KeGetSharedArea || X || X || X || X
|-
|-
| 0x2F00 || Proc_GetCallArgs || X || X || X ||  
| 0x5A00 || KeProcSendPolicy || X || X || X || X
|-
|-
| 0x3000 || GetAbsoluteSystemTimeInternal || X || X || X ||  
| 0x5B00-0x5C00 || - || - || - || - || -
|-
|-
| 0x3100 || SetAbsoluteSystemTimeInternal || X || X || X ||  
| 0x5D00 || KeBlockLogSaveHiLo || X || X || X || X
|-
|-
| 0x3200 || Drivers_GetInstance || X || X || X ||  
| 0x5E00-0x6000 || - || - || - || - || -
|-
|-
| 0x3300 || Drivers_PurgeMaster || X || X || X ||  
| 0x6100 || KeProcQuerySwitchReady || X || X || X || X
|-
|-
| 0x3400 || - || - || - || - || -
| 0x6200 || KeLaunchTitleByPath || X || X || X || X
|-
|-
| 0x3500 || - || - || - || - || -
| 0x6300 || KeQueryLaunchReady || X || X || X || X
|-
|-
| 0x3600 || - || - || - || - || -
| 0x6400 || KeSetTime || || X || ||  
|-
|-
| 0x3700 || - || - || - || - || -
| 0x6500 || KeGetProfileLog || X || X || X || X
|-
|-
| 0x3800 || AllocVirtAddr || X || X || X ||  
| 0x6600 || - || - || - || - || -
|-
|-
| 0x3900 || FreeVirtAddr || X || X || X ||  
| 0x6700 || KeProcRequestExit || X || X || X || X
|-
|-
| 0x3A00 || GetMapVirtAddrRange || X || X || X ||  
| 0x6800 || KeProcCoreInitDone || X || X || X || X
|-
|-
| 0x3B00 || GetDataPhysAddrRange || X || X || X ||  
| 0x6900 || KeProcGetSwitchTarget || X || X || X || X
|-
|-
| 0x3C00 || GetAvailPhysAddrRange || X || X || X ||  
| 0x6A00 || KeProcAcquireDone || X || X || X || X
|-
|-
| 0x3D00 || MapMemory || X || X || X ||  
| 0x6B00 || KeProcGetBuiltSDKVersion || X || X || X || X
|-
|-
| 0x3E00 || UnmapMemory || X || X || X ||  
| 0x6C00 || KeProcSystemFatal || X || X || X || X
|-
|-
| 0x3F00 || LogBuffer || X || X || X || X
| 0x6D00 || - || - || - || - || -
|-
|-
| 0x4000 || LogArgs || X || X || X || X
| 0x6E00 || KeSwitchSecCodeGenMode || X || X || X || X
|-
|-
| 0x4100 || LogFunc || X || X || X || X
| 0x6F00 || KeIopShell_RegisterCallback || X || X || X || X
|-
|-
| 0x4200 || LogReportKernel || X || X || X || X
| 0x7000 || Proc_GetTitleVersion || X || X || X || X
|-
|-
| 0x4300 || LogRetrieve || X || X || X || X
| 0x7100 || Proc_IsTestKernel || X || X || X || X
|-
|-
| 0x4400 || || X || X || X ||  
| 0x7200 || ForceFullRelaunch || X || X || X || X
|-
|-
| 0x4500 || || X || X || X ||  
| 0x7300 || Proc_Recycle || X || || ||  
|-
|-
| 0x4600 || || X || X || X ||  
| 0x7400 || GetFlags || X || X || X || X
|-
|-
| 0x4700 || Drivers_CopyFromSaveArea || X || X || X ||  
| 0x7500 || QueryVirtAddr || X || X || X || X
|-
|-
| 0x4800 || Drivers_CopyToSaveArea || X || X || X ||  
| 0x7600 || GetCodegenInfo || X || X || X || X
|-
|-
| 0x4900 || Proc_ReadyToRelease || X || X || X ||  
| 0x7700 || GetSecCodeGenMode || X || X || X || X
|-
|-
| 0x4A00 || SetAlarm || X || X || X ||  
| 0x7800 || CodegenCopy || X || X || X || X
|-
|-
| 0x4B00 || SetDABR || X || X || X ||  
| 0x7900 || Proc_LoadShared || X || || ||  
|-
|-
| 0x4C00 || SetIABR || X || X || X ||  
| 0x7A00 || SetExceptionCallback || X || X || X || X
|-
|-
| 0x4D00 || Proc_GetProcessInfo || X || X || X ||  
| 0x7B00 || IopShell_InjectCommand || X || X || X || X
|-
|-
| 0x4E00 || GetCodegenVirtAddrRange || X || X || X ||  
| 0x7C00 || Proc_Kill || X || X || X || X
|-
|-
| 0x4F00 || DynLoad_RPLLoaderEntry || X || X || X ||  
| 0x7D00 || EnableOverlayArena || X || X || X || X
|-
|-
| 0x5000 || RPLLoaderResumeContext || || || || X
| 0x7E00 || DisableOverlayArena || X || X || X || X
|-
|-
| 0x5100 || - || - || - || - || -
| 0x7F00 || GetSystemMode || X || X || X || X
|-
|-
| 0x5200 || WaitIopComplete || || || || X
| 0x8000 || SystemMode_RegisterCallback || X || X || X || X
|-
|-
| 0x5300 || FlushCode || ||  ||  || X
| 0x8100 || ZeroProcessMemory || X ||  ||  ||  
|-
|-
| 0x5400 || FlushData || || || || X
| 0x8200 || - || - || - || - || -
|-
|-
| 0x5500 || UpdateHeartbeat || || || || X
| 0x8300 || ConsoleTimestamp || X || X || X || X
|-
|-
| 0x5600 || LogEntry || || || || X
| 0x8400-0xFF00 || - || - || - || - || -
|}
 
=== LoaderSysCallTable ===
{| class="wikitable sortable"
|-
|-
| 0x5700 || FastClearMemory ||  ||  ||  || X
! scope="col" | #
! scope="col" | Name
|-
|-
| 0x5800 || GetBusClockSpeed ||  ||  ||  || X
| 0x0 || KeConsoleWrite
|-
|-
| 0x5900 || Shared_GetArea || X || X || X ||  
| 0x100 || KeAppPanic
|-
|-
| 0x5A00 || Proc_SendPolicy || X || X || X ||  
| 0x200-0x400 || -
|-
|-
| 0x5B00 || GetProcessIndex ||  ||  ||  || X
| 0x500 || KeValidateAddressSpaceRange
|-
|-
| 0x5C00 || IPCKDriver_PollLoaderCompletion ||  ||  ||  || X
| 0x600-0xE00 || -
|-
|-
| 0x5D00 || BlockLogSaveHiLo || X || X || X ||  
| 0xF00 || KeDumpModuleList
|-
|-
| 0x5E00 || FinishInitAndPreload ||  ||  ||  || X
| 0x1000-0x1600 || -
|-
|-
| 0x5F00 || ContinueStartProcess ||  ||  ||  || X
| 0x1700 || KeLoaderGetSymbolName
|-
|-
| 0x6000 || OpenMCP ||  ||  ||  || X
| 0x1800-0x1D00 || -
|-
|-
| 0x6100 || Proc_QuerySwitchReady || X || X || X ||  
| 0x1E00 || KeIPCKDriver_LoaderReset
|-
|-
| 0x6200 || Launch || X || X || X ||  
| 0x1F00 || KeIPCKDriver_LoaderReset
|-
|-
| 0x6300 || Call || X || X || X ||  
| 0x2000 || KeIPCKDriver_SubmitLoaderRequest
|-
|-
| 0x6400 || SetTimeInternal ||  || X ||  ||  
| 0x2100-0x3E00 || -
|-
|-
| 0x6500 || || X || X || X ||  
| 0x3F00 || KeLogBuffer
|-
|-
| 0x6600 || ProfileEntry ||  ||  ||  || X
| 0x4000 || KeLogArgs
|-
|-
| 0x6700 || Proc_RequestExit || X || X || X ||  
| 0x4100 || KeLogFunc
|-
|-
| 0x6800 || Proc_CoreInitDone || X || X || X ||  
| 0x4200 || KeLogReport
|-
|-
| 0x6900 || Proc_GetSwitchTarget || X || X || X ||  
| 0x4300 || KeLogRetrieve
|-
|-
| 0x6A00 || Proc_AcquireDone || X || X || X ||  
| 0x4400-0x4F00 || -
|-
|-
| 0x6B00 || Proc_GetBuiltSDKVersion || X || X || X ||  
| 0x5000 || KeRPLLoader_ResumeUserContext
|-
|-
| 0x6C00 || Proc_SystemFatal || X || X || X ||  
| 0x5100 || -
|-
|-
| 0x6D00 || - || - || - || - || -
| 0x5200 || KiWaitIopComplete
|-
|-
| 0x6E00 || SwitchSecCodeGenMode || X || X || X ||  
| 0x5300 || KeLoaderFlushCode
|-
|-
| 0x6F00 || IopShell_RegisterCallback || X || X || X ||  
| 0x5400 || KeLoaderFlushData
|-
|-
| 0x7000 || Proc_GetTitleVersion || X || X || X ||  
| 0x5500 || KiUpdateAllHeartBeats
|-
|-
| 0x7100 || Proc_IsTestKernel || X || X || X ||  
| 0x5600 || KiLogPrintf
|-
|-
| 0x7200 || ForceFullRelaunch || X || X || X ||  
| 0x5700 || KiMemclr
|-
|-
| 0x7300 || Proc_Recycle || X ||  ||  ||  
| 0x5800 || KeLoaderBusClockSpeed
|-
|-
| 0x7400 || GetFlags || X || X || X || X
| 0x5900-0x5A00 || -
|-
|-
| 0x7500 || QueryVirtAddr || X || X || X ||  
| 0x5B00 || GetProcessIndex
|-
|-
| 0x7600 || GetCodegenInfo || X || X || X ||  
| 0x5C00 || KeIPCKDriver_PollLoaderCompletion
|-
|-
| 0x7700 || GetSecCodeGenMode || X || X || X ||  
| 0x5D00 || -
|-
|-
| 0x7800 || CodegenCopy || X || X || X ||  
| 0x5E00 || KeProcess_FinishInitAndPreload
|-
|-
| 0x7900 || Proc_LoadShared || X ||  ||  ||  
| 0x5F00 || KeContinueStartCore1
|-
|-
| 0x7A00 || SetExceptionCallback || X || X || X ||  
| 0x6000 || KeOpenMCP
|-
|-
| 0x7B00 || IopShell_InjectCommand || X || X || X ||  
| 0x6100-0x6500 || -
|-
|-
| 0x7C00 || Proc_Kill || X || X || X ||  
| 0x6600 || KeLoaderProfile
|-
|-
| 0x7D00 || EnableOverlayArena || X || X || X ||  
| 0x6700-0x6C00 || -
|-
|-
| 0x7E00 || DisableOverlayArena || X || X || X ||  
| 0x6D00 || KeProcess_FinishChainLoad
|-
|-
| 0x7F00 || GetSystemMode || X || X || X ||  
| 0x6E00-0x7300 || -
|-
|-
| 0x8000 || SystemMode_RegisterCallback || X || X || X ||  
| 0x7400 || GetFlags
|-
|-
| 0x8100 || ZeroProcessMemory || X ||  ||  ||
| 0x7500-0x8100 || -
|-
|-
| 0x8200 || HandlePowerEvents ||  ||  ||  || X
| 0x8200 || HandlePowerEvents
|-
|-
| 0x8300 || ConsoleTimestamp || X || X || X || X
| 0x8300 || ConsoleTimestamp
|-
|-
| 0x8400 || ValidateOverlayRange ||  ||  ||  || X
| 0x8400 || ValidateOverlayRange
|-
|-
| 0x8500-0xFF00 || BadSysCall (jump to null on purpose) || X || X || X || X
| 0x8500-0xFF00 || -
|}
|}


Line 309: Line 369:
! scope="col" | Name
! scope="col" | Name
|-
|-
| 0x0 || - (default branch to syscall dispatcher)
| 0x0 || KsDispatchToKernel
|-
| 0x1 || KsMemoryBarrier
|-
| 0x2 || KsEnableInterrupts (reserved)
|-
| 0x3 || KsDisableInterrupts (reserved)
|-
| 0x4 || KsGetInterruptsEnabled (reserved)
|-
|-
| 0x1 || SyncEieio
| 0x5 || KsRestoreInterrupts (reserved)
|-
|-
| 0x2 || EnableInterrupts (deprecated, jumps to error)
| 0x6 || KsLoadContext
|-
|-
| 0x3 || DisableInterrupts (deprecated, jumps to error)
| 0x7 || KsGetMSR
|-
|-
| 0x4 || IsInterruptEnabled (deprecated, jumps to error)
| 0x8 || KsSetCurrentContext
|-
|-
| 0x5 || RestoreInterrupts (deprecated, jumps to error)
| 0x9 || KsGetCurrentFPUContext
|-
|-
| 0x6 || LoadContext
| 0xA || KsSetCurrentFPUContext
|-
|-
| 0x7 || GetMSR
| 0xB || KsCompareAndSwapCurrentFPUContext
|-
|-
| 0x8 || SetCurrentContext
| 0xC || KsWGReset
|-
|-
| 0x9 || GetCurrentFPUContext
| 0xD || KsSetPerformanceMonitor
|-
|-
| 0xA || SetCurrentFPUContext
| 0xE || KsWriteDMAUL
|-
|-
| 0xB || CompareAndSwapCurrentFPUContext
| 0xF || KsUpdateCoretime
|-
|-
| 0xC || WriteGatherInit
| 0x10 || KsFlushFPUContext
|-
|-
| 0xD || SetPerformanceMonitor
| 0x11 || [[#KsReadRegister32Ex|KsReadRegister32Ex]]
|-
|-
| 0xE ||  
| 0x12 || [[#KsWriteRegister32Ex|KsWriteRegister32Ex]]
|-
|-
| 0xF || (return)
| 0x13 || KsWGInit
|-
|-
| 0x10 || FlushFPUContext
| 0x14 || KsWGInitBaseAndTop
|-
|-
| 0x11 || ReadRegister32Ex
| 0x15 || KsWGInitWritePtr
|-
|-
| 0x12 || WriteRegister32Ex
| 0x16 || KsWGInitThreshold
|-
|-
| 0x13 ||  
| 0x17 || KsWGReadWritePtr
|-
|-
| 0x14 ||  
| 0x18 || KsEnableFPU
|-
|-
| 0x15 ||  
| 0x19 || KsGetSecurityLevel_u32
|-
|-
| 0x16 ||  
| 0x1A || KsFastCall26 (reserved)
|-
|-
| 0x17 || WriteGatherGetPtr
| 0x1B || KsFastCall27 (reserved)
|-
|-
| 0x18 || EnableFPU
| 0x1C || KsFastCall28 (reserved)
|-
|-
| 0x19 || GetSecurityLevel
| 0x1D || KsFastCall29 (reserved)
|-
|-
| 0x1A-0x1F || BadFastCall (jump to error on purpose)
| 0x1E || KsFastCall30 (reserved)
|-
| 0x1F || KsFastCall31 (reserved)
|}
|}
=== KsReadRegister32Ex ===
Takes two u32s '''WhitelistIndex''' and '''RegisterIndex'''. Returns an u32 '''RegisterValue'''.
Reads a hardware register from the following whitelist:
0                // Invalid
0xFD020068      // 2 registers at 0x0D000068 (HW_I2CIOPINTEN to HW_I2CIOPINTSTS)
0xFD0100C0      // 1 registers at 0x0D0000C0 (HW_GPIOPPCOUT)
0xFD04021C      // 4 registers at 0x0D00021C (HW_VIIOPDATA to HW_VIIOPCTRL)
0xFD040250      // 4 registers at 0x0D000250 (HW_I2CMCTRL to HW_I2CMDATARD)
0xFD060520      // 6 registers at 0x0D000520 (LT_GPIOPPCOUT to LT_GPIOPPCINTEN)
0xFD106400      // 16 registers at 0x0D006400 (SI0_OUTBUF to SIEXI_LOCK)
0xFD046C00      // 4 registers at 0x0D006C00 (AI_CR to AI_IT)
0xFD046E00      // 4 registers at 0x0D006E00
0xFD0F6800      // 15 registers at 0x0D006800 (EXI0_CSR to EXI2_DATA)
0                // Invalid
0                // Invalid
0                // Invalid
0                // Invalid
0                // Invalid
0                // Invalid
=== KsWriteRegister32Ex ===
Takes three u32s '''WhitelistIndex''', '''RegisterIndex''' and '''RegisterValue'''. No output.
Same as [[#KsReadRegister32Ex|KsReadRegister32Ex]], but for writing to a whitelisted hardware register instead.


== OSPlatformInfo ==
== OSPlatformInfo ==
Line 371: Line 467:
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x4 || Magic (0x5726)
| 0x0 || 0x4 || Version (0x5726)
|-
|-
| 0x4 || 0x4 || Size (0x40C)
| 0x4 || 0x4 || Size (0x40C)
Line 449: Line 545:
| 0x370 || 0x4 || HardwareVersion
| 0x370 || 0x4 || HardwareVersion
|-
|-
| 0x374 || 0x8C || Reserved
| 0x374 || 0x40 || Reserved
|-
| 0x3B4 || 0x4 || SmdBaseAddress
|-
| 0x3B8 || 0x44 || Reserved
|-
| 0x3FC || 0x4 || [[#OSPackage|OSPackageAddress]]
|-
|-
| 0x400 || 0x4 || LastPMState
| 0x400 || 0x4 || LastPMState
Line 464: Line 566:
! Description
! Description
|-
|-
| 0-26
| 0-25
|  
|  
|-
| 26
| IsEnterBgNormalMode
|-
|-
| 27
| 27
Line 471: Line 576:
|-
|-
| 28
| 28
|  
| IsFastRelaunch
|-
|-
| 29
| 29
Line 481: Line 586:
| 31
| 31
|  
|  
|}
== OSPackage ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || [[#OSPackageHeader|OSPackageHeader]]
|-
| 0x8 || Variable || Array of [[#OSPackageInfo|OSPackageInfo]]
|-
| Variable || 0x4 || OSArgc
|-
| Variable || Variable || OSArgv
|}
=== OSPackageHeader ===
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Flags
|-
| 0x4 || 0x4 || NumPackages
|}
=== OSPackageInfo ===
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Address
|-
| 0x4 || 0x4 || Size
|-
| 0x8 || 0x4 ||
|-
| 0xC || 0x4 ||
|-
| 0x10 || 0x4 ||
|-
| 0x14 || 0x4 ||
|-
| 0x18 || 0x4 ||
|-
| 0x1C || 0x4 ||
|}
== OSContext ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || Tag
|-
| 0x8 || 0x80 || Gpr
|-
| 0x88 || 0x4 || Cr
|-
| 0x8C || 0x4 || Lr
|-
| 0x90 || 0x4 || Ctr
|-
| 0x94 || 0x4 || Xer
|-
| 0x98 || 0x4 || Srr0
|-
| 0x9C || 0x4 || Srr1
|-
| 0xA0 || 0x4 || Dsisr
|-
| 0xA4 || 0x4 || Dar
|-
| 0xA8 || 0x4 || CrashType
|-
| 0xAC || 0x4 || Reserved
|-
| 0xB0 || 0x4 || FpscrHigh
|-
| 0xB4 || 0x4 || FpscrLow
|-
| 0xB8 || 0x100 || Fpr
|-
| 0x1B8 || 0x2 || SpinLockCount
|-
| 0x1BA || 0x2 || ContextState
|-
| 0x1BC || 0x20 || Ugqr
|-
| 0x1DC || 0x4 || Pir
|-
| 0x1E0 || 0x100 || Psf
|-
| 0x2E0 || 0x18 || Coretime
|-
| 0x2F8 || 0x8 || Starttime
|-
| 0x300 || 0x4 || Error
|-
| 0x304 || 0x4 || Attributes
|-
| 0x308 || 0x4 || Pmc1
|-
| 0x30C || 0x4 || Pmc2
|-
| 0x310 || 0x4 || Pmc3
|-
| 0x314 || 0x4 || Pmc4
|-
| 0x318 || 0x4 || Mmcr0
|-
| 0x31C || 0x4 || Mmcr1
|}
== CoreControl ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x40 ||
|-
| 0x40 || 0x4 || BootStage
|-
| 0x44 || 0x4 || CoreInitFunc
|-
| 0x48 || 0x4 || CoreState
|-
| 0x4C || 0x4 ||
|-
| 0x50 || 0x4 ||
|-
| 0x54 || 0x4 || IsKernelPanic
|-
| 0x58 || 0x4 || InterruptedContext
|-
| 0x5C || 0x4 || CurrentFpuContext
|-
| 0x60 || 0x4 || CurrentCoreControl
|-
| 0x64 || 0x4 || SysCallTableAddress
|-
| 0x68 || 0x4 || FastCallBaseAddress
|-
| 0x6C || 0x4 || NonRecoverableExceptionHandlerTableAddress
|-
| 0x70 || 0x4 || RecoverableExceptionHandlerTableAddress
|-
| 0x74 || 0x2 ||
|-
| 0x76 || 0x2 ||
|-
| 0x78 || 0x4 || LoadPerfMonContext
|-
| 0x7C || 0x4 || CurrentSysCallAddress
|-
| 0x80 || 0x4 || CurrentSysCallCallback
|-
| 0x84 || 0x4 || NonRecoverableExceptionContextAddress
|-
| 0x88 || 0x4 || RecoverableExceptionContextAddress
|-
| 0x8C || 0x4 || NormalSysCalls
|-
| 0x90 || 0x4 || FpuExceptions
|-
| 0x94 || 0x4 || DsiExceptions
|-
| 0x98 || 0x4 || IciExceptions
|-
| 0x9C || 0x4 ||
|-
| 0xA0 || 0x4 || Ps0
|-
| 0xA4 || 0x4 || Ps1
|-
| 0xA8 || 0x8 || ProcessWork
|-
| 0xB0 || 0x4 ||
|-
| 0xB4 || 0x4 || RamPid
|-
| 0xB8 || 0x4 || Upid
|-
| 0xBC || 0x4 || Mem1Address
|-
| 0xC0 || 0x4 || InterceptedLoadContext
|-
| 0xC4 || 0x4 || SintEnableAfterKernelExit
|-
| 0xC8 || 0x4 || AddrConfig
|-
| 0xCC || 0x20 || SysCallCallbackGpr
|-
| 0xEC || 0x4 || EaDataBegin
|-
| 0xF0 || 0x4 || EaDataEnd
|-
| 0xF4 || 0x18 ||
|-
| 0x10C || 0x4 || WriteGatherDataOffset
|-
| 0x110 || 0x30 || [[#ExceptionInfo|ExceptionInfo]]
|-
| 0x140 || 0x4 || OverwriteGprOnExceptionExit
|-
| 0x144 || 0x28 || ExceptionExitGpr
|-
| 0x16C || 0x28 || [[#PostException|PostException]]
|-
| 0x194 || 0x4 ||
|-
| 0x198 || 0x128 || [[#ExceptionContext|RecoverableExceptionContext]]
|-
| 0x2C0 || 0x14 ||
|-
| 0x2D8 || 0x128 || [[#ExceptionContext|NonRecoverableExceptionContext]]
|}
== ExceptionContext ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || Tbr64
|-
| 0x8 || 0x80 || Gpr
|-
| 0x88 || 0x4 || Cr
|-
| 0x8C || 0x4 || Lr
|-
| 0x90 || 0x4 || Ctr
|-
| 0x94 || 0x4 || Xer
|-
| 0x98 || 0x4 || Srr0
|-
| 0x9C || 0x4 || Srr1
|-
| 0xA0 || 0x88 ||
|}
== ExceptionInfo ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 ||
|-
| 0x4 || 0x4 ||
|-
| 0x8 || 0x4 || UserStackPtr
|-
| 0xC || 0x4 || ExHandler
|-
| 0x10 || 0x4 || Msr
|-
| 0x14 || 0x4 || Sprg0
|-
| 0x18 || 0x4 || Dsisr
|-
| 0x1C || 0x4 || Dar
|-
| 0x20 || 0x4 ||
|-
| 0x24 || 0x4 ||
|-
| 0x28 || 0x4 ||
|-
| 0x2C || 0x4 || CallbackContext
|}
== PostException ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || OldUpid
|-
| 0x4 || 0x4 || TargetUpid
|-
| 0x8 || 0x4 || Exit
|-
| 0xC || 0x4 || Callback
|-
| 0x10 || 0x4 || CurrentExceptionContext
|-
| 0x14 || 0x4 || InterruptedContext
|-
| 0x18 || 0x4 ||
|-
| 0x1C || 0x4 ||
|-
| 0x20 || 0x4 ||
|-
| 0x24 || 0x4 ||
|}
== NewExecCtx ==
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || InterruptedContext
|-
| 0x4 || 0x4 || CurrentFpuContext
|-
| 0x8 || 0x4 ||
|-
| 0xC || 0x4 || FastCallBaseAddress
|-
| 0x10 || 0x4 || SintEnableAfterKernelExit
|-
| 0x14 || 0x4 ||
|-
| 0x18 || 0x4 ||
|-
| 0x1C || 0x4 || Dabr
|-
| 0x20 || 0x4 || Iabr
|-
| 0x24 || 0x4 || EaDataBegin
|-
| 0x24 || 0x4 || EaDataEnd
|-
| 0x28 || 0x1C ||
|-
| 0x48 || 0x4 || AddrConfig
|-
| 0x4C || 0x3C || [[#PerCore|PerCore]]
|}
== PerCore ==
This is a structure mapped to address 0xFFFFFFC0.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x18 ||
|-
| 0x18 || 0x4 || UserHeartBeat
|-
| 0x1C || 0x4 ||
|-
| 0x20 || 0x4 || CurrentThread
|-
| 0x24 || 0x4 || SoftIntEnabled
|-
| 0x28 || 0x4 || SoftIntPending
|-
| 0x2C || 0x4 || CurrentContext
|-
| 0x30 || 0x4 ||
|-
| 0x34 || 0x4 ||
|-
| 0x38 || 0x4 || ThreadQueue
|}
|}


Line 560: Line 1,023:
|-
|-
| 7
| 7
| "MiniMiiverse"
| Miiverse Post App
| ???
| ???
|-
|-
Line 594: Line 1,057:
| Game
| Game
| 7
| 7
|-
| 16
| AOC Overlay App
| ???
|-
| 17
| amiibo Settings
| ???
|-
| 31
| Test Overlay
| ???
|-
|}
|}


Line 623: Line 1,099:
*[[nn_act.rpl]] - Nintendo Network Accounts
*[[nn_act.rpl]] - Nintendo Network Accounts
*[[nn_aoc.rpl]] - Nintendo Network Add-On Content
*[[nn_aoc.rpl]] - Nintendo Network Add-On Content
*[[nn_boss.rpl]] - Nintendo Network BOSS (SpotPass)
*[[nn_boss.rpl]] - Nintendo Network Background Online Services (SpotPass)
*[[nn_ccr.rpl]]
*[[nn_ccr.rpl]]
*[[nn_cmpt.rpl]] - Handles transition into vWii
*[[nn_cmpt.rpl]] - Handles transition into vWii
Line 631: Line 1,107:
*[[nn_hai.rpl]] - Helper library for interfacing [[nn_cmpt.rpl]] with Wii VC titles.
*[[nn_hai.rpl]] - Helper library for interfacing [[nn_cmpt.rpl]] with Wii VC titles.
*[[nn_hpad.rpl]] - Something related to controllers. Probably for the Gamecube controller adapter?
*[[nn_hpad.rpl]] - Something related to controllers. Probably for the Gamecube controller adapter?
*[[nn_idbe.rpl]] - Downloads and decrypts game icons from an online icon database
*[[nn_idbe.rpl]] - Icon Database Entries (Downloads and decrypts game icons from an online icon database)
*[[nn_ndm.rpl]] - Daemons???
*[[nn_ndm.rpl]] - Daemons
*[[nn_nets2.rpl]] - More network functions
*[[nn_nets2.rpl]] - More network functions
*[[nn_nfp.rpl]] - Nintendo Network Nintendo Figurine Platform (Amiibo)
*[[nn_nfp.rpl]] - Nintendo Network Nintendo Figurine Platform (Amiibo)
*[[nn_nim.rpl]]
*[[nn_nim.rpl]] - Title installation
*[[nn_olv.rpl]] - Olive/OLV - Miiverse
*[[nn_olv.rpl]] - Olive/OLV - Miiverse
*[[nn_pdm.rpl]] - System Play related data (play times etc.)
*[[nn_pdm.rpl]] - System Play related data (play times etc.)
*[[nn_save.rpl]] - Savefile access
*[[nn_save.rpl]] - Save file access
*[[nn_sl.rpl]]
*[[nn_sl.rpl]] - GamePad Quick Start menu communication
*[[nn_spm.rpl]] - Storage related functions (USB?)
*[[nn_spm.rpl]] - Storage related functions (USB?)
*[[nn_temp.rpl]] - TEMP library (for temporary files)
*[[nn_temp.rpl]] - TEMP library (for temporary files)
Line 658: Line 1,134:
*[[snduser2.rpl]] - Sound-2 User
*[[snduser2.rpl]] - Sound-2 User
*[[swkbd.rpl]] - Onscreen keyboard
*[[swkbd.rpl]] - Onscreen keyboard
*[[sysapp.rpl]]
*[[sysapp.rpl]] - Application jump/transition handling
*[[tcl.rpl]] - Texture Core library
*[[tcl.rpl]] - Texture Core library
*[[tve.rpl]] - TV Engine
*[[tve.rpl]] - TV Engine
*[[uac.rpl]] - DRH communication (Gamepad microphone)
*[[uac.rpl]] - DRH communication (Gamepad microphone)
*[[uac_rpl.rpl]]
*[[uac.rpl]]
*[[usb_mic.rpl]]
*[[usb_mic.rpl]]
*[[uvc.rpl]] - DRH communication (Gamepad camera)
*[[uvc.rpl]] - DRH communication (Gamepad camera)
Line 785: Line 1,261:
| 0xC2A0000
| 0xC2A0000
| 0x78100023
| 0x78100023
| GX2 FIFO space? (Radeon PKT3 sent here)
| Write Gather Pipe
|-
|-
| 0xFC300000
| 0xFC300000