2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
StackEntry sBootThreadInfo;
|
|
|
|
OSThread sIdleThread;
|
2022-02-06 18:00:01 +00:00
|
|
|
STACK(sIdleThreadStack, 0x400);
|
2020-03-17 04:31:30 +00:00
|
|
|
StackEntry sIdleThreadInfo;
|
2022-02-06 18:00:01 +00:00
|
|
|
STACK(sBootThreadStack, 0x400);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void cleararena(void) {
|
2020-05-27 13:06:37 +00:00
|
|
|
bzero(_dmadataSegmentStart, osMemSize - OS_K0_TO_PHYSICAL(_dmadataSegmentStart));
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void bootproc(void) {
|
2022-02-06 18:00:01 +00:00
|
|
|
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, STACK_TOP(sBootThreadStack), 0, -1, "boot");
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
osMemSize = osGetMemSize();
|
|
|
|
cleararena();
|
|
|
|
__osInitialize_common();
|
|
|
|
__osInitialize_autodetect();
|
|
|
|
|
|
|
|
gCartHandle = osCartRomInit();
|
|
|
|
osDriveRomInit();
|
|
|
|
isPrintfInit();
|
|
|
|
Locale_Init();
|
2020-03-22 21:19:43 +00:00
|
|
|
|
2022-02-06 18:00:01 +00:00
|
|
|
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, STACK_TOP(sIdleThreadStack), 0, 256, "idle");
|
|
|
|
osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, NULL, STACK_TOP(sIdleThreadStack),
|
2021-02-14 00:49:40 +00:00
|
|
|
Z_PRIORITY_MAIN);
|
2020-03-17 04:31:30 +00:00
|
|
|
osStartThread(&sIdleThread);
|
|
|
|
}
|