Skip to content

Commit 70044ad

Browse files
committed
Add idle_task_init() call in main()
The idle task is now initialized in main() during system startup. This ensures that the scheduler always has a valid execution context before any user or application tasks are created. Initializing the idle task early guarantees a safe fallback path when no runnable tasks exist and keeps the scheduler entry point consistent.
1 parent 2a01530 commit 70044ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ int32_t main(void)
2323
printf("Heap initialized, %u bytes available\n",
2424
(unsigned int) (size_t) &_heap_size);
2525

26+
/* Initialize idle task */
27+
idle_task_init();
28+
2629
/* Call the application's main entry point to create initial tasks. */
2730
kcb->preemptive = (bool) app_main();
2831
printf("Scheduler mode: %s\n",

0 commit comments

Comments
 (0)