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

Difference between revisions of "IOP OS"

From WiiBrew
Jump to navigation Jump to search
(Removed redirect to IOS)
Tag: Removed redirect
(added interrupts and threads)
Line 1: Line 1:
 
'''IOP OS''' is a set of functions in [[IOS]]'s networking code that convert [[Revolution OS]] calls to IOS [[IOS/Syscalls|syscalls]]; for example, OSAlloc is implemented as a call to IOS_Alloc.
 
'''IOP OS''' is a set of functions in [[IOS]]'s networking code that convert [[Revolution OS]] calls to IOS [[IOS/Syscalls|syscalls]]; for example, OSAlloc is implemented as a call to IOS_Alloc.
 +
 +
== Toggling interrupts ==
 +
Disabling interrupts is simulated by locking a mutex implemented as a message queue and changing the current thread priority to 0x38. While this does not completely prevent concurrent execution within the module,{{check}} it is enough for most uses of <code>OSDisableInterrupts</code>.
 +
 +
== Threads ==
 +
Threads are implemented as a proxy to [[IOS/Kernel#Threads|IOS threads]]. Because of this, <code>OSThreadQueue</code> is only used for suspended queues.
 +
 +
<pre>
 +
struct OSThread {
 +
int threadId;
 +
int priority;
 +
void *threadSpecific;
 +
struct OSThread *next;
 +
}
 +
 +
struct OSThreadQueue {
 +
struct OSThread *head;
 +
struct OSThread *tail;
 +
}
 +
</pre>

Revision as of 23:55, 16 June 2022

IOP OS is a set of functions in IOS's networking code that convert Revolution OS calls to IOS syscalls; for example, OSAlloc is implemented as a call to IOS_Alloc.

Toggling interrupts

Disabling interrupts is simulated by locking a mutex implemented as a message queue and changing the current thread priority to 0x38. While this does not completely prevent concurrent execution within the module,[check] it is enough for most uses of OSDisableInterrupts.

Threads

Threads are implemented as a proxy to IOS threads. Because of this, OSThreadQueue is only used for suspended queues.

struct OSThread {
	int threadId;
	int priority;
	void *threadSpecific;
	struct OSThread *next;
}

struct OSThreadQueue {
	struct OSThread *head;
	struct OSThread *tail;
}