4 //---------------------------------------------------------------------------
5 IMPLEMENTATION [ppc32]:
13 //#include "kmem_alloc.h"
15 //#include "pagetable.h"
17 #include "kernel_thread.h"
18 #include "kernel_task.h"
19 #include "kernel_console.h"
20 //#include "reset.h" //TODO cbass: implement
22 //#include "terminate.h" //TODO cbass: implement
24 #include "processor.h"
25 #include "boot_info.h"
27 static int exit_question_active = 0;
29 extern "C" void __attribute__ ((noreturn))
32 if (exit_question_active)
43 static void exit_question()
45 exit_question_active = 1;
49 puts("\nReturn reboots, \"k\" enters L4 kernel debugger...");
51 char c = Kconsole::console()->getchar();
53 if (c == 'k' || c == 'K')
59 // it may be better to not call all the destruction stuff
60 // because of unresolved static destructor dependency
62 // SO just do the reset at this point.
63 puts("\033[1mRebooting...\033[0m");
71 #include "thread_state.h"
74 // caution: no stack variables in this function because we're going
75 // to change the stack pointer!
77 // make some basic initializations, then create and run the kernel
79 //set_exit_question(&exit_question);
81 // disallow all interrupts before we selectively enable them
84 // create kernel thread
85 static Kernel_thread *kernel = new (Ram_quota::root) Kernel_thread;
87 Task *const ktask = Kernel_task::kernel_task();
88 check(kernel->bind(ktask, User<Utcb>::Ptr(0)));
91 // switch to stack of kernel thread and bootstrap the kernel
92 asm volatile ( " stw %%r1, 0(%[boot_stack]) \n" //save old stack pointer
93 " mr %%r1, %[stack] \n" //new stack
94 " mr %%r3, %[kernel] \n" //"this" pointer
95 " bl call_bootstrap \n"
97 : [boot_stack]"r" (&boot_stack),
98 [stack]"r" (kernel->init_stack()),