( ! ) Notice: fwrite(): write of 120 bytes failed with errno=32 Broken pipe in /root/w/includes/shell/Command.php on line 493
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.03963131224MediaWiki->performRequest( ).../MediaWiki.php:947
60.04103347440MediaWiki->performAction( ).../MediaWiki.php:313
70.04363370128ViewAction->show( ).../MediaWiki.php:531
80.04383370184Article->view( ).../ViewAction.php:80
90.08054156792PoolWorkArticleView->execute( ).../Article.php:810
100.08054156984PoolWorkArticleView->doWork( ).../PoolCounterWork.php:162
110.08064164048MediaWiki\Revision\RenderedRevision->getRevisionParserOutput( ).../PoolWorkArticleView.php:216
120.08064164048call_user_func:{/root/w/includes/Revision/RenderedRevision.php:197} ( ).../RenderedRevision.php:197
130.08064164048MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure:/root/w/includes/Revision/RevisionRenderer.php:151-153}( ).../RenderedRevision.php:197
140.08064164048MediaWiki\Revision\RevisionRenderer->combineSlotOutput( ).../RevisionRenderer.php:152
150.08064164048MediaWiki\Revision\RenderedRevision->getSlotParserOutput( ).../RevisionRenderer.php:215
160.08064164048MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached( ).../RenderedRevision.php:235
170.08074164048WikitextContent->getParserOutput( ).../RenderedRevision.php:263
180.08074166656WikitextContent->fillParserOutput( ).../AbstractContent.php:590
190.08084170752Parser->parse( ).../WikitextContent.php:374
200.08104178376Parser->internalParse( ).../Parser.php:651
210.08104178408Parser->replaceVariables( ).../Parser.php:1556
220.08394235872PPFrame_Hash->expand( ).../Parser.php:2887
230.09554263328Parser->extensionSubstitution( ).../PPFrame_Hash.php:340
240.09574263816SyntaxHighlight::parserHook( ).../Parser.php:3922
250.09574263976SyntaxHighlight::highlight( ).../SyntaxHighlight.php:131
260.09584265200WANObjectCache->getWithSetCallback( ).../SyntaxHighlight.php:350
270.09584265200WANObjectCache->fetchOrRegenerate( ).../WANObjectCache.php:1376
280.09604265712SyntaxHighlight::{closure:/root/w/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php:328-350}( ).../WANObjectCache.php:1529
290.09614266968MediaWiki\Shell\Command->execute( ).../SyntaxHighlight.php:341
300.09934271144fwrite ( ).../Command.php:493

( ! ) Notice: fwrite(): write of 281 bytes failed with errno=32 Broken pipe in /root/w/includes/shell/Command.php on line 493
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.03963131224MediaWiki->performRequest( ).../MediaWiki.php:947
60.04103347440MediaWiki->performAction( ).../MediaWiki.php:313
70.04363370128ViewAction->show( ).../MediaWiki.php:531
80.04383370184Article->view( ).../ViewAction.php:80
90.08054156792PoolWorkArticleView->execute( ).../Article.php:810
100.08054156984PoolWorkArticleView->doWork( ).../PoolCounterWork.php:162
110.08064164048MediaWiki\Revision\RenderedRevision->getRevisionParserOutput( ).../PoolWorkArticleView.php:216
120.08064164048call_user_func:{/root/w/includes/Revision/RenderedRevision.php:197} ( ).../RenderedRevision.php:197
130.08064164048MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure:/root/w/includes/Revision/RevisionRenderer.php:151-153}( ).../RenderedRevision.php:197
140.08064164048MediaWiki\Revision\RevisionRenderer->combineSlotOutput( ).../RevisionRenderer.php:152
150.08064164048MediaWiki\Revision\RenderedRevision->getSlotParserOutput( ).../RevisionRenderer.php:215
160.08064164048MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached( ).../RenderedRevision.php:235
170.08074164048WikitextContent->getParserOutput( ).../RenderedRevision.php:263
180.08074166656WikitextContent->fillParserOutput( ).../AbstractContent.php:590
190.08084170752Parser->parse( ).../WikitextContent.php:374
200.08104178376Parser->internalParse( ).../Parser.php:651
210.08104178408Parser->replaceVariables( ).../Parser.php:1556
220.08394235872PPFrame_Hash->expand( ).../Parser.php:2887
230.10194285504Parser->extensionSubstitution( ).../PPFrame_Hash.php:340
240.10204285992SyntaxHighlight::parserHook( ).../Parser.php:3922
250.10214286312SyntaxHighlight::highlight( ).../SyntaxHighlight.php:131
260.10214287536WANObjectCache->getWithSetCallback( ).../SyntaxHighlight.php:350
270.10214287536WANObjectCache->fetchOrRegenerate( ).../WANObjectCache.php:1376
280.10234288048SyntaxHighlight::{closure:/root/w/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php:328-350}( ).../WANObjectCache.php:1529
290.10244289304MediaWiki\Shell\Command->execute( ).../SyntaxHighlight.php:341
300.10484293960fwrite ( ).../Command.php:493

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.19584553728WebResponse->header( ).../OutputPage.php:2571
80.19584553824header ( ).../WebResponse.php:74

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.19614553808WebResponse->header( ).../OutputPage.php:2573
80.19614553808header ( ).../WebResponse.php:74

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/libs/http/SetCookieCompat.php on line 60
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.19634553760OutputPage->getSkin( ).../OutputPage.php:2610
80.19634553760RequestContext->getSkin( ).../ContextSource.php:150
90.19634553848MediaWiki\HookContainer\HookRunner->onRequestContextCreateSkin( ).../RequestContext.php:402
100.19634554224MediaWiki\HookContainer\HookContainer->run( ).../HookRunner.php:3216
110.19634555352MediaWiki\HookContainer\HookContainer->callLegacyHook( ).../HookContainer.php:132
120.19634555728MobileFrontendHooks::onRequestContextCreateSkin( ).../HookContainer.php:329
130.19644555760MobileContext->doToggling( ).../MobileFrontendHooks.php:111
140.19654556232MobileContext->setUseFormatCookie( ).../MobileContext.php:944
150.19654556232WebResponse->setCookie( ).../MobileContext.php:609
160.19674557624Wikimedia\Http\SetCookieCompat::setcookie( ).../WebResponse.php:241
170.19674557664Wikimedia\Http\SetCookieCompat->setCookieInternal( ).../SetCookieCompat.php:30
180.19674557664setcookie ( ).../SetCookieCompat.php:60
Coreinit.rpl - WiiUBrew

Coreinit.rpl

Revision as of 02:47, 2 December 2015 by Yellows8 (talk | contribs)

coreinit.rpl is the the system library that provides direct access to Cafe OS services. It provides kernel calls, thread scheduling, memory management, and filesystem services. coreinit is the first RPL loaded by the loader, even before the main executable itself.

Functions

Cache

Name Prototype Description
DCFlushRange void DCFlushRange(const void *addr, size_t length); Flush the specified data cache blocks to memory
DCInvalidateRange void DCInvalidateRange(void *addr, size_t length); Invalidate the specified data cache blocks
ICInvalidateRange void ICInvalidateRange(const void *addr, size_t length); Invalidate the specified instruction cache blocks

Disassembler

Name Prototype Description
DisassemblePPCOpcode void DisassemblePPCOpcode(uint32_t *addr, char *instr_buf, int instr_len, find_symbol_t sym_func, int flags); Disassemble a PPC opcode at addr and place it into instr_buf (instr_len must be 0x40 or lower)
DisassemblePPCRange void DisassemblePPCRange(uint32_t *start, uint32_t *end, printf_t printf_func, find_symbol_t sym_func, int flags); Disassemble PPC instructions from start to end, printing them using printf_func() with various flags applied

Dynamic Linking

Name Prototype Description
OSDynLoad_Acquire void OSDynLoad_Acquire(const char *rplname, uint32_t *handle); Acquire a handle to an RPL by name
OSDynLoad_FindExport void OSDynLoad_FindExport(uint32_t handle, bool isdata, const char *symname, void **address); Get a symbol address from a loaded RPL

Error

Name Prototype Description
OSFatal void OSFatal(const char *msg); Print a message to the screen and halts the system

Filesystem

Name Prototype Description Notes
FSInit void FSInit(void); Initializes the FS library. Must be called before anything else! Can be called multiple times safely.
FSAddClient int FSAddClient(void *client, int ret_flag); Registers a new client for use. Returns 0 if successful. Client size is 0x1700 bytes, should be 0x20 byte padded.
FSInitCmdBlock void FSInitCmdBlock(void *block); Initializes a command block for use. Command Block size is 0xA80 bytes, should be 0x20 byte padded.

Internal

Name Prototype Description
__os_snprintf int __os_snprintf(char *buf, size_t n, const char *format, ... ); Format a string and place it in a buffer (just like snprintf())

Threads

Name Prototype Description
OSCreateThread bool OSCreateThread(OSThread *thread, void (*entry)(int,void*), int argc, void *args, void *stack, size_t stack_size, int32_t priority, int16_t affinity); Create a (initially-paused) thread that starts at the specified entry point
OSResumeThread void OSResumeThread(OSThread *thread); Resume a paused thread, causing it to be scheduled
OSYieldThread void OSYieldThread(void); Yield control of the CPU, allowing another thread to run
OSGetCurrentThread OSThread *OSGetCurrentThread(void); Get the OSThread structure ptr for the current thread.
OSSetThreadAffinity uint32_t OSSetThreadAffinity(OSThread* thread, int16_t affinity); Sets the affinity for the specified thread. Returns 0 for failure, 1 for success.
OSGetCoreId uint32_t OSGetCoreId(void); Returns the PowerPC coreid this code is running on(value of spr1007).

Screen

In all the functions below, bufferNum means: 0 = TV, 1 = Gamepad. "colour" in the form stored in memory is RGBA8. These functions can't be used without crashing, unless OSScreen was properly initialized. The below functions will immediately return if x/y is out-of-bounds.

Name Prototype Description
OSScreenGetBufferSizeEx uint32_t OSScreenGetBufferSizeEx(int bufferNum) Get the size of the specified buffer
OSScreenFlipBuffersEx uint32_t OSScreenFlipBuffersEx(int bufferNum); Do a buffer-swap, which results in the buffer previously being drawn to being displayed. This flushes data-cache for the buffers and updates coreinit + hw-regs state.
OSScreenClearBufferEx uint32_t OSScreenClearBufferEx(int bufferNum, uint32_t colour); Fill the specified buffer with a certain color
OSScreenPutPixelEx uint32_t OSScreenPutPixelEx(int bufferNum, uint32_t posX, uint32_t posY, uint32_t colour); Draw a pixel of a certain color to the specified coordinates
OSScreenPutFontEx uint32_t OSScreenPutFontEx(int bufferNum, uint32_t posX, uint32_t posY, const char *str); Write text to the specified buffer; unlike OSFatal() this doesn't halt your system.

Structures

Threads

Name Prototype
OSThread
typedef struct {
    char tag[8];                     /* 0x000 "OSContxt" */
    int32_t gpr[32];                 /* 0x008 from OSDumpContext */
    uint32_t cr;                     /* 0x088 from OSDumpContext */
    uint32_t lr;                     /* 0x08c from OSDumpContext */
    uint32_t ctr;                    /* 0x090 from context switch code */
    uint32_t xer;                    /* 0x094 from context switch code */
    uint32_t srr0;                   /* 0x098 from OSDumpContext */
    uint32_t srr1;                   /* 0x09c from OSDumpContext */
    char _unknowna0[0xb8 - 0xa0];
    uint64_t fpr[32];                /* 0x0b8 from OSDumpContext */
    int16_t spinLockCount;           /* 0x1b8 from OSDumpContext */
    char _unknown1ba[0x1bc - 0x1ba]; /* 0x1ba could genuinely be padding? */
    uint32_t gqr[8];                 /* 0x1bc from OSDumpContext */
    char _unknown1dc[0x1e0 - 0x1dc];
    uint64_t psf[32];                /* 0x1e0 from OSDumpContext */
    int64_t coretime[3];             /* 0x2e0 from OSDumpContext */
    int64_t starttime;               /* 0x2f8 from OSDumpContext */
    int32_t error;                   /* 0x300 from OSDumpContext */
    char _unknown304[0x6a0 - 0x304];
} OSThread;                          /* 0x6a0 total length from RAM dumps */

Defines

Disassembler

printf_func() and find_symbol() have the following types:

typedef int (*printf_t)(char *fmt, ...);
typedef uint32_t (*find_symbol_t)(uint32_t addr, char *name_buf, int name_len);

The flags argument of DisassemblePPCRange() and DisassemblePPCOpcode() is a bitmask of the following options:

#define DISASM_OMIT_ADDR      0x40     /* Don't print the address of the instruction */
#define DISASM_OMIT_OPCODE    0x80     /* Don't print the opcode of the instruction */
#define DISASM_GETSYM         0x100    /* Print the nearest symbol and the instruction's offset from it */

Screen

Name Value Description
SCREEN_BUF_TV 0 The buffer number for the TV
SCREEN_BUF_DRC0 1 The buffer number for the first Gamepad

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.27625600072OutputPage->sendCacheControl( ).../OutputPage.php:2637
80.27645601392WebResponse->header( ).../OutputPage.php:2437
90.27645601392header ( ).../WebResponse.php:74

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.27625600072OutputPage->sendCacheControl( ).../OutputPage.php:2637
80.27685601400WebResponse->header( ).../OutputPage.php:2466
90.27685601400header ( ).../WebResponse.php:74

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.27625600072OutputPage->sendCacheControl( ).../OutputPage.php:2637
80.27705601336WebResponse->header( ).../OutputPage.php:2467
90.27705601336header ( ).../WebResponse.php:74

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /root/w/includes/shell/Command.php:493) in /root/w/includes/WebResponse.php on line 74
Call Stack
#TimeMemoryFunctionLocation
10.0000364680{main}( ).../index.php:0
20.03492943832wfIndexMain( ).../index.php:46
30.03492945976MediaWiki->run( ).../index.php:53
40.03512946232MediaWiki->main( ).../MediaWiki.php:547
50.19584537152MediaWiki->{closure:/root/w/includes/MediaWiki.php:952-958}( ).../MediaWiki.php:967
60.19584537152OutputPage->output( ).../MediaWiki.php:954
70.27625600072OutputPage->sendCacheControl( ).../OutputPage.php:2637
80.27735601416WebResponse->header( ).../OutputPage.php:2478
90.27735601416header ( ).../WebResponse.php:74