#include <iop.h>
#include <ios.h>
#include <ioslibc.h>

#define STACK_SIZE 1024
const u8 _initStack[STACK_SIZE];
const u32 _initStackSize = sizeof(_initStack);
const u32 _initPriority = 10;

int
main(void)
{
    IOSError rv = 0;
    IOSProcessId pid;

    /* Need root access */
    pid = IOS_GetProcessId();
    IOS_SetUid(pid, 0);
    IOS_SetGid(pid, 0);

    if ((rv = IOS_LaunchOS("/os.img")) != IOS_ERROR_OK) {
        printf("Failed to launch OS, rv=%d\n", rv);
        goto end;
    }

end:

    return (rv);
}
