+ sched_ctx = (struct scheduler){
+ ._procs = vzalloc(PROC_TABLE_SIZE), .ptable_len = 0, .procs_index = 0};
+
+ // TODO initialize dummy_proc
+ sched_init_dummy();
+}
+
+#define DUMMY_STACK_SIZE 2048
+
+void
+sched_init_dummy()
+{
+ // This surely need to be simplified or encapsulated!
+ // It is a living nightmare!
+
+ extern void my_dummy();
+ static char dummy_stack[DUMMY_STACK_SIZE] __attribute__((aligned(16)));
+
+ ptr_t stktop = (ptr_t)dummy_stack + DUMMY_STACK_SIZE;
+
+ dummy_proc = (struct proc_info){};
+
+ proc_init_transfer(&dummy_proc, stktop, (ptr_t)my_dummy, TRANSFER_IE);
+
+ dummy_proc.page_table = cpu_ldvmspace();
+ dummy_proc.state = PS_READY;
+ dummy_proc.parent = &dummy_proc;
+ dummy_proc.pid = KERNEL_PID;
+
+ __current = &dummy_proc;