In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "IOSU syscalls"

From WiiUBrew
Jump to navigation Jump to search
(Created page with "{{stub}} There are 2 types of syscalls: 1. Syscalls using undefined ARM instruction. 2. Syscalls using ARM syscall instruction. == Syscalls (via undefined instructions) == ...")
 
(Added some syscalls)
Line 16: Line 16:
 
! ID # !! Internal name !! Description !! Return value
 
! ID # !! Internal name !! Description !! Return value
 
|-
 
|-
| 2D || int device_open(const char* device, int mode) || Similar to IOS_Open on PPC, except now internal to the IOS system || Returns an fd or error (negative)
+
|  C || int IOS_CreateMessageQueue(u32 *ptr, u32 n_msgs)  || Create a queue at ptr, for n_msgs messages || The queue ID
 +
|-
 +
| 10 || int IOS_ReceiveMessage(int queueid, u32 *message, u32 flags) || Fetch a message from the front of a queue || 0 on success
 +
|-
 +
| 24 || void* IOS_Alloc(int heapid, u32 size) || Allocate size bytes from the specified heap || pointer to memory
 +
|-
 +
| 28 || BOOL IOS_RegisterResourceManager(const char* device, int queueid) || Registers device to the device tree, so it can be opened (from Starlet and PPC) || 0 on success
 +
|-
 +
| 2D || int IOS_Open(const char* device, int mode) || Similar to IOS_Open on PPC, except now internal to the IOS system || Returns an fd or error (negative)
 
|}
 
|}

Revision as of 19:48, 27 November 2012

There are 2 types of syscalls:

1. Syscalls using undefined ARM instruction.

2. Syscalls using ARM syscall instruction.

Syscalls (via undefined instructions)

Syscalls are invoked by way of the invalid instruction handler; syscalls take the form 0xE7F000F0 | (syscall_num << 8). (E.g. E7F000F0 is syscall 0, E7F036F0 is syscall 0x36, etc.). IOS has 0x82 available syscalls.

(please feel free to contribute your own findings!)

ID # Internal name Description Return value
C int IOS_CreateMessageQueue(u32 *ptr, u32 n_msgs) Create a queue at ptr, for n_msgs messages The queue ID
10 int IOS_ReceiveMessage(int queueid, u32 *message, u32 flags) Fetch a message from the front of a queue 0 on success
24 void* IOS_Alloc(int heapid, u32 size) Allocate size bytes from the specified heap pointer to memory
28 BOOL IOS_RegisterResourceManager(const char* device, int queueid) Registers device to the device tree, so it can be opened (from Starlet and PPC) 0 on success
2D int IOS_Open(const char* device, int mode) Similar to IOS_Open on PPC, except now internal to the IOS system Returns an fd or error (negative)