Difference between revisions of "IPC (SDK)"
Jump to navigation
Jump to search
Hallowizer (talk | contribs) m (Typo) |
Hallowizer (talk | contribs) (→Memory allocation: process ID might be used by IOS?) |
||
Line 20: | Line 20: | ||
</pre> | </pre> | ||
− | <code>processId</code> is probably only present to match the struct used by IOS; it is never set or checked, | + | <code>processId</code> is probably only present to match the struct used by IOS; it is never set or checked by IPC, but it may be used by IOS's memory management. |
Revision as of 22:52, 6 January 2022
IPC is the SDK library that provides functions for communication with IOS. It seems to also mirror some IOS syscalls, suggesting that IOS was originally planned to run on the Broadway.
Memory allocation
Memory used by IPC and NAND is mainly allocated with iosAllocAligned
, which allocates from one of 8 heaps, each with the following structure:
struct HeapBlockHeader { u16 magic; // always 0xbabe u16 status; // 0 means free, 1 means it is in the process of being allocated, 2 means it is being used u32 size; struct HeapBlockHeader *prev; // points to the same heap block if it is allocated, NULL for the beginning of the heap struct HeapBlockHeader *next; // NULL for the end of the heap or if this heap block is allocated } struct Heap { void *base; u32 processId; // See note below u32 size; struct HeapBlockHeader *firstBlock; }
processId
is probably only present to match the struct used by IOS; it is never set or checked by IPC, but it may be used by IOS's memory management.