This commit is contained in:
Lukas Höppner
2026-08-09 19:39:53 +02:00
parent 123a6e71b4
commit 93fc058120
3 changed files with 81 additions and 80 deletions
+22 -22
View File
@@ -45,13 +45,13 @@ static void nova64_log(const char *format, ...) {
}
static bool initialize_wasm_runtime(void) {
nova64_log("[Core] Initializing WASM runtime...\n");
nova64_log("Initializing WASM runtime...\n");
// TODO: Replace this stub with real WAMR initialization.
return true;
}
static bool load_launcher_from_internal_storage(void) {
nova64_log("[Core] Loading launcher from internal storage (%s)...\n",
nova64_log("Loading launcher from internal storage (%s)...\n",
kInternalLauncherPath);
// TODO: Implement the actual internal storage filesystem and launcher load.
return true;
@@ -59,7 +59,7 @@ static bool load_launcher_from_internal_storage(void) {
static void nova64_wasm_launcher_task(void *params) {
(void)params;
nova64_log("[Core] WASM launcher task started.\n");
nova64_log("WASM launcher task started.\n");
// TODO: Execute the loaded WASM launcher module here with the WAMR engine.
for (;;) {
@@ -73,21 +73,21 @@ static bool start_launcher_task(void) {
tskIDLE_PRIORITY + 1, &launcher_task_handle);
if (result != pdPASS) {
nova64_log("[Core] Failed to create launcher task.\n");
nova64_log("Failed to create launcher task.\n");
return false;
}
nova64_log("[Core] Launcher task created successfully.\n");
nova64_log("Launcher task created successfully.\n");
return true;
}
static void nova64_shutdown_task(void *params) {
(void)params;
nova64_log("[Core] Shutdown task started.\n");
nova64_log("Shutdown task started.\n");
for (;;) {
if (shutdown_requested) {
nova64_log("[Core] Shutdown requested; ending scheduler.\n");
nova64_log("Shutdown requested; ending scheduler.\n");
vTaskEndScheduler();
return;
}
@@ -101,37 +101,37 @@ static bool start_shutdown_task(void) {
tskIDLE_PRIORITY + 2, &shutdown_task_handle);
if (result != pdPASS) {
nova64_log("[Core] Failed to create shutdown task.\n");
nova64_log("Failed to create shutdown task.\n");
return false;
}
nova64_log("[Core] Shutdown task created successfully.\n");
nova64_log("Shutdown task created successfully.\n");
return true;
}
static void nova64_boot_task(void *params) {
(void)params;
nova64_log("[Core] Boot task started.\n");
nova64_log("Boot task started.\n");
if (!initialize_wasm_runtime()) {
nova64_log("[Core] WASM runtime initialization failed.\n");
nova64_log("WASM runtime initialization failed.\n");
vTaskDelete(NULL);
return;
}
if (!load_launcher_from_internal_storage()) {
nova64_log("[Core] Launcher loading failed.\n");
nova64_log("Launcher loading failed.\n");
vTaskDelete(NULL);
return;
}
if (!start_launcher_task()) {
nova64_log("[Core] Launcher startup failed.\n");
nova64_log("Launcher startup failed.\n");
vTaskDelete(NULL);
return;
}
nova64_log("[Core] Boot process completed.\n");
nova64_log("Boot process completed.\n");
vTaskDelete(NULL);
}
@@ -144,11 +144,11 @@ NOVA64_API bool nova64_init(const nova64_io_interface_t *io_interface) {
g_io_interface = &g_io_interface_storage;
shutdown_requested = false;
nova64_log("[Core] System Initializing...\n");
nova64_log("System Initializing...\n");
event_queue = xQueueCreate(10, sizeof(uint32_t));
if (event_queue == NULL) {
nova64_log("[Core] Failed to create event queue.\n");
nova64_log("Failed to create event queue.\n");
return false;
}
@@ -156,12 +156,12 @@ NOVA64_API bool nova64_init(const nova64_io_interface_t *io_interface) {
return false;
}
nova64_log("[Core] Starting boot process...\n");
nova64_log("Starting boot process...\n");
BaseType_t created =
xTaskCreate(nova64_boot_task, "Nova64Boot", 4096 / sizeof(StackType_t),
NULL, tskIDLE_PRIORITY + 2, &boot_task_handle);
if (created != pdPASS) {
nova64_log("[Core] Failed to create boot task.\n");
nova64_log("Failed to create boot task.\n");
return false;
}
@@ -175,14 +175,14 @@ NOVA64_API int32_t nova64_main() {
}
nova64_log(
"[Core] Entering main runtime and starting FreeRTOS scheduler...\n");
"Entering main runtime and starting FreeRTOS scheduler...\n");
vTaskStartScheduler();
// vTaskStartScheduler only returns if the scheduler fails to start or if
// the scheduler is shut down by vTaskEndScheduler().
nova64_log("[Core] vTaskStartScheduler returned.\n");
nova64_log("vTaskStartScheduler returned.\n");
is_initialized = false;
return -1;
return 1;
}
NOVA64_API bool nova64_shutdown(void) {
@@ -190,7 +190,7 @@ NOVA64_API bool nova64_shutdown(void) {
return false;
}
nova64_log("[Core] Scheduler shutdown requested from host.\n");
nova64_log("Scheduler shutdown requested from host.\n");
shutdown_requested = true;
return true;
}